51 character(len=25) :: SOURCE_KNOWN_TYPES(10) = [character(len=25) :: &
56 "gradient_jump_penalty", &
70 module subroutine source_term_factory(object, json, fields, coef, &
72 class(source_term_t),
allocatable,
intent(inout) :: object
73 type(json_file),
intent(inout) :: json
74 type(field_list_t),
intent(inout) :: fields
75 type(coef_t),
intent(inout) :: coef
76 character(len=*),
intent(in) :: variable_name
77 character(len=:),
allocatable :: type_name
78 character(len=:),
allocatable :: type_string
80 call json_get(json,
"type", type_name)
83 call source_term_allocator(object, type_name)
86 call object%init(json, fields, coef, variable_name)
88 end subroutine source_term_factory
93 module subroutine source_term_allocator(object, type_name)
94 class(source_term_t),
allocatable,
intent(inout) :: object
95 character(len=:),
allocatable,
intent(in) :: type_name
98 if (
allocated(object))
then
103 select case (trim(type_name))
116 case (
"gradient_jump_penalty")
125 do i = 1, source_term_registry_size
126 if (trim(type_name) .eq. trim(source_term_registry(i)%type_name))
then
127 call source_term_registry(i)%allocator(object)
134 end subroutine source_term_allocator
141 module subroutine register_source_term(type_name, allocator)
142 character(len=*),
intent(in) :: type_name
143 procedure(source_term_allocate),
pointer,
intent(in) :: allocator
144 type(allocator_entry),
allocatable :: temp(:)
147 do i = 1,
size(source_known_types)
148 if (trim(type_name) .eq. trim(source_known_types(i)))
then
153 do i = 1, source_term_registry_size
154 if (trim(type_name) .eq. trim(source_term_registry(i)%type_name))
then
160 if (source_term_registry_size .eq. 0)
then
161 allocate(source_term_registry(1))
163 allocate(temp(source_term_registry_size + 1))
164 temp(1:source_term_registry_size) = source_term_registry
165 call move_alloc(temp, source_term_registry)
168 source_term_registry_size = source_term_registry_size + 1
169 source_term_registry(source_term_registry_size)%type_name = type_name
170 source_term_registry(source_term_registry_size)%allocator => allocator
171 end subroutine register_source_term
173end submodule source_term_fctry
Retrieves a parameter by name or throws an error.
Implements the boussinesq_source_term_t type.
Implements the brinkman_source_term_t type.
Implements the centrifugal_source_term_t type. Maintainer: Adam Peplinski.
Implements the const_source_term_t type.
Implements the coriolis_source_term_t type. Maintainer: Timofey Mukha.
Implements the field_source_term_t type.
Implements gradient_jump_penalty_t.
Implements the hpfrt_source_term_t type.
Utilities for retrieving parameters from the case files.
Implements the source_term_t type and a wrapper source_term_wrapper_t.
Implements the sponge_t type.
Implements the coriolis_source_term_t type. Implements the translation_source_term_t type.
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.
Bouyancy source term accroding to the Boussinesq approximation.
A Brinkman source term. The region and strength are controlled by assigning regions types and brinkma...
This source term adds the centrifugal force.
A constant source term. The strength is specified with the values keyword, which should be an array,...
This source term adds the Coriolis force.
A source term that grabs the values from fields in the registry. The fields are specified with the fi...
Implements the gradient jump penalty.
High-pass filter relaxation source term.
This source term adds the translation force.