Add a position (the first dof elements of pos are used) for the next
time that has none. ok is false if every time already has a position.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Trajectory), | intent(inout) | :: | self | |||
| real(kind=wp), | intent(in) | :: | pos(:) |
position (first dof elements used) |
||
| logical, | intent(out), | optional | :: | ok |
false if not added |
subroutine add_position(self, pos, ok) class(Trajectory), intent(inout) :: self real(wp), intent(in) :: pos(:) !! position (first [[dof]] elements used) logical, intent(out), optional :: ok !! false if not added integer :: d if (present(ok)) ok = .false. if (self%n_pos >= self%n_times) return call grow_positions(self, self%n_pos + 1) self%n_pos = self%n_pos + 1 d = min(self%dof_, size(pos)) self%posopt(:, :, self%n_pos) = 0.0_wp self%posopt(1:d, 0, self%n_pos) = pos(1:d) self%revision_ = self%revision_ + 1 if (present(ok)) ok = .true. end subroutine add_position