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

Neumann domain boundary condition for PetscHelmholtzOp. More...

#include <CD_PetscHelmholtzNeumannDomainBC.H>

Inheritance diagram for PetscHelmholtzNeumannDomainBC:
Collaboration diagram for PetscHelmholtzNeumannDomainBC:

Public Member Functions

 PetscHelmholtzNeumannDomainBC ()
 Default constructor. Must subsequently call setDphiDn.
 PetscHelmholtzNeumannDomainBC (const Real a_DphiDn)
 Constructor with a constant normal derivative.
 PetscHelmholtzNeumannDomainBC (const std::function< Real(const RealVect &a_pos)> &a_DphiDn)
 Constructor with a spatially varying normal derivative.
virtual ~PetscHelmholtzNeumannDomainBC ()
 Destructor.
void setDphiDn (const Real a_DphiDn)
 Set a constant normal derivative on the boundary.
void setDphiDn (const std::function< Real(const RealVect &a_pos)> &a_DphiDn)
 Set a spatially varying normal derivative 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. The stencil is empty and w_B = -s, with s = -1 on the low side and +1 on the high side: a positive dphi/dn is a flux into the domain, as in EBHelmholtzNeumannDomainBC.
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. dphi/dn 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_constantDphiDn
 Constant dphi/dn.
std::function< Real(const RealVect &a_pos)> m_functionDphiDn
 Spatially varying dphi/dn.
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

Neumann domain boundary condition for PetscHelmholtzOp.

As in EBHelmholtzNeumannDomainBC, a positive dphi/dn is a flux into the domain. The flux has no phi-dependent part, so the stencil is empty.

Constructor & Destructor Documentation

◆ PetscHelmholtzNeumannDomainBC() [1/2]

PetscHelmholtzNeumannDomainBC::PetscHelmholtzNeumannDomainBC ( const Real a_DphiDn)

Constructor with a constant normal derivative.

Parameters
[in]a_DphiDnValue of dphi/dn on the boundary

◆ PetscHelmholtzNeumannDomainBC() [2/2]

PetscHelmholtzNeumannDomainBC::PetscHelmholtzNeumannDomainBC ( const std::function< Real(const RealVect &a_pos)> & a_DphiDn)

Constructor with a spatially varying normal derivative.

Parameters
[in]a_DphiDnValue of dphi/dn on the boundary

Member Function Documentation

◆ getBoundaryData()

Real PetscHelmholtzNeumannDomainBC::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. dphi/dn 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
dphi/dn on the boundary.

Implements PetscHelmholtzDomainBC.

◆ getFaceFluxStencil()

void PetscHelmholtzNeumannDomainBC::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. The stencil is empty and w_B = -s, with s = -1 on the low side and +1 on the high side: a positive dphi/dn is a flux into the domain, as in EBHelmholtzNeumannDomainBC.

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.

◆ setDphiDn() [1/2]

void PetscHelmholtzNeumannDomainBC::setDphiDn ( const Real a_DphiDn)

Set a constant normal derivative on the boundary.

Parameters
[in]a_DphiDnValue of dphi/dn on the boundary

◆ setDphiDn() [2/2]

void PetscHelmholtzNeumannDomainBC::setDphiDn ( const std::function< Real(const RealVect &a_pos)> & a_DphiDn)

Set a spatially varying normal derivative on the boundary.

Parameters
[in]a_DphiDnValue of dphi/dn on the boundary

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