36 #ifndef EVALUATION_RETURN_AT_QUAD_PTS_HPP 37 #define EVALUATION_RETURN_AT_QUAD_PTS_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/ExpressionReturnAtQuadraturePoints.hpp> 54 namespace ExpressionAssembly
68 template<
typename MeshType,
typename MapType,
UInt SpaceDim,
UInt FieldDim>
69 class EvaluationReturnAtQuadraturePoints
80 typedef ETFESpace<MeshType, MapType, SpaceDim, FieldDim> fespace_Type;
83 typedef std::shared_ptr<fespace_Type> fespacePtr_Type;
86 typedef std::vector<std::vector<return_Type>> vector_Type;
110 EvaluationReturnAtQuadraturePoints (
const EvaluationReturnAtQuadraturePoints<MeshType, MapType, SpaceDim, FieldDim>& evaluation)
112 M_fespace ( evaluation.M_fespace),
113 M_vector ( evaluation.M_vector ),
116 M_currentFE (evaluation.M_currentFE),
117 M_returnedValues (evaluation.M_returnedValues)
119 if (evaluation.M_quadrature != 0)
127 explicit EvaluationReturnAtQuadraturePoints (
const ExpressionReturnAtQuadraturePoints<MeshType, MapType, SpaceDim, FieldDim>& expression)
129 M_fespace ( expression.fespace() ),
130 M_vector ( expression.vector() ),
132 M_currentFE (M_fespace->refFE(), M_fespace->geoMap() ),
137 ~EvaluationReturnAtQuadraturePoints()
139 if (M_quadrature != 0)
152 void update (
const UInt& iElement)
158 M_returnedValues[q] = M_vector[iElement][q];
167 for (
UInt iDim (0); iDim < FieldDim; ++iDim)
169 M_returnedValues[q][iDim] = 0.0;
175 void showValues()
const 177 std::cout <<
" Values : " << std::endl;
181 std::cout << M_returnedValues[i] << std::endl;
186 static void display (std::ostream& out = std::cout)
188 out <<
"returned[" << FieldDim <<
"]";
198 template<
typename CFEType >
199 void setGlobalCFE (
const CFEType* )
203 template<
typename CFEType >
204 void setTestCFE (
const CFEType* )
208 template<
typename CFEType >
209 void setSolutionCFE (
const CFEType* )
215 if (M_quadrature != 0)
220 M_currentFE.setQuadratureRule (qr);
221 M_returnedValues.resize (qr.nbQuadPt() );
231 return_Type value_q (
const UInt& q)
const 233 return M_returnedValues[q];
237 return_Type value_qi (
const UInt& q,
const UInt& )
const 239 return M_returnedValues[q];
243 return_Type value_qij (
const UInt& q,
const UInt& ,
const UInt& )
const 245 return M_returnedValues[q];
256 EvaluationReturnAtQuadraturePoints();
260 fespacePtr_Type M_fespace;
261 vector_Type M_vector;
264 ETCurrentFE<SpaceDim, 1> M_currentFE;
266 std::vector<return_Type> M_returnedValues;
281 template<
typename MeshType,
typename MapType,
UInt SpaceDim>
282 class EvaluationReturnAtQuadraturePoints<MeshType, MapType, SpaceDim, 1>
294 typedef ETFESpace<MeshType, MapType, SpaceDim, 1> fespace_Type;
297 typedef std::shared_ptr<fespace_Type> fespacePtr_Type;
300 typedef std::vector<std::vector<VectorSmall<1>>> vector_Type;
324 EvaluationReturnAtQuadraturePoints (
const EvaluationReturnAtQuadraturePoints<MeshType, MapType, SpaceDim, 1>& evaluation)
326 M_fespace ( evaluation.M_fespace),
327 M_vector ( evaluation.M_vector ),
330 M_currentFE (evaluation.M_currentFE),
331 M_returnedValues (evaluation.M_returnedValues)
333 if (evaluation.M_quadrature != 0)
341 explicit EvaluationReturnAtQuadraturePoints (
const ExpressionReturnAtQuadraturePoints<MeshType, MapType, SpaceDim, 1>& expression)
343 M_fespace ( expression.fespace() ),
344 M_vector ( expression.vector() ),
346 M_currentFE (M_fespace->refFE(), M_fespace->geoMap() ),
351 ~EvaluationReturnAtQuadraturePoints()
353 if (M_quadrature != 0)
366 void update (
const UInt& iElement)
371 M_returnedValues[q] = M_vector[iElement][q](0);
380 M_returnedValues[q] = 0.0;
385 void showValues()
const 387 std::cout <<
" Values : " << std::endl;
391 std::cout << M_returnedValues[i] << std::endl;
396 static void display (std::ostream& out = std::cout)
398 out <<
"returned[1]";
408 template<
typename CFEType >
409 void setGlobalCFE (
const CFEType* )
413 template<
typename CFEType >
414 void setTestCFE (
const CFEType* )
418 template<
typename CFEType >
419 void setSolutionCFE (
const CFEType* )
425 if (M_quadrature != 0)
430 M_currentFE.setQuadratureRule (qr);
431 M_returnedValues.resize (qr.nbQuadPt() );
441 return_Type value_q (
const UInt& q)
const 443 return M_returnedValues[q];
447 return_Type value_qi (
const UInt& q,
const UInt& )
const 449 return M_returnedValues[q];
453 return_Type value_qij (
const UInt& q,
const UInt& ,
const UInt& )
const 455 return M_returnedValues[q];
466 EvaluationReturnAtQuadraturePoints();
471 fespacePtr_Type M_fespace;
472 vector_Type M_vector;
476 ETCurrentFE<SpaceDim, 1> M_currentFE;
479 std::vector<return_Type> M_returnedValues;
484 template<
typename MeshType,
typename MapType,
UInt SpaceDim,
UInt FieldDim>
486 EvaluationReturnAtQuadraturePoints<MeshType, MapType, SpaceDim, FieldDim>::
487 S_globalUpdateFlag = ET_UPDATE_NONE;
489 template<
typename MeshType,
typename MapType,
UInt SpaceDim,
UInt FieldDim>
491 EvaluationReturnAtQuadraturePoints<MeshType, MapType, SpaceDim, FieldDim>::
492 S_testUpdateFlag = ET_UPDATE_NONE;
494 template<
typename MeshType,
typename MapType,
UInt SpaceDim,
UInt FieldDim>
496 EvaluationReturnAtQuadraturePoints<MeshType, MapType, SpaceDim, FieldDim>::
497 S_solutionUpdateFlag = ET_UPDATE_NONE;
501 template<
typename MeshType,
typename MapType,
UInt SpaceDim>
503 EvaluationReturnAtQuadraturePoints<MeshType, MapType, SpaceDim, 1>::
504 S_globalUpdateFlag = ET_UPDATE_NONE;
506 template<
typename MeshType,
typename MapType,
UInt SpaceDim>
508 EvaluationReturnAtQuadraturePoints<MeshType, MapType, SpaceDim, 1>::
509 S_testUpdateFlag = ET_UPDATE_NONE;
511 template<
typename MeshType,
typename MapType,
UInt SpaceDim>
513 EvaluationReturnAtQuadraturePoints<MeshType, MapType, SpaceDim, 1>::
514 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)
double Real
Generic real data.
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)