12#ifndef DUMUX_BOUNDARY_TYPES_HH
13#define DUMUX_BOUNDARY_TYPES_HH
32 static constexpr int size()
44 for (
int eqIdx=0; eqIdx < numEq; ++eqIdx)
83 for (
int i=0; i < numEq; ++i)
92 for (
int eqIdx = 0; eqIdx < numEq; ++eqIdx)
101 for (
int eqIdx = 0; eqIdx < numEq; ++ eqIdx)
110 for (
int eqIdx = 0; eqIdx < numEq; ++eqIdx)
119 for (
int eqIdx = 0; eqIdx < numEq; ++eqIdx)
214 b.isCouplingDirichlet; }
227 b.isCouplingDirichlet; }
252 b.isCouplingNeumann; }
265 b.isCouplingNeumann; }
286 [](
const BoundaryInfo& b){ return b.isCouplingDirichlet; }
307 [](
const BoundaryInfo& b){ return b.isCouplingNeumann; }
329 for (
int i = 0; i < numEq; ++i)
Class to specify the type of a boundary.
Definition: common/boundarytypes.hh:26
void setAllCouplingDirichlet()
Set all boundary conditions to Dirichlet-like coupling.
Definition: common/boundarytypes.hh:108
void setAllNeumann()
Set all boundary conditions to Neumann.
Definition: common/boundarytypes.hh:90
bool isNeumann(unsigned eqIdx) const
Returns true if an equation is used to specify a Neumann condition.
Definition: common/boundarytypes.hh:237
void setAllDirichlet()
Set all boundary conditions to Dirichlet.
Definition: common/boundarytypes.hh:99
void reset()
Reset the boundary types for all equations.
Definition: common/boundarytypes.hh:42
bool hasOnlyDirichlet() const
Returns true if all equations are used to specify a Dirichlet condition.
Definition: common/boundarytypes.hh:209
BoundaryTypes()
Definition: common/boundarytypes.hh:28
bool isSet(int eqIdx) const
Returns true if the boundary types for a given equation has been specified.
Definition: common/boundarytypes.hh:71
bool isDirichlet(unsigned eqIdx) const
Returns true if an equation is used to specify a Dirichlet condition.
Definition: common/boundarytypes.hh:200
void resetEq(int eqIdx)
Reset the boundary types for one equation.
Definition: common/boundarytypes.hh:51
bool hasNeumann() const
Returns true if some equation is used to specify a Neumann condition.
Definition: common/boundarytypes.hh:260
void setDirichlet(int pvIdx)
Set a Dirichlet boundary condition for a single primary variable.
Definition: common/boundarytypes.hh:189
unsigned eqToDirichletIndex(unsigned eqIdx) const
Returns the index of the primary variable which should be used for the Dirichlet condition given an e...
Definition: common/boundarytypes.hh:354
void checkWellPosed() const
Make sure the boundary conditions are well-posed.
Definition: common/boundarytypes.hh:80
bool isCouplingNeumann(unsigned eqIdx) const
Returns true if an equation is used to specify an Neumann coupling condition.
Definition: common/boundarytypes.hh:296
bool hasCoupling() const
Returns true if some equation is used to specify a coupling condition.
Definition: common/boundarytypes.hh:327
bool hasOnlyNeumann() const
Returns true if all equations are used to specify a Neumann condition.
Definition: common/boundarytypes.hh:247
void setDirichlet(int pvIdx, int eqIdx)
Set a Dirichlet boundary condition for a single primary variable.
Definition: common/boundarytypes.hh:144
std::array< BoundaryInfo, numEq > boundaryInfo_
Definition: common/boundarytypes.hh:368
std::array< unsigned int, numEq > eq2pvIdx_
Definition: common/boundarytypes.hh:369
void setCouplingNeumann(int eqIdx)
Set a boundary condition for a single equation to a Neumann-like coupling condition.
Definition: common/boundarytypes.hh:171
unsigned dirichletToEqIndex(unsigned pvIdx) const
Returns the index of the equation which should be used for the Dirichlet condition of the pvIdx's pri...
Definition: common/boundarytypes.hh:343
bool isCouplingDirichlet(unsigned eqIdx) const
Returns true if an equation is used to specify an Dirichlet coupling condition.
Definition: common/boundarytypes.hh:275
bool hasDirichlet() const
Returns true if some equation is used to specify a Dirichlet condition.
Definition: common/boundarytypes.hh:222
void setCouplingDirichlet(int eqIdx)
Set a boundary condition for a single equation to a Dirichlet-like coupling condition.
Definition: common/boundarytypes.hh:159
bool isCoupling(unsigned eqIdx) const
Returns true if an equation is used to specify a coupling condition.
Definition: common/boundarytypes.hh:317
void setAllCouplingNeumann()
Set all boundary conditions to Neumann-like coupling.
Definition: common/boundarytypes.hh:117
bool hasCouplingDirichlet() const
Returns true if some equation is used to specify an Dirichlet coupling condition.
Definition: common/boundarytypes.hh:282
bool hasCouplingNeumann() const
Returns true if some equation is used to specify an Neumann coupling condition.
Definition: common/boundarytypes.hh:303
std::array< unsigned int, numEq > pv2eqIdx_
Definition: common/boundarytypes.hh:369
static constexpr int size()
we have a boundary condition for each equation
Definition: common/boundarytypes.hh:32
void setNeumann(int eqIdx)
Set a Neumann boundary condition for a single equation.
Definition: common/boundarytypes.hh:128
use bitfields to minimize the size
Definition: common/boundarytypes.hh:359
bool isNeumann
Definition: common/boundarytypes.hh:362
bool isOutflow
Definition: common/boundarytypes.hh:363
bool isDirichlet
Definition: common/boundarytypes.hh:361
bool visited
Definition: common/boundarytypes.hh:360
bool isCouplingDirichlet
Definition: common/boundarytypes.hh:364
bool isCouplingNeumann
Definition: common/boundarytypes.hh:365