chombo-discharge
Public Types | Public Member Functions | Protected Attributes | List of all members
CdrDomainBC Class Reference

Class for encapsulating possible domain boundary conditions for CdrSolver. More...

#include <CD_CdrDomainBC.H>

Public Types

enum class  BcType {
  DataBased , Wall , Function , Outflow ,
  Solver
}
 Boundary condition types for the CDR solvers.
 
using FluxFunction = std::function< Real(const RealVect a_position, const Real a_time)>
 Function which maps f(R^3,t) : R. Used for setting the associated value and boundary condition type. More...
 
using DomainSide = std::pair< int, Side::LoHiSide >
 Alias for mapping a direction and side. The first element in pair is the coordinate direction and the second is the low/high end in that direction.
 

Public Member Functions

 CdrDomainBC ()
 Initializing constructor. More...
 
 CdrDomainBC (const CdrDomainBC &a_other)=default
 Copy constructor. More...
 
 CdrDomainBC (const CdrDomainBC &&a_other)=delete
 Disallowed copy constructor. More...
 
CdrDomainBCoperator= (const CdrDomainBC &a_other)=default
 Copy assignment. More...
 
CdrDomainBCoperator= (const CdrDomainBC &&a_other)=delete
 Disallowed move assignment. More...
 
DomainSide domainSide (const int a_dir, const Side::LoHiSide a_side) const
 Create a domain side from dir/side. More...
 
 ~CdrDomainBC ()
 Destructor. Does nothing.
 
const BcTypegetBcType (const DomainSide &a_domainSide) const
 Get the BC type on a particular domain side. More...
 
const FluxFunctiongetBcFunction (const DomainSide &a_domainSide) const
 Get the BC type on a particular domain side. More...
 
void setBcType (const DomainSide &a_domainSide, const BcType &a_bcType)
 Set the BC type on a domain side. More...
 
void setBcFunction (const DomainSide &a_domainSide, const FluxFunction &a_function)
 Set the BC type on a domain side. More...
 

Protected Attributes

std::map< DomainSide, BcTypem_bcTypes
 BC types on various domain edges.
 
std::map< DomainSide, FluxFunctionm_bcFunctions
 BC functions on various domain edges.
 

Detailed Description

Class for encapsulating possible domain boundary conditions for CdrSolver.

Note
This class is used in CdrSolver to populate boundary conditions, letting the solver pick between various scenarios, such as wall boundary conditions, data-based boundary conditions, function-based boundary conditions etc. This class is just a placeholder for that functionality – it does not provide any discretization whatsoever.
This class will be run-time safe in the sense that its default constructor provides a fully functional object which (shouldn't) cause run-time errors.

Member Typedef Documentation

◆ FluxFunction

using CdrDomainBC::FluxFunction = std::function<Real(const RealVect a_position, const Real a_time)>

Function which maps f(R^3,t) : R. Used for setting the associated value and boundary condition type.

Parameters
[in]a_positionPhysical position
[in]a_timeTime
Returns
Returns flux in time and space

Constructor & Destructor Documentation

◆ CdrDomainBC() [1/3]

CdrDomainBC::CdrDomainBC ( )
inline

Initializing constructor.

This populates m_bcTypes and m_bcFunctions with BcType::Wall and flux functions which return zero (i.e., also wall).

◆ CdrDomainBC() [2/3]

CdrDomainBC::CdrDomainBC ( const CdrDomainBC a_other)
default

Copy constructor.

Parameters
[in]a_otherOther

◆ CdrDomainBC() [3/3]

CdrDomainBC::CdrDomainBC ( const CdrDomainBC &&  a_other)
delete

Disallowed copy constructor.

Parameters
[in]a_otherOther

Member Function Documentation

◆ domainSide()

CdrDomainBC::DomainSide CdrDomainBC::domainSide ( const int  a_dir,
const Side::LoHiSide  a_side 
) const
inline

Create a domain side from dir/side.

Parameters
[in]a_dirCoordinate direction
[in]a_sideLow/high side
Returns
Returns std::pair<int, Side::LoHiSide>(a_dir, a_sit)

◆ getBcFunction()

const CdrDomainBC::FluxFunction & CdrDomainBC::getBcFunction ( const DomainSide a_domainSide) const
inline

Get the BC type on a particular domain side.

Parameters
[in]a_domainSideDomain side
Returns
Returns the BC function on the domain side

◆ getBcType()

const CdrDomainBC::BcType & CdrDomainBC::getBcType ( const DomainSide a_domainSide) const
inline

Get the BC type on a particular domain side.

Parameters
[in]a_domainSideDomain side
Returns
Returns the BC type on the domain side

◆ operator=() [1/2]

CdrDomainBC& CdrDomainBC::operator= ( const CdrDomainBC &&  a_other)
delete

Disallowed move assignment.

Parameters
[in]a_otherOther

◆ operator=() [2/2]

CdrDomainBC& CdrDomainBC::operator= ( const CdrDomainBC a_other)
default

Copy assignment.

Parameters
[in]a_otherOther

◆ setBcFunction()

void CdrDomainBC::setBcFunction ( const DomainSide a_domainSide,
const FluxFunction a_function 
)
inline

Set the BC type on a domain side.

Parameters
[in]a_domainSideDomain side
[in]a_functionFlux function on domain side

◆ setBcType()

void CdrDomainBC::setBcType ( const DomainSide a_domainSide,
const BcType a_bcType 
)
inline

Set the BC type on a domain side.

Parameters
[in]a_domainSideDomain side
[in]a_bcTypeDomain BC type

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