36 #include "SimpleLinearEllipticSolver.hpp"
38 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
40 c_vector<double, ELEMENT_DIM+1>& rPhi,
41 c_matrix<double, SPACE_DIM, ELEMENT_DIM+1>& rGradPhi,
43 c_vector<double,1>& rU,
44 c_matrix<double,1,SPACE_DIM>& rGradU,
47 c_matrix<double, SPACE_DIM, SPACE_DIM> pde_diffusion_term = mpEllipticPde->ComputeDiffusionTerm(rX);
50 if (mpEllipticPde->ComputeLinearInUCoeffInSourceTerm(rX,pElement)!=0)
52 return prod( trans(rGradPhi), c_matrix<double, SPACE_DIM, ELEMENT_DIM+1>(prod(pde_diffusion_term, rGradPhi)) )
53 - mpEllipticPde->ComputeLinearInUCoeffInSourceTerm(rX,pElement)*outer_prod(rPhi,rPhi);
57 return prod( trans(rGradPhi), c_matrix<double, SPACE_DIM, ELEMENT_DIM+1>(prod(pde_diffusion_term, rGradPhi)) );
61 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
63 c_vector<double, ELEMENT_DIM+1>& rPhi,
64 c_matrix<double, SPACE_DIM, ELEMENT_DIM+1>& rGradPhi,
66 c_vector<double,1>& rU,
67 c_matrix<double,1,SPACE_DIM>& rGradU,
70 return mpEllipticPde->ComputeConstantInUSourceTerm(rX, pElement) * rPhi;
74 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
85 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
89 assert(this->mpLinearSystem);
90 this->mpLinearSystem->SetMatrixIsSymmetric(
true);
91 this->mpLinearSystem->SetKspType(
"cg");
virtual c_vector< double, 1 *(ELEMENT_DIM+1)> ComputeVectorTerm(c_vector< double, ELEMENT_DIM+1 > &rPhi, c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &rGradPhi, ChastePoint< SPACE_DIM > &rX, c_vector< double, 1 > &rU, c_matrix< double, 1, SPACE_DIM > &rGradU, Element< ELEMENT_DIM, SPACE_DIM > *pElement)
void InitialiseForSolve(Vec initialSolution=NULL)
virtual void InitialiseForSolve(Vec initialSolution=NULL)
SimpleLinearEllipticSolver(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, AbstractLinearEllipticPde< ELEMENT_DIM, SPACE_DIM > *pPde, BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, 1 > *pBoundaryConditions)
AbstractLinearEllipticPde< ELEMENT_DIM, SPACE_DIM > * mpEllipticPde
virtual c_matrix< double, 1 *(ELEMENT_DIM+1), 1 *(ELEMENT_DIM+1)> ComputeMatrixTerm(c_vector< double, ELEMENT_DIM+1 > &rPhi, c_matrix< double, SPACE_DIM, ELEMENT_DIM+1 > &rGradPhi, ChastePoint< SPACE_DIM > &rX, c_vector< double, 1 > &rU, c_matrix< double, 1, SPACE_DIM > &rGradU, Element< ELEMENT_DIM, SPACE_DIM > *pElement)