47 character(len=20) :: SOURCE_KNOWN_TYPES(6) = [character(len=20) :: &
52 "gradient_jump_penalty", &
61 module subroutine source_term_factory(object, json, fields, coef, &
63 class(source_term_t),
allocatable,
intent(inout) :: object
64 type(json_file),
intent(inout) :: json
65 type(field_list_t),
intent(inout) :: fields
66 type(coef_t),
intent(inout) :: coef
67 character(len=*),
intent(in) :: variable_name
68 character(len=:),
allocatable :: type_name
69 character(len=:),
allocatable :: type_string
71 call json_get(json,
"type", type_name)
74 call source_term_allocator(object, type_name)
77 call object%init(json, fields, coef, variable_name)
79 end subroutine source_term_factory
84 module subroutine source_term_allocator(object, type_name)
85 class(source_term_t),
allocatable,
intent(inout) :: object
86 character(len=:),
allocatable,
intent(in) :: type_name
89 select case (trim(type_name))
100 case (
"gradient_jump_penalty")
103 do i = 1, source_term_registry_size
104 if (trim(type_name) .eq. trim(source_term_registry(i)%type_name))
then
105 call source_term_registry(i)%allocator(object)
112 end subroutine source_term_allocator
119 module subroutine register_source_term(type_name, allocator)
120 character(len=*),
intent(in) :: type_name
121 procedure(source_term_allocate),
pointer,
intent(in) :: allocator
122 type(allocator_entry),
allocatable :: temp(:)
125 do i = 1,
size(source_known_types)
126 if (trim(type_name) .eq. trim(source_known_types(i)))
then
131 do i = 1, source_term_registry_size
132 if (trim(type_name) .eq. trim(source_term_registry(i)%type_name))
then
138 if (source_term_registry_size .eq. 0)
then
139 allocate(source_term_registry(1))
141 allocate(temp(source_term_registry_size + 1))
142 temp(1:source_term_registry_size) = source_term_registry
143 call move_alloc(temp, source_term_registry)
146 source_term_registry_size = source_term_registry_size + 1
147 source_term_registry(source_term_registry_size)%type_name = type_name
148 source_term_registry(source_term_registry_size)%allocator => allocator
149 end subroutine register_source_term
151end 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.
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.