17 : moab(moab), meshSet(meshset), tagId(NULL), tagSpaceData(NULL),
18 tagNbCoeffData(NULL), tagName(NULL), tagNameSize(0) {
20 auto get_tag_data_ptr = [&](
const auto name,
auto &tag_data) {
24 CHKERR moab.tag_get_by_ptr(
th, &meshset, 1, (
const void **)&tag_data);
29 ierr = get_tag_data_ptr(
"_FieldId",
tagId);
30 CHKERRABORT(PETSC_COMM_SELF,
ierr);
33 CHKERRABORT(PETSC_COMM_SELF,
ierr);
37 CHKERRABORT(PETSC_COMM_SELF,
ierr);
41 CHKERR moab.tag_get_handle(
"_FieldName", th_field_name);
45 Tag th_field_name_data_name_prefix;
46 CHKERR moab.tag_get_handle(
"_FieldName_DataNamePrefix",
47 th_field_name_data_name_prefix);
54 std::string Tag_rank_name =
"_Field_Rank_" +
getName();
59 auto get_all_tags = [&]() {
63 std::string tag_approximation_order_name =
"_App_Order_" +
getName();
64 rval =
moab.tag_get_handle(tag_approximation_order_name.c_str(), 1,
66 MB_TAG_CREAT | MB_TAG_SPARSE, &def_approx_order);
67 if (
rval == MB_ALREADY_ALLOCATED)
72 std::string tag_data_name = name_data_prefix +
getName();
73 const int def_len = 0;
75 tag_data_name.c_str(), def_len, MB_TYPE_DOUBLE,
th_FieldData,
76 MB_TAG_CREAT | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
77 if (
rval == MB_ALREADY_ALLOCATED)
81 std::string tag_data_name_verts = name_data_prefix +
getName() +
"_V";
83 if (
rval == MB_SUCCESS)
91 def_vert_data.clear();
95 &*def_vert_data.begin());
96 if (
rval == MB_ALREADY_ALLOCATED)
104 auto get_all_tags_deprecated = [&]() {
108 std::string tag_approximation_order_name =
"_App_Order_" +
getName();
109 rval =
moab.tag_get_handle(tag_approximation_order_name.c_str(), 1,
111 MB_TAG_CREAT | MB_TAG_SPARSE, &def_approx_order);
112 if (
rval == MB_ALREADY_ALLOCATED)
117 std::string tag_data_name = name_data_prefix +
getName();
118 const int def_len = 0;
120 tag_data_name.c_str(), def_len, MB_TYPE_DOUBLE,
th_FieldData,
121 MB_TAG_CREAT | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
122 if (
rval == MB_ALREADY_ALLOCATED)
126 std::string tag_data_name_verts = name_data_prefix +
getName() +
"V";
128 if (
rval == MB_SUCCESS)
136 def_vert_data.clear();
140 &*def_vert_data.begin());
141 if (
rval == MB_ALREADY_ALLOCATED)
154 ierr = get_all_tags();
155 CHKERRABORT(PETSC_COMM_SELF,
ierr);
157 ierr = get_all_tags_deprecated();
158 CHKERRABORT(PETSC_COMM_SELF,
ierr);
163 auto reset_entity_order_table = [&]() {
164 for (
int tt = 0; tt != MBMAXTYPE; ++tt)
168 auto set_entity_order_table = [&]() {
174 forderTable[MBVERTEX] = [](
int P) ->
int {
return (P > 0) ? 1 : 0; };
231 forderTable[MBVERTEX] = [](
int P) ->
int {
return (P > 0) ? 1 : 0; };
250 THROW_MESSAGE(
"unknown approximation space or not yet implemented");
256 forderTable[MBVERTEX] = [](
int P) ->
int {
return (P > 0) ? 1 : 0; };
319 THROW_MESSAGE(
"unknown approximation space or not yet implemented");
323 for (
int ee = 0; ee < MBMAXTYPE; ee++) {
343 reset_entity_order_table();
344 set_entity_order_table();
346 CHKERRABORT(PETSC_COMM_SELF,
ierr);
352 for (
auto t = MBVERTEX;
t != MBMAXTYPE; ++
t) {
355 int nb_last_order_dofs = 0;
356 const int rank = (*tagNbCoeffData);
362 const int diff_oo = nb_order_dofs - nb_last_order_dofs;
366 for (
int dd = 0; dd < diff_oo; ++dd)
367 for (
int rr = 0; rr != rank; ++rr, ++DD)
372 nb_last_order_dofs = nb_order_dofs;
387 os << e.
getNameRef() <<
" field_id " << e.
getId().to_ulong() <<
" space "
397 const boost::shared_ptr<FieldEntity> &ent_field_ptr,
398 const boost::shared_ptr<EntFiniteElement> &ent_fe_ptr)
399 : byWhat(0), entFieldPtr(ent_field_ptr), entFePtr(ent_fe_ptr) {}
405 << *e.
entFePtr->getFiniteElementPtr();
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ USER_BASE
user implemented approximation base
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
@ L2
field with C-1 continuity
@ NOFIELD
scalar or vector of scalars describe (no true field)
@ HCURL
field with continuous tangents
@ HDIV
field with continuous normal traction
static const char *const FieldSpaceNames[]
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
static const char *const ApproximationBaseNames[]
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
#define NBFACEQUAD_DEMKOWICZ_HDIV(P)
#define NBEDGE_DEMKOWICZ_HCURL(P)
#define NBVOLUMETET_H1(P)
Number of base functions on tetrahedron for H1 space.
#define NBVOLUMETET_AINSWORTH_HDIV(P)
#define NBVOLUMEHEX_DEMKOWICZ_HCURL(P)
#define NBFACEQUAD_H1(P)
Number of base functions on quad for H1 space.
#define NBVOLUMETET_AINSWORTH_HCURL(P)
#define NBFACETRI_AINSWORTH_HCURL(P)
#define NBFACEQUAD_L2(P)
Number of base functions on quad for L2 space.
#define NBVOLUMEHEX_H1(P)
Number of base functions on hex for H1 space.
#define NBFACETRI_L2(P)
Number of base functions on triangle for L2 space.
#define NBVOLUMETET_DEMKOWICZ_HDIV(P)
#define NBVOLUMEPRISM_H1(P)
Number of base functions on prism for H1 space.
#define NBVOLUMEHEX_DEMKOWICZ_HDIV(P)
#define NBFACEQUAD_DEMKOWICZ_HCURL(P)
#define NBEDGE_H1(P)
Numer of base function on edge for H1 space.
#define NBFACETRI_DEMKOWICZ_HDIV(P)
#define NBEDGE_L2(P)
Number of base functions on edge fro L2 space.
#define NBVOLUMEHEX_L2(P)
Number of base functions on hexahedron for L2 space.
#define NBVOLUMETET_DEMKOWICZ_HCURL(P)
#define NBFACETRI_DEMKOWICZ_HCURL(P)
#define NBEDGE_AINSWORTH_HCURL(P)
#define NBFACETRI_H1(P)
Number of base function on triangle for H1 space.
#define NBFACETRI_AINSWORTH_HDIV(P)
#define NBVOLUMETET_L2(P)
Number of base functions on tetrahedron for L2 space.
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
int ApproximationOrder
Approximation on the entity.
implementation of Data Operators for Forces and Sources
std::ostream & operator<<(std::ostream &os, const EntitiesFieldData::EntData &e)
constexpr double t
plate stiffness
FieldEntityEntFiniteElementAdjacencyMap of mofem finite element and entities.
const boost::shared_ptr< FieldEntity > entFieldPtr
field entity
unsigned int byWhat
see options ByWhat
FieldEntityEntFiniteElementAdjacencyMap(const boost::shared_ptr< FieldEntity > &ent_field_ptr, const boost::shared_ptr< EntFiniteElement > &ent_fe_ptr)
const boost::shared_ptr< EntFiniteElement > entFePtr
finite element entity
Provide data structure for (tensor) field approximation.
FieldCoefficientsNumber getNbOfCoeffs() const
Get number of field coefficients.
const void * tagNamePrefixData
tag keeps name prefix of the field
FieldOrderTable forderTable
nb. DOFs table for entities
const void * tagName
tag keeps name of the field
int tagNameSize
number of bits necessary to keep field name
std::string getName() const
Get field name.
FieldApproximationBase getApproxBase() const
Get approximation base.
EntityHandle meshSet
keeps entities for this meshset
FieldSpace * tagSpaceData
tag keeps field space
FieldBitNumber getBitNumberCalculate() const
Calculate number of set bit in Field ID. Each field has uid, get getBitNumber get number of bit set f...
Tag th_FieldData
Tag storing field values on entity in the field.
MoFEMErrorCode rebuildDofsOrderMap()
FieldCoefficientsNumber * tagNbCoeffData
BitFieldId * tagId
Tag field rank.
FieldSpace getSpace() const
Get field approximation space.
Field(moab::Interface &moab, const EntityHandle meshset)
constructor for moab field
Tag th_FieldDataVerts
Tag storing field values on vertices in the field.
FieldApproximationBase * tagBaseData
tag keeps field base
TagType tagFieldDataVertsType
Tag th_AppOrder
Tag storing approximation order on entity.
boost::string_ref getNameRef() const
Get string reference to field name.
const BitFieldId & getId() const
Get unique field id.
static const bool IamNotPartitioned
static const bool IamNotPartitioned
static const bool IamNotPartitioned
static MoFEMErrorCode getFileVersion(moab::Interface &moab, Version &version)
Get database major version.