36 #include "OperatorSplittingMonodomainSolver.hpp"
39 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
42 assert(this->mpLinearSystem->rGetLhsMatrix() != NULL);
43 assert(this->mpLinearSystem->rGetRhsVector() != NULL);
50 mpMonodomainAssembler->SetMatrixToAssemble(this->mpLinearSystem->rGetLhsMatrix());
51 mpMonodomainAssembler->AssembleMatrix();
57 this->mpLinearSystem->FinaliseLhsMatrix();
76 index!= dist_vec_matrix_based.
End();
79 double V = distributed_current_solution[index];
87 dist_vec_matrix_based.
Restore();
92 MatMult(mMassMatrix, mVecForConstructingRhs, this->mpLinearSystem->rGetRhsVector());
101 mpNeumannSurfaceTermsAssembler->SetVectorToAssemble(this->mpLinearSystem->rGetRhsVector(),
false);
102 mpNeumannSurfaceTermsAssembler->AssembleVector();
105 this->mpLinearSystem->FinaliseRhsVector();
108 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
113 mpMonodomainTissue->SolveCellSystems(currentSolution, time, time+dt/2.0,
true);
117 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
127 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
130 if (this->mpLinearSystem != NULL)
152 this->mpLinearSystem->SetMatrixIsSymmetric(
true);
157 Vec& r_template = this->mpLinearSystem->rGetRhsVector();
158 VecDuplicate(r_template, &mVecForConstructingRhs);
161 VecGetOwnershipRange(r_template, &ownership_range_lo, &ownership_range_hi);
162 PetscInt local_size = ownership_range_hi - ownership_range_lo;
164 this->mpMesh->CalculateMaximumNodeConnectivityPerProcess(),
165 local_size, local_size);
170 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
176 mpBoundaryConditions(pBoundaryConditions),
177 mpMonodomainTissue(pTissue)
180 assert(pBoundaryConditions);
191 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
194 delete mpMonodomainAssembler;
195 delete mpNeumannSurfaceTermsAssembler;
197 if(mVecForConstructingRhs)
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpMesh
virtual void InitialiseForSolve(Vec initialSolution=NULL)
DistributedVector CreateDistributedVector(Vec vec, bool readOnly=false)
static void BeginEvent(unsigned event)
NaturalNeumannSurfaceTermAssembler< ELEMENT_DIM, SPACE_DIM, 1 > * mpNeumannSurfaceTermsAssembler
void InitialiseForSolve(Vec initialSolution)
OperatorSplittingMonodomainSolver(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, MonodomainTissue< ELEMENT_DIM, SPACE_DIM > *pTissue, BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, 1 > *pBoundaryConditions)
MonodomainTissue< ELEMENT_DIM, SPACE_DIM > * mpMonodomainTissue
Vec mVecForConstructingRhs
void SetupLinearSystem(Vec currentSolution, bool computeMatrix)
static double GetNextTime()
~OperatorSplittingMonodomainSolver()
static double GetPdeTimeStepInverse()
void FollowingSolveLinearSystem(Vec currentSolution)
static double GetPdeTimeStep()
void PrepareForSetupLinearSystem(Vec currentSolution)
void SetCacheReplication(bool doCacheReplication)
double GetCapacitance() const
double GetSurfaceAreaToVolumeRatio() const
static void EndEvent(unsigned event)
void SetMatrixToAssemble(Mat &rMatToAssemble, bool zeroMatrixBeforeAssembly=true)
static HeartConfig * Instance()
MonodomainAssembler< ELEMENT_DIM, SPACE_DIM > * mpMonodomainAssembler