39 use dirichlet,
only : dirichlet_t
40 use neumann,
only : neumann_t
41 use usr_scalar,
only : usr_scalar_t
42 use user_intf,
only : user_t
43 use usr_scalar,
only : usr_scalar_t
44 use utils,
only : neko_type_error
45 use field_dirichlet,
only : field_dirichlet_t
49 character(len=25) :: ADJOINT_SCALAR_KNOWN_BCS(4) = [character(len=25) :: &
64 module subroutine adjoint_bc_factory(object, scheme, json, coef, user)
65 class(bc_t),
pointer,
intent(inout) :: object
66 type(adjoint_scalar_pnpn_t),
intent(in) :: scheme
67 type(json_file),
intent(inout) :: json
68 type(coef_t),
intent(in) :: coef
69 type(user_t),
intent(in) :: user
70 character(len=:),
allocatable :: type
72 integer,
allocatable :: zone_indices(:)
74 call json_get(json,
"type", type)
76 select case (trim(type))
77 case (
"user_pointwise")
78 allocate(usr_scalar_t::object)
79 select type (obj => object)
80 type is (usr_scalar_t)
81 call obj%set_eval(user%scalar_user_bc)
84 allocate(field_dirichlet_t::object)
85 select type (obj => object)
86 type is (field_dirichlet_t)
87 obj%update => user%user_dirichlet_update
90 call json%add(
"field_name", scheme%s_adj%name)
93 allocate(dirichlet_t::object)
95 allocate(neumann_t::object)
97 call neko_type_error(
"scalar_pnpn boundary conditions",
type, &
98 ADJOINT_SCALAR_KNOWN_BCS)
101 call json_get(json,
"zone_indices", zone_indices)
102 call object%init(coef, json)
103 do i = 1,
size(zone_indices)
104 call object%mark_zone(coef%msh%labeled_zones(zone_indices(i)))
106 call object%finalize()
108 end subroutine adjoint_bc_factory
111end submodule adjoint_scalar_pnpn_bc_fctry
Contains the adjoint_scalar_pnpn_t type.