AbstractBidomainSolver.hpp
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
00041 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00042 class AbstractBidomainSolver : public AbstractDynamicLinearPdeSolver<ELEMENT_DIM,SPACE_DIM,2>
00043 {
00044 protected:
00046 bool mBathSimulation;
00047
00049 BidomainTissue<SPACE_DIM>* mpBidomainTissue;
00050
00052 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* mpBoundaryConditions;
00053
00058 unsigned mNumQuadPoints;
00059
00061 bool mNullSpaceCreated;
00062
00064 HeartConfig* mpConfig;
00065
00069 std::vector<unsigned> mFixedExtracellularPotentialNodes;
00070
00076 unsigned mRowForAverageOfPhiZeroed;
00077
00084 void InitialiseForSolve(Vec initialSolution);
00085
00097 virtual void CheckCompatibilityCondition();
00098
00106 void PrepareForSetupLinearSystem(Vec existingSolution);
00107
00124 virtual void FinaliseLinearSystem(Vec existingSolution);
00125
00132 virtual Vec GenerateNullBasis() const;
00133
00147 void FinaliseForBath(bool computeMatrix, bool computeVector);
00148
00149 public:
00159 AbstractBidomainSolver(bool bathSimulation,
00160 AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00161 BidomainTissue<SPACE_DIM>* pTissue,
00162 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* pBoundaryConditions,
00163 unsigned numQuadPoints = 2);
00164
00168 virtual ~AbstractBidomainSolver();
00169
00180 void SetFixedExtracellularPotentialNodes(std::vector<unsigned> fixedExtracellularPotentialNodes);
00181
00188 void SetRowForAverageOfPhiZeroed(unsigned rowMeanPhiEZero);
00189
00193 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* GetBoundaryConditions()
00194 {
00195 return mpBoundaryConditions;
00196 }
00197
00203 void ResetBoundaryConditionsContainer(BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* pBcc)
00204 {
00205 assert(pBcc);
00206 mpBoundaryConditions = pBcc;
00207
00208
00209
00210 }
00211 };
00212
00213
00214
00215
00216 #endif