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

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

#include <CD_ElectrostaticEbBc.H>

Public 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 potential at an electrode.
 

Public Member Functions

 ElectrostaticEbBc ()
 Initializing constructor (does nothing)
 
virtual ~ElectrostaticEbBc ()
 Destructor (does nothing)
 
void clear ()
 Clears the object.
 
void addEbBc (const Electrode &a_electrode, const BcFunction &a_bcFunction)
 Add a boundary condition. More...
 
void setEbBc (const int a_electrode, const BcFunction &a_bcFunction)
 Set the potential for a_electrode to be given by a_bcFunction. More...
 
BcFunctiongetBc (const int a_electrode)
 Return boundary condition associated with a particular electrode. More...
 
const BcFunctiongetBc (const int a_electrode) const
 Return boundary condition associated with a particular electrode. More...
 
std::vector< std::pair< Electrode, BcFunction > > & getBcs ()
 Get all boundary conditions. More...
 
const std::vector< std::pair< Electrode, BcFunction > > & getBcs () const
 Get all boundary conditions. More...
 

Protected Attributes

std::vector< std::pair< Electrode, BcFunction > > m_bcFunctions
 Data structure which holds electrode and associated potential functions.
 

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 an electrode, which is used for setting the voltage on the electrode (in time and space).

Member Function Documentation

◆ addEbBc()

void ElectrostaticEbBc::addEbBc ( const Electrode a_electrode,
const BcFunction a_bcFunction 
)

Add a boundary condition.

Parameters
[in]a_electrodeThe electrode.
[in]a_bcFunctionBoundary condition function.

This appends an EbBc to the end of m_bcFunctions.

Note
If the boundary condition already exists for a_electrode, it will be overwritten.

◆ getBc() [1/2]

ElectrostaticEbBc::BcFunction & ElectrostaticEbBc::getBc ( const int  a_electrode)

Return boundary condition associated with a particular electrode.

Parameters
[in]a_electrodeelectrode
Returns
Boundary condition associated with a_electrode.

◆ getBc() [2/2]

const ElectrostaticEbBc::BcFunction & ElectrostaticEbBc::getBc ( const int  a_electrode) const

Return boundary condition associated with a particular electrode.

Parameters
[in]a_electrodeelectrode
Returns
Boundary condition associated with a_electrode.

◆ getBcs() [1/2]

std::vector< std::pair< Electrode, ElectrostaticEbBc::BcFunction > > & ElectrostaticEbBc::getBcs ( )

Get all boundary conditions.

Returns
Returns modifiable version of m_bcFunctions

◆ getBcs() [2/2]

const std::vector< std::pair< Electrode, ElectrostaticEbBc::BcFunction > > & ElectrostaticEbBc::getBcs ( ) const

Get all boundary conditions.

Returns
Returns non-modifiable version of m_bcFunctions

◆ setEbBc()

void ElectrostaticEbBc::setEbBc ( const int  a_electrode,
const BcFunction a_bcFunction 
)

Set the potential for a_electrode to be given by a_bcFunction.

Parameters
[in]a_electrodeThe electrode index in the vector.
[in]a_bcFunctionBoundary condition function.

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