AbstractLinearParabolicPde.hpp
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 #ifndef _ABSTRACTLINEARPARABOLICPDE_HPP_
00029 #define _ABSTRACTLINEARPARABOLICPDE_HPP_
00030
00031 #include "UblasCustomFunctions.hpp"
00032 #include "ChastePoint.hpp"
00033 #include "Node.hpp"
00034 #include "Element.hpp"
00035 #include <petscvec.h>
00036
00037
00045 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM = ELEMENT_DIM>
00046 class AbstractLinearParabolicPde
00047 {
00048 public:
00049
00055 virtual double ComputeDuDtCoefficientFunction(const ChastePoint<SPACE_DIM>& rX)=0;
00056
00063 virtual double ComputeNonlinearSourceTerm(const ChastePoint<SPACE_DIM>& rX, double u)=0;
00064
00071 virtual double ComputeNonlinearSourceTermAtNode(const Node<SPACE_DIM>& rNode, double u);
00072
00078 virtual double ComputeLinearSourceTerm(const ChastePoint<SPACE_DIM>& rX)=0;
00079
00087 virtual c_matrix<double, SPACE_DIM, SPACE_DIM> ComputeDiffusionTerm(const ChastePoint<SPACE_DIM>& rX, Element<ELEMENT_DIM,SPACE_DIM>* pElement=NULL)=0;
00088
00094 virtual double ComputeLinearSourceTermAtNode(const Node<SPACE_DIM>& rNode);
00095
00099 virtual ~AbstractLinearParabolicPde()
00100 {}
00101 };
00102
00103
00105
00107
00108
00109 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00110 double AbstractLinearParabolicPde<ELEMENT_DIM, SPACE_DIM>::ComputeLinearSourceTermAtNode(const Node<SPACE_DIM>& rNode)
00111 {
00112 return ComputeLinearSourceTerm(rNode.GetPoint());
00113 }
00114
00115 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00116 double AbstractLinearParabolicPde<ELEMENT_DIM, SPACE_DIM>::ComputeNonlinearSourceTermAtNode(const Node<SPACE_DIM>& rNode, double u)
00117 {
00118 return ComputeNonlinearSourceTerm(rNode.GetPoint(), u);
00119 }
00120
00121 #endif //_ABSTRACTLINEARPARABOLICPDE_HPP_