BidomainNeumannSurfaceTermAssembler.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
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef BIDOMAINNEUMANNSURFACETERMASSEMBLER_HPP_
00037 #define BIDOMAINNEUMANNSURFACETERMASSEMBLER_HPP_
00038
00039 #include "AbstractFeSurfaceIntegralAssembler.hpp"
00040
00041
00042
00055 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00056 class BidomainNeumannSurfaceTermAssembler : public AbstractFeSurfaceIntegralAssembler<ELEMENT_DIM,SPACE_DIM,2>
00057 {
00058 protected:
00071 virtual c_vector<double, 2*ELEMENT_DIM> ComputeVectorSurfaceTerm(
00072 const BoundaryElement<ELEMENT_DIM-1,SPACE_DIM>& rSurfaceElement,
00073 c_vector<double, ELEMENT_DIM>& rPhi,
00074 ChastePoint<SPACE_DIM>& rX);
00075
00076 public:
00083 BidomainNeumannSurfaceTermAssembler(AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00084 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,2>* pBoundaryConditions)
00085 : AbstractFeSurfaceIntegralAssembler<ELEMENT_DIM,SPACE_DIM,2>(pMesh, pBoundaryConditions)
00086 {
00087 }
00088 };
00089
00090
00091
00092 template <unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00093 c_vector<double, 2*ELEMENT_DIM> BidomainNeumannSurfaceTermAssembler<ELEMENT_DIM, SPACE_DIM>::ComputeVectorSurfaceTerm(
00094 const BoundaryElement<ELEMENT_DIM-1,SPACE_DIM>& rSurfaceElement,
00095 c_vector<double, ELEMENT_DIM>& rPhi,
00096 ChastePoint<SPACE_DIM>& rX)
00097 {
00098
00099 double sigma_i_times_grad_phi_i_dot_n = this->mpBoundaryConditions->GetNeumannBCValue(&rSurfaceElement, rX, 0);
00100 double sigma_e_times_grad_phi_e_dot_n = this->mpBoundaryConditions->GetNeumannBCValue(&rSurfaceElement, rX, 1);
00101
00102 c_vector<double, 2*ELEMENT_DIM> ret;
00103 for (unsigned i=0; i<ELEMENT_DIM; i++)
00104 {
00105 ret(2*i) = rPhi(i)*sigma_i_times_grad_phi_i_dot_n;
00106 ret(2*i+1) = rPhi(i)*(sigma_i_times_grad_phi_i_dot_n + sigma_e_times_grad_phi_e_dot_n);
00107 }
00108
00109 return ret;
00110 }
00111
00112 #endif // BIDOMAINNEUMANNSURFACETERMASSEMBLER_HPP_