try_solve_zhao_branch_c Subroutine

public subroutine try_solve_zhao_branch_c(p, x, success)

Arguments

Type IntentOptional Attributes Name
type(zhao_params_type), intent(in) :: p
real(kind=dp), intent(out) :: x(2)
logical, intent(out) :: success

Calls

proc~~try_solve_zhao_branch_c~~CallsGraph proc~try_solve_zhao_branch_c try_solve_zhao_branch_c proc~solve_nonlinear_system solve_nonlinear_system proc~try_solve_zhao_branch_c->proc~solve_nonlinear_system proc~try_newton_solve try_newton_solve proc~solve_nonlinear_system->proc~try_newton_solve proc~numerical_jacobian numerical_jacobian proc~try_newton_solve->proc~numerical_jacobian proc~residual_norm residual_norm proc~try_newton_solve->proc~residual_norm proc~solve_small_linear_system solve_small_linear_system proc~try_newton_solve->proc~solve_small_linear_system

Called by

proc~~try_solve_zhao_branch_c~~CalledByGraph proc~try_solve_zhao_branch_c try_solve_zhao_branch_c proc~solve_zhao_branch_c solve_zhao_branch_c proc~solve_zhao_branch_c->proc~try_solve_zhao_branch_c proc~solve_zhao_unknowns solve_zhao_unknowns proc~solve_zhao_unknowns->proc~try_solve_zhao_branch_c proc~solve_zhao_unknowns->proc~solve_zhao_branch_c proc~resolve_sheath_injection_context resolve_sheath_injection_context proc~resolve_sheath_injection_context->proc~solve_zhao_unknowns proc~init_particle_batch_from_config init_particle_batch_from_config proc~init_particle_batch_from_config->proc~resolve_sheath_injection_context

Source Code

  subroutine try_solve_zhao_branch_c(p, x, success)
    type(zhao_params_type), intent(in) :: p
    real(dp), intent(out) :: x(2)
    logical, intent(out) :: success

    real(dp) :: guesses(2, 5)

    guesses(:, 1) = [-0.5d0, 6.0d6]
    guesses(:, 2) = [-2.0d0, 7.0d6]
    guesses(:, 3) = [-5.0d0, 8.0d6]
    guesses(:, 4) = [-10.0d0, 8.2d6]
    guesses(:, 5) = [-15.0d0, 8.5d6]
    call solve_nonlinear_system(2, guesses, residual_c, x, success)

  contains

    subroutine residual_c(xc, fc)
      real(dp), intent(in) :: xc(:)
      real(dp), intent(out) :: fc(:)

      call zhao_residuals_type_c(p, xc, fc)
    end subroutine residual_c

  end subroutine try_solve_zhao_branch_c