chombo-discharge
Loading...
Searching...
No Matches
PetscHelmholtzDirichletDomainBC Class Reference

Dirichlet domain boundary condition for PetscHelmholtzOp. More...

#include <CD_PetscHelmholtzDirichletDomainBC.H>

Inheritance diagram for PetscHelmholtzDirichletDomainBC:
Collaboration diagram for PetscHelmholtzDirichletDomainBC:

Public Member Functions

 PetscHelmholtzDirichletDomainBC ()
 Default constructor. Must subsequently call setValue.
 PetscHelmholtzDirichletDomainBC (const Real a_value)
 Constructor with a constant value.
 PetscHelmholtzDirichletDomainBC (const std::function< Real(const RealVect &a_pos)> &a_value)
 Constructor with a spatially varying value.
virtual ~PetscHelmholtzDirichletDomainBC ()
 Destructor.
void setValue (const Real a_value)
 Set a constant value on the boundary.
void setValue (const std::function< Real(const RealVect &a_pos)> &a_value)
 Set a spatially varying value on the boundary.
void getFaceFluxStencil (Real &a_boundaryWeight, VoFStencil &a_stencilCoar, VoFStencil &a_stencil, VoFStencil &a_stencilFine, const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof, const int a_dir, const Side::LoHiSide a_side) const override
 Get the stencil of the face flux through a domain face.
Real getBoundaryData (const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof, const int a_dir, const Side::LoHiSide a_side) const override
 Get the boundary data, i.e. phi on the boundary.
Public Member Functions inherited from PetscHelmholtzDomainBC
 PetscHelmholtzDomainBC ()
 Default constructor. Must subsequently call define.
virtual ~PetscHelmholtzDomainBC ()
 Destructor.
 PetscHelmholtzDomainBC (const PetscHelmholtzDomainBC &a_other)=delete
 Disallowed copy constructor.
 PetscHelmholtzDomainBC (const PetscHelmholtzDomainBC &&a_other)=delete
 Disallowed move constructor.
PetscHelmholtzDomainBC & operator= (const PetscHelmholtzDomainBC &a_other)=delete
 Disallowed copy assignment operator.
PetscHelmholtzDomainBC & operator= (const PetscHelmholtzDomainBC &&a_other)=delete
 Disallowed move assignment operator.
virtual void define (const RefCountedPtr< PetscGrid > &a_petscGrid, const RealVect &a_probLo, const Vector< Real > &a_dx)
 Define the BC over the AMR hierarchy.

Protected Attributes

bool m_useConstant
 Use a constant value or not.
bool m_useFunction
 Use a spatially varying value or not.
Real m_constantValue
 Constant value.
std::function< Real(const RealVect &a_pos)> m_functionValue
 Spatially varying value.
Protected Attributes inherited from PetscHelmholtzDomainBC
bool m_isDefined
 Is defined or not.
RefCountedPtr< PetscGrid > m_petscGrid
 PETSc grid.
RealVect m_probLo
 Lower-left corner of the computational domain.
Vector< Real > m_dx
 Grid resolution on each level.

Additional Inherited Members

Protected Member Functions inherited from PetscHelmholtzDomainBC
RealVect getBoundaryPosition (const int a_phase, const int a_level, const DataIndex &a_din, const VolIndex &a_vof, const int a_dir, const Side::LoHiSide a_side) const noexcept
 Get the physical position of the centroid of a domain face.

Detailed Description

Dirichlet domain boundary condition for PetscHelmholtzOp.

The face derivative is the one-sided difference between the cell center and the face, (phi_B - phi)/(dx/2) on the high side and (phi - phi_B)/(dx/2) on the low side, as in EBHelmholtzDirichletDomainBC.

Constructor & Destructor Documentation

◆ PetscHelmholtzDirichletDomainBC() [1/2]

PetscHelmholtzDirichletDomainBC::PetscHelmholtzDirichletDomainBC ( const Real a_value)

Constructor with a constant value.

Parameters
[in]a_valueValue of phi on the boundary

◆ PetscHelmholtzDirichletDomainBC() [2/2]

PetscHelmholtzDirichletDomainBC::PetscHelmholtzDirichletDomainBC ( const std::function< Real(const RealVect &a_pos)> & a_value)

Constructor with a spatially varying value.

Parameters
[in]a_valueValue of phi on the boundary

Member Function Documentation

◆ getBoundaryData()

Real PetscHelmholtzDirichletDomainBC::getBoundaryData ( const int a_phase,
const int a_level,
const DataIndex & a_din,
const VolIndex & a_vof,
const int a_dir,
const Side::LoHiSide a_side ) const
overridevirtual

Get the boundary data, i.e. phi on the boundary.

Parameters
[in]a_phasePhase
[in]a_levelGrid level
[in]a_dinGrid index on the level
[in]a_vofCell adjacent to the domain face
[in]a_dirCoordinate direction of the face
[in]a_sideDomain side of the face
Returns
phi on the boundary.

Implements PetscHelmholtzDomainBC.

◆ getFaceFluxStencil()

void PetscHelmholtzDirichletDomainBC::getFaceFluxStencil ( Real & a_boundaryWeight,
VoFStencil & a_stencilCoar,
VoFStencil & a_stencil,
VoFStencil & a_stencilFine,
const int a_phase,
const int a_level,
const DataIndex & a_din,
const VolIndex & a_vof,
const int a_dir,
const Side::LoHiSide a_side ) const
overridevirtual

Get the stencil of the face flux through a domain face.

Parameters
[out]a_boundaryWeightWeight w_B of the boundary data in the flux, see getBoundaryData
[out]a_stencilCoarStencil over cells on level a_level - 1
[out]a_stencilStencil over cells on level a_level
[out]a_stencilFineStencil over cells on level a_level + 1
[in]a_phasePhase
[in]a_levelGrid level
[in]a_dinGrid index on the level
[in]a_vofCell adjacent to the domain face
[in]a_dirCoordinate direction of the face
[in]a_sideDomain side of the face

Implements PetscHelmholtzDomainBC.

◆ setValue() [1/2]

void PetscHelmholtzDirichletDomainBC::setValue ( const Real a_value)

Set a constant value on the boundary.

Parameters
[in]a_valueValue of phi on the boundary

◆ setValue() [2/2]

void PetscHelmholtzDirichletDomainBC::setValue ( const std::function< Real(const RealVect &a_pos)> & a_value)

Set a spatially varying value on the boundary.

Parameters
[in]a_valueValue of phi on the boundary

The documentation for this class was generated from the following files: