![Logo](MoFEMLogo.png) |
| v0.14.0
|
Go to the documentation of this file.
16 : moab(moab), meshSet(meshset), tagId(NULL), tagSpaceData(NULL),
17 tagFieldContinuityData(NULL), tagNbCoeffData(NULL), tagName(NULL),
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);
36 CHKERRABORT(PETSC_COMM_SELF,
ierr);
40 CHKERRABORT(PETSC_COMM_SELF,
ierr);
44 CHKERR moab.tag_get_handle(
"_FieldName", th_field_name);
48 Tag th_field_name_data_name_prefix;
49 CHKERR moab.tag_get_handle(
"_FieldName_DataNamePrefix",
50 th_field_name_data_name_prefix);
57 std::string Tag_rank_name =
"_Field_Rank_" +
getName();
62 auto get_all_tags = [&]() {
66 std::string tag_approximation_order_name =
"_App_Order_" +
getName();
67 rval =
moab.tag_get_handle(tag_approximation_order_name.c_str(), 1,
69 MB_TAG_CREAT | MB_TAG_SPARSE, &def_approx_order);
70 if (
rval == MB_ALREADY_ALLOCATED)
75 std::string tag_data_name = name_data_prefix +
getName();
76 const int def_len = 0;
78 tag_data_name.c_str(), def_len, MB_TYPE_DOUBLE,
th_FieldData,
79 MB_TAG_CREAT | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
80 if (
rval == MB_ALREADY_ALLOCATED)
84 std::string tag_data_name_verts = name_data_prefix +
getName() +
"_V";
86 if (
rval == MB_SUCCESS)
94 def_vert_data.clear();
98 &*def_vert_data.begin());
99 if (
rval == MB_ALREADY_ALLOCATED)
107 auto get_all_tags_deprecated = [&]() {
111 std::string tag_approximation_order_name =
"_App_Order_" +
getName();
112 rval =
moab.tag_get_handle(tag_approximation_order_name.c_str(), 1,
114 MB_TAG_CREAT | MB_TAG_SPARSE, &def_approx_order);
115 if (
rval == MB_ALREADY_ALLOCATED)
120 std::string tag_data_name = name_data_prefix +
getName();
121 const int def_len = 0;
123 tag_data_name.c_str(), def_len, MB_TYPE_DOUBLE,
th_FieldData,
124 MB_TAG_CREAT | MB_TAG_VARLEN | MB_TAG_SPARSE, NULL);
125 if (
rval == MB_ALREADY_ALLOCATED)
129 std::string tag_data_name_verts = name_data_prefix +
getName() +
"V";
131 if (
rval == MB_SUCCESS)
139 def_vert_data.clear();
143 &*def_vert_data.begin());
144 if (
rval == MB_ALREADY_ALLOCATED)
157 ierr = get_all_tags();
158 CHKERRABORT(PETSC_COMM_SELF,
ierr);
160 ierr = get_all_tags_deprecated();
161 CHKERRABORT(PETSC_COMM_SELF,
ierr);
166 auto reset_entity_order_table = [&]() {
167 for (
int tt = 0; tt != MBMAXTYPE; ++tt)
171 auto set_continuos_entity_order_table = [&]() {
177 forderTable[MBVERTEX] = [](
int P) ->
int {
return (
P > 0) ? 1 : 0; };
234 forderTable[MBVERTEX] = [](
int P) ->
int {
return (
P > 0) ? 1 : 0; };
253 THROW_MESSAGE(
"unknown approximation space or not yet implemented");
259 forderTable[MBVERTEX] = [](
int P) ->
int {
return (
P > 0) ? 1 : 0; };
322 THROW_MESSAGE(
"unknown approximation space or not yet implemented");
326 for (
int ee = 0; ee < MBMAXTYPE; ee++) {
337 for (EntityType
t = MBVERTEX;
t < MBMAXTYPE;
t++)
346 auto set_discontinuous_entity_order_table = [&]() {
388 THROW_MESSAGE(
"unknown approximation space or not implemented");
392 THROW_MESSAGE(
"unknown approximation space or not yet implemented");
449 THROW_MESSAGE(
"unknown approximation space or not yet implemented");
453 for (
int ee = 0; ee < MBMAXTYPE; ee++) {
464 for (EntityType
t = MBVERTEX;
t < MBMAXTYPE;
t++)
473 reset_entity_order_table();
476 set_continuos_entity_order_table();
479 set_discontinuous_entity_order_table();
486 CHKERRABORT(PETSC_COMM_SELF,
ierr);
492 for (
auto t = MBVERTEX;
t != MBMAXTYPE; ++
t) {
495 int nb_last_order_dofs = 0;
496 const int rank = (*tagNbCoeffData);
502 const int diff_oo = nb_order_dofs - nb_last_order_dofs;
506 for (
int dd = 0;
dd < diff_oo; ++
dd)
507 for (
int rr = 0; rr != rank; ++rr, ++DD)
512 nb_last_order_dofs = nb_order_dofs;
527 os << e.
getNameRef() <<
" field_id " << e.
getId().to_ulong() <<
" space "
537 const boost::shared_ptr<FieldEntity> &ent_field_ptr,
538 const boost::shared_ptr<EntFiniteElement> &ent_fe_ptr)
539 : byWhat(0), entFieldPtr(ent_field_ptr), entFePtr(ent_fe_ptr) {}
545 << *e.
entFePtr->getFiniteElementPtr();
auto getSpaceName() const
Get field approximation space.
unsigned int byWhat
see options ByWhat
std::ostream & operator<<(std::ostream &os, const EntitiesFieldData::EntData &e)
static const bool IamNotPartitioned
TagType tagFieldDataVertsType
FieldCoefficientsNumber getNbOfCoeffs() const
Get number of field coefficients.
#define NBVOLUMEHEX_DEMKOWICZ_HCURL(P)
#define NBEDGE_H1(P)
Numer of base function on edge for H1 space.
#define NBVOLUMETET_DEMKOWICZ_HCURL(P)
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
@ L2
field with C-1 continuity
FieldSpace * tagSpaceData
tag keeps field space
MoFEMErrorCode rebuildDofsOrderMap()
FieldContinuity * tagFieldContinuityData
tag keeps field continuity
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Tag th_FieldData
Tag storing field values on entity in the field.
static MoFEMErrorCode getFileVersion(moab::Interface &moab, Version &version)
Get database major version.
#define NBVOLUMETET_H1(P)
Number of base functions on tetrahedron for H1 space.
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
std::string getName() const
Get field name.
#define NBVOLUMETET_L2(P)
Number of base functions on tetrahedron for L2 space.
#define NBFACEQUAD_DEMKOWICZ_HCURL(P)
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
auto getApproxBaseName() const
Get approximation base.
Provide data structure for (tensor) field approximation.
@ USER_BASE
user implemented approximation base
DeprecatedCoreInterface Interface
int tagNameSize
number of bits necessary to keep field name
const BitFieldId & getId() const
Get unique field id.
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
static const bool IamNotPartitioned
#define CHKERR
Inline error check.
implementation of Data Operators for Forces and Sources
#define NBFACEQUAD_L2(P)
Number of base functions on quad for L2 space.
boost::string_ref getNameRef() const
Get string reference to field name.
#define NBVOLUMEHEX_DEMKOWICZ_HDIV(P)
Tag th_FieldDataVerts
Tag storing field values on vertices in the field.
#define NBEDGE_L2(P)
Number of base functions on edge fro L2 space.
#define NBFACETRI_DEMKOWICZ_HDIV(P)
FieldApproximationBase * tagBaseData
tag keeps field base
#define NBVOLUMETET_DEMKOWICZ_HDIV(P)
auto getContinuityName() const
Get field space continuity name.
#define NBEDGE_DEMKOWICZ_HCURL(P)
const boost::shared_ptr< EntFiniteElement > entFePtr
finite element entity
const void * tagName
tag keeps name of the field
FieldCoefficientsNumber * tagNbCoeffData
#define NBFACEQUAD_H1(P)
Number of base functions on quad for H1 space.
constexpr double t
plate stiffness
#define NBFACETRI_DEMKOWICZ_HCURL(P)
@ AINSWORTH_BERNSTEIN_BEZIER_BASE
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
FieldEntityEntFiniteElementAdjacencyMap of mofem finite element and entities.
#define NBEDGE_AINSWORTH_HCURL(P)
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
#define NBFACETRI_H1(P)
Number of base function on triangle for H1 space.
Tag th_AppOrder
Tag storing approximation order on entity.
FieldEntityEntFiniteElementAdjacencyMap(const boost::shared_ptr< FieldEntity > &ent_field_ptr, const boost::shared_ptr< EntFiniteElement > &ent_fe_ptr)
Field(moab::Interface &moab, const EntityHandle meshset)
constructor for moab field
int ApproximationOrder
Approximation on the entity.
const boost::shared_ptr< FieldEntity > entFieldPtr
field entity
#define NBFACEQUAD_DEMKOWICZ_HDIV(P)
static const bool IamNotPartitioned
#define NBVOLUMETET_AINSWORTH_HCURL(P)
#define NBFACETRI_L2(P)
Number of base functions on triangle for L2 space.
@ DISCONTINUOUS
Broken continuity (No effect on L2 space)
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
@ AINSWORTH_LEGENDRE_BASE
Ainsworth Cole (Legendre) approx. base .
@ HCURL
field with continuous tangents
#define NBVOLUMETET_AINSWORTH_HDIV(P)
#define NBVOLUMEHEX_H1(P)
Number of base functions on hex for H1 space.
const void * tagNamePrefixData
tag keeps name prefix of the field
#define NBFACETRI_AINSWORTH_HCURL(P)
#define NBVOLUMEPRISM_H1(P)
Number of base functions on prism for H1 space.
FieldBitNumber getBitNumberCalculate() const
Calculate number of set bit in Field ID. Each field has uid, get getBitNumber get number of bit set f...
#define NBFACETRI_AINSWORTH_HDIV(P)
@ CONTINUOUS
Regular field.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
@ HDIV
field with continuous normal traction
FieldOrderTable forderTable
nb. DOFs table for entities
EntityHandle meshSet
keeps entities for this meshset
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define NBVOLUMEHEX_L2(P)
Number of base functions on hexahedron for L2 space.
@ NOFIELD
scalar or vector of scalars describe (no true field)
BitFieldId * tagId
Tag field rank.