38 use json_module,
only : json_file
56 procedure, pass(this) :: init_from_attributes => &
71 type(json_file),
intent(inout) :: json
72 class(
case_t),
intent(inout),
target :: case
73 character(len=:),
allocatable :: filename
74 character(len=:),
allocatable :: precision
75 character(len=20),
allocatable :: fields(:)
77 call this%init_base(json,
case)
78 call json_get(json,
"fields", fields)
80 if (json%valid_path(
"output_filename"))
then
81 call json_get(json,
"output_filename", filename)
82 if (json%valid_path(
"output_precision"))
then
83 call json_get(json,
"output_precision", precision)
84 if (precision ==
"double")
then
105 character(len=20),
allocatable,
intent(in) :: fields(:)
106 character(len=*),
intent(in),
optional :: filename
107 integer,
intent(in),
optional :: precision
108 character(len=20) :: fieldi
113 fieldi = trim(fields(i))
115 ignore_existing=.true.)
118 if (
present(filename))
then
119 if (
present(precision))
then
120 call this%output%init(precision, filename,
size(fields))
122 call this%output%init(
sp, filename,
size(fields))
125 fieldi = trim(fields(i))
129 call this%case%output_controller%add(this%output, &
130 this%output_controller%control_value, &
131 this%output_controller%control_mode)
134 fieldi = trim(fields(i))
144 call this%free_base()
152 real(kind=
rp),
intent(in) :: t
153 integer,
intent(in) :: tstep
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_free(this)
Destructor.
subroutine field_writer_init_from_attributes(this, fields, filename, precision)
Actual constructor.
subroutine field_writer_init_from_json(this, json, case)
Constructor from json.
subroutine field_writer_compute(this, t, tstep)
Here to comply with the interface, does nothing.
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.
Simulation components are objects that encapsulate functionality that can be fit to a particular comp...
subroutine compute_(this, t, tstep)
Dummy compute function.
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.