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)
141 call this%field_bc%init(this%dof, field_name)
142 call this%field_list%init(1)
143 call this%field_list%assign_to_field(1, this%field_bc)
152 call this%field_bc%free()
153 call this%field_list%free()
155 if (
associated(this%update))
then
156 this%update => null()
167 integer,
intent(in) :: n
168 real(kind=
rp),
intent(inout),
dimension(n) :: x
170 logical,
intent(in),
optional :: strong
173 if (
present(strong))
then
181 if (.not. this%updated)
then
182 call this%update(this%field_list, this, time)
183 this%updated = .true.
186 call masked_copy_0(x, this%field_bc%x, this%msk, n, this%msk(0))
197 type(c_ptr),
intent(inout) :: x_d
199 logical,
intent(in),
optional :: strong
200 type(c_ptr),
intent(inout) :: strm
203 if (
present(strong))
then
210 if (.not. this%updated)
then
211 call this%update(this%field_list, this, time)
212 this%updated = .true.
215 if (this%msk(0) .gt. 0)
then
217 this%field_bc%dof%size(), this%msk(0), strm)
231 integer,
intent(in) :: n
232 real(kind=
rp),
intent(inout),
dimension(n) :: x
233 real(kind=
rp),
intent(inout),
dimension(n) :: y
234 real(kind=
rp),
intent(inout),
dimension(n) :: z
236 logical,
intent(in),
optional :: strong
238 call neko_error(
"field_dirichlet cannot apply vector BCs.&
239 & Use field_dirichlet_vector instead!")
252 type(c_ptr),
intent(inout) :: x_d
253 type(c_ptr),
intent(inout) :: y_d
254 type(c_ptr),
intent(inout) :: z_d
256 logical,
intent(in),
optional :: strong
257 type(c_ptr),
intent(inout) :: strm
258 call neko_error(
"field_dirichlet cannot apply vector BCs.&
259 & Use field_dirichlet_vector instead!")
266 call this%finalize_base()
Abstract interface defining a dirichlet condition on a list of fields.
Retrieves a parameter by name or throws an error.
Defines a boundary condition.
integer, parameter, public bc_dirichlet
Supported boundary condition types. The values are set in order of precedence for global resolution....
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_apply_vector_dev(this, x_d, y_d, z_d, time, strong, strm)
(No-op) Apply vector (device).
subroutine field_dirichlet_finalize(this)
Finalize.
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.