Neko 1.99.9
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
field_dirichlet::field_dirichlet_t Type Referenceabstract

User defined dirichlet condition, for which the user can work with an entire field. The type stores a separate dummy field field_bc, which is passed to the user routine and can be populated with arbitrary values. The boundary condition then copy-pastes these values to the actual solution field using the mask of the boundary condition. So, in the end, only the relevant boundary values are updated. More...

Inheritance diagram for field_dirichlet::field_dirichlet_t:
Collaboration diagram for field_dirichlet::field_dirichlet_t:

Public Member Functions

procedure, pass(this) init (this, coef, json)
 Constructor.
 
procedure, pass(this) init_from_components (this, coef, field_name)
 Constructor from components.
 
procedure, pass(this) free (this)
 Destructor.
 
procedure, pass(this) finalize (this)
 Finalize.
 
procedure, pass(this) apply_scalar (this, x, n, time, strong)
 Apply scalar by performing a masked copy.
 
procedure, pass(this) apply_vector (this, x, y, z, n, time, strong)
 (No-op) Apply vector.
 
procedure, pass(this) apply_vector_dev (this, x_d, y_d, z_d, time, strong, strm)
 (No-op) Apply vector (device).
 
procedure, pass(this) apply_scalar_dev (this, x_d, time, strong, strm)
 Apply scalar (device).
 
procedure, pass(this) init_base (this, coef)
 Constructor.
 
procedure, pass(this) free_base (this)
 Destructor.
 
procedure, pass(this) mark_facet (this, facet, el)
 Mark a facet on an element as part of the boundary condition.
 
procedure, pass(this) mark_facets (this, facet_list)
 Mark all facets from a (facet, element) tuple list.
 
procedure, pass(this) mark_zone (this, bc_zone)
 Mark all facets from a zone.
 
procedure, pass(this) mark_labeled_zone (this, zone_index)
 Mark all facets from a labeled zone.
 
procedure, pass(this) mark_labeled_zones (this, zone_indices)
 Mark all facets from a list of labeled zones.
 
procedure, pass(this) finalize_base (this)
 Finalize the construction of the bc by populating the msk and facet arrays.
 
procedure, pass(this) apply_scalar_generic (this, x, time, strong, strm)
 Apply the boundary condition to a scalar field. Dispatches to the CPU or the device version.
 
procedure, pass(this) apply_vector_generic (this, x, y, z, time, strong, strm)
 Apply the boundary condition to a vector field. Dispatches to the CPU or the device version.
 
procedure, pass(this) debug_mask_ (this, file_name)
 Write a field showing the mask of the bcs.
 
procedure, pass(this) restart_scalar (this, s, slag)
 Restore a scalar boundary condition from solution history.
 
procedure, pass(this) restart_vector (this, u, v, w, ulag, vlag, wlag)
 Restore a vector boundary condition from solution history.
 
generic restart (this, s, slag)
 Restore boundary-condition state after a simulation restart.
 
generic restart (this, u, v, w, ulag, vlag, wlag)
 Restore boundary-condition state after a simulation restart.
 
procedure(bc_apply_scalar), deferred, pass apply_scalar (this, x, n, time, strong)
 Apply the boundary condition to a scalar field on the CPU.
 
procedure(bc_apply_vector), deferred, pass apply_vector (this, x, y, z, n, time, strong)
 Apply the boundary condition to a vector field on the CPU.
 
procedure(bc_apply_scalar_dev), deferred, pass apply_scalar_dev (this, x_d, time, strong, strm)
 Device version of apply_scalar on the device.
 
procedure(bc_apply_vector_dev), deferred, pass apply_vector_dev (this, x_d, y_d, z_d, time, strong, strm)
 Device version of apply_vector on the device.
 
procedure(bc_destructor), deferred, pass free (this)
 Deferred destructor.
 
procedure(bc_constructor), deferred, pass init (this, coef, json)
 Deferred constructor.
 
procedure(bc_finalize), deferred, pass finalize (this)
 Deferred finalizer.
 

Public Attributes

