46 assert(this->mpLinearSystem->rGetLhsMatrix() != NULL);
47 assert(this->mpLinearSystem->rGetRhsVector() != NULL);
54 mpVolumeAssembler->SetMatrixToAssemble(this->mpLinearSystem->rGetLhsMatrix(),
false);
55 mpVolumeAssembler->AssembleMatrix();
57 mpCableAssembler->SetMatrixToAssemble(this->mpLinearSystem->rGetLhsMatrix(),
false);
60 mpCableAssembler->AssembleMatrix();
62 SetIdentityBlockToLhsMatrix();
63 this->mpLinearSystem->FinaliseLhsMatrix();
68 volume_mass_matrix_assembler.
Assemble();
72 cable_mass_matrix_assembler.
Assemble();
101 index!= dist_vec_matrix_based.
End();
104 double V_volume = distributed_current_solution_volume[index];
105 double F_volume = - Am*this->mpMonodomainTissue->rGetIionicCacheReplicated()[index.Global]
106 - this->mpMonodomainTissue->rGetIntracellularStimulusCacheReplicated()[index.Global];
109 double V_cable = distributed_current_solution_cable[index];
110 double F_cable = - Am*this->mpMonodomainTissue->rGetPurkinjeIionicCacheReplicated()[index.Global]
111 - this->mpMonodomainTissue->rGetPurkinjeIntracellularStimulusCacheReplicated()[index.Global];
116 dist_vec_matrix_based.
Restore();
121 MatMult(mMassMatrix, mVecForConstructingRhs, this->mpLinearSystem->rGetRhsVector());
131 mpNeumannSurfaceTermsAssembler->SetVectorToAssemble(this->mpLinearSystem->rGetRhsVector(),
false);
132 mpNeumannSurfaceTermsAssembler->AssembleVector();
135 this->mpLinearSystem->FinaliseRhsVector();
142 this->mpLinearSystem->FinaliseLhsMatrix();
145 VecDuplicate(mVecForConstructingRhs, &diagonal);
146 MatGetDiagonal(this->mpLinearSystem->rGetLhsMatrix(), diagonal);
151 this->mpLinearSystem->GetOwnershipRange(lo, hi);
152 for (
int row=lo; row<hi; row++)
166 if (this->mpLinearSystem != NULL)
187 this->mpLinearSystem->SetMatrixIsSymmetric(
true);
191 VecDuplicate(initialSolution, &mVecForConstructingRhs);
194 VecGetOwnershipRange(initialSolution, &ownership_range_lo, &ownership_range_hi);
195 PetscInt local_size = ownership_range_hi - ownership_range_lo;
197 2*this->mpMesh->CalculateMaximumNodeConnectivityPerProcess(),
198 local_size, local_size);
void PrepareForSetupLinearSystem(Vec currentSolution)
MonodomainTissue< ELEMENT_DIM, SPACE_DIM > * mpMonodomainTissue
void SetupLinearSystem(Vec currentSolution, bool computeMatrix)
NaturalNeumannSurfaceTermAssembler< ELEMENT_DIM, SPACE_DIM, 2 > * mpNeumannSurfaceTermsAssembler
virtual ~MonodomainPurkinjeSolver()
MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM > * mpMixedMesh
MonodomainPurkinjeCableAssembler< ELEMENT_DIM, SPACE_DIM > * mpCableAssembler
MonodomainPurkinjeVolumeAssembler< ELEMENT_DIM, SPACE_DIM > * mpVolumeAssembler
Vec mVecForConstructingRhs
void SetIdentityBlockToLhsMatrix()
virtual void InitialiseForSolve(Vec initialSolution)
MonodomainPurkinjeSolver(MixedDimensionMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, MonodomainTissue< ELEMENT_DIM, SPACE_DIM > *pTissue, BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, 2 > *pBoundaryConditions)