38 use json_module,
only : json_file
80 generic :: init_from_components => &
81 init_from_controllers, init_from_controllers_properties
83 procedure, pass(this) :: init_from_controllers => &
87 procedure, pass(this) :: init_from_controllers_properties => &
101 class(
curl_t),
intent(inout),
target :: this
102 type(json_file),
intent(inout) :: json
103 class(
case_t),
intent(inout),
target :: case
104 character(len=20) :: fields(3)
105 character(len=20),
allocatable :: field_names(:)
106 character(len=:),
allocatable :: computed_field
110 call json_get(json,
"fields", field_names)
112 if (
size(field_names) .ne. 3)
then
113 call neko_error(
"The curl simcomp requires exactly 3 entries in " // &
117 fields(1) = trim(computed_field) //
"_x"
118 fields(2) = trim(computed_field) //
"_y"
119 fields(3) = trim(computed_field) //
"_z"
122 call json%add(
"fields", fields)
124 call this%init_base(json,
case)
125 call this%writer%init(json,
case)
134 class(
curl_t),
intent(inout) :: this
135 character(len=*) :: field_names(3)
136 character(len=*) :: computed_field
164 preprocess_controller, compute_controller, output_controller, &
165 field_names, computed_field, filename, precision)
166 class(
curl_t),
intent(inout) :: this
167 class(
case_t),
intent(inout),
target :: case
172 character(len=*) :: field_names(3)
173 character(len=*) :: computed_field
174 character(len=*),
intent(in),
optional :: filename
175 integer,
intent(in),
optional :: precision
177 character(len=20) :: fields(3)
179 fields(1) = trim(computed_field) //
"_x"
180 fields(2) = trim(computed_field) //
"_y"
181 fields(3) = trim(computed_field) //
"_z"
183 call this%init_base_from_components(
case, order, preprocess_controller, &
185 call this%writer%init_from_components(
case, order, preprocess_controller, &
187 call this%init_common(field_names, computed_field)
208 case, order, preprocess_control, preprocess_value, compute_control, &
209 compute_value, output_control, output_value, field_names, computed_field, &
211 class(
curl_t),
intent(inout) :: this
212 class(
case_t),
intent(inout),
target :: case
214 character(len=*),
intent(in) :: preprocess_control
215 real(kind=
rp),
intent(in) :: preprocess_value
216 character(len=*),
intent(in) :: compute_control
217 real(kind=
rp),
intent(in) :: compute_value
218 character(len=*),
intent(in) :: output_control
219 real(kind=
rp),
intent(in) :: output_value
220 character(len=*) :: field_names(3)
221 character(len=*) :: computed_field
222 character(len=*),
intent(in),
optional :: filename
223 integer,
intent(in),
optional :: precision
225 character(len=20) :: fields(3)
227 fields(1) = trim(computed_field) //
"_x"
228 fields(2) = trim(computed_field) //
"_y"
229 fields(3) = trim(computed_field) //
"_z"
231 call this%init_base_from_components(
case, order, preprocess_control, &
232 preprocess_value, compute_control, compute_value, output_control, &
234 call this%writer%init_from_components(
case, order, preprocess_control, &
235 preprocess_value, compute_control, compute_value, output_control, &
236 output_value, fields, filename, precision)
237 call this%init_common(field_names, computed_field)
243 class(
curl_t),
intent(inout) :: this
244 call this%free_base()
245 call this%writer%free()
257 class(
curl_t),
intent(inout) :: this
259 type(
field_t),
pointer :: temp1, temp2
260 integer :: tmp_idx(2)
265 call curl(this%curl_x, this%curl_y, this%curl_z, this%u, this%v, &
266 this%w, temp1, temp2, 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 curl_t type.
subroutine curl_init_from_controllers(this, case, order, preprocess_controller, compute_controller, output_controller, field_names, computed_field, filename, precision)
Constructor from components, passing controllers.
subroutine curl_init_from_controllers_properties(this, case, order, preprocess_control, preprocess_value, compute_control, compute_value, output_control, output_value, field_names, computed_field, filename, precision)
Constructor from components, passing properties to the time_based_controller` components in the base ...
subroutine curl_free(this)
Destructor.
subroutine curl_init_common(this, field_names, computed_field)
Common part of the constructors.
subroutine curl_init_from_json(this, json, case)
Constructor from json.
subroutine curl_compute(this, time)
Compute the curl field.
Device abstraction, common interface for various accelerators.
type(c_ptr), bind(C), public glb_cmd_event
Event for the global command queue.
Defines a registry for storing solution fields.
type(field_registry_t), target, public neko_field_registry
Global field registry.
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 curl(w1, w2, w3, u1, u2, u3, work1, work2, coef, event)
Implements output_controller_t
Defines a registry for storing and requesting temporary fields This can be used when you have a funct...
type(scratch_registry_t), target, public neko_scratch_registry
Global scratch 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.
A simulation component that computes the curl of a vector field. Added to the field registry as curl_...
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.