type(field_t) field_bc
 A dummy field which can be manipulated by the user to set the boundary values.
 
type(field_list_t) field_list
 A field list, which just stores field_bc, for convenience.
 
integer, dimension(:), allocatable msk
 The linear index of each constrained local degree of freedom.
 
integer, dimension(:), allocatable facet_node_msk
 The linear index of each node on the marked boundary facets.
 
integer, dimension(:), allocatable facet
 A list of facet ids (1 to 6), one for each entry in facet_node_msk.
 
type(dofmap_t), pointer dof => null()
 Map of degrees of freedom.
 
type(coef_t), pointer coef => null()
 SEM coefficients.
 
type(mesh_t), pointer msh => null()
 The mesh.
 
type(space_t), pointer xh => null()
 The function space.
 
type(stack_i4t2_t) marked_facet
 Index tuples (facet, element) marked as part of the boundary condition.
 
type(c_ptr) msk_d = C_NULL_PTR
 Device pointer for msk.
 
type(c_ptr) facet_node_msk_d = C_NULL_PTR
 Device pointer for facet_node_msk.
 
type(c_ptr) facet_d = C_NULL_PTR
 Device pointer for facet.
 
integer bc_type = -1
 Type of the boundary condition, from the BC_* constants.
 
logical updated = .false.
 Indicates wether the bc has been updated, for those BCs that need additional computations.
 
character(len=:), allocatable name
 
integer, dimension(:), allocatable zone_indices
 

Static Public Attributes

procedure(field_dirichlet_update), pointer, nopass update => null()
 Function pointer to the user routine performing the update of the values of the boundary fields.
 

Detailed Description

Note
Would be neat to add another class that contains all three dirichlet bcs for the velocity, this bc would then implement apply_vector.

Definition at line 65 of file field_dirichlet.f90.

Member Function/Subroutine Documentation

◆ apply_scalar() [1/2]

procedure(bc_apply_scalar), deferred, pass bc::bc_t::apply_scalar ( class(bc_t), intent(inout)  this,
real(kind=rp), dimension(n), intent(inout)  x,
integer, intent(in)  n,
type(time_state_t), intent(in), optional  time,
logical, intent(in), optional  strong 
)
pure virtualinherited

Definition at line 139 of file bc.f90.

◆ apply_scalar() [2/2]

procedure, pass(this) field_dirichlet::field_dirichlet_t::apply_scalar ( class(field_dirichlet_t), intent(inout)  this,
real(kind=rp), dimension(n), intent(inout)  x,
integer, intent(in)  n,
type(time_state_t), intent(in), optional  time,
logical, intent(in), optional  strong 
)
Parameters
xField onto which to copy the values (e.g. u,v,w,p or s).
nSize of the array x.
timeThe current time state.

Definition at line 85 of file field_dirichlet.f90.

◆ apply_scalar_dev() [1/2]

procedure(bc_apply_scalar_dev), deferred, pass bc::bc_t::apply_scalar_dev ( class(bc_t), intent(inout), target  this,
type(c_ptr), intent(inout)  x_d,
type(time_state_t), intent(in), optional  time,
logical, intent(in), optional  strong,
type(c_ptr), intent(inout)  strm 
)
pure virtualinherited

Definition at line 143 of file bc.f90.

◆ apply_scalar_dev() [2/2]

procedure, pass(this) field_dirichlet::field_dirichlet_t::apply_scalar_dev ( class(field_dirichlet_t), intent(inout), target  this,
type(c_ptr), intent(inout)  x_d,
type(time_state_t), intent(in), optional  time,
logical, intent(in), optional  strong,
type(c_ptr), intent(inout)  strm 
)
Parameters
x_dDevice pointer to the field onto which to copy the values.
timeThe current time state.
strmDevice stream

Definition at line 92 of file field_dirichlet.f90.

◆ apply_scalar_generic()

