38 use json_module,
only : json_file
60 real(kind=
rp),
pointer :: dr(:,:,:,:)
62 real(kind=
rp),
pointer :: ds(:,:,:,:)
64 real(kind=
rp),
pointer :: dt(:,:,:,:)
72 procedure, pass(this) :: init_from_components => &
85 type(json_file),
intent(inout) :: json
86 class(
case_t),
intent(inout),
target :: case
87 character(len=:),
allocatable :: fieldname
88 character(len=:),
allocatable :: direction
89 character(len=20) :: fields(1)
93 call json_get(json,
"field", fieldname)
94 call json_get(json,
"direction", direction)
96 fields(1) =
"d" // trim(fieldname) //
"_d" // direction
97 call json%add(
"fields", fields)
99 call this%init_base(json,
case)
100 call this%writer%init(json,
case)
108 character(len=*) :: fieldname
109 character(len=*) :: direction
114 "d" // fieldname //
"_d" // direction)
116 if (direction .eq.
"x")
then
117 this%dr => this%case%fluid%c_Xh%drdx
118 this%ds => this%case%fluid%c_Xh%dsdx
119 this%dt => this%case%fluid%c_Xh%dtdx
120 else if (direction .eq.
"y")
then
121 this%dr => this%case%fluid%c_Xh%drdy
122 this%ds => this%case%fluid%c_Xh%dsdy
123 this%dt => this%case%fluid%c_Xh%dtdy
124 else if (direction .eq.
"z")
then
125 this%dr => this%case%fluid%c_Xh%drdz
126 this%ds => this%case%fluid%c_Xh%dsdz
127 this%dt => this%case%fluid%c_Xh%dtdz
129 call neko_error(
"The direction of the derivative must be x, y or z")
136 call this%free_base()
137 call this%writer%free()
151 call dudxyz(this%du%x, this%u%x, this%dr, this%ds, this%dt,&
152 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 derivative_t type.
subroutine derivative_compute(this, time)
Compute the derivative field.
subroutine derivative_free(this)
Destructor.
subroutine derivative_init_from_components(this, fieldname, direction)
Actual constructor.
subroutine derivative_init_from_json(this, json, case)
Constructor from json.
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 dudxyz(du, u, dr, ds, dt, coef)
Compute derivative of a scalar field along a single direction.
Simulation components are objects that encapsulate functionality that can be fit to a particular comp...
subroutine compute_(this, time)
Dummy compute function.
Module with things related to the simulation time.
A simulation component that computes a derivative of a field. Wraps the duxyz operator.
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 struct that contains all info about the time, expand as needed.