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 :: name
86 character(len=:),
allocatable :: precision
87 character(len=20),
allocatable :: fields(:)
89 call this%init_base(json,
case)
90 call json_get(json,
"fields", fields)
93 if (json%valid_path(
"output_filename"))
then
94 call json_get(json,
"output_filename", filename)
95 if (json%valid_path(
"output_precision"))
then
96 call json_get(json,
"output_precision", precision)
97 if (precision ==
"double")
then
98 call this%init_common(name, fields, filename,
dp)
100 call this%init_common(name, fields, filename,
sp)
103 call this%init_common(name, fields, filename)
106 call this%init_common(name, fields)
123 preprocess_controller, compute_controller, output_controller, &
124 fields, filename, precision)
126 character(len=*),
intent(in) :: name
127 class(
case_t),
intent(inout),
target :: case
132 character(len=20),
intent(in) :: fields(:)
133 character(len=*),
intent(in),
optional :: filename
134 integer,
intent(in),
optional :: precision
136 call this%init_base_from_components(
case, order, preprocess_controller, &
138 call this%init_common(name, fields, filename, precision)
159 case, order, preprocess_control, preprocess_value, compute_control, &
160 compute_value, output_control, output_value, fields, filename, precision)
162 character(len=*),
intent(in) :: name
163 class(
case_t),
intent(inout),
target :: case
165 character(len=*),
intent(in) :: preprocess_control
166 real(kind=
rp),
intent(in) :: preprocess_value
167 character(len=*),
intent(in) :: compute_control
168 real(kind=
rp),
intent(in) :: compute_value
169 character(len=*),
intent(in) :: output_control
170 real(kind=
rp),
intent(in) :: output_value
171 character(len=20),
intent(in) :: fields(:)
172 character(len=*),
intent(in),
optional :: filename
173 integer,
intent(in),
optional :: precision
175 call this%init_base_from_components(
case, order, preprocess_control, &
176 preprocess_value, compute_control, compute_value, output_control, &
178 call this%init_common(name, fields, filename, precision)
191 character(len=*),
intent(in) :: name
192 character(len=20),
intent(in) :: fields(:)
193 character(len=*),
intent(in),
optional :: filename
194 integer,
intent(in),
optional :: precision
195 character(len=20) :: fieldi
200 do i = 1,
size(fields)
201 fieldi = trim(fields(i))
203 ignore_existing = .true.)
206 if (
present(filename))
then
207 if (
present(precision))
then
208 call this%output%init(precision, filename,
size(fields))
210 call this%output%init(
sp, filename,
size(fields))
212 do i = 1,
size(fields)
213 fieldi = trim(fields(i))
214 call this%output%fields%assign(i, &
218 call this%case%output_controller%add(this%output, &
219 this%output_controller%control_value, &
220 this%output_controller%control_mode)
222 do i = 1,
size(fields)
223 fieldi = trim(fields(i))
224 call this%case%f_out%fluid%append( &
234 call this%free_base()
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.
subroutine field_writer_init_from_controllers(this, name, case, order, preprocess_controller, compute_controller, output_controller, fields, filename, precision)
Constructor from components, passing controllers.
subroutine field_writer_init_from_controllers_properties(this, name, 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 ...
subroutine field_writer_compute(this, time)
Here to comply with the interface, does nothing.
subroutine field_writer_free(this)
Destructor.
subroutine field_writer_init_common(this, name, fields, filename, precision)
Common part of both constructors.
subroutine field_writer_init_from_json(this, json, case)
Constructor from json.
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
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.
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.