procedure, pass(this) bc::bc_t::apply_scalar_generic ( class(bc_t), intent(inout)  this,
type(field_t), intent(inout)  x,
type(time_state_t), intent(in), optional  time,
logical, intent(in), optional  strong,
type(c_ptr), intent(inout), optional  strm 
)
inherited
Parameters
xThe x comp of the field for which to apply the bc.
timeCurrent time state.
strongWhether we are setting a strong or a weak bc.
strmDevice stream

Definition at line 126 of file bc.f90.

◆ apply_vector() [1/2]

procedure(bc_apply_vector), deferred, pass bc::bc_t::apply_vector ( class(bc_t), intent(inout)  this,
real(kind=rp), dimension(n), intent(inout)  x,
real(kind=rp), dimension(n), intent(inout)  y,
real(kind=rp), dimension(n), intent(inout)  z,
integer, intent(in)  n,
type(time_state_t), intent(in), optional  time,
logical, intent(in), optional  strong 
)
pure virtualinherited

Definition at line 141 of file bc.f90.

◆ apply_vector() [2/2]

procedure, pass(this) field_dirichlet::field_dirichlet_t::apply_vector ( class(field_dirichlet_t), intent(inout)  this,
real(kind=rp), dimension(n), intent(inout)  x,
real(kind=rp), dimension(n), intent(inout)  y,
real(kind=rp), dimension(n), intent(inout)  z,
integer, intent(in)  n,
type(time_state_t), intent(in), optional  time,
logical, intent(in), optional  strong 
)
Parameters
xx-component of the field onto which to apply the values.
yy-component of the field onto which to apply the values.
zz-component of the field onto which to apply the values.
nSize of the x, y and z arrays.
timeThe current time state.

Definition at line 87 of file field_dirichlet.f90.

◆ apply_vector_dev() [1/2]

procedure(bc_apply_vector_dev), deferred, pass bc::bc_t::apply_vector_dev ( class(bc_t), intent(inout), target  this,
type(c_ptr), intent(inout)  x_d,
type(c_ptr), intent(inout)  y_d,
type(c_ptr), intent(inout)  z_d,
type(time_state_t), intent(in), optional  time,
logical, intent(in), optional  strong,
type(c_ptr), intent(inout)  strm 
)
pure virtualinherited

Definition at line 145 of file bc.f90.

◆ apply_vector_dev() [2/2]

procedure, pass(this) field_dirichlet::field_dirichlet_t::apply_vector_dev ( class(field_dirichlet_t), intent(inout), target  this,
type(c_ptr), intent(inout)  x_d,
type(c_ptr), intent(inout)  y_d,
type(c_ptr), intent(inout)  z_d,
type(time_state_t), intent(in), optional  time,
logical, intent(in), optional  strong,
type(c_ptr), intent(inout)  strm 
)
Parameters
xx-component of the field onto which to apply the values.
yy-component of the field onto which to apply the values.
zz-component of the field onto which to apply the values.
timeThe current time state.
strmDevice stream

Definition at line 89 of file field_dirichlet.f90.

◆ apply_vector_generic()

procedure, pass(this) bc::bc_t::apply_vector_generic ( class(bc_t), intent(inout)  this,
type(field_t), intent(inout)  x,
type(field_t), intent(inout)  y,
type(field_t), intent(inout)  z,
type(time_state_t), intent(in), optional  time,
logical, intent(in), optional  strong,
type(c_ptr), intent(inout), optional  strm 
)
inherited
Parameters
xThe x comp of the field for which to apply the bc.
yThe y comp of the field for which to apply the bc.
zThe z comp of the field for which to apply the bc.
timeCurrent time state.
strongWhether we are setting a strong or a weak bc.
Devicestream

Definition at line 129 of file bc.f90.

◆ debug_mask_()

procedure, pass(this) bc::bc_t::debug_mask_ ( class(bc_t), intent(inout)  this,
character(len=*), intent(in)  file_name 
)
inherited

The mask will be marked with 1.

Parameters
file_nameThe name of the fld file.

Definition at line 131 of file bc.f90.

◆ finalize() [1/2]

procedure(bc_finalize), deferred, pass bc::bc_t::finalize ( class(bc_t), intent(inout), target  this)
pure virtualinherited

