Computes the constraint violation vector for the mission.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mission_type), | intent(inout) | :: | me | |||
real(kind=wp), | intent(in), | dimension(:) | :: | x |
opt var vector for the mission [n] |
|
real(kind=wp), | intent(out), | dimension(:) | :: | f |
constraint violation vector for the mission [m] |
|
integer, | intent(in), | optional, | dimension(:) | :: | funcs_to_compute |
the indices of f to compute |
subroutine constraint_violations(me,x,f,funcs_to_compute) implicit none class(mission_type),intent(inout) :: me real(wp),dimension(:),intent(in) :: x !! opt var vector for the mission [n] real(wp),dimension(:),intent(out) :: f !! constraint violation vector for the mission [m] integer,dimension(:),intent(in),optional :: funcs_to_compute !! the indices of f to compute integer :: i !! counters integer,dimension(:),allocatable :: isegs if (.not. allocated(me%segs)) error stop 'error: segs is not allocated' ! first extract data from the opt var vector ! and put it into all the segments: call me%put_x_in_segments(x) ! get the list of segments that needs to be propagated: ! this depends on the functions that are being computed, ! and the sparsity pattern call me%segs_to_propagate(funcs_to_compute,isegs) !==================================== ! now propagate the segments: !$OMP PARALLEL DO !...FIRSTPRIVATE(me) do i = 1, size(isegs) call me%segs(isegs(i))%propagate() end do !$OMP END PARALLEL DO !==================================== ! now that all the segments are propagated, we ! compute the function (constraint violations for the ! final states of segment segment) call me%get_problem_arrays(f=f) end subroutine constraint_violations