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

Class which maps boundary condition types to a side and direction. More...

#include <CD_ElectrostaticDomainBc.H>

Public Types

enum class  BcType { Dirichlet , Neumann }
 Supported boundary condition types.
 
using BcFunction = 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.
 
using Bc = std::pair< BcType, BcFunction >
 Alias for mapping a bctype and function.
 

Public Member Functions

 ElectrostaticDomainBc ()
 Initializing constructor. This populates the BC functions with homogeneous Neumann boundary conditions.
 
 ElectrostaticDomainBc (const ElectrostaticDomainBc &a_other)=default
 Copy constructor. More...
 
 ElectrostaticDomainBc (const ElectrostaticDomainBc &&a_other)=delete
 Disallowed move constructor. More...
 
ElectrostaticDomainBcoperator= (const ElectrostaticDomainBc &a_other)=default
 Copy assignment. More...
 
ElectrostaticDomainBcoperator= (const ElectrostaticDomainBc &&a_other)=delete
 Disallowed move assignment. More...
 
virtual ~ElectrostaticDomainBc ()
 Destructor. This.
 
void setBc (const DomainSide a_wall, const Bc a_bc)
 Set the boundary condition on a domain side. You must set both the type, and the associated function. More...
 
Bc getBc (const DomainSide a_domainSide) const
 Returns the boundary condition for a domain side. More...
 

Protected Attributes

std::map< DomainSide, Bcm_bcFunctions
 This holds the map to the boundary condition type and side. The first entry in the map is the direction and side of the boundary condition. The other entry in the map is the BC type, and the associated function which returns the value in space and time of the BC.
 

Detailed Description

Class which maps boundary condition types to a side and direction.

This class is simply meant to hold functions that will be used as boundary conditions for use in various FieldSolver code. The user will construct this object, after which he can associate a polymorphic function with a domain side and a boundary condition type. Currently, only Dirichlet and Neumann are supported.

Member Typedef Documentation

◆ BcFunction

using ElectrostaticDomainBc::BcFunction = 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 coordinates
[in]a_timeTime

Constructor & Destructor Documentation

◆ ElectrostaticDomainBc() [1/2]

ElectrostaticDomainBc::ElectrostaticDomainBc ( const ElectrostaticDomainBc a_other)
default

Copy constructor.

Parameters
[in]a_otherOther

◆ ElectrostaticDomainBc() [2/2]

ElectrostaticDomainBc::ElectrostaticDomainBc ( const ElectrostaticDomainBc &&  a_other)
delete

Disallowed move constructor.

Parameters
[in]a_otherOther

Member Function Documentation

◆ getBc()

ElectrostaticDomainBc::Bc ElectrostaticDomainBc::getBc ( const DomainSide  a_domainSide) const

Returns the boundary condition for a domain side.

Parameters
[in]a_domainSideDomain side
Note
If the boundary condition for the associated side and direction has not been previously set, this routine will cause a run-time error.

◆ operator=() [1/2]

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

Disallowed move assignment.

Parameters
[in]a_otherOther

◆ operator=() [2/2]

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

Copy assignment.

Parameters
[in]a_otherOther

◆ setBc()

void ElectrostaticDomainBc::setBc ( const DomainSide  a_wall,
const Bc  a_bc 
)

Set the boundary condition on a domain side. You must set both the type, and the associated function.

Parameters
[in]a_domainSideDomain side
[in]a_bcBC type and function
Note
If the boundary condition had been set previously, this code will overwrite the previous setting.

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