Definition at line 151 of file bc.f90.

◆ finalize() [2/2]

procedure, pass(this) field_dirichlet::field_dirichlet_t::finalize ( class(field_dirichlet_t), intent(inout), target  this)

Definition at line 83 of file field_dirichlet.f90.

◆ finalize_base()

procedure, pass(this) bc::bc_t::finalize_base ( class(bc_t), intent(inout), target  this)
inherited

This will linearize the marked facet's indicies in the msk array.

Definition at line 122 of file bc.f90.

◆ free() [1/2]

procedure(bc_destructor), deferred, pass bc::bc_t::free ( class(bc_t), intent(inout), target  this)
pure virtualinherited

Definition at line 147 of file bc.f90.

◆ free() [2/2]

procedure, pass(this) field_dirichlet::field_dirichlet_t::free ( class(field_dirichlet_t), intent(inout), target  this)

Definition at line 81 of file field_dirichlet.f90.

◆ free_base()

procedure, pass(this) bc::bc_t::free_base ( class(bc_t), intent(inout)  this)
inherited

Definition at line 109 of file bc.f90.

◆ init() [1/2]

procedure(bc_constructor), deferred, pass bc::bc_t::init ( class(bc_t), intent(inout), target  this,
type(coef_t), intent(in), target  coef,
type(json_file), intent(inout)  json 
)
pure virtualinherited

Definition at line 149 of file bc.f90.

◆ init() [2/2]

procedure, pass(this) field_dirichlet::field_dirichlet_t::init ( class(field_dirichlet_t), intent(inout), target  this,
type(coef_t), intent(in), target  coef,
type(json_file), intent(inout)  json 
)
Parameters
[in]coefThe SEM coefficients.
[in,out]jsonThe JSON object configuring the boundary condition.

Definition at line 76 of file field_dirichlet.f90.

◆ init_base()

procedure, pass(this) bc::bc_t::init_base ( class(bc_t), intent(inout)  this,
type(coef_t), intent(in), target  coef 
)
inherited
Parameters
dofMap of degrees of freedom.

Definition at line 107 of file bc.f90.

◆ init_from_components()

procedure, pass(this) field_dirichlet::field_dirichlet_t::init_from_components ( class(field_dirichlet_t), intent(inout), target  this,
type(coef_t), intent(in)  coef,
character(len=*), intent(in)  field_name 
)
Parameters
[in]coefThe SEM coefficients.

Definition at line 78 of file field_dirichlet.f90.

◆ mark_facet()

procedure, pass(this) bc::bc_t::mark_facet ( class(bc_t), intent(inout)  this,
integer, intent(in)  facet,
integer, intent(in)  el 
)
inherited
Parameters
facetThe index of the facet.
elThe index of the element.

Definition at line 111 of file bc.f90.

◆ mark_facets()

procedure, pass(this) bc::bc_t::mark_facets ( class(bc_t), intent(inout)  this,
type(stack_i4t2_t), intent(inout)  facet_list 
)
inherited
Parameters
facet_listThe list of tuples.

Definition at line 113 of file bc.f90.

◆ mark_labeled_zone()

procedure, pass(this) bc::bc_t::mark_labeled_zone ( class(bc_t), intent(inout)  this,
integer, intent(in)  zone_index 
)
inherited
Parameters
zone_indexThe index of the labeled zone to be marked.

Definition at line 117 of file bc.f90.

◆ mark_labeled_zones()

procedure, pass(this) bc::bc_t::mark_labeled_zones ( class(bc_t), intent(inout)  this,
integer, dimension(:), intent(in)  zone_indices 
)
inherited
Parameters
zone_indicesThe indices of the labeled zones to be marked.

Definition at line 119 of file bc.f90.

◆ mark_zone()

procedure, pass(this) bc::bc_t::mark_zone ( class(bc_t), intent(inout)  this,
class(facet_zone_t), intent(in)  bc_zone 
)
inherited
Parameters
bc_zoneBoundary zone to be marked.

Definition at line 115 of file bc.f90.

◆ restart() [1/2]

generic bc::bc_t::restart ( class(bc_t), intent(inout)  this,
type(field_t), intent(in)  s,
type(field_series_t), intent(in), optional  slag 
)
inherited

Definition at line 137 of file bc.f90.

◆ restart() [2/2]

generic bc::bc_t::restart ( class(bc_t), intent(inout)  this,
type(field_t), intent(in)  u,
type(field_t), intent(in)  v,
type(field_t), intent(in)  w,
type(field_series_t), intent(in)  ulag,
type(field_series_t), intent(in)  vlag,
type(field_series_t), intent(in)  wlag 
)
inherited

Definition at line 137 of file bc.f90.

◆ restart_scalar()

procedure, pass(this) bc::bc_t::restart_scalar ( class(bc_t), intent(inout)  this,
type(field_t), intent(in)  s,
type(field_series_t), intent(in), optional  slag 
)
inherited

Definition at line 133 of file bc.f90.

◆ restart_vector()

procedure, pass(this) bc::bc_t::restart_vector ( class(bc_t), intent(inout)  this,
type(field_t), intent(in)  u,
type(field_t), intent(in)  v,
type(field_t), intent(in)  w,
type(field_series_t), intent(in)  ulag,
type(field_series_t), intent(in)  vlag,
type(field_series_t), intent(in)  wlag 
)
inherited

Definition at line 135 of file bc.f90.

Member Data Documentation

◆ bc_type

integer bc::bc_t::bc_type = -1
inherited

Definition at line 97 of file bc.f90.

◆ coef

type(coef_t), pointer bc::bc_t::coef => null()
inherited

Definition at line 83 of file bc.f90.

◆ dof

type(dofmap_t), pointer bc::bc_t::dof => null()
inherited

Definition at line 81 of file bc.f90.

◆ facet

integer, dimension(:), allocatable bc::bc_t::facet
inherited

Definition at line 79 of file bc.f90.

◆ facet_d

type(c_ptr) bc::bc_t::facet_d = C_NULL_PTR
inherited

Definition at line 95 of file bc.f90.

◆ facet_node_msk

integer, dimension(:), allocatable bc::bc_t::facet_node_msk
inherited

Definition at line 77 of file bc.f90.

◆ facet_node_msk_d

type(c_ptr) bc::bc_t::facet_node_msk_d = C_NULL_PTR
inherited

Definition at line 93 of file bc.f90.

◆ field_bc

type(field_t) field_dirichlet::field_dirichlet_t::field_bc

Definition at line 68 of file field_dirichlet.f90.

◆ field_list

type(field_list_t) field_dirichlet::field_dirichlet_t::field_list

Definition at line 70 of file field_dirichlet.f90.

◆ marked_facet

type(stack_i4t2_t) bc::bc_t::marked_facet
inherited

Definition at line 89 of file bc.f90.

◆ msh

type(mesh_t), pointer bc::bc_t::msh => null()
inherited

Definition at line 85 of file bc.f90.

◆ msk

integer, dimension(:), allocatable bc::bc_t::msk
inherited

Definition at line 75 of file bc.f90.

◆ msk_d

type(c_ptr) bc::bc_t::msk_d = C_NULL_PTR
inherited

Definition at line 91 of file bc.f90.

◆ name

character(len=:), allocatable bc::bc_t::name
inherited

Definition at line 102 of file bc.f90.

◆ update

procedure(field_dirichlet_update), pointer, nopass field_dirichlet::field_dirichlet_t::update => null()
static

Definition at line 73 of file field_dirichlet.f90.

◆ updated

logical bc::bc_t::updated = .false.
inherited

Definition at line 100 of file bc.f90.

◆ xh

type(space_t), pointer bc::bc_t::xh => null()
inherited

Definition at line 87 of file bc.f90.

◆ zone_indices

integer, dimension(:), allocatable bc::bc_t::zone_indices
inherited

Definition at line 104 of file bc.f90.


The documentation for this type was generated from the following file: