53 character(len=20) :: SIMCOMPS_KNOWN_TYPES(12) = [character(len=20) :: &
73 module subroutine simulation_component_factory(object, json,
case)
74 class(simulation_component_t),
allocatable,
intent(inout) :: object
75 type(json_file),
intent(inout) :: json
76 class(case_t),
intent(inout),
target :: case
77 character(len=:),
allocatable :: type_name
78 character(len=:),
allocatable :: type_string
82 call json_get_or_default(json,
"is_user", is_user, .false.)
86 call json_get(json,
"type", type_name)
89 call simulation_component_allocator(object, type_name)
92 call object%init(json,
case)
94 end subroutine simulation_component_factory
99 module subroutine simulation_component_allocator(object, type_name)
100 class(simulation_component_t),
allocatable,
intent(inout) :: object
101 character(len=*),
intent(in):: type_name
104 select case (trim(type_name))
111 case (
"field_writer")
123 case (
"force_torque")
127 case (
"spectral_error")
130 do i = 1, simcomp_registry_size
131 if (trim(type_name) == &
132 trim(simcomp_registry(i)%type_name))
then
133 call simcomp_registry(i)%allocator(object)
138 simcomps_known_types)
141 end subroutine simulation_component_allocator
148 module subroutine register_simulation_component(type_name, allocator)
149 character(len=*),
intent(in) :: type_name
150 procedure(simulation_component_allocate),
pointer,
intent(in) :: allocator
151 type(allocator_entry),
allocatable :: temp(:)
154 do i = 1,
size(simcomps_known_types)
155 if (trim(type_name) .eq. trim(simcomps_known_types(i)))
then
161 do i = 1, simcomp_registry_size
162 if (trim(type_name) .eq. &
163 trim(simcomp_registry(i)%type_name))
then
170 if (simcomp_registry_size == 0)
then
171 allocate(simcomp_registry(1))
173 allocate(temp(simcomp_registry_size + 1))
174 temp(1:simcomp_registry_size) = simcomp_registry
175 call move_alloc(temp, simcomp_registry)
178 simcomp_registry_size = simcomp_registry_size + 1
179 simcomp_registry(simcomp_registry_size)%type_name = type_name
180 simcomp_registry(simcomp_registry_size)%allocator => allocator
181 end subroutine register_simulation_component
183end submodule simulation_component_fctry
Defines a simulation case.
Implements the curl_t type.
Implements the derivative_t type.
Implements the divergence_t type.
Implements the field_writer_t type.
Implements the fluid_stats_simcomp_t type.
Implements the force_torque_t type.
Implements the gradient_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_registration_error(base_type, wrong_type, known)
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 weak_gradient_t type.
A simulation component that computes the curl of a vector field. Added to the field registry as curl_...
A simulation component that computes a derivative of a field. Wraps the duxyz operator.
A simulation component that computes the divergence of a vector field. Added to the field registry as...
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 and torque on a given boundary zone.
A simulation component that computes the gradient of a field. Wraps the gradient operator.
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 weak gradient of a field. Wraps the opgradient operator.