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;
73 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
84 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
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 SetKspType(const char *kspType)
virtual void InitialiseForSolve(Vec initialSolution=nullptr)
void InitialiseForSolve(Vec initialSolution=nullptr)
SimpleLinearEllipticSolver(AbstractTetrahedralMesh< ELEMENT_DIM, SPACE_DIM > *pMesh, AbstractLinearEllipticPde< ELEMENT_DIM, SPACE_DIM > *pPde, BoundaryConditionsContainer< ELEMENT_DIM, SPACE_DIM, 1 > *pBoundaryConditions)
void SetMatrixIsSymmetric(bool isSymmetric=true)
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)
LinearSystem * mpLinearSystem