38 use json_module,
only : json_file
58 generic :: init_from_components => &
59 init_from_controllers, init_from_controllers_properties
60 procedure, pass(this) :: init_from_controllers => &
64 procedure, pass(this) :: init_from_controllers_properties => &
81 type(json_file),
intent(inout) :: json
82 class(
case_t),
intent(inout),
target :: case
83 character(len=:),
allocatable :: filename
84 character(len=:),
allocatable :: precision
85 character(len=20),
allocatable :: fields(:)
87 call this%init_base(json,
case)
88 call json_get(json,
"fields", fields)
90 if (json%valid_path(
"output_filename"))
then
91 call json_get(json,
"output_filename", filename)
92 if (json%valid_path(
"output_precision"))
then
93 call json_get(json,
"output_precision", precision)
94 if (precision ==
"double")
then
95 call this%init_common(fields, filename,
dp)
97 call this%init_common(fields, filename,
sp)
100 call this%init_common(fields, filename)
103 call this%init_common(fields)
119 preprocess_controller, compute_controller, output_controller, &
120 fields, filename, precision)
122 class(
case_t),
intent(inout),
target :: case
127 character(len=20),
intent(in) :: fields(:)
128 character(len=*),
intent(in),
optional :: filename
129 integer,
intent(in),
optional :: precision
131 call this%init_base_from_components(
case, order, preprocess_controller, &
133 call this%init_common(fields, filename, precision)
153 case, order, preprocess_control, preprocess_value, compute_control, &
154 compute_value, output_control, output_value, fields, filename, precision)
156 class(
case_t),
intent(inout),
target :: case
158 character(len=*),
intent(in) :: preprocess_control
159 real(kind=
rp),
intent(in) :: preprocess_value
160 character(len=*),
intent(in) :: compute_control
161 real(kind=
rp),
intent(in) :: compute_value
162 character(len=*),
intent(in) :: output_control
163 real(kind=
rp),
intent(in) :: output_value
164 character(len=20),
intent(in) :: fields(:)
165 character(len=*),
intent(in),
optional :: filename
166 integer,
intent(in),
optional :: precision
168 call this%init_base_from_components(
case, order, preprocess_control, &
169 preprocess_value, compute_control, compute_value, output_control, &
171 call this%init_common(fields, filename, precision)
183 character(len=20),
intent(in) :: fields(:)
184 character(len=*),
intent(in),
optional :: filename
185 integer,
intent(in),
optional :: precision
186 character(len=20) :: fieldi
190 do i = 1,
size(fields)
191 fieldi = trim(fields(i))
193 ignore_existing = .true.)
196 if (
present(filename))
then
197 if (
present(precision))
then
198 call this%output%init(precision, filename,
size(fields))
200 call this%output%init(
sp, filename,
size(fields))
202 do i = 1,
size(fields)
203 fieldi = trim(fields(i))
204 call this%output%fields%assign(i, &
208 call this%case%output_controller%add(this%output, &
209 this%output_controller%control_value, &
210 this%output_controller%control_mode)
212 do i = 1,
size(fields)
213 fieldi = trim(fields(i))
214 call this%case%f_out%fluid%append( &
224 call this%free_base()
Retrieves a parameter by name or throws an error.
Defines a simulation case.
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.
subroutine field_writer_compute(this, time)
Here to comply with the interface, does nothing.
subroutine field_writer_init_from_controllers(this, case, order, preprocess_controller, compute_controller, output_controller, fields, filename, precision)
Constructor from components, passing controllers.
subroutine field_writer_free(this)
Destructor.
subroutine field_writer_init_common(this, fields, filename, precision)
Common part of both constructors.
subroutine field_writer_init_from_json(this, json, case)
Constructor from json.
subroutine field_writer_init_from_controllers_properties(this, case, order, preprocess_control, preprocess_value, compute_control, compute_value, output_control, output_value, fields, filename, precision)
Constructor from components, passing properties to the time_based_controller` components in the base ...
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.
Implements output_controller_t
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 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.