36 use json_module,
only: json_file
37 use json_utils,
only: json_get
38 use num_types,
only: rp
39 use point_zone,
only: point_zone_t
41 use vector,
only: vector_t
42 use utils,
only: neko_error
59 real(kind=rp) ::
value
61 type(vector_t) :: sensitivity
63 character(len=25) :: name
67 class(point_zone_t),
pointer :: mask => null()
74 generic :: init => init_json, init_json_sim
77 procedure, pass(this) :: init_json => functional_init_json
79 procedure, pass(this) :: init_json_sim => functional_init_json_sim
84 procedure(functional_update_value), pass(this),
deferred :: update_value
86 procedure(functional_update_sensitivity), pass(this),
deferred :: &
90 procedure, pass(this) :: get_value => functional_get_value
92 procedure, pass(this) :: get_sensitivity => functional_get_sensitivity
105 class(base_functional_t),
intent(inout) :: this
109 subroutine functional_update_value(this, design)
111 class(base_functional_t),
intent(inout) :: this
112 class(design_t),
intent(in) :: design
113 end subroutine functional_update_value
116 subroutine functional_update_sensitivity(this, design)
118 class(base_functional_t),
intent(inout) :: this
119 class(design_t),
intent(in) :: design
120 end subroutine functional_update_sensitivity
127 subroutine functional_init_json(this, json, design)
128 class(base_functional_t),
intent(inout) :: this
129 type(json_file),
intent(inout) :: json
130 class(design_t),
intent(in) :: design
131 character(len=:),
allocatable :: type
133 call json_get(json,
'type', type)
134 call neko_error(
"Functional type: '" //
type // &
135 "' does not support initialization without simulation")
136 end subroutine functional_init_json
139 subroutine functional_init_json_sim(this, json, design, simulation)
140 class(base_functional_t),
intent(inout) :: this
141 type(json_file),
intent(inout) :: json
142 class(design_t),
intent(in) :: design
143 type(simulation_t),
target,
intent(inout) :: simulation
144 character(len=:),
allocatable :: type
146 call json_get(json,
'type', type)
147 call neko_error(
"Functional type: '" //
type // &
148 "' does not support initialization with simulation")
149 end subroutine functional_init_json_sim
153 function functional_get_value(this)
result(v)
154 class(base_functional_t),
intent(in) :: this
158 end function functional_get_value
161 subroutine functional_get_sensitivity(this, sensitivity)
162 class(base_functional_t),
intent(in) :: this
163 type(vector_t),
intent(inout) :: sensitivity
165 sensitivity = this%sensitivity
166 end subroutine functional_get_sensitivity
Defines the abstract the base_functional_t type.
Implements the steady_problem_t type.
The base functional type.