00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef ELECTRODES_HPP_
00030 #define ELECTRODES_HPP_
00031
00032 #include "AbstractTetrahedralMesh.hpp"
00033 #include "DistributedVector.hpp"
00034 #include "BoundaryConditionsContainer.hpp"
00035 #include "ConstBoundaryCondition.hpp"
00036
00037
00049 template<unsigned DIM>
00050 class Electrodes
00051 {
00052 friend class TestBidomainWithBathAssembler;
00053
00054 private:
00056 bool mGroundSecondElectrode;
00058 BoundaryConditionsContainer<DIM,DIM,2>* mpBoundaryConditionsContainer;
00060 double mEndTime;
00062 bool mAreActive;
00063
00064 public:
00076 Electrodes(AbstractTetrahedralMesh<DIM,DIM>& rMesh,
00077 bool groundSecondElectrode,
00078 unsigned index, double lowerValue, double upperValue,
00079 double magnitude, double duration);
00080
00084 ~Electrodes()
00085 {
00086 delete mpBoundaryConditionsContainer;
00087 }
00088
00094 BoundaryConditionsContainer<DIM,DIM,2>* GetBoundaryConditionsContainer()
00095 {
00096 assert(mAreActive);
00097 return mpBoundaryConditionsContainer;
00098 }
00099
00107 bool SwitchOff(double time)
00108 {
00109 if(mAreActive && time>mEndTime)
00110 {
00111 mAreActive = false;
00112 return true;
00113 }
00114
00115 return false;
00116 }
00117 };
00118
00119 #endif