The tail: from point k (the latest passed) to the point interpolated at time t toward point k2 (the next in time: k + 1, or k - 1 for decreasing times); none if either isn't a point written (before the start, or everything passed).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CurveArtist), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | t |
the current time |
||
| integer, | intent(in) | :: | k |
the tail's ends (0: none) |
||
| integer, | intent(in) | :: | k2 |
the tail's ends (0: none) |
subroutine update_tail(self, t, k, k2) class(CurveArtist), intent(inout) :: self real(wp), intent(in) :: t !! the current time integer, intent(in) :: k, k2 !! the tail's ends (0: none) real(c_float), dimension(:,:,:), pointer :: p real(wp) :: frac, xyz(3, 2), along self%tail_shown = .false. if (.not. c_associated(self%tail)) return if (min(k, k2) < 1 .or. max(k, k2) > self%n_written) then call check_status(vkf_line_set_range(self%tail, 1_c_int, 0_c_int), 'trajectory artists') return end if frac = self%traj%time_fraction(k, k2, t) xyz(:, 1) = art_point(self, k, self%sources_) xyz(:, 2) = art_point_between(self, k, k2, t, self%sources_) call line_buffer(self%tail, p) if (.not. associated(p)) return call split_points(xyz, p(:, :, 1:2)) along = merge(1.0_wp, -1.0_wp, k2 > k) * norm2(xyz(:, 2) - xyz(:, 1)) ! (the distance along: in point order) call split_distances(self%chain%distance(k) + [0.0_wp, along], p(4, :, 1:2)) self%tail_from = k self%tail_to = k2 call tail_colors(self, k, k2, frac) call check_status(vkf_line_points_changed(self%tail, 2_c_int), 'trajectory artists') self%tail_shown = .true. end subroutine update_tail