48 character(len=25),
parameter :: SCALAR_PNPN_KNOWN_BCS(6) = [ &
49 character(len=25) :: &
51 "expression_dirichlet", &
62 module subroutine scalar_pnpn_bc_allocator(object, type_name)
63 class(bc_t),
pointer,
intent(inout) :: object
64 character(len=*),
intent(in) :: type_name
67 if (
associated(object))
then
72 select case (trim(type_name))
73 case (
"user_dirichlet")
77 case (
"expression_dirichlet")
83 case (
"overset_interface")
86 do i = 1, scalar_pnpn_bc_registry_size
87 if (trim(type_name) .eq. &
88 trim(scalar_pnpn_bc_registry(i)%type_name))
then
89 call scalar_pnpn_bc_registry(i)%allocator(object)
95 scalar_pnpn_known_bcs)
97 end subroutine scalar_pnpn_bc_allocator
104 module subroutine register_scalar_pnpn_bc(type_name, allocator)
105 character(len=*),
intent(in) :: type_name
106 procedure(scalar_pnpn_bc_allocate),
pointer,
intent(in) :: allocator
107 type(scalar_pnpn_bc_allocator_entry),
allocatable :: temp(:)
110 do i = 1,
size(scalar_pnpn_known_bcs)
111 if (trim(type_name) .eq. trim(scalar_pnpn_known_bcs(i)))
then
117 do i = 1, scalar_pnpn_bc_registry_size
118 if (trim(type_name) .eq. &
119 trim(scalar_pnpn_bc_registry(i)%type_name))
then
125 if (scalar_pnpn_bc_registry_size .eq. 0)
then
126 allocate(scalar_pnpn_bc_registry(1))
128 allocate(temp(scalar_pnpn_bc_registry_size + 1))
129 temp(1:scalar_pnpn_bc_registry_size) = scalar_pnpn_bc_registry
130 call move_alloc(temp, scalar_pnpn_bc_registry)
133 scalar_pnpn_bc_registry_size = scalar_pnpn_bc_registry_size + 1
134 scalar_pnpn_bc_registry(scalar_pnpn_bc_registry_size)%type_name = type_name
135 scalar_pnpn_bc_registry(scalar_pnpn_bc_registry_size)%allocator => allocator
136 end subroutine register_scalar_pnpn_bc
145 module subroutine scalar_pnpn_bc_factory(object, scheme, json, coef,
user)
146 class(bc_t),
pointer,
intent(inout) :: object
147 type(scalar_pnpn_t),
intent(in) :: scheme
148 type(json_file),
intent(inout) :: json
149 type(coef_t),
target,
intent(in) :: coef
150 type(user_t),
intent(in) :: user
151 character(len=:),
allocatable :: type
153 integer,
allocatable :: zone_indices(:)
154 character(len=:),
allocatable :: default_name
155 character(len=64) :: buf
157 call json_get(json,
"type", type)
158 call scalar_pnpn_bc_allocator(object, type)
160 select case (trim(type))
161 case (
"user_dirichlet")
162 select type (obj => object)
164 obj%update =>
user%dirichlet_conditions
167 call json%add(
"field_name", scheme%s%name)
169 case (
"user_neumann")
170 select type (obj => object)
172 obj%update =>
user%neumann_conditions
175 call json%add(
"field_name", scheme%s%name)
177 case (
"overset_interface")
178 select type (obj => object)
180 call json%add(
"field_name", scheme%s%name)
184 call json_get(json,
"zone_indices", zone_indices)
185 call object%init(coef, json)
186 do i = 1,
size(zone_indices)
187 call object%mark_labeled_zone(zone_indices(i))
190 write(buf,
'("scalar_bc_",I0)') zone_indices(1)
191 default_name = trim(buf)
192 call json_get_or_default(json,
"name", object%name, default_name)
193 object%zone_indices = zone_indices
194 call object%finalize()
197 deallocate(zone_indices)
198 deallocate(default_name)
200 end subroutine scalar_pnpn_bc_factory
203end submodule scalar_pnpn_bc_fctry
Defines a dirichlet boundary condition.
Defines a Dirichlet condition prescribed by a mathematical expression.
Defines user dirichlet condition for a scalar field.
Defines user neumann condition for a scalar field.
Defines a Neumann boundary condition.
Defines overset interface scalar boundary conditions.
Contains the scalar_pnpn_t type.
Interfaces for user interaction with NEKO.
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.
Generic Dirichlet boundary condition on .
Dirichlet condition on , where is a mathematical expression given in the case file.
User defined dirichlet condition, for which the user can work with an entire field....
User defined neumann condition, for which the user can work with an entire field. The type stores a s...
A Neumann boundary condition. Sets the flux of the field to the chosen values.
Overset interface BC for a scalar field.
A type collecting all the overridable user routines and flag to suppress type injection from custom m...