Compute the solver function (all the constraint violations)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nlesolver_type), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in), | dimension(:) | :: | x | ||
| real(kind=wp), | intent(out), | dimension(:) | :: | f |
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