20 #ifndef __HO_DATA_OPERATORS_HPP__
21 #define __HO_DATA_OPERATORS_HPP__
43 boost::shared_ptr<MatrixDouble>
jacPtr;
67 boost::shared_ptr<MatrixDouble> inv_jac_ptr)
96 boost::shared_ptr<MatrixDouble> inv_jac_ptr)
101 "Pointer for invJacPtr not allocated");
142 "Pointer for detPtr not allocated");
160 boost::shared_ptr<VectorDouble> det_ptr,
161 boost::shared_ptr<MatrixDouble> jac_ptr)
186 boost::shared_ptr<MatrixDouble> jac_inv_ptr)
194 "Pointer for jacPtr not allocated");
267 boost::shared_ptr<MatrixDouble> normals_at_gauss_pts =
nullptr)
286 boost::shared_ptr<MatrixDouble> tangent_at_pts =
nullptr)
305 boost::shared_ptr<MatrixDouble> normals_at_pts =
nullptr,
306 boost::shared_ptr<MatrixDouble> tangent1_at_pts =
nullptr,
307 boost::shared_ptr<MatrixDouble> tangent2_at_pts =
nullptr)
311 if (normals_at_pts || tangent1_at_pts || tangent2_at_pts)
312 if (normals_at_pts && tangent1_at_pts && tangent2_at_pts)
314 "All elements in constructor have to set pointer");
336 std::string field_name,
337 boost::shared_ptr<MatrixDouble> tangents_at_pts =
nullptr)
357 boost::shared_ptr<VectorDouble> det_jac_ptr,
const FieldSpace space =
L2)
371 auto &base_fun = data.
getN(base);
372 auto &diff_base_fun = data.
getDiffN(base);
376 const auto nb_base_fun = base_fun.size2();
377 const auto nb_int_pts = base_fun.size1();
379 if (nb_int_pts != det_vec.size())
381 "Number of integration pts in detJacPtr does not mush "
382 "number of integration pts in base function");
384 auto get_row = [](
auto &
m,
auto gg) {
385 return ublas::matrix_row<decltype(m)>(
m, gg);
388 for (
auto gg = 0; gg != nb_int_pts; ++gg)
389 get_row(base_fun) /= det_vec[gg];
391 if (diff_base_fun.size1() == nb_int_pts) {
392 for (
auto gg = 0; gg != nb_int_pts; ++gg)
393 get_row(diff_base_fun) /= det_vec[gg];
399 if (this->getFEDim() == 3) {
419 }
else if (this->getFEDim() == 2) {
436 }
else if (this->getFEDim() == 1) {
461 template <
typename E>
463 bool hdiv,
bool l2) {
465 auto material_grad_mat = boost::make_shared<MatrixDouble>();
466 auto material_det_vec = boost::make_shared<VectorDouble>();
467 auto material_inv_grad_mat = boost::make_shared<MatrixDouble>();
468 e.getOpPtrVector().push_back(
471 material_grad_mat, material_det_vec, material_inv_grad_mat));
472 e.getOpPtrVector().push_back(
new OpSetHOWeights(material_det_vec));
474 e.getOpPtrVector().push_back(
477 e.getOpPtrVector().push_back(
481 HDIV, material_det_vec, material_grad_mat));
482 e.getOpPtrVector().push_back(
486 e.getOpPtrVector().push_back(
488 e.getOpPtrVector().push_back(
494 template <
typename E>
498 e.meshPositionsFieldName =
"none";
502 e.getOpPtrVector().push_back(
506 e.getOpPtrVector().push_back(
ForcesAndSourcesCore::UserDataOperator UserDataOperator
FieldApproximationBase
approximation base
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ USER_BASE
user implemented approximation base
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
FieldSpace
approximation spaces
@ L2
field with C-1 continuity
@ HCURL
field with continuous tangents
@ HDIV
field with continuous normal traction
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_DATA_INCONSISTENCY
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
UBlasMatrix< double > MatrixDouble
implementation of Data Operators for Forces and Sources
MoFEMErrorCode addHOOpsFace3D(const std::string field, E &e, bool hcurl, bool hdiv)
MoFEMErrorCode addHOOpsVol(const std::string field, E &e, bool h1, bool hcurl, bool hdiv, bool l2)
FTensor::Index< 'm', 3 > m
bool & doVertices
\deprectaed If false skip vertices
bool & doEdges
\deprectaed If false skip edges
default operator for EDGE element
Data on single entity (This is passed as argument to DataOperator::doWork)
MatrixDouble & getDiffN(const FieldApproximationBase base)
get derivatives of base functions
MatrixDouble & getN(const FieldApproximationBase base)
get base functions this return matrix (nb. of rows is equal to nb. of Gauss pts, nb....
default operator for TRI element
structure to get information form mofem into EntitiesFieldData
Calculate HO coordinates at gauss points.
OpCalculateHOCoords(const std::string field_name)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< MatrixDouble > jacPtr
Calculate jacobian for face element.
Calculate jacobian on Hex or other volume which is not simplex.
boost::shared_ptr< MatrixDouble > jacPtr
OpCalculateHOJacVolume(boost::shared_ptr< MatrixDouble > jac_ptr)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Get field gradients at integration pts for scalar filed rank 0, i.e. vector field.
Calculate normals at Gauss points of triangle element.
OpGetHONormalsOnFace(std::string field_name)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Calculate tangent vector on edge form HO geometry approximation.
boost::shared_ptr< MatrixDouble > tangentsAtPts
OpGetHOTangentsOnEdge(std::string field_name, boost::shared_ptr< MatrixDouble > tangents_at_pts=nullptr)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
Scale base functions by inverses of measure of element.
OpScaleBaseBySpaceInverseOfMeasure(boost::shared_ptr< VectorDouble > det_jac_ptr, const FieldSpace space=L2)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
boost::shared_ptr< VectorDouble > detJacPtr
Set inverse jacobian to base functions.
OpSetHOInvJacToScalarBases(const FieldSpace space, boost::shared_ptr< MatrixDouble > inv_jac_ptr)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< MatrixDouble > invJacPtr
transform local reference derivatives of shape function to global derivatives if higher order geometr...
boost::shared_ptr< MatrixDouble > invJacPtr
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
OpSetHOInvJacVectorBase(const FieldSpace space, boost::shared_ptr< MatrixDouble > inv_jac_ptr)
MatrixDouble diffHdivInvJac
Set inverse jacobian to base functions.
OpSetHOWeights(boost::shared_ptr< VectorDouble > det_ptr)
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.
boost::shared_ptr< VectorDouble > detPtr
Modify integration weights on face to take in account higher-order geometry.
MoFEMErrorCode doWork(int side, EntityType type, EntitiesFieldData::EntData &data)
Operator for linear form, usually to calculate values on right hand side.