50 character(len=20) :: SIMCOMPS_KNOWN_TYPES(9) = [character(len=20) :: &
67 module subroutine simulation_component_factory(object, json,
case)
68 class(simulation_component_t),
allocatable,
intent(inout) :: object
69 type(json_file),
intent(inout) :: json
70 class(case_t),
intent(inout),
target :: case
71 character(len=:),
allocatable :: type_name
72 character(len=:),
allocatable :: type_string
76 call json_get_or_default(json,
"is_user", is_user, .false.)
80 call json_get(json,
"type", type_name)
83 call simulation_component_allocator(object, type_name)
86 call object%init(json,
case)
88 end subroutine simulation_component_factory
93 module subroutine simulation_component_allocator(object, type_name)
94 class(simulation_component_t),
allocatable,
intent(inout) :: object
95 character(len=*),
intent(in):: type_name
97 select case (trim(type_name))
106 case (
"field_writer")
112 case (
"force_torque")
116 case (
"spectral_error")
119 do i = 1, simcomp_registry_size
120 if (trim(type_name) == &
121 trim(simcomp_registry(i)%type_name))
then
122 call simcomp_registry(i)%allocator(object)
127 simcomps_known_types)
130 end subroutine simulation_component_allocator
136 module subroutine register_simulation_component(type_name, allocator)
137 character(len=*),
intent(in) :: type_name
138 procedure(simulation_component_allocate),
pointer,
intent(in) :: allocator
139 type(allocator_entry),
allocatable :: temp(:)
142 if (simcomp_registry_size == 0)
then
143 allocate(simcomp_registry(1))
145 allocate(temp(simcomp_registry_size + 1))
146 temp(1:simcomp_registry_size) = simcomp_registry
147 call move_alloc(temp, simcomp_registry)
150 simcomp_registry_size = simcomp_registry_size + 1
151 simcomp_registry(simcomp_registry_size)%type_name = type_name
152 simcomp_registry(simcomp_registry_size)%allocator => allocator
153 end subroutine register_simulation_component
155end submodule simulation_component_fctry
Defines a simulation case.
Implements the derivative_t type.
Implements the field_writer_t type.
Implements the fluid_stats_simcomp_t type.
Implements the force_torque_t type.
A simulation component that computes lambda2 The values are stored in the field registry under the na...
Implements the les_simcomp_t type.
Simulation components are objects that encapsulate functionality that can be fit to a particular comp...
Implements type spectral_error_t.
character(:) function, allocatable, public concat_string_array(array, sep, prepend)
Concatenate an array of strings into one string with array items separated by spaces.
subroutine, public neko_type_error(base_type, wrong_type, known_types)
Reports an error allocating a type for a particular base pointer class.
Implements the vorticity_t type.
Implements the weak_grad_t type.
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 simulation component that computes the velocity and pressure statistics up to 4th order....
A simulation component that computes the force_torque field. Added to the field registry as omega_x,...
A simulation component that drives the computation of the SGS viscosity.
Provides tools to calculate the spectral error indicator.
A simulation component that computes the vorticity field. Added to the field registry as omega_x,...
A simulation component that computes the weak gradient of a field. Wraps the opgrad operator.