4 use json_utils,
only: json_get, json_get_or_default
5 use utils,
only: neko_type_error
12 character(len=25),
parameter :: KNOWN_TYPES(1) = [ character(len=25) :: &
29 module subroutine optimizer_factory(object, parameters,
problem,
design, &
31 class(optimizer_t),
allocatable,
intent(inout) :: object
32 type(json_file),
intent(inout) :: parameters
33 class(problem_t),
intent(in) :: problem
34 class(design_t),
intent(in) :: design
35 class(simulation_t),
intent(in) :: simulation
37 character(len=:),
allocatable :: type
38 integer :: max_iterations
39 real(kind=rp) :: tolerance
41 if (
allocated(object))
then
47 call json_get(parameters,
"optimization.solver.type", type)
48 call json_get_or_default(parameters,
"optimization.solver.max_iterations", &
50 call json_get_or_default(parameters,
"optimization.solver.tolerance", &
54 select case (trim(type))
59 call neko_type_error(
"Optimizer",
type, KNOWN_TYPES)
63 max_iterations, tolerance)
64 end subroutine optimizer_factory
67end submodule optimizer_factory_mod
Module for handling the optimization problem.
Implements the steady_problem_t type.