Also follow traj (no effect if it is already followed).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(TrajectoryFollower), | intent(inout) | :: | self | |||
| type(Trajectory), | intent(in), | pointer | :: | traj |
the trajectory to add (not owned; null: none) |
subroutine add_trajectory(self, traj) class(TrajectoryFollower), intent(inout) :: self type(Trajectory), pointer, intent(in) :: traj !! the trajectory to add (not owned; null: none) type(TrajectoryPointer), allocatable :: tmp(:) integer :: k if (.not. associated(traj)) return do k = 1, self%n if (associated(self%trajs(k)%p, traj)) return end do if (.not. allocated(self%trajs)) allocate(self%trajs(4)) if (self%n == size(self%trajs)) then allocate(tmp(2 * self%n)) tmp(1:self%n) = self%trajs(1:self%n) call move_alloc(tmp, self%trajs) end if self%n = self%n + 1 self%trajs(self%n)%p => traj if (self%default_data) call self%set_default_data() self%stamp_ = next_motion_stamp() end subroutine add_trajectory