v0.15.0
Loading...
Searching...
No Matches
MoFEM::FiniteElement Struct Reference

Finite element definition. More...

#include "src/multi_indices/FEMultiIndices.hpp"

Collaboration diagram for MoFEM::FiniteElement:
[legend]

Public Member Functions

 FiniteElement (Interface &moab, const EntityHandle _meshset)
 
const UIdgetFEUId () const
 Get finite element uid.
 
BitFEId getId () const
 Get finite element id.
 
EntityHandle getMeshset () const
 Get meshset containing element entities.
 
boost::string_ref getNameRef () const
 Get finite element name.
 
std::string getName () const
 Get finite element name.
 
BitFieldId getBitFieldIdCol () const
 Get field ids on columns.
 
BitFieldId getBitFieldIdRow () const
 Get field ids on rows.
 
BitFieldId getBitFieldIdData () const
 Get field ids on data.
 
unsigned int getBitNumber () const
 Get bit identifying this element.
 

Static Public Member Functions

static Tag getNoFieldTag (moab::Interface &moab, const Field &field)
 Get the tag storing meshset with adjacent entities to finite element.
 
static MoFEMErrorCode setNoFieldTagField (moab::Interface &moab, Range &fe_ents, const Field &field, EntityHandle meshset)
 Set the No Field meshset to finite element entities storing no field adjacencies to it.
 
static MoFEMErrorCode setNoFieldTagField (moab::Interface &moab, std::vector< EntityHandle > &fe_ents, const Field &field, EntityHandle meshset)
 Set the No Field meshset to finite element entities storing no field adjacencies to it.
 
static EntityHandle getNoFieldAdjacencyMeshset (moab::Interface &moab, EntityHandle fe_ent, const Field &field)
 Get the No Field adjacency meshset from finite element entity.
 

Public Attributes

EntityHandle meshset
 meshset stores FE ents
 
BitFEIdtagId
 ptr to tag storing FE id
 
void * tagName
 ptr to tag storing FE name
 
int tagNameSize
 numer of characters in FE name
 
BitFieldIdtag_BitFieldId_col_data
 tag stores col id_id for fields
 
BitFieldIdtag_BitFieldId_row_data
 tag stores row id_id for fields
 
BitFieldIdtag_BitFieldId_data
 tag stores data id_id for fields
 
UId feUId
 
std::array< ElementAdjacencyFunct, MBMAXTYPE > elementAdjacencyTable
 Table of functions retrieving adjacencies for finite element User can alter and change default behavior.
 

Static Private Attributes

static constexpr int ent_shift = 64
 

Friends

std::ostream & operator<< (std::ostream &os, const FiniteElement &e)
 print finite element
 

Detailed Description

Finite element definition.

Definition at line 26 of file FEMultiIndices.hpp.

Constructor & Destructor Documentation

◆ FiniteElement()

MoFEM::FiniteElement::FiniteElement ( Interface & moab,
const EntityHandle _meshset )

Definition at line 388 of file FEMultiIndices.cpp.

389 : meshset(_meshset) {
390 Tag th_FEId;
391 CHK_MOAB_THROW(moab.tag_get_handle("_FEId", th_FEId), "get tag");
393 moab.tag_get_by_ptr(th_FEId, &meshset, 1, (const void **)&tagId),
394 "get tag data");
395 Tag th_FEName;
396 CHK_MOAB_THROW(moab.tag_get_handle("_FEName", th_FEName), "get tag");
397 CHK_MOAB_THROW(moab.tag_get_by_ptr(th_FEName, &meshset, 1,
398 (const void **)&tagName, &tagNameSize),
399 "get tag data");
400 Tag th_FEIdCol, th_FEIdRow, th_FEIdData;
401 CHK_MOAB_THROW(moab.tag_get_handle("_FEIdCol", th_FEIdCol), "get_tag");
402 CHK_MOAB_THROW(moab.tag_get_by_ptr(th_FEIdCol, &meshset, 1,
403 (const void **)&tag_BitFieldId_col_data),
404 "get tag data");
405 CHK_MOAB_THROW(moab.tag_get_handle("_FEIdRow", th_FEIdRow), "get tag");
406 CHK_MOAB_THROW(moab.tag_get_by_ptr(th_FEIdRow, &meshset, 1,
407 (const void **)&tag_BitFieldId_row_data),
408 "get tag data");
409 CHK_MOAB_THROW(moab.tag_get_handle("_FEIdData", th_FEIdData), "get tag");
410 CHK_MOAB_THROW(moab.tag_get_by_ptr(th_FEIdData, &meshset, 1,
411 (const void **)&tag_BitFieldId_data),
412 "get tag data");
413
422
423 feUId = static_cast<UId>(getBitNumber()) << ent_shift;
424}
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
uint128_t UId
Unique Id.
Definition Types.hpp:31
static MoFEMErrorCode defaultMeshset(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static MoFEMErrorCode defaultVertex(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static MoFEMErrorCode defaultVolume(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static MoFEMErrorCode defaultEdge(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static MoFEMErrorCode defaultPrism(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static MoFEMErrorCode defaultFace(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
BitFieldId * tag_BitFieldId_col_data
tag stores col id_id for fields
void * tagName
ptr to tag storing FE name
unsigned int getBitNumber() const
Get bit identifying this element.
BitFieldId * tag_BitFieldId_data
tag stores data id_id for fields
BitFEId * tagId
ptr to tag storing FE id
BitFieldId * tag_BitFieldId_row_data
tag stores row id_id for fields
static constexpr int ent_shift
int tagNameSize
numer of characters in FE name
EntityHandle meshset
meshset stores FE ents
std::array< ElementAdjacencyFunct, MBMAXTYPE > elementAdjacencyTable
Table of functions retrieving adjacencies for finite element User can alter and change default behavi...

Member Function Documentation

◆ getBitFieldIdCol()

BitFieldId MoFEM::FiniteElement::getBitFieldIdCol ( ) const
inline

Get field ids on columns.

Returns
Bit field ids

Definition at line 126 of file FEMultiIndices.hpp.

126 {
128 }
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition Types.hpp:42

◆ getBitFieldIdData()

BitFieldId MoFEM::FiniteElement::getBitFieldIdData ( ) const
inline

Get field ids on data.

Returns
Bit field ids

Definition at line 142 of file FEMultiIndices.hpp.

142 {
143 return *((BitFieldId *)tag_BitFieldId_data);
144 }

◆ getBitFieldIdRow()

BitFieldId MoFEM::FiniteElement::getBitFieldIdRow ( ) const
inline

Get field ids on rows.

Returns
Bit field ids

Definition at line 134 of file FEMultiIndices.hpp.

134 {
136 }

◆ getBitNumber()

unsigned int MoFEM::FiniteElement::getBitNumber ( ) const
inline

Get bit identifying this element.

Each element like field is identified by bit set. Each element has unique bit set, this function returns number of that bit.

Returns
Bit number

Definition at line 154 of file FEMultiIndices.hpp.

154 {
155 return ffsl(((BitFieldId *)tagId)->to_ulong());
156 }

◆ getFEUId()

const UId & MoFEM::FiniteElement::getFEUId ( ) const
inline

Get finite element uid.

Returns
const UId&

Definition at line 92 of file FEMultiIndices.hpp.

92{ return feUId; }

◆ getId()

BitFEId MoFEM::FiniteElement::getId ( ) const
inline

Get finite element id.

Returns
Finite element Id

Definition at line 98 of file FEMultiIndices.hpp.

98{ return *tagId; }

◆ getMeshset()

EntityHandle MoFEM::FiniteElement::getMeshset ( ) const
inline

Get meshset containing element entities.

Returns
Meshset

Definition at line 104 of file FEMultiIndices.hpp.

104{ return meshset; }

◆ getName()

std::string MoFEM::FiniteElement::getName ( ) const
inline

Get finite element name.

Returns
string

Definition at line 118 of file FEMultiIndices.hpp.

118 {
119 return std::string((char *)tagName, tagNameSize);
120 }

◆ getNameRef()

boost::string_ref MoFEM::FiniteElement::getNameRef ( ) const
inline

Get finite element name.

Returns
string_ref

Definition at line 110 of file FEMultiIndices.hpp.

110 {
111 return boost::string_ref((char *)tagName, tagNameSize);
112 }

◆ getNoFieldAdjacencyMeshset()

EntityHandle MoFEM::FiniteElement::getNoFieldAdjacencyMeshset ( moab::Interface & moab,
EntityHandle fe_ent,
const Field & field )
static

Get the No Field adjacency meshset from finite element entity.

Parameters
moab
fe_ent
field_name
Returns
EntityHandle

Definition at line 60 of file FEMultiIndices.cpp.

62 {
63 Tag th_no_field = getNoFieldTag(moab, field);
64 EntityHandle meshset[] = {0};
65 CHK_THROW_MESSAGE(moab.tag_get_data(th_no_field, &fe_ent, 1, meshset),
66 "Cannot get _NOFIELD_ tag data");
67 return meshset[0];
68}
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
static Tag getNoFieldTag(moab::Interface &moab, const Field &field)
Get the tag storing meshset with adjacent entities to finite element.

◆ getNoFieldTag()

Tag MoFEM::FiniteElement::getNoFieldTag ( moab::Interface & moab,
const Field & field )
static

Get the tag storing meshset with adjacent entities to finite element.

Parameters
moab
field_name
Returns
Tag

Definition at line 28 of file FEMultiIndices.cpp.

28 {
29 static Tag th_no_field;
30 EntityHandle def_handle = field.getMeshset();
31 CHK_THROW_MESSAGE(moab.tag_get_handle(("_NOFIELD_" + field.getName()).c_str(),
32 1, MB_TYPE_HANDLE, th_no_field,
33 MB_TAG_CREAT | MB_TAG_SPARSE,
34 &def_handle),
35 "Cannot get or create _NOFIELD_ tag");
36 return th_no_field;
37}

◆ setNoFieldTagField() [1/2]

MoFEMErrorCode MoFEM::FiniteElement::setNoFieldTagField ( moab::Interface & moab,
Range & fe_ents,
const Field & field,
EntityHandle meshset )
static

Set the No Field meshset to finite element entities storing no field adjacencies to it.

Parameters
moab
fe_ents
field_name
meshset
Returns
MoFEMErrorCode

Definition at line 39 of file FEMultiIndices.cpp.

42 {
44 Tag th_no_field = getNoFieldTag(moab, field);
45 CHKERR moab.tag_clear_data(th_no_field, fe_ents, &meshset);
47}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.

◆ setNoFieldTagField() [2/2]

MoFEMErrorCode MoFEM::FiniteElement::setNoFieldTagField ( moab::Interface & moab,
std::vector< EntityHandle > & fe_ents,
const Field & field,
EntityHandle meshset )
static

Set the No Field meshset to finite element entities storing no field adjacencies to it.

Parameters
moab
fe_ents
field_name
meshset
Returns
MoFEMErrorCode

Definition at line 50 of file FEMultiIndices.cpp.

52 {
54 Tag th_no_field = getNoFieldTag(moab, field);
55 CHKERR moab.tag_clear_data(th_no_field, fe_ents.data(), fe_ents.size(),
56 &meshset);
58}

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const FiniteElement & e )
friend

print finite element

Definition at line 426 of file FEMultiIndices.cpp.

426 {
427 os << e.getNameRef() << " fe_id " << e.getId().to_ulong() << " f_id_row "
428 << e.getBitFieldIdRow() << " f_id_col " << e.getBitFieldIdCol()
429 << " BitFEId_data " << e.getBitFieldIdData();
430 return os;
431}

Member Data Documentation

◆ elementAdjacencyTable

std::array<ElementAdjacencyFunct, MBMAXTYPE> MoFEM::FiniteElement::elementAdjacencyTable

Table of functions retrieving adjacencies for finite element User can alter and change default behavior.

Definition at line 162 of file FEMultiIndices.hpp.

◆ ent_shift

int MoFEM::FiniteElement::ent_shift = 64
staticconstexprprivate

Definition at line 170 of file FEMultiIndices.hpp.

◆ feUId

UId MoFEM::FiniteElement::feUId

Definition at line 35 of file FEMultiIndices.hpp.

◆ meshset

EntityHandle MoFEM::FiniteElement::meshset

meshset stores FE ents

Definition at line 28 of file FEMultiIndices.hpp.

◆ tag_BitFieldId_col_data

BitFieldId* MoFEM::FiniteElement::tag_BitFieldId_col_data

tag stores col id_id for fields

Definition at line 32 of file FEMultiIndices.hpp.

◆ tag_BitFieldId_data

BitFieldId* MoFEM::FiniteElement::tag_BitFieldId_data

tag stores data id_id for fields

Definition at line 34 of file FEMultiIndices.hpp.

◆ tag_BitFieldId_row_data

BitFieldId* MoFEM::FiniteElement::tag_BitFieldId_row_data

tag stores row id_id for fields

Definition at line 33 of file FEMultiIndices.hpp.

◆ tagId

BitFEId* MoFEM::FiniteElement::tagId

ptr to tag storing FE id

Definition at line 29 of file FEMultiIndices.hpp.

◆ tagName

void* MoFEM::FiniteElement::tagName

ptr to tag storing FE name

Definition at line 30 of file FEMultiIndices.hpp.

◆ tagNameSize

int MoFEM::FiniteElement::tagNameSize

numer of characters in FE name

Definition at line 31 of file FEMultiIndices.hpp.


The documentation for this struct was generated from the following files: