constraint_violations Subroutine

public subroutine constraint_violations(me, x, f, funcs_to_compute)

Computes the constraint violation vector for the mission.

Type Bound

mission_type

Arguments

Type IntentOptional 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


Calls

proc~~constraint_violations~~CallsGraph proc~constraint_violations mission_type%constraint_violations proc~get_problem_arrays mission_type%get_problem_arrays proc~constraint_violations->proc~get_problem_arrays proc~propagate_segment segment%propagate_segment proc~constraint_violations->proc~propagate_segment proc~put_x_in_segments mission_type%put_x_in_segments proc~constraint_violations->proc~put_x_in_segments proc~segs_to_propagate mission_type%segs_to_propagate proc~constraint_violations->proc~segs_to_propagate fill_vector fill_vector proc~get_problem_arrays->fill_vector first_call first_call proc~propagate_segment->first_call icrf_frame icrf_frame proc~propagate_segment->icrf_frame integrate integrate proc~propagate_segment->integrate proc~set_segment_outputs segment%set_segment_outputs proc~propagate_segment->proc~set_segment_outputs transform transform proc~propagate_segment->transform two_body_rotating_frame two_body_rotating_frame proc~propagate_segment->two_body_rotating_frame extract_vector extract_vector proc~put_x_in_segments->extract_vector proc~define_problem_size mission_type%define_problem_size proc~put_x_in_segments->proc~define_problem_size proc~set_segment_inputs segment%set_segment_inputs proc~put_x_in_segments->proc~set_segment_inputs proc~set_segment_inputs->icrf_frame proc~set_segment_inputs->transform proc~set_segment_inputs->two_body_rotating_frame

Called by

proc~~constraint_violations~~CalledByGraph proc~constraint_violations mission_type%constraint_violations proc~halo_solver_main halo_solver_main proc~halo_solver_main->proc~constraint_violations

Source Code

    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