38 use json_module,
only : json_file
58 generic :: init_from_components => &
59 init_from_controllers, init_from_controllers_properties
61 procedure, pass(this) :: init_from_controllers => &
65 procedure, pass(this) :: init_from_controllers_properties => &
82 type(json_file),
intent(inout) :: json
83 class(
case_t),
intent(inout),
target :: case
84 character(len=:),
allocatable :: filename
85 character(len=:),
allocatable :: precision
86 character(len=20),
allocatable :: fields(:)
88 call this%init_base(json,
case)
89 call json_get(json,
"fields", fields)
91 if (json%valid_path(
"output_filename"))
then
92 call json_get(json,
"output_filename", filename)
93 if (json%valid_path(
"output_precision"))
then
94 call json_get(json,
"output_precision", precision)
95 if (precision ==
"double")
then
96 call this%init_common(fields, filename,
dp)
98 call this%init_common(fields, filename,
sp)
101 call this%init_common(fields, filename)
104 call this%init_common(fields)
120 preprocess_controller, compute_controller, output_controller, &
121 fields, filename, precision)
123 class(
case_t),
intent(inout),
target :: case
128 character(len=20),
intent(in) :: fields(:)
129 character(len=*),
intent(in),
optional :: filename
130 integer,
intent(in),
optional :: precision
132 call this%init_base_from_components(
case, order, preprocess_controller, &
134 call this%init_common(fields, filename, precision)
154 case, order, preprocess_control, preprocess_value, compute_control, &
155 compute_value, output_control, output_value, fields, filename, precision)
157 class(
case_t),
intent(inout),
target :: case
159 character(len=*),
intent(in) :: preprocess_control
160 real(kind=
rp),
intent(in) :: preprocess_value
161 character(len=*),
intent(in) :: compute_control
162 real(kind=
rp),
intent(in) :: compute_value
163 character(len=*),
intent(in) :: output_control
164 real(kind=
rp),
intent(in) :: output_value
165 character(len=20),
intent(in) :: fields(:)
166 character(len=*),
intent(in),
optional :: filename
167 integer,
intent(in),
optional :: precision
169 call this%init_base_from_components(
case, order, preprocess_control, &
170 preprocess_value, compute_control, compute_value, output_control, &
172 call this%init_common(fields, filename, precision)
184 character(len=20),
intent(in) :: fields(:)
185 character(len=*),
intent(in),
optional :: filename
186 integer,
intent(in),
optional :: precision
187 character(len=20) :: fieldi
191 do i = 1,
size(fields)
192 fieldi = trim(fields(i))
194 ignore_existing = .true.)
197 if (
present(filename))
then
198 if (
present(precision))
then
199 call this%output%init(precision, filename,
size(fields))
201 call this%output%init(
sp, filename,
size(fields))
203 do i = 1,
size(fields)
204 fieldi = trim(fields(i))
205 call this%output%fields%assign(i, &
209 call this%case%output_controller%add(this%output, &
210 this%output_controller%control_value, &
211 this%output_controller%control_mode)
213 do i = 1,
size(fields)
214 fieldi = trim(fields(i))
215 call this%case%f_out%fluid%append( &
225 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.