49 character(len=25) :: SOURCE_KNOWN_TYPES(8) = [character(len=25) :: &
54 "gradient_jump_penalty", &
66 module subroutine source_term_factory(object, json, fields, coef, &
68 class(source_term_t),
allocatable,
intent(inout) :: object
69 type(json_file),
intent(inout) :: json
70 type(field_list_t),
intent(inout) :: fields
71 type(coef_t),
intent(inout) :: coef
72 character(len=*),
intent(in) :: variable_name
73 character(len=:),
allocatable :: type_name
74 character(len=:),
allocatable :: type_string
76 call json_get(json,
"type", type_name)
79 call source_term_allocator(object, type_name)
82 call object%init(json, fields, coef, variable_name)
84 end subroutine source_term_factory
89 module subroutine source_term_allocator(object, type_name)
90 class(source_term_t),
allocatable,
intent(inout) :: object
91 character(len=:),
allocatable,
intent(in) :: type_name
94 if (
allocated(object))
then
99 select case (trim(type_name))
112 case (
"gradient_jump_penalty")
117 do i = 1, source_term_registry_size
118 if (trim(type_name) .eq. trim(source_term_registry(i)%type_name))
then
119 call source_term_registry(i)%allocator(object)
126 end subroutine source_term_allocator
133 module subroutine register_source_term(type_name, allocator)
134 character(len=*),
intent(in) :: type_name
135 procedure(source_term_allocate),
pointer,
intent(in) :: allocator
136 type(allocator_entry),
allocatable :: temp(:)
139 do i = 1,
size(source_known_types)
140 if (trim(type_name) .eq. trim(source_known_types(i)))
then
145 do i = 1, source_term_registry_size
146 if (trim(type_name) .eq. trim(source_term_registry(i)%type_name))
then
152 if (source_term_registry_size .eq. 0)
then
153 allocate(source_term_registry(1))
155 allocate(temp(source_term_registry_size + 1))
156 temp(1:source_term_registry_size) = source_term_registry
157 call move_alloc(temp, source_term_registry)
160 source_term_registry_size = source_term_registry_size + 1
161 source_term_registry(source_term_registry_size)%type_name = type_name
162 source_term_registry(source_term_registry_size)%allocator => allocator
163 end subroutine register_source_term
165end 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.
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.
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.