36 #ifndef EVALUATE_QUAD_PT_HPP 37 #define EVALUATE_QUAD_PT_HPP 39 #include <lifev/core/LifeV.hpp> 41 #include <lifev/core/fem/QuadratureRule.hpp> 42 #include <lifev/eta/fem/ETCurrentFE.hpp> 43 #include <lifev/eta/fem/MeshGeometricMap.hpp> 44 #include <lifev/eta/fem/QRAdapterBase.hpp> 46 #include <lifev/eta/expression/ExpressionToEvaluation.hpp> 47 #include <lifev/eta/expression/EvaluationPhiI.hpp> 49 #include <lifev/eta/array/ETVectorElemental.hpp> 54 namespace ExpressionAssembly
62 template <
typename MeshType,
typename TestSpaceType,
typename ExpressionType,
typename QRAdapterType>
72 TestSpaceType::field_dim,
84 const QRAdapterType& qrAdapter,
85 const std::shared_ptr<TestSpaceType>& testSpace,
86 const ExpressionType& expression,
87 const UInt offset = 0);
152 ETCurrentFE<TestSpaceType::space_dim, TestSpaceType::field_dim>*
M_testCFE_std;
170 template <
typename MeshType,
typename TestSpaceType,
typename ExpressionType,
typename QRAdapterType>
173 const QRAdapterType& qrAdapter,
174 const std::shared_ptr<TestSpaceType>& testSpace,
175 const ExpressionType& expression,
189 switch (MeshType::geoShape_Type::BasRefSha::S_shape)
192 M_globalCFE_std =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feSegP0, geometricMapFromMesh<MeshType>(), qrAdapter.standardQR() );
193 M_globalCFE_adapted =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feSegP0, geometricMapFromMesh<MeshType>(), qrAdapter.standardQR() );
196 M_globalCFE_std =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feTriaP0, geometricMapFromMesh<MeshType>(), qrAdapter.standardQR() );
197 M_globalCFE_adapted =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feTriaP0, geometricMapFromMesh<MeshType>(), qrAdapter.standardQR() );
200 M_globalCFE_std =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feQuadQ0, geometricMapFromMesh<MeshType>(), qrAdapter.standardQR() );
201 M_globalCFE_adapted =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feQuadQ0, geometricMapFromMesh<MeshType>(), qrAdapter.standardQR() );
204 M_globalCFE_std =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feTetraP0, geometricMapFromMesh<MeshType>(), qrAdapter.standardQR() );
205 M_globalCFE_adapted =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feTetraP0, geometricMapFromMesh<MeshType>(), qrAdapter.standardQR() );
208 M_globalCFE_std =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feHexaQ0, geometricMapFromMesh<MeshType>(), qrAdapter.standardQR() );
209 M_globalCFE_adapted =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feHexaQ0, geometricMapFromMesh<MeshType>(), qrAdapter.standardQR() );
212 ERROR_MSG (
"Unrecognized element shape");
221 template <
typename MeshType,
typename TestSpaceType,
typename ExpressionType,
typename QRAdapterType>
235 switch (MeshType::geoShape_Type::BasRefSha::S_shape)
238 M_globalCFE_std =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feSegP0, geometricMapFromMesh<MeshType>(), integrator.M_qrAdapter.standardQR() );
239 M_globalCFE_adapted =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feSegP0, geometricMapFromMesh<MeshType>(), integrator.M_qrAdapter.standardQR() );
242 M_globalCFE_std =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feTriaP0, geometricMapFromMesh<MeshType>(), integrator.M_qrAdapter.standardQR() );
243 M_globalCFE_adapted =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feTriaP0, geometricMapFromMesh<MeshType>(), integrator.M_qrAdapter.standardQR() );
246 M_globalCFE_std =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feQuadQ0, geometricMapFromMesh<MeshType>(), integrator.M_qrAdapter.standardQR() );
247 M_globalCFE_adapted =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feQuadQ0, geometricMapFromMesh<MeshType>(), integrator.M_qrAdapter.standardQR() );
250 M_globalCFE_std =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feTetraP0, geometricMapFromMesh<MeshType>(), integrator.M_qrAdapter.standardQR() );
251 M_globalCFE_adapted =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feTetraP0, geometricMapFromMesh<MeshType>(), integrator.M_qrAdapter.standardQR() );
254 M_globalCFE_std =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feHexaQ0, geometricMapFromMesh<MeshType>(), integrator.M_qrAdapter.standardQR() );
255 M_globalCFE_adapted =
new ETCurrentFE<MeshType::S_geoDimensions, 1> (
feHexaQ0, geometricMapFromMesh<MeshType>(), integrator.M_qrAdapter.standardQR() );
258 ERROR_MSG (
"Unrecognized element shape");
260 M_evaluation.setQuadrature (integrator.M_qrAdapter.standardQR() );
266 template <
typename MeshType,
typename TestSpaceType,
typename ExpressionType,
typename QRAdapterType>
280 template <
typename MeshType,
typename TestSpaceType,
typename ExpressionType,
typename QRAdapterType>
283 check (std::ostream& out)
285 out <<
" Checking the integration : " << std::endl;
288 out <<
" Elemental vector : " << std::endl;
289 M_elementalVector.showMe (out);
293 template <
typename MeshType,
typename TestSpaceType,
typename ExpressionType,
typename QRAdapterType>
296 evaluate (std::vector<std::vector<VectorSmall<TestSpaceType::field_dim>>>& vec)
298 UInt nbElements (M_mesh->numElements() );
299 UInt nbQuadPt_std (M_qrAdapter.standardQR().nbQuadPt() );
300 UInt nbTestDof (M_testSpace->refFE().nbDof() );
303 bool isPreviousAdapted (
true);
305 for (UInt iElement (0); iElement < nbElements; ++iElement)
309 M_qrAdapter.update (iElement);
312 if (isPreviousAdapted)
314 M_evaluation.setQuadrature ( M_qrAdapter.standardQR() );
315 M_evaluation.setGlobalCFE ( M_globalCFE_std );
316 M_evaluation.setTestCFE ( M_testCFE_std );
318 isPreviousAdapted =
false;
322 M_globalCFE_std->update (M_mesh->element (iElement), evaluation_Type::S_globalUpdateFlag | ET_UPDATE_WDET);
323 M_testCFE_std->update (M_mesh->element (iElement), evaluation_Type::S_testUpdateFlag);
326 M_evaluation.update (iElement);
328 for (UInt iQuadPt (0); iQuadPt < nbQuadPt_std; ++iQuadPt)
330 vec[iElement][iQuadPt] = M_evaluation.value_qi (iQuadPt, 0);
void evaluate(std::vector< std::vector< VectorSmall< TestSpaceType::field_dim >>> &vec)
Method that performs the assembly.
ETCurrentFE< MeshType::S_geoDimensions, 1 > * M_globalCFE_adapted
const ReferenceFEScalar feHexaQ0("Lagrange Q0 on a hexaedra", FE_Q0_3D, HEXA, 0, 0, 0, 1, 1, 3, fct_Q0_3D, derfct_Q0_3D, der2fct_Q0_3D, refcoor_Q0_3D, STANDARD_PATTERN, &feQuadQ0, &lagrangianTransform)
class ETVectorElemental A class for describing an elemental vector
void check(std::ostream &out=std::cout)
Ouput method.
const ReferenceFEScalar feSegP0("Lagrange P0 on a segment", FE_P0_1D, LINE, 0, 1, 0, 0, 1, 1, fct_P0_1D, derfct_P0_1D, der2fct_P0_1D, refcoor_P0_1D, STANDARD_PATTERN, &fePointP0, &lagrangianTransform)
ETVectorElemental M_elementalVector
EvaluateAtQuadraturePoint(const IntegrateVectorElement< MeshType, TestSpaceType, ExpressionType, QRAdapterType > &integrator)
Copy constructor.
const ReferenceFEScalar feTetraP0("Lagrange P0 on a tetraedra", FE_P0_3D, TETRA, 0, 0, 0, 1, 1, 3, fct_P0_3D, derfct_P0_3D, der2fct_P0_3D, refcoor_P0_3D, STANDARD_PATTERN, &feTriaP0, &lagrangianTransform)
evaluation_Type M_evaluation
const ReferenceFEScalar feTriaP0("Lagrange P0 on a triangle", FE_P0_2D, TRIANGLE, 0, 0, 1, 0, 1, 2, fct_P0_2D, derfct_P0_2D, der2fct_P0_2D, refcoor_P0_2D, STANDARD_PATTERN, &feSegP0, &lagrangianTransform)
EvaluateAtQuadraturePoint()
class ExpressionToEvaluation A class to pass from an Expression (Tree) to the corresponding Evaluatio...
ExpressionToEvaluation< ExpressionType, TestSpaceType::field_dim, 0, MeshType::S_geoDimensions >::evaluation_Type evaluation_Type
Type of the Evaluation.
void operator>>(std::vector< std::vector< VectorSmall< TestSpaceType::field_dim >>> &vector)
Operator wrapping the addTo method.
~EvaluateAtQuadraturePoint()
Destructor.
std::shared_ptr< TestSpaceType > M_testSpace
The class to actually perform the loop over the elements to assemble a vector.
const ReferenceFEScalar feQuadQ0("Lagrange Q0 on a quadrangle", FE_Q0_2D, QUAD, 0, 0, 1, 0, 1, 2, fct_Q0_2D, derfct_Q0_2D, der2fct_Q0_2D, refcoor_Q0_2D, STANDARD_PATTERN, &feSegP0, &lagrangianTransform)
ETCurrentFE< TestSpaceType::space_dim, TestSpaceType::field_dim > * M_testCFE_std
ETCurrentFE< MeshType::S_geoDimensions, 1 > * M_globalCFE_std
QRAdapterType M_qrAdapter
EvaluateAtQuadraturePoint(const std::shared_ptr< MeshType > &mesh, const QRAdapterType &qrAdapter, const std::shared_ptr< TestSpaceType > &testSpace, const ExpressionType &expression, const UInt offset=0)
Full data constructor.
ETCurrentFE< TestSpaceType::space_dim, TestSpaceType::field_dim > * M_testCFE_adapted
std::shared_ptr< MeshType > M_mesh
uint32_type UInt
generic unsigned integer (used mainly for addressing)