NaturalNeumannSurfaceTermAssembler.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 NATURALNEUMANNSURFACETERMASSEMBLER_HPP
00037 #define NATURALNEUMANNSURFACETERMASSEMBLER_HPP
00038
00039 #include "AbstractFeSurfaceIntegralAssembler.hpp"
00040
00041
00061 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
00062 class NaturalNeumannSurfaceTermAssembler : public AbstractFeSurfaceIntegralAssembler<ELEMENT_DIM,SPACE_DIM,PROBLEM_DIM>
00063 {
00064 protected:
00066 double mScaleFactor;
00067
00068
00083 virtual c_vector<double, PROBLEM_DIM*ELEMENT_DIM> ComputeVectorSurfaceTerm(
00084 const BoundaryElement<ELEMENT_DIM-1,SPACE_DIM>& rSurfaceElement,
00085 c_vector<double, ELEMENT_DIM>& rPhi,
00086 ChastePoint<SPACE_DIM>& rX);
00087
00088 public:
00095 NaturalNeumannSurfaceTermAssembler(AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh,
00096 BoundaryConditionsContainer<ELEMENT_DIM,SPACE_DIM,PROBLEM_DIM>* pBoundaryConditions)
00097 : AbstractFeSurfaceIntegralAssembler<ELEMENT_DIM,SPACE_DIM,PROBLEM_DIM>(pMesh, pBoundaryConditions),
00098 mScaleFactor(1.0)
00099 {
00100 }
00101
00106 void SetScaleFactor(double scaleFactor)
00107 {
00108 mScaleFactor = scaleFactor;
00109 }
00110 };
00111
00112
00113
00114 template <unsigned ELEMENT_DIM, unsigned SPACE_DIM, unsigned PROBLEM_DIM>
00115 c_vector<double, PROBLEM_DIM*ELEMENT_DIM> NaturalNeumannSurfaceTermAssembler<ELEMENT_DIM, SPACE_DIM, PROBLEM_DIM>::ComputeVectorSurfaceTerm(
00116 const BoundaryElement<ELEMENT_DIM-1,SPACE_DIM>& rSurfaceElement,
00117 c_vector<double, ELEMENT_DIM>& rPhi,
00118 ChastePoint<SPACE_DIM>& rX)
00119 {
00120 c_vector<double, ELEMENT_DIM*PROBLEM_DIM> ret;
00121 c_vector<double, PROBLEM_DIM> neumann_bc_values;
00122
00123 for (unsigned i=0; i<ELEMENT_DIM; i++)
00124 {
00125 for(unsigned problem_dim = 0; problem_dim<PROBLEM_DIM; problem_dim++)
00126 {
00127 double neumann_bc_value = this->mpBoundaryConditions->GetNeumannBCValue(&rSurfaceElement, rX, problem_dim);
00128
00129 ret(PROBLEM_DIM*i + problem_dim) = mScaleFactor * rPhi(i) * neumann_bc_value;
00130 }
00131 }
00132
00133 return ret;
00134 }
00135
00136 #endif