8 use json_module,
only: json_file
12 use num_types,
only: rp
13 use csv_file,
only: csv_file_t
22 integer,
public :: max_iterations
24 real(kind=rp),
public :: tolerance
26 type(csv_file_t),
public :: logger
33 procedure(optimizer_run), pass(this),
public,
deferred :: run
35 procedure(optimizer_free), pass(this),
public,
deferred :: free
38 procedure(optimizer_validate), pass(this),
public,
deferred :: validate
41 procedure, pass(this) :: init_base => optimizer_init_base
52 max_iterations, tolerance, simulation)
54 class(optimizer_t),
intent(inout) :: this
55 type(json_file),
intent(inout) :: parameters
56 class(problem_t),
intent(in) :: problem
57 class(design_t),
intent(in) :: design
58 integer,
intent(in) :: max_iterations
59 real(kind=rp),
intent(in) :: tolerance
60 type(simulation_t),
optional,
intent(in) :: simulation
64 subroutine optimizer_run(this, problem, design, simulation)
66 class(optimizer_t),
intent(inout) :: this
67 class(problem_t),
intent(inout) :: problem
68 class(design_t),
intent(inout) :: design
69 type(simulation_t),
optional,
intent(inout) :: simulation
70 end subroutine optimizer_run
73 subroutine optimizer_free(this)
75 class(optimizer_t),
intent(inout) :: this
76 end subroutine optimizer_free
79 subroutine optimizer_validate(this, problem, design)
81 class(optimizer_t),
intent(inout) :: this
82 class(problem_t),
intent(in) :: problem
83 class(design_t),
intent(in) :: design
84 end subroutine optimizer_validate
97 module subroutine optimizer_factory(object, parameters,
problem,
design, &
99 class(optimizer_t),
allocatable,
intent(inout) :: object
100 type(json_file),
intent(inout) :: parameters
101 class(problem_t),
intent(in) :: problem
102 class(design_t),
intent(in) :: design
103 class(simulation_t),
optional,
intent(in) :: simulation
104 end subroutine optimizer_factory
105 end interface optimizer_factory
107 public :: optimizer_t, optimizer_factory
115 subroutine optimizer_init_base(this, max_iterations, tolerance)
116 class(optimizer_t),
intent(inout) :: this
117 integer,
intent(in) :: max_iterations
118 real(kind=rp),
intent(in) :: tolerance
120 this%max_iterations = max_iterations
121 this%tolerance = tolerance
123 end subroutine optimizer_init_base
Factory function for the optimizer.
Interface for optimizer initialization.
Module for handling the optimization problem.
Implements the steady_problem_t type.
Abstract optimizer class.
The abstract problem type.