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);
116 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
125 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
128 if (this->mpLinearSystem != NULL)
150 this->mpLinearSystem->SetMatrixIsSymmetric(
true);
155 Vec& r_template = this->mpLinearSystem->rGetRhsVector();
156 VecDuplicate(r_template, &mVecForConstructingRhs);
159 VecGetOwnershipRange(r_template, &ownership_range_lo, &ownership_range_hi);
160 PetscInt local_size = ownership_range_hi - ownership_range_lo;
162 this->mpMesh->CalculateMaximumNodeConnectivityPerProcess(),
163 local_size, local_size);
166 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
172 mpBoundaryConditions(pBoundaryConditions),
173 mpMonodomainTissue(pTissue)
176 assert(pBoundaryConditions);
187 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
190 delete mpMonodomainAssembler;
191 delete mpNeumannSurfaceTermsAssembler;
193 if (mVecForConstructingRhs)
AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > * mpMesh
DistributedVector CreateDistributedVector(Vec vec, bool readOnly=false)
virtual void InitialiseForSolve(Vec initialSolution=nullptr)
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