Neko 1.99.10
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
vector_bc_projector::coupled_vector_bc_projector_t Type Referenceabstract

A coupled projector for vector fields, suitable for mixed boundary conditions. More...

Inheritance diagram for vector_bc_projector::coupled_vector_bc_projector_t:
Collaboration diagram for vector_bc_projector::coupled_vector_bc_projector_t:

Public Member Functions

procedure, pass(this) init (this, coef)
 Constructor.
procedure, pass(this) free (this)
 Destructor.
procedure, pass(this) mark_bc (this, bc)
 Mark a boundary condition for later resolution.
procedure, pass(this) mark_bc_list (this, bclst)
 Mark a list of boundary conditions for later resolution.
procedure, pass(this) finalize (this, rebuild_mask)
 Resolve the queued boundary conditions into masks and basis data.
procedure, pass(this) apply (this, x, y, z, n, strm)
 Apply the resolved homogeneous mixed constraints to a vector field.
procedure, pass(this) debug_output (this, field_name)
 Write diagnostic output for the resolved masks and basis.
procedure, pass(this) debug_output_normal_component (this, x, y, z, n, field_name)
 Write debug output of normal component on mixed BC nodes.
procedure(vector_bc_projector_init_intrf), deferred, pass init (this, coef)
 Constructor.
procedure(vector_bc_projector_free_intrf), deferred, pass free (this)
 Destructor.
procedure(vector_bc_projector_finalize_intrf), deferred, pass finalize (this, rebuild_mask)
 Finalize the vector boundary-condition projector.
procedure(vector_bc_projector_apply_intrf), deferred, pass apply (this, x, y, z, n, strm)
 Apply homogeneous resolved vector boundary constraints.
procedure(vector_bc_projector_mark_bc_intrf), deferred, pass mark_bc (this, bc)
 Mark a boundary condition in the vector boundary-condition projector.
procedure, pass(this) mark_bc_component (this, bc, component)
 Mark a boundary condition on one Cartesian component.
procedure(vector_bc_projector_mark_bc_list_intrf), deferred, pass mark_bc_list (this, bclst)
 Mark a list of boundary conditions in the projector.
procedure, pass(this) mark_bc_list_component (this, bclst, component)
 Mark a list of boundary conditions on one Cartesian component.
generic mark (this, bc)
 Mark a boundary condition in the vector boundary-condition projector.
generic mark (this, bc, component)
 Mark a boundary condition on one Cartesian component.
generic mark (this, bclst)
 Mark a list of boundary conditions in the projector.
generic mark (this, bclst, component)
 Mark a list of boundary conditions on one Cartesian component.

Public Attributes

type(mask_t) dirichlet_dof_mask
 DOFs that are fully constrained in Cartesian space.
type(mask_t) mixed_dof_mask
 DOFs that require basis-aware mixed treatment.
real(kind=rp), dimension(:), allocatable node_type
 Per-boundary-DOF node classification using the BC_* constants.
real(kind=rp), dimension(:,:), allocatable face_type
 Per-boundary-face classification using the BC_* constants.
integer, dimension(:), allocatable boundary_dof
 Linear indices of boundary DOFs.
type(htable_i4_t) boundary_idx
 Hash table from a linear DOF index to boundary_dof.
integer, dimension(:,:), allocatable node_rst
 Reference-space coordinates of the element corner nodes.
integer, dimension(:,:), allocatable edge_mid_rst
 Reference-space coordinates of the edge-midpoint nodes.
integer, dimension(:), allocatable node_linear_idx
 Linear indices of the element corner nodes.
integer, dimension(:), allocatable constraint_n
 Local normal-component constraint flags on mixed_dof_mask.
integer, dimension(:), allocatable constraint_t1
 Local first-tangent constraint flags on mixed_dof_mask.
integer, dimension(:), allocatable constraint_t2
 Local second-tangent constraint flags on mixed_dof_mask.
type(matrix_t) n
 Local normal basis vectors for the mixed-node support.
type(matrix_t) t1
 Local first tangential basis vectors for the mixed-node support.
type(matrix_t) t2
 Local second tangential basis vectors for the mixed-node support.
type(c_ptr) constraint_n_d = c_null_ptr
 Device mirror of constraint_n.
type(c_ptr) constraint_t1_d = c_null_ptr
 Device mirror of constraint_t1.
type(c_ptr) constraint_t2_d = c_null_ptr
 Device mirror of constraint_t2.

Private Member Functions

procedure, pass, private clear_masks (this)
 Clear the resolved mask-side state.
procedure, pass, private rebuild_masks (this)
 Rebuild the Dirichlet and mixed-node masks from the queued BCs.
procedure, pass, private clear_basis (this)
 Clear the resolved basis-side state.
procedure, pass, private rebuild_basis (this)
 Rebuild the local basis on the resolved mixed-node support.

Private Attributes

type(bc_list_t), private bcs
 Boundary conditions queued for resolution during finalize().
type(coef_t), pointer, private coef => null()
 SEM coefficients.
type(dofmap_t), pointer, private dof => null()
 Degree-of-freedom map.

Detailed Description

This projector first accumulates the marked vector boundary conditions, then resolves them onto the global velocity dofs in finalize(). The resolved support is split into two disjoint parts: plain Dirichlet nodes, stored in dirichlet_dof_mask, and genuinely mixed nodes, stored in mixed_dof_mask. For the mixed nodes, the projector also builds a local orthonormal basis (n, t1, t2) together with the resolved local constraint flags constraint_n, constraint_t1, and constraint_t2. The apply() routine then projects the vector field to this local basis, zeroes the constrained components, and reconstructs the Cartesian vector. Additionally, the projector propagates the mixed masks and basis data to the boundary conditions of class mixed_bc_t, which is necessary for them to work correctly.

Definition at line 149 of file vector_bc_projector.f90.

Member Function/Subroutine Documentation

◆ apply() [1/2]

procedure, pass(this) vector_bc_projector::coupled_vector_bc_projector_t::apply ( class(coupled_vector_bc_projector_t), intent(in) 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(c_ptr), intent(inout), optional strm )
Parameters
[in,out]xx-component field values.
[in,out]yy-component field values.
[in,out]zz-component field values.
[in]nNumber of entries in each component array.
[in,out]strmOptional backend stream/queue used on device backends.

Definition at line 206 of file vector_bc_projector.f90.

◆ apply() [2/2]

procedure(vector_bc_projector_apply_intrf), deferred, pass vector_bc_projector::vector_bc_projector_t::apply ( class(vector_bc_projector_t), intent(in) 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(c_ptr), intent(inout), optional strm )
pure virtualinherited

Definition at line 82 of file vector_bc_projector.f90.

◆ clear_basis()

procedure, pass, private vector_bc_projector::coupled_vector_bc_projector_t::clear_basis ( class(coupled_vector_bc_projector_t), intent(inout) this)
private

Definition at line 220 of file vector_bc_projector.f90.

◆ clear_masks()

procedure, pass, private vector_bc_projector::coupled_vector_bc_projector_t::clear_masks ( class(coupled_vector_bc_projector_t), intent(inout) this)
private

Releases the resolved Dirichlet and mixed masks, compact boundary-node caches, and the per-mixed-node constraint flags together with their device mirrors.

Definition at line 214 of file vector_bc_projector.f90.

◆ debug_output()

procedure, pass(this) vector_bc_projector::coupled_vector_bc_projector_t::debug_output ( class(coupled_vector_bc_projector_t), intent(inout) this,
character(len=*), intent(in), optional field_name )
Parameters
[in]field_nameOptional base name for the output file. The .fld suffix is appended automatically.

Definition at line 208 of file vector_bc_projector.f90.

◆ debug_output_normal_component()

procedure, pass(this) vector_bc_projector::coupled_vector_bc_projector_t::debug_output_normal_component ( class(coupled_vector_bc_projector_t), intent(inout) this,
real(kind=rp), dimension(n), intent(in) x,
real(kind=rp), dimension(n), intent(in) y,
real(kind=rp), dimension(n), intent(in) z,
integer, intent(in) n,
character(len=*), intent(in), optional field_name )

The output is zero outside mixed_dof_mask. The normal vectors come from (1) the resolved basis stored in this projector and (2) the normals stored in coef_t. No area scaling is applied.

Parameters
[in]xx-component of the vector field.
[in]yy-component of the vector field.
[in]zz-component of the vector field.
[in]nNumber of entries in x, y, z.
[in]field_nameOptional base name for the output file. The .fld suffix is appended automatically.

Definition at line 211 of file vector_bc_projector.f90.

◆ finalize() [1/2]

procedure, pass(this) vector_bc_projector::coupled_vector_bc_projector_t::finalize ( class(coupled_vector_bc_projector_t), intent(inout) this,
logical, intent(in) rebuild_mask )

This routine builds the dof masks for Dirichlet and mixed nodes, and computes the local basis for the mixed ones.

Definition at line 204 of file vector_bc_projector.f90.

◆ finalize() [2/2]

procedure(vector_bc_projector_finalize_intrf), deferred, pass vector_bc_projector::vector_bc_projector_t::finalize ( class(vector_bc_projector_t), intent(inout) this,
logical, intent(in) rebuild_mask )
pure virtualinherited

Definition at line 79 of file vector_bc_projector.f90.

◆ free() [1/2]

procedure, pass(this) vector_bc_projector::coupled_vector_bc_projector_t::free ( class(coupled_vector_bc_projector_t), intent(inout) this)

Definition at line 197 of file vector_bc_projector.f90.

◆ free() [2/2]

procedure(vector_bc_projector_free_intrf), deferred, pass vector_bc_projector::vector_bc_projector_t::free ( class(vector_bc_projector_t), intent(inout) this)
pure virtualinherited

Definition at line 77 of file vector_bc_projector.f90.

◆ init() [1/2]

procedure, pass(this) vector_bc_projector::coupled_vector_bc_projector_t::init ( class(coupled_vector_bc_projector_t), intent(inout) this,
type(coef_t), intent(in), target coef )
Parameters
[in]coefSEM coefficients.

This resets any previous resolved state, stores pointers to the coefficient and dofmap objects, and precomputes reference-element lookup tables used later to reconstruct mixed-node normals on edges and corners.

Definition at line 195 of file vector_bc_projector.f90.

◆ init() [2/2]

procedure(vector_bc_projector_init_intrf), deferred, pass vector_bc_projector::vector_bc_projector_t::init ( class(vector_bc_projector_t), intent(inout) this,
type(coef_t), intent(in), target coef )
pure virtualinherited

Definition at line 75 of file vector_bc_projector.f90.

◆ mark() [1/4]

generic vector_bc_projector::vector_bc_projector_t::mark ( class(vector_bc_projector_t), intent(inout) this,
class(bc_t), intent(inout), target bc )
inherited

Definition at line 95 of file vector_bc_projector.f90.

◆ mark() [2/4]

generic vector_bc_projector::vector_bc_projector_t::mark ( class(vector_bc_projector_t), intent(inout) this,
class(bc_t), intent(inout), target bc,
character(len=1), intent(in) component )
inherited

Definition at line 95 of file vector_bc_projector.f90.

◆ mark() [3/4]

generic vector_bc_projector::vector_bc_projector_t::mark ( class(vector_bc_projector_t), intent(inout) this,
type(bc_list_t), intent(in) bclst )
inherited

Definition at line 95 of file vector_bc_projector.f90.

◆ mark() [4/4]

generic vector_bc_projector::vector_bc_projector_t::mark ( class(vector_bc_projector_t), intent(inout) this,
type(bc_list_t), intent(in) bclst,
character(len=1), intent(in) component )
inherited

Definition at line 95 of file vector_bc_projector.f90.

◆ mark_bc() [1/2]

procedure, pass(this) vector_bc_projector::coupled_vector_bc_projector_t::mark_bc ( class(coupled_vector_bc_projector_t), intent(inout) this,
class(bc_t), intent(inout), target bc )
Parameters
[in,out]bcBoundary condition to queue for resolution.

Definition at line 199 of file vector_bc_projector.f90.

◆ mark_bc() [2/2]

procedure(vector_bc_projector_mark_bc_intrf), deferred, pass vector_bc_projector::vector_bc_projector_t::mark_bc ( class(vector_bc_projector_t), intent(inout) this,
class(bc_t), intent(inout), target bc )
pure virtualinherited

Definition at line 84 of file vector_bc_projector.f90.

◆ mark_bc_component()

procedure, pass(this) vector_bc_projector::vector_bc_projector_t::mark_bc_component ( class(vector_bc_projector_t), intent(inout) this,
class(bc_t), intent(inout), target bc,
character(len=1), intent(in) component )
inherited

Definition at line 87 of file vector_bc_projector.f90.

◆ mark_bc_list() [1/2]

procedure, pass(this) vector_bc_projector::coupled_vector_bc_projector_t::mark_bc_list ( class(coupled_vector_bc_projector_t), intent(inout) this,
type(bc_list_t), intent(in) bclst )
Parameters
[in]bclstBoundary-condition list to queue.

Definition at line 201 of file vector_bc_projector.f90.

◆ mark_bc_list() [2/2]

procedure(vector_bc_projector_mark_bc_list_intrf), deferred, pass vector_bc_projector::vector_bc_projector_t::mark_bc_list ( class(vector_bc_projector_t), intent(inout) this,
type(bc_list_t), intent(in) bclst )
pure virtualinherited

Definition at line 90 of file vector_bc_projector.f90.

◆ mark_bc_list_component()

procedure, pass(this) vector_bc_projector::vector_bc_projector_t::mark_bc_list_component ( class(vector_bc_projector_t), intent(inout) this,
type(bc_list_t), intent(in) bclst,
character(len=1), intent(in) component )
inherited

Definition at line 93 of file vector_bc_projector.f90.

◆ rebuild_basis()

procedure, pass, private vector_bc_projector::coupled_vector_bc_projector_t::rebuild_basis ( class(coupled_vector_bc_projector_t), intent(inout) this)
private

Using the resolved mixed-node mask and constraint metadata built by rebuild_masks(), this routine reconstructs consistent normals on face, edge, and corner nodes and then builds an orthonormal local basis (n, t1, t2) for each mixed node. It then propagates the basis data to all marked mixed boundary conditions.

Definition at line 223 of file vector_bc_projector.f90.

◆ rebuild_masks()

procedure, pass, private vector_bc_projector::coupled_vector_bc_projector_t::rebuild_masks ( class(coupled_vector_bc_projector_t), intent(inout) this)
private

This routine reduces the queued boundary conditions to a nodal classification, constructs the global Dirichlet and mixed-node masks, computes BC-local resolved supports for mixed_bc_t instances, and fills the local constraint flags constraint_n, constraint_t1, and constraint_t2 on the mixed-node mask.

Definition at line 217 of file vector_bc_projector.f90.

Member Data Documentation

◆ bcs

type(bc_list_t), private vector_bc_projector::coupled_vector_bc_projector_t::bcs
private

Definition at line 155 of file vector_bc_projector.f90.

◆ boundary_dof

integer, dimension(:), allocatable vector_bc_projector::coupled_vector_bc_projector_t::boundary_dof

Definition at line 165 of file vector_bc_projector.f90.

◆ boundary_idx

type(htable_i4_t) vector_bc_projector::coupled_vector_bc_projector_t::boundary_idx

Definition at line 167 of file vector_bc_projector.f90.

◆ coef

type(coef_t), pointer, private vector_bc_projector::coupled_vector_bc_projector_t::coef => null()
private

Definition at line 157 of file vector_bc_projector.f90.

◆ constraint_n

integer, dimension(:), allocatable vector_bc_projector::coupled_vector_bc_projector_t::constraint_n

Definition at line 175 of file vector_bc_projector.f90.

◆ constraint_n_d

type(c_ptr) vector_bc_projector::coupled_vector_bc_projector_t::constraint_n_d = c_null_ptr

Definition at line 188 of file vector_bc_projector.f90.

◆ constraint_t1

integer, dimension(:), allocatable vector_bc_projector::coupled_vector_bc_projector_t::constraint_t1

Definition at line 177 of file vector_bc_projector.f90.

◆ constraint_t1_d

type(c_ptr) vector_bc_projector::coupled_vector_bc_projector_t::constraint_t1_d = c_null_ptr

Definition at line 190 of file vector_bc_projector.f90.

◆ constraint_t2

integer, dimension(:), allocatable vector_bc_projector::coupled_vector_bc_projector_t::constraint_t2

Definition at line 179 of file vector_bc_projector.f90.

◆ constraint_t2_d

type(c_ptr) vector_bc_projector::coupled_vector_bc_projector_t::constraint_t2_d = c_null_ptr

Definition at line 192 of file vector_bc_projector.f90.

◆ dirichlet_dof_mask

type(mask_t) vector_bc_projector::coupled_vector_bc_projector_t::dirichlet_dof_mask

Definition at line 151 of file vector_bc_projector.f90.

◆ dof

type(dofmap_t), pointer, private vector_bc_projector::coupled_vector_bc_projector_t::dof => null()
private

Definition at line 159 of file vector_bc_projector.f90.

◆ edge_mid_rst

integer, dimension(:,:), allocatable vector_bc_projector::coupled_vector_bc_projector_t::edge_mid_rst

Definition at line 171 of file vector_bc_projector.f90.

◆ face_type

real(kind=rp), dimension(:,:), allocatable vector_bc_projector::coupled_vector_bc_projector_t::face_type

Definition at line 163 of file vector_bc_projector.f90.

◆ mixed_dof_mask

type(mask_t) vector_bc_projector::coupled_vector_bc_projector_t::mixed_dof_mask

Definition at line 153 of file vector_bc_projector.f90.

◆ n

type(matrix_t) vector_bc_projector::coupled_vector_bc_projector_t::n

Definition at line 181 of file vector_bc_projector.f90.

◆ node_linear_idx

integer, dimension(:), allocatable vector_bc_projector::coupled_vector_bc_projector_t::node_linear_idx

Definition at line 173 of file vector_bc_projector.f90.

◆ node_rst

integer, dimension(:,:), allocatable vector_bc_projector::coupled_vector_bc_projector_t::node_rst

Definition at line 169 of file vector_bc_projector.f90.

◆ node_type

real(kind=rp), dimension(:), allocatable vector_bc_projector::coupled_vector_bc_projector_t::node_type

Definition at line 161 of file vector_bc_projector.f90.

◆ t1

type(matrix_t) vector_bc_projector::coupled_vector_bc_projector_t::t1

Definition at line 183 of file vector_bc_projector.f90.

◆ t2

type(matrix_t) vector_bc_projector::coupled_vector_bc_projector_t::t2

Definition at line 185 of file vector_bc_projector.f90.


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