44 assert(this->mpLinearSystem->rGetLhsMatrix() != NULL);
45 assert(this->mpLinearSystem->rGetRhsVector() != NULL);
53 mpMonodomainAssembler->SetMatrixToAssemble(this->mpLinearSystem->rGetLhsMatrix());
54 mpMonodomainAssembler->AssembleMatrix();
60 this->mpLinearSystem->FinaliseLhsMatrix();
65 this->mpLinearSystem->SetPrecondMatrixIsDifferentFromLhs();
74 this->mpLinearSystem->FinalisePrecondMatrix();
93 index!= dist_vec_matrix_based.
End();
96 double V = distributed_current_solution[index];
97 double F = - Am*this->mpMonodomainTissue->rGetIionicCacheReplicated()[index.Global]
98 - this->mpMonodomainTissue->rGetIntracellularStimulusCacheReplicated()[index.Global];
102 dist_vec_matrix_based.
Restore();
107 MatMult(mMassMatrix, mVecForConstructingRhs, this->mpLinearSystem->rGetRhsVector());
116 mpNeumannSurfaceTermsAssembler->SetVectorToAssemble(this->mpLinearSystem->rGetRhsVector(),
false);
117 mpNeumannSurfaceTermsAssembler->AssembleVector();
122 if (mpMonodomainCorrectionTermAssembler)
124 mpMonodomainCorrectionTermAssembler->SetVectorToAssemble(this->mpLinearSystem->rGetRhsVector(),
false);
126 mpMonodomainCorrectionTermAssembler->AssembleVector();
130 this->mpLinearSystem->FinaliseRhsVector();
136 if (this->mpLinearSystem != NULL)
156 this->mpLinearSystem->SetMatrixIsSymmetric(
true);
161 Vec& r_template = this->mpLinearSystem->rGetRhsVector();
162 VecDuplicate(r_template, &mVecForConstructingRhs);
165 VecGetOwnershipRange(r_template, &ownership_range_lo, &ownership_range_hi);
166 PetscInt local_size = ownership_range_hi - ownership_range_lo;
168 this->mpMesh->CalculateMaximumNodeConnectivityPerProcess(),
169 local_size, local_size);
virtual void InitialiseForSolve(Vec initialSolution)
MonodomainAssembler< ELEMENT_DIM, SPACE_DIM > * mpMonodomainAssembler
void PrepareForSetupLinearSystem(Vec currentSolution)
MonodomainCorrectionTermAssembler< ELEMENT_DIM, SPACE_DIM > * mpMonodomainCorrectionTermAssembler
virtual ~MonodomainSolver()
MonodomainSolver(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, MonodomainTissue< ELEMENT_DIM, SPACE_DIM > *pTissue, BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, 1 > *pBoundaryConditions)
void SetupLinearSystem(Vec currentSolution, bool computeMatrix)
Vec mVecForConstructingRhs
NaturalNeumannSurfaceTermAssembler< ELEMENT_DIM, SPACE_DIM, 1 > * mpNeumannSurfaceTermsAssembler
MonodomainTissue< ELEMENT_DIM, SPACE_DIM > * mpMonodomainTissue