47 use json_module,
only : json_file
50 use,
intrinsic :: iso_c_binding, only : c_ptr, c_size_t
78 procedure, pass(this) :: init_from_components => &
89 procedure, pass(this) :: apply_vector_dev => &
92 procedure, pass(this) :: apply_scalar_dev => &
122 type(
coef_t),
target,
intent(in) :: coef
123 type(json_file),
intent(inout) ::json
124 character(len=:),
allocatable :: field_name
126 call json_get(json,
"field_name", field_name)
127 call this%init_from_components(coef, field_name)
135 type(
coef_t),
intent(in) :: coef
136 character(len=*),
intent(in) :: field_name
138 call this%init_base(coef)
140 call this%field_bc%init(this%dof, field_name)
141 call this%field_list%init(1)
142 call this%field_list%assign_to_field(1, this%field_bc)
151 call this%field_bc%free()
152 call this%field_list%free()
154 if (
associated(this%update))
then
155 this%update => null()
166 integer,
intent(in) :: n
167 real(kind=
rp),
intent(inout),
dimension(n) :: x
169 logical,
intent(in),
optional :: strong
172 if (
present(strong))
then
181 if (.not. this%updated)
then
182 call this%update(this%field_list, this, time)
183 this%updated = .true.
187 call masked_copy_0(x, this%field_bc%x, this%msk, n, this%msk(0))
198 type(c_ptr),
intent(inout) :: x_d
200 logical,
intent(in),
optional :: strong
201 type(c_ptr),
intent(inout) :: strm
204 if (
present(strong))
then
212 if (.not. this%updated)
then
213 call this%update(this%field_list, this, time)
214 this%updated = .true.
218 if (this%msk(0) .gt. 0)
then
220 this%field_bc%dof%size(), this%msk(0), strm)
234 integer,
intent(in) :: n
235 real(kind=
rp),
intent(inout),
dimension(n) :: x
236 real(kind=
rp),
intent(inout),
dimension(n) :: y
237 real(kind=
rp),
intent(inout),
dimension(n) :: z
239 logical,
intent(in),
optional :: strong
241 call neko_error(
"field_dirichlet cannot apply vector BCs.&
242 & Use field_dirichlet_vector instead!")
255 type(c_ptr),
intent(inout) :: x_d
256 type(c_ptr),
intent(inout) :: y_d
257 type(c_ptr),
intent(inout) :: z_d
259 logical,
intent(in),
optional :: strong
260 type(c_ptr),
intent(inout) :: strm
261 call neko_error(
"field_dirichlet cannot apply vector BCs.&
262 & Use field_dirichlet_vector instead!")
269 logical,
optional,
intent(in) :: only_facets
270 logical :: only_facets_
272 if (
present(only_facets))
then
273 only_facets_ = only_facets
275 only_facets_ = .false.
278 call this%finalize_base(only_facets_)
Abstract interface defining a dirichlet condition on a list of fields.
Retrieves a parameter by name or throws an error.
Defines a boundary condition.
subroutine, public device_masked_copy_0(a_d, b_d, mask_d, n, n_mask, strm)
Copy a masked vector .
Defines a dirichlet boundary condition.
Defines a mapping of the degrees of freedom.
Defines user dirichlet condition for a scalar field.
subroutine field_dirichlet_finalize(this, only_facets)
Finalize.
subroutine field_dirichlet_apply_vector_dev(this, x_d, y_d, z_d, time, strong, strm)
(No-op) Apply vector (device).
subroutine field_dirichlet_apply_vector(this, x, y, z, n, time, strong)
(No-op) Apply vector.
subroutine field_dirichlet_init_from_components(this, coef, field_name)
Constructor from components.
subroutine field_dirichlet_apply_scalar(this, x, n, time, strong)
Apply scalar by performing a masked copy.
subroutine field_dirichlet_init(this, coef, json)
Constructor.
subroutine field_dirichlet_free(this)
Destructor. Currently thisfield_bc is being freed in fluid_scheme_incompressible::free
subroutine field_dirichlet_apply_scalar_dev(this, x_d, time, strong, strm)
Apply scalar (device).
Utilities for retrieving parameters from the case files.
subroutine, public masked_copy_0(a, b, mask, n, n_mask)
Copy a masked vector .
integer, parameter, public rp
Global precision used in computations.
Module with things related to the simulation time.
character(len=100) function, dimension(:), allocatable, public split_string(string, delimiter)
Split a string based on delimiter (tokenizer) OBS: very hacky, this should really be improved,...
Base type for a boundary condition.
A list of allocatable `bc_t`. Follows the standard interface of lists.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Generic Dirichlet boundary condition on .
User defined dirichlet condition, for which the user can work with an entire field....
field_list_t, To be able to group fields together
A struct that contains all info about the time, expand as needed.