The point at time t (components from sources; default: the
position's), linear in time between the points about it; outside the
times, the first or last point. ok (optional) false, and v 0, if there
is no point (or the search for the time failed).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Trajectory), | intent(in) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
the time |
||
| type(DataSource), | intent(in), | optional | :: | sources(3) |
where the components come from (default: the position) |
|
| logical, | intent(out), | optional | :: | ok |
a point was found |
function point_at(self, t, sources, ok) result(v) class(Trajectory), intent(in) :: self real(wp), intent(in) :: t !! the time type(DataSource), intent(in), optional :: sources(3) !! where the components come from (default: the position) logical, intent(out), optional :: ok !! a point was found real(wp) :: v(3) type(DataSource) :: src(3) integer :: n, i, status v = 0.0_wp if (present(ok)) ok = .false. src = position_sources(self%dof_) if (present(sources)) src = sources n = min(self%n_times, self%num_points(src)) if (n == 0) return status = self%time_index(t, i) if (status == TIME_NOT_FOUND) return if (i < 1) then v = self%point(1, src) else if (i >= n) then v = self%point(n, src) else v = self%point_between(i, i + 1, t, src) end if if (present(ok)) ok = .true. end function point_at