48 character(len=20) :: SOURCE_KNOWN_TYPES(7) = [character(len=20) :: &
53 "gradient_jump_penalty", &
63 module subroutine source_term_factory(object, json, fields, coef, &
65 class(source_term_t),
allocatable,
intent(inout) :: object
66 type(json_file),
intent(inout) :: json
67 type(field_list_t),
intent(inout) :: fields
68 type(coef_t),
intent(inout) :: coef
69 character(len=*),
intent(in) :: variable_name
70 character(len=:),
allocatable :: type_name
71 character(len=:),
allocatable :: type_string
73 call json_get(json,
"type", type_name)
76 call source_term_allocator(object, type_name)
79 call object%init(json, fields, coef, variable_name)
81 end subroutine source_term_factory
86 module subroutine source_term_allocator(object, type_name)
87 class(source_term_t),
allocatable,
intent(inout) :: object
88 character(len=:),
allocatable,
intent(in) :: type_name
91 select case (trim(type_name))
104 case (
"gradient_jump_penalty")
107 do i = 1, source_term_registry_size
108 if (trim(type_name) .eq. trim(source_term_registry(i)%type_name))
then
109 call source_term_registry(i)%allocator(object)
116 end subroutine source_term_allocator
123 module subroutine register_source_term(type_name, allocator)
124 character(len=*),
intent(in) :: type_name
125 procedure(source_term_allocate),
pointer,
intent(in) :: allocator
126 type(allocator_entry),
allocatable :: temp(:)
129 do i = 1,
size(source_known_types)
130 if (trim(type_name) .eq. trim(source_known_types(i)))
then
135 do i = 1, source_term_registry_size
136 if (trim(type_name) .eq. trim(source_term_registry(i)%type_name))
then
142 if (source_term_registry_size .eq. 0)
then
143 allocate(source_term_registry(1))
145 allocate(temp(source_term_registry_size + 1))
146 temp(1:source_term_registry_size) = source_term_registry
147 call move_alloc(temp, source_term_registry)
150 source_term_registry_size = source_term_registry_size + 1
151 source_term_registry(source_term_registry_size)%type_name = type_name
152 source_term_registry(source_term_registry_size)%allocator => allocator
153 end subroutine register_source_term
155end 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 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.
Implements the gradient jump penalty.