Chaste Commit::1fd4e48e3990e67db148bc1bc4cf6991a0049d0c
Electrodes< DIM > Class Template Reference

#include <Electrodes.hpp>

+ Collaboration diagram for Electrodes< DIM >:

Public Member Functions

 Electrodes (AbstractTetrahedralMesh< DIM, DIM > &rMesh)
 
boost::shared_ptr< BoundaryConditionsContainer< DIM, DIM, 2 > > GetBoundaryConditionsContainer ()
 
bool SwitchOff (double time)
 
bool SwitchOn (double time)
 
double GetSwitchOnTime ()
 
double GetSwitchOffTime ()
 
bool HasGroundedElectrode ()
 

Private Member Functions

void ComputeElectrodesAreasAndCheckEquality (unsigned index, double lowerValue, double upperValue)
 
template<class Archive >
void save (Archive &archive, const unsigned int version) const
 
template<class Archive >
void load (Archive &archive, const unsigned int version)
 
 Electrodes ()
 

Private Attributes

bool mGroundSecondElectrode
 
boost::shared_ptr< BoundaryConditionsContainer< DIM, DIM, 2 > > mpBoundaryConditionsContainer
 
double mStartTime
 
double mEndTime
 
bool mAreActive
 
AbstractTetrahedralMesh< DIM, DIM > * mpMesh
 
double mLeftElectrodeArea
 
double mRightElectrodeArea
 

Friends

class TestBidomainWithBathProblem
 
class TestElectrodes
 
class boost::serialization::access
 

Detailed Description

template<unsigned DIM>
class Electrodes< DIM >

A class for setting up the boundary conditions associated with electrodes. There are two modes: grounding the second electrode, in which case the first electrode has an input flux (Neumann boundary condition) of the specified magnitude, the extracellular potential is fixed on the second electrode; or not grounded, in which case the opposite electrode has an equal and opposite output flux.

This class assumes the given mesh is cuboid, and the electrodes are taken to be the specified opposite surfaces.

Note the class now includes a pointer to the mesh as a member variable, as this is required to archive (reconstruct) itself. Because boost is clever it will still only archive one copy of the mesh.

Definition at line 65 of file Electrodes.hpp.

Constructor & Destructor Documentation

◆ Electrodes() [1/2]

template<unsigned DIM>
Electrodes< DIM >::Electrodes ( )
inlineprivate

Private default constructor for archiving only.

Definition at line 148 of file Electrodes.hpp.

◆ Electrodes() [2/2]

Member Function Documentation

◆ ComputeElectrodesAreasAndCheckEquality()

template<unsigned DIM>
void Electrodes< DIM >::ComputeElectrodesAreasAndCheckEquality ( unsigned  index,
double  lowerValue,
double  upperValue 
)
private

Helper method to compute electrodes area and check they are equal. Throws if they are not.

Parameters
indexThe value i when applying the electrodes to x_i=a and x_i=b (a<b)
lowerValueThe value a when applying the electrodes to x_i=a and x_i=b (a<b) (should be the minimum value of x_i for the given mesh)
upperValueThe value b when applying the electrodes to x_i=a and x_i=b (a<b) (should be the maximum value of x_i for the given mesh)

Definition at line 171 of file Electrodes.cpp.

References EXCEPTION, and UNUSED_OPT.

Referenced by Electrodes< DIM >::Electrodes().

◆ GetBoundaryConditionsContainer()

template<unsigned DIM>
boost::shared_ptr< BoundaryConditionsContainer< DIM, DIM, 2 > > Electrodes< DIM >::GetBoundaryConditionsContainer ( )
Returns
the boundary conditions container in which is set up the Neumann fluxes for the first electrode, and the opposite fluxes for the second electrode if the the second electrode isn't grounded

Definition at line 134 of file Electrodes.cpp.

◆ GetSwitchOffTime()

template<unsigned DIM>
double Electrodes< DIM >::GetSwitchOffTime ( )
inline
Returns
the time the electrodes are switched off

Definition at line 193 of file Electrodes.hpp.

References Electrodes< DIM >::mEndTime.

◆ GetSwitchOnTime()

template<unsigned DIM>
double Electrodes< DIM >::GetSwitchOnTime ( )
inline
Returns
the time the electrodes are switched on

Definition at line 187 of file Electrodes.hpp.

References Electrodes< DIM >::mStartTime.

◆ HasGroundedElectrode()

template<unsigned DIM>
bool Electrodes< DIM >::HasGroundedElectrode ( )
inline
Returns
whether the second electrode is grounded or not

Definition at line 199 of file Electrodes.hpp.

References Electrodes< DIM >::mGroundSecondElectrode.

◆ load()

template<unsigned DIM>
template<class Archive >
void Electrodes< DIM >::load ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

◆ save()

template<unsigned DIM>
template<class Archive >
void Electrodes< DIM >::save ( Archive &  archive,
const unsigned int  version 
) const
inlineprivate

◆ SwitchOff()

template<unsigned DIM>
bool Electrodes< DIM >::SwitchOff ( double  time)
Returns
whether it is time to switch off the electrodes yet. THIS ONLY RETURNS TRUE ONCE - the first appropriate time. After that the electrodes assume they have been switched off and therefore this returns false.
Parameters
timethe current time
Todo:
remove magic number? (#1884)

Definition at line 141 of file Electrodes.cpp.

◆ SwitchOn()

template<unsigned DIM>
bool Electrodes< DIM >::SwitchOn ( double  time)
Returns
whether it is time to switch on the electrodes yet. THIS ONLY RETURNS TRUE ONCE - the first appropriate time. After that the electrodes assume they have been switched on and therefore this returns false.
Parameters
timethe current time
Todo:
remove magic number? (#1884)

Definition at line 156 of file Electrodes.cpp.

Friends And Related Symbol Documentation

◆ boost::serialization::access

template<unsigned DIM>
friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 106 of file Electrodes.hpp.

◆ TestBidomainWithBathProblem

template<unsigned DIM>
friend class TestBidomainWithBathProblem
friend

Definition at line 67 of file Electrodes.hpp.

◆ TestElectrodes

template<unsigned DIM>
friend class TestElectrodes
friend

Definition at line 68 of file Electrodes.hpp.

Member Data Documentation

◆ mAreActive

template<unsigned DIM>
bool Electrodes< DIM >::mAreActive
private

Whether the electrodes are currently switched on

Definition at line 80 of file Electrodes.hpp.

Referenced by Electrodes< DIM >::Electrodes(), Electrodes< DIM >::load(), and Electrodes< DIM >::save().

◆ mEndTime

template<unsigned DIM>
double Electrodes< DIM >::mEndTime
private

The time the electrodes are switched off

Definition at line 78 of file Electrodes.hpp.

Referenced by Electrodes< DIM >::Electrodes(), Electrodes< DIM >::GetSwitchOffTime(), Electrodes< DIM >::load(), and Electrodes< DIM >::save().

◆ mGroundSecondElectrode

template<unsigned DIM>
bool Electrodes< DIM >::mGroundSecondElectrode
private

Whether the second electrode is grounded

Definition at line 72 of file Electrodes.hpp.

Referenced by Electrodes< DIM >::Electrodes(), Electrodes< DIM >::HasGroundedElectrode(), Electrodes< DIM >::load(), and Electrodes< DIM >::save().

◆ mLeftElectrodeArea

template<unsigned DIM>
double Electrodes< DIM >::mLeftElectrodeArea
private

Left electrode area

Definition at line 89 of file Electrodes.hpp.

Referenced by Electrodes< DIM >::Electrodes().

◆ mpBoundaryConditionsContainer

template<unsigned DIM>
boost::shared_ptr<BoundaryConditionsContainer<DIM,DIM,2> > Electrodes< DIM >::mpBoundaryConditionsContainer
private

The created bcc, which BidomainProblem will use

Definition at line 74 of file Electrodes.hpp.

Referenced by Electrodes< DIM >::Electrodes(), Electrodes< DIM >::load(), and Electrodes< DIM >::save().

◆ mpMesh

template<unsigned DIM>
AbstractTetrahedralMesh<DIM,DIM>* Electrodes< DIM >::mpMesh
private

This is needed for archiving: the boundary conditions refer to nodes and/or elements, so need the mesh to be archived, but don't have a pointer to the mesh itself.

Definition at line 86 of file Electrodes.hpp.

Referenced by Electrodes< DIM >::Electrodes(), Electrodes< DIM >::load(), and Electrodes< DIM >::save().

◆ mRightElectrodeArea

template<unsigned DIM>
double Electrodes< DIM >::mRightElectrodeArea
private

Right electrode area

Definition at line 92 of file Electrodes.hpp.

Referenced by Electrodes< DIM >::Electrodes().

◆ mStartTime

template<unsigned DIM>
double Electrodes< DIM >::mStartTime
private

The time the electrodes are switched on

Definition at line 76 of file Electrodes.hpp.

Referenced by Electrodes< DIM >::Electrodes(), Electrodes< DIM >::GetSwitchOnTime(), Electrodes< DIM >::load(), and Electrodes< DIM >::save().


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