36 use json_module,
only : json_file
55 procedure, pass(this) :: init_from_components => &
70 type(json_file),
intent(inout) :: json
71 class(
case_t),
intent(inout),
target :: case
72 character(len=:),
allocatable :: name
73 character(len=:),
allocatable :: avg_direction
74 character(len=:),
allocatable :: output_filename
75 character(len=NEKO_VARNAME_LEN),
allocatable :: fields(:)
77 call this%init_base(json,
case)
80 call json_get(json,
'fields', fields)
81 call json_get(json,
'avg_direction', avg_direction)
85 call this%init_from_components(name, fields,
case%fluid%c_Xh, &
86 avg_direction, output_filename)
88 if (
allocated(fields))
deallocate(fields)
89 if (
allocated(output_filename))
deallocate(output_filename)
90 if (
allocated(avg_direction))
deallocate(avg_direction)
91 if (
allocated(name))
deallocate(name)
101 avg_direction, output_filename)
103 character(len=*),
intent(in) :: name
104 character(len=*),
intent(in) :: fields(:)
105 type(
coef_t),
target,
intent(inout) :: coef
106 character(len=*),
intent(in) :: avg_direction
107 character(len=*),
intent(in) :: output_filename
108 character(len=NEKO_FNAME_LEN) :: resolved_output_filename
112 if (
allocated(this%case%output_directory) .and. &
113 len_trim(this%case%output_directory) .gt. 0)
then
114 resolved_output_filename = trim(this%case%output_directory) // &
115 trim(output_filename)
117 resolved_output_filename = trim(output_filename)
120 call this%output%init(fields, coef, avg_direction, &
121 resolved_output_filename)
122 call this%case%output_controller%add(this%output, &
123 this%output_controller%control_value, &
124 this%output_controller%control_mode)
131 call this%free_base()
132 call this%output%free()
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.
Utilities for retrieving parameters from the case files.
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, time)
Dummy compute function.
Output for spatially averaged fields.
Implements the spatial_average_t type.
subroutine spatial_average_free(this)
Destructor.
subroutine spatial_average_init_from_json(this, json, case)
Constructor from json.
subroutine spatial_average_compute(this, time)
Here to comply with the interface, does nothing.
subroutine spatial_average_init_from_components(this, name, fields, coef, avg_direction, output_filename)
Constructor from components.
Module with things related to the simulation time.
integer, parameter, public neko_fname_len
integer, parameter, public neko_varname_len
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Base abstract class for simulation components.
A simulation component that writes spatial averages of registry fields.
Output for spatially averaged fields.
A struct that contains all info about the time, expand as needed.