halo_func Subroutine

public subroutine halo_func(me, x, f)

Compute the solver function (all the constraint violations)

Arguments

Type IntentOptional Attributes Name
class(nlesolver_type), intent(inout) :: me
real(kind=wp), intent(in), dimension(:) :: x
real(kind=wp), intent(out), dimension(:) :: f

Calls

proc~~halo_func~~CallsGraph proc~halo_func halo_func compute_jacobian_stm compute_jacobian_stm proc~halo_func->compute_jacobian_stm constraint_violations constraint_violations proc~halo_func->constraint_violations get_problem_arrays get_problem_arrays proc~halo_func->get_problem_arrays

Source Code

    subroutine halo_func(me,x,f)

    implicit none

    class(nlesolver_type),intent(inout) :: me
    real(wp),dimension(:),intent(in)     :: x
    real(wp),dimension(:),intent(out)    :: f

    select type (me)
    class is (my_solver_type)
        associate (mission => me%mission)
            if (mission%func_with_stm .and. mission%jacobian_mode==2) then
                ! propagate with the STMs, and keep the Jacobian for the next request
                ! at this x (in [[halo_grad_sparse]] or [[halo_grad]]):
                call mission%compute_jacobian_stm(x, mission%jac_cache)
                call mission%get_problem_arrays(f=f)
                mission%jac_cache_x = x
            else
                call mission%constraint_violations(x,f)
            end if
        end associate
    class default
        error stop 'invalid class in halo_func'
    end select

    end subroutine halo_func