00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include "SimpleLinearParabolicSolver.hpp"
00037
00038 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00039 c_matrix<double, 1*(ELEMENT_DIM+1), 1*(ELEMENT_DIM+1)> SimpleLinearParabolicSolver<ELEMENT_DIM,SPACE_DIM>::ComputeMatrixTerm(
00040 c_vector<double, ELEMENT_DIM+1>& rPhi,
00041 c_matrix<double, SPACE_DIM, ELEMENT_DIM+1>& rGradPhi,
00042 ChastePoint<SPACE_DIM>& rX,
00043 c_vector<double,1>& rU,
00044 c_matrix<double,1,SPACE_DIM>& rGradU,
00045 Element<ELEMENT_DIM,SPACE_DIM>* pElement)
00046 {
00047 c_matrix<double, SPACE_DIM, SPACE_DIM> pde_diffusion_term = mpParabolicPde->ComputeDiffusionTerm(rX, pElement);
00048
00049 return prod( trans(rGradPhi), c_matrix<double, SPACE_DIM, ELEMENT_DIM+1>(prod(pde_diffusion_term, rGradPhi)) )
00050 + PdeSimulationTime::GetPdeTimeStepInverse() * mpParabolicPde->ComputeDuDtCoefficientFunction(rX) * outer_prod(rPhi, rPhi);
00051 }
00052
00053 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00054 c_vector<double,1*(ELEMENT_DIM+1)> SimpleLinearParabolicSolver<ELEMENT_DIM,SPACE_DIM>::ComputeVectorTerm(
00055 c_vector<double, ELEMENT_DIM+1>& rPhi,
00056 c_matrix<double, SPACE_DIM, ELEMENT_DIM+1>& rGradPhi,
00057 ChastePoint<SPACE_DIM>& rX,
00058 c_vector<double,1>& rU,
00059 c_matrix<double,1,SPACE_DIM>& rGradU,
00060 Element<ELEMENT_DIM,SPACE_DIM>* pElement)
00061 {
00062 return (mpParabolicPde->ComputeSourceTerm(rX, rU(0))
00063 + PdeSimulationTime::GetPdeTimeStepInverse() * mpParabolicPde->ComputeDuDtCoefficientFunction(rX) * rU(0)) * rPhi;
00064 }
00065
00066
00067 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00068 SimpleLinearParabolicSolver<ELEMENT_DIM,SPACE_DIM>::SimpleLinearParabolicSolver(
00069 AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00070 AbstractLinearParabolicPde<ELEMENT_DIM,SPACE_DIM>* pPde,
00071 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,1>* pBoundaryConditions)
00072 : AbstractAssemblerSolverHybrid<ELEMENT_DIM,SPACE_DIM,1,NORMAL>(pMesh,pBoundaryConditions),
00073 AbstractDynamicLinearPdeSolver<ELEMENT_DIM,SPACE_DIM,1>(pMesh)
00074 {
00075 mpParabolicPde = pPde;
00076 this->mMatrixIsConstant = true;
00077 }
00078
00080
00082
00083 template class SimpleLinearParabolicSolver<1,1>;
00084 template class SimpleLinearParabolicSolver<2,2>;
00085 template class SimpleLinearParabolicSolver<3,3>;