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 ABSTRACTBIDOMAINSOLVER_HPP_
00030 #define ABSTRACTBIDOMAINSOLVER_HPP_
00031
00032 #include "AbstractDynamicLinearPdeSolver.hpp"
00033 #include "BidomainTissue.hpp"
00034 #include "HeartConfig.hpp"
00035 #include "BidomainAssembler.hpp"
00036
00042 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00043 class AbstractBidomainSolver : public AbstractDynamicLinearPdeSolver<ELEMENT_DIM,SPACE_DIM,2>
00044 {
00045 protected:
00047 bool mBathSimulation;
00048
00050 BidomainTissue<SPACE_DIM>* mpBidomainTissue;
00051
00053 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* mpBoundaryConditions;
00054
00059 BidomainAssembler<ELEMENT_DIM,SPACE_DIM>* mpBidomainAssembler;
00060
00065 unsigned mNumQuadPoints;
00066
00068 bool mNullSpaceCreated;
00069
00071 HeartConfig* mpConfig;
00072
00076 std::vector<unsigned> mFixedExtracellularPotentialNodes;
00077
00083 unsigned mRowForAverageOfPhiZeroed;
00084
00091 void InitialiseForSolve(Vec initialSolution);
00092
00104 virtual void CheckCompatibilityCondition();
00105
00113 void PrepareForSetupLinearSystem(Vec existingSolution);
00114
00131 virtual void FinaliseLinearSystem(Vec existingSolution);
00132
00139 virtual Vec GenerateNullBasis() const;
00140
00150 void FinaliseForBath(bool computeMatrix, bool computeVector);
00151
00152 public:
00162 AbstractBidomainSolver(bool bathSimulation,
00163 AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00164 BidomainTissue<SPACE_DIM>* pTissue,
00165 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* pBoundaryConditions,
00166 unsigned numQuadPoints = 2);
00167
00171 virtual ~AbstractBidomainSolver();
00172
00183 void SetFixedExtracellularPotentialNodes(std::vector<unsigned> fixedExtracellularPotentialNodes);
00184
00191 void SetRowForAverageOfPhiZeroed(unsigned rowMeanPhiEZero);
00192
00196 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* GetBoundaryConditions()
00197 {
00198 return mpBoundaryConditions;
00199 }
00200
00206 void ResetBoundaryConditionsContainer(BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* pBcc)
00207 {
00208 assert(pBcc);
00209 mpBoundaryConditions = pBcc;
00210
00211
00212
00213
00214
00215
00216
00217 }
00218 };
00219
00220
00221
00222
00223 #endif