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

Base class for passing Dirichlet EB boundary conditions into EBHelmholtzOp. More...

#include <CD_EBHelmholtzDirichletEBBC.H>

Inheritance diagram for EBHelmholtzDirichletEBBC:
Collaboration diagram for EBHelmholtzDirichletEBBC:

Public Member Functions

 EBHelmholtzDirichletEBBC ()
 Default constructor.
virtual ~EBHelmholtzDirichletEBBC ()
 Destructor.
virtual void setOrder (const int a_order)
 Set BC order.
virtual void setWeight (const int a_weight)
 Set stencil weights.
virtual void setValue (const int a_value)
 Set the value on the EB.
virtual void setValue (const std::function< Real(const RealVect &a_pos)> &a_value)
 Set the value on the EB.
virtual void setDomainDropOrder (const int a_domainSize)
 Drop BC order if domain size is equal or below this.
virtual void setCoarseGridDropOrder (const bool a_dropOrder)
 Signal that we should drop the stencil order if the cell is a coarsened cell.
virtual void applyEBFlux (VoFIterator &a_vofit, EBCellFAB &a_Lphi, const EBCellFAB &a_phi, const BaseIVFAB< Real > &a_Bcoef, const DataIndex &a_dit, const Real &a_beta, const bool &a_homogeneousPhysBC) const override
 Apply the EB flux. This is the version that is called by EBHelmholtzOp.
Public Member Functions inherited from EBHelmholtzEBBC
 EBHelmholtzEBBC ()
 Default constructor.
virtual ~EBHelmholtzEBBC ()
 Destructor.
 EBHelmholtzEBBC (const EBHelmholtzEBBC &a_other)=delete
 Disallowed – don't see why you would need it.
EBHelmholtzEBBC & operator= (const EBHelmholtzEBBC &a_other)=delete
 Disallowed - don't see why you would need it.
void define (const Location::Cell a_dataLocation, const EBLevelGrid &a_eblg, const AmrMask &a_validCells, const RealVect &a_probLo, const Real &a_dx, const int a_ghostCF)
 Define function that is called by EBHelmholtzOp.
const LayoutData< BaseIVFAB< VoFStencil > > & getGradPhiStencils () const
 Get the stencil for computing the finite-volume approximation to kappa*Div(F).

Protected Member Functions

virtual void define () override
 User define function.
virtual bool getLeastSquaresStencil (std::pair< Real, VoFStencil > &a_stencil, const VolIndex &a_vof, const VofUtils::Neighborhood a_neighborhood, const DataIndex &a_dit, const int a_order) const
 Get stencil with specified order.
virtual bool getJohansenStencil (std::pair< Real, VoFStencil > &a_stencil, const VolIndex &a_vof, const DataIndex &a_dit, const int a_order) const
 Get johansen stencil with specified order. Not used but exists for backward compatibility testing and debugging.
virtual bool getChomboLsqStencil (std::pair< Real, VoFStencil > &a_stencil, const VolIndex &a_vof, const DataIndex &a_dit) const
 Get Chombo's least squares gradient stencil. Not used but kept for backward compatibility testing and debugging.
Protected Member Functions inherited from EBHelmholtzEBBC
bool isStencilValidCF (const VoFStencil &a_stencil, const DataIndex &a_dit) const
 Check if stencil is valid.
RealVect getBoundaryPosition (const VolIndex &a_vof, const DataIndex &a_dit) const
 Returns physical position at the boundary.
Real applyStencil (const VoFStencil &a_stencil, const EBCellFAB &a_phi) const
 Apply stencil to data holder and return result.

Protected Attributes

bool m_useConstant = false
 Use constant for BC.
bool m_useFunction = false
 Use function for BC value.
int m_order = -1
 Stencil approximation order,.
int m_weight = -1
 Distance weighting factor for stencils.
int m_domainDropOrder = 0
 Special flag for dropping stencil order when domains become coarser than this.
bool m_dropOrder = false
 Special flag for dropping stencil order if the cell is a coarsened cell.
Real m_constantValue
 Value on EB.
std::function< Real(const RealVect &a_pos)> m_functionValue
 Value on the EB.
LayoutData< BaseIVFAB< Real > > m_boundaryWeights
 Boundary weights.
Protected Attributes inherited from EBHelmholtzEBBC
Location::Cell m_dataLocation
 Data centering.
int m_ghostCF
 Number of ghost cells that were filled across CF interface.
Real m_dx
 Grid resolution.
RealVect m_probLo
 Lower-left corner of computational domain.
EBLevelGrid m_eblg
 Level grid.
RefCountedPtr< LevelData< BaseFab< bool > > > m_validCells
 Valid grid cells.
LayoutData< BaseIVFAB< VoFStencil > > m_gradPhiStencils
 Stencils for computing the flux on a single level. This is a single-level object.

Additional Inherited Members

Public Types inherited from EBHelmholtzEBBC
using AmrMask = RefCountedPtr<LevelData<BaseFab<bool>>>
 Alias to cut down on typing.
Static Protected Attributes inherited from EBHelmholtzEBBC
static constexpr int m_comp = 0
 Component that everything is defined for. Always have m_comp = 0.
static constexpr int m_nComp = 1
 Number of components. Always have m_nComp = 1.

Detailed Description

Base class for passing Dirichlet EB boundary conditions into EBHelmholtzOp.

Member Function Documentation

◆ applyEBFlux()

void EBHelmholtzDirichletEBBC::applyEBFlux ( VoFIterator & a_vofit,
EBCellFAB & a_Lphi,
const EBCellFAB & a_phi,
const BaseIVFAB< Real > & a_Bcoef,
const DataIndex & a_dit,
const Real & a_beta,
const bool & a_homogeneousPhysBC ) const
overridevirtual

Apply the EB flux. This is the version that is called by EBHelmholtzOp.

Parameters
[in,out]a_vofitIterator for cut-cells
[in]a_LphiOperator kappa*L(phi)
[in]a_phiPhi, cell-centered.
[in]a_BcoefEB-centered B-coefficient
[in]a_ditData index
[in]a_betaBeta. Passed in from operator.
[in]a_homogeneousPhysBCHomogeneous BC or not.

Implements EBHelmholtzEBBC.

◆ define()

void EBHelmholtzDirichletEBBC::define ( )
overrideprotectedvirtual

User define function.

Implements EBHelmholtzEBBC.

◆ getChomboLsqStencil()

bool EBHelmholtzDirichletEBBC::getChomboLsqStencil ( std::pair< Real, VoFStencil > & a_stencil,
const VolIndex & a_vof,
const DataIndex & a_dit ) const
protectedvirtual

Get Chombo's least squares gradient stencil. Not used but kept for backward compatibility testing and debugging.

Parameters
[out]a_stencilWeight and stencil
[out]a_vofGrid cell
[in]a_ditData index
Returns
If this returns true, a_stencil contains a valid stencil and weight.

◆ getJohansenStencil()

bool EBHelmholtzDirichletEBBC::getJohansenStencil ( std::pair< Real, VoFStencil > & a_stencil,
const VolIndex & a_vof,
const DataIndex & a_dit,
const int a_order ) const
protectedvirtual

Get johansen stencil with specified order. Not used but exists for backward compatibility testing and debugging.

Parameters
[out]a_stencilWeight and stencil
[out]a_vofGrid cell
[in]a_ditData index
[in]a_orderAttempted order for stencil. This is also the stencil radius.
Returns
If this returns true, a_stencil contains a valid stencil and weight.

◆ getLeastSquaresStencil()

bool EBHelmholtzDirichletEBBC::getLeastSquaresStencil ( std::pair< Real, VoFStencil > & a_stencil,
const VolIndex & a_vof,
const VofUtils::Neighborhood a_neighborhood,
const DataIndex & a_dit,
const int a_order ) const
protectedvirtual

Get stencil with specified order.

Parameters
[out]a_stencilWeight and stencil
[out]a_vofGrid cell
[out]a_neighborhoodNeighborhood specifier
[in]a_ditData index
[in]a_orderAttempted order for stencil. This is also the stencil radius.
Returns
If this returns true, a_stencil contains a valid stencil and weight.
Note
Stencils are computed using weighted least squares with squared inverse distance weighting.

◆ setCoarseGridDropOrder()

void EBHelmholtzDirichletEBBC::setCoarseGridDropOrder ( const bool a_dropOrder)
virtual

Signal that we should drop the stencil order if the cell is a coarsened cell.

Parameters
[in]a_dropOrder

◆ setDomainDropOrder()

void EBHelmholtzDirichletEBBC::setDomainDropOrder ( const int a_domainSize)
virtual

Drop BC order if domain size is equal or below this.

Parameters
[in]a_domainSizeDescription

◆ setOrder()

void EBHelmholtzDirichletEBBC::setOrder ( const int a_order)
virtual

Set BC order.

Parameters
[in]a_orderOrder
Note
The order is also the attempted radius of the stencil.

◆ setValue() [1/2]

void EBHelmholtzDirichletEBBC::setValue ( const int a_value)
virtual

Set the value on the EB.

Parameters
[in]a_valueConstant value on EB

◆ setValue() [2/2]

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

Set the value on the EB.

Parameters
[in]a_valueSpatially dependent value on EB

◆ setWeight()

void EBHelmholtzDirichletEBBC::setWeight ( const int a_weight)
virtual

Set stencil weights.

Parameters
[in]a_weightWeighting factor for least squares stencils
Note
a_weight=0 can lead to ill-conditioned systems.

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