38 use json_module,
only : json_file
70 generic :: init_from_components => &
71 init_from_controllers, init_from_controllers_properties
73 procedure, pass(this) :: init_from_controllers => &
77 procedure, pass(this) :: init_from_controllers_properties => &
92 type(json_file),
intent(inout) :: json
93 class(
case_t),
intent(inout),
target :: case
94 character(len=:),
allocatable :: field_name
95 character(len=:),
allocatable :: name
96 character(len=20) :: fields(3)
97 character(len=:),
allocatable :: computed_field
102 call json_get(json,
"field", field_name)
104 "weak_gradient" // trim(field_name))
106 fields(1) = computed_field //
"_x"
107 fields(2) = computed_field //
"_y"
108 fields(3) = computed_field //
"_z"
110 call json%add(
"fields", fields)
112 call this%init_base(json,
case)
113 call this%writer%init(json,
case)
115 call this%init_common(name, field_name, computed_field)
122 character(len=*) :: name
123 character(len=*) :: field_name
124 character(len=*) :: computed_field
130 computed_field //
"_x")
132 computed_field //
"_y")
134 computed_field //
"_z")
152 preprocess_controller, compute_controller, output_controller, &
153 field_name, computed_field, filename, precision)
155 character(len=*),
intent(in) :: name
156 class(
case_t),
intent(inout),
target :: case
161 character(len=*) :: field_name
162 character(len=*) :: computed_field
163 character(len=*),
intent(in),
optional :: filename
164 integer,
intent(in),
optional :: precision
166 character(len=20) :: fields(3)
168 fields(1) = trim(computed_field) //
"_x"
169 fields(2) = trim(computed_field) //
"_y"
170 fields(3) = trim(computed_field) //
"_z"
172 call this%init_base_from_components(
case, order, preprocess_controller, &
174 call this%writer%init_from_components(
"field_writer",
case, order, &
177 call this%init_common(name, field_name, computed_field)
199 case, order, preprocess_control, preprocess_value, compute_control, &
200 compute_value, output_control, output_value, field_name, &
201 computed_field, filename, precision)
203 character(len=*),
intent(in) :: name
204 class(
case_t),
intent(inout),
target :: case
206 character(len=*),
intent(in) :: preprocess_control
207 real(kind=
rp),
intent(in) :: preprocess_value
208 character(len=*),
intent(in) :: compute_control
209 real(kind=
rp),
intent(in) :: compute_value
210 character(len=*),
intent(in) :: output_control
211 real(kind=
rp),
intent(in) :: output_value
212 character(len=*) :: field_name
213 character(len=*) :: computed_field
214 character(len=*),
intent(in),
optional :: filename
215 integer,
intent(in),
optional :: precision
217 character(len=20) :: fields(3)
219 fields(1) = trim(computed_field) //
"_x"
220 fields(2) = trim(computed_field) //
"_y"
221 fields(3) = trim(computed_field) //
"_z"
223 call this%init_base_from_components(
case, order, preprocess_control, &
224 preprocess_value, compute_control, compute_value, output_control, &
226 call this%writer%init_from_components(
"field_writer",
case, order, &
227 preprocess_control, preprocess_value, compute_control, compute_value, &
228 output_control, output_value, fields, filename, precision)
229 call this%init_common(name, field_name, computed_field)
236 call this%free_base()
237 call this%writer%free()
238 nullify(this%gradient_x)
239 nullify(this%gradient_y)
240 nullify(this%gradient_z)
250 call opgrad(this%gradient_x%x, this%gradient_y%x, this%gradient_z%x, &
251 this%u%x, this%case%fluid%c_Xh)
Retrieves a parameter by name or assigns a provided default value. In the latter case also adds the m...
Retrieves a parameter by name or throws an error.
Defines a simulation case.
Implements the field_writer_t type.
Implements fld_file_output_t.
Utilities for retrieving parameters from the case files.
integer, parameter, public dp
integer, parameter, public sp
integer, parameter, public rp
Global precision used in computations.
subroutine, public opgrad(ux, uy, uz, u, coef, es, ee)
Compute the weak gradient of a scalar field, i.e. the gradient multiplied by the mass matrix.
Implements output_controller_t
Defines a registry for storing solution fields.
type(registry_t), target, public neko_registry
Global field registry.
Simulation components are objects that encapsulate functionality that can be fit to a particular comp...
subroutine compute_(this, time)
Dummy compute function.
Contains the time_based_controller_t type.
Module with things related to the simulation time.
Implements the weak_gradient_t type.
subroutine weak_gradient_init_from_controllers(this, name, case, order, preprocess_controller, compute_controller, output_controller, field_name, computed_field, filename, precision)
Constructor from components, passing controllers.
subroutine weak_gradient_free(this)
Destructor.
subroutine weak_gradient_init_from_controllers_properties(this, name, case, order, preprocess_control, preprocess_value, compute_control, compute_value, output_control, output_value, field_name, computed_field, filename, precision)
Constructor from components, passing properties to the time_based_controller` components in the base ...
subroutine weak_gradient_init_common(this, name, field_name, computed_field)
Common part of the constructors.
subroutine weak_gradient_init_from_json(this, json, case)
Constructor from json.
subroutine weak_gradient_compute(this, time)
Compute the weak_gradient field.
A simulation component that writes a 3d field to a file.
A simple output saving a list of fields to a .fld file.
Base abstract class for simulation components.
A utility type for determining whether an action should be executed based on the current time value....
A struct that contains all info about the time, expand as needed.
A simulation component that computes the weak gradient of a field. Wraps the opgradient operator.