46 character(len=20) :: SOURCE_KNOWN_TYPES(5) = [character(len=20) :: &
50 "gradient_jump_penalty", &
59 module subroutine source_term_factory(object, json, fields, coef, &
61 class(source_term_t),
allocatable,
intent(inout) :: object
62 type(json_file),
intent(inout) :: json
63 type(field_list_t),
intent(inout) :: fields
64 type(coef_t),
intent(inout) :: coef
65 character(len=*),
intent(in) :: variable_name
66 character(len=:),
allocatable :: type_name
67 character(len=:),
allocatable :: type_string
69 call json_get(json,
"type", type_name)
72 call source_term_allocator(object, type_name)
75 call object%init(json, fields, coef, variable_name)
77 end subroutine source_term_factory
82 module subroutine source_term_allocator(object, type_name)
83 class(source_term_t),
allocatable,
intent(inout) :: object
84 character(len=:),
allocatable,
intent(in) :: type_name
87 select case (trim(type_name))
96 case (
"gradient_jump_penalty")
99 do i = 1, source_term_registry_size
100 if (trim(type_name) .eq. trim(source_term_registry(i)%type_name))
then
101 call source_term_registry(i)%allocator(object)
108 end subroutine source_term_allocator
115 module subroutine register_source_term(type_name, allocator)
116 character(len=*),
intent(in) :: type_name
117 procedure(source_term_allocate),
pointer,
intent(in) :: allocator
118 type(allocator_entry),
allocatable :: temp(:)
121 do i = 1,
size(source_known_types)
122 if (trim(type_name) .eq. trim(source_known_types(i)))
then
127 do i = 1, source_term_registry_size
128 if (trim(type_name) .eq. trim(source_term_registry(i)%type_name))
then
134 if (source_term_registry_size .eq. 0)
then
135 allocate(source_term_registry(1))
137 allocate(temp(source_term_registry_size + 1))
138 temp(1:source_term_registry_size) = source_term_registry
139 call move_alloc(temp, source_term_registry)
142 source_term_registry_size = source_term_registry_size + 1
143 source_term_registry(source_term_registry_size)%type_name = type_name
144 source_term_registry(source_term_registry_size)%allocator => allocator
145 end subroutine register_source_term
147end 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 const_source_term_t type.
Implements the coriolis_source_term_t type. Maintainer: Timofey Mukha.
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.
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...
A constant source term. The strength is specified with the values keyword, which should be an array,...
This source term adds the Coriolis force.
Implements the gradient jump penalty.