36 #ifndef EVALUATION_PATCHAREA_HPP 37 #define EVALUATION_PATCHAREA_HPP 39 #include <lifev/core/LifeV.hpp> 41 #include <lifev/core/array/VectorEpetra.hpp> 42 #include <lifev/core/array/VectorSmall.hpp> 44 #include <lifev/eta/fem/ETCurrentFE.hpp> 45 #include <lifev/eta/fem/ETCurrentFlag.hpp> 46 #include <lifev/eta/fem/ETFESpace.hpp> 47 #include <lifev/core/fem/QuadratureRule.hpp> 49 #include <lifev/eta/expression/ExpressionInterpolateValue.hpp> 51 #include <boost/shared_ptr.hpp> 57 namespace ExpressionAssembly
71 template<
typename MeshType,
typename MapType,
UInt SpaceDim,
UInt FieldDim>
72 class EvaluationPatchArea
81 typedef ETFESpace<MeshType, MapType, SpaceDim, FieldDim> ETFESpace_Type;
82 typedef boost::shared_ptr<ETFESpace_Type> ETFESpacePtr_Type;
105 EvaluationPatchArea (
const EvaluationPatchArea& evaluation)
107 M_fespace ( evaluation.M_fespace),
110 M_currentFE (evaluation.M_currentFE),
111 M_patchArea (evaluation.M_patchArea)
113 if (evaluation.M_quadrature != 0)
121 explicit EvaluationPatchArea (
const ExpressionPatchArea<MeshType, MapType, SpaceDim, FieldDim>& expression)
123 M_fespace ( expression.fespace() ),
125 M_currentFE (M_fespace->refFE(), M_fespace->geoMap() ),
130 ~EvaluationPatchArea()
132 if (M_quadrature != 0)
145 void update (
const UInt& iElement)
149 M_currentFE.update (M_fespace->mesh()->element (iElement), ET_UPDATE_DPHI | ET_UPDATE_WDET );
151 std::cout <<
"Measure! "<< M_currentFE.measure() << std::endl;
157 for (
UInt iDim (0); iDim < FieldDim; ++iDim)
159 M_patchArea[q][iDim] += M_currentFE.measure();
170 for (
UInt iDim (0); iDim < FieldDim; ++iDim)
172 M_patchArea[q][iDim] = 0.0;
178 void showValues()
const 180 std::cout <<
" Values : " << std::endl;
184 std::cout << M_patchArea[i] << std::endl;
189 static void display (std::ostream& out = std::cout)
191 out <<
"patchAread" <<
"\n";
201 template<
typename CFEType >
202 void setGlobalCFE (
const CFEType* )
206 template<
typename CFEType >
207 void setTestCFE (
const CFEType* )
211 template<
typename CFEType >
212 void setSolutionCFE (
const CFEType* )
218 if (M_quadrature != 0)
223 M_currentFE.setQuadratureRule (qr);
224 M_patchArea.resize (qr.nbQuadPt() );
234 return_Type value_q (
const UInt& q)
const 236 return M_patchArea[q];
240 return_Type value_qi (
const UInt& q,
const UInt& )
const 242 return M_patchArea[q];
246 return_Type value_qij (
const UInt& q,
const UInt& ,
const UInt& )
const 248 return M_patchArea[q];
259 EvaluationPatchArea();
263 ETFESpacePtr_Type M_fespace;
266 ETCurrentFE<SpaceDim, 1> M_currentFE;
268 std::vector<return_Type> M_patchArea;
272 template<
typename MeshType,
typename MapType,
UInt SpaceDim,
UInt FieldDim>
274 EvaluationPatchArea<MeshType, MapType, SpaceDim, FieldDim>::
275 S_globalUpdateFlag = ET_UPDATE_NONE;
277 template<
typename MeshType,
typename MapType,
UInt SpaceDim,
UInt FieldDim>
279 EvaluationPatchArea<MeshType, MapType, SpaceDim, FieldDim>::
280 S_testUpdateFlag = ET_UPDATE_NONE;
282 template<
typename MeshType,
typename MapType,
UInt SpaceDim,
UInt FieldDim>
284 EvaluationPatchArea<MeshType, MapType, SpaceDim, FieldDim>::
285 S_solutionUpdateFlag = ET_UPDATE_NONE;
uint32_type flag_Type
bit-flag with up to 32 different flags
QuadratureRule(const QuadratureRule &qr)
Copy constructor.
void updateInverseJacobian(const UInt &iQuadPt)
QuadratureRule - The basis class for storing and accessing quadrature rules.
const UInt & nbQuadPt() const
Getter for the number of quadrature points.
uint32_type UInt
generic unsigned integer (used mainly for addressing)