v0.8.20
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Private Attributes | Friends | List of all members
MoFEM::Field Struct Reference

Provide data structure for (tensor) field approximation.The Field is intended to provide support for fields, with a strong bias towards supporting first and best the capabilities required for scientific computing applications. Since we work with discrete spaces, data structure has to carry information about type of approximation space, its regularity. More...

#include <src/multi_indices/FieldMultiIndices.hpp>

Collaboration diagram for MoFEM::Field:
[legend]

Public Types

typedef multi_index_container< boost::weak_ptr< std::vector< FieldEntity > >, indexed_by< sequenced<> > > SequenceEntContainer
 
typedef multi_index_container< boost::weak_ptr< std::vector< DofEntity > >, indexed_by< sequenced<> > > SequenceDofContainer
 

Public Member Functions

FieldOrderTablegetFieldOrderTable ()
 Get the Field Order Table. More...
 
UId generateGlobalUniqueIdForTypeLo (const EntityType type, const int owner_proc) const
 
UId generateGlobalUniqueIdForTypeHi (const EntityType type, const int owner_proc) const
 
 Field (const moab::Interface &moab, const EntityHandle meshset, const boost::shared_ptr< CoordSys > coord_sys_ptr)
 constructor for moab field More...
 
EntityHandle getMeshset () const
 Get field meshset. More...
 
int getCoordSysDim (const int d=0) const
 Get dimension of general two-point tensor MoFEM::CoordSys::getDim. More...
 
MoFEMErrorCode get_E_Base (const double m[]) const
 Get reference base vectors. More...
 
MoFEMErrorCode get_E_DualBase (const double m[]) const
 Get reference dual base vectors. More...
 
MoFEMErrorCode get_e_Base (const double m[]) const
 Get current dual base vectors. More...
 
MoFEMErrorCode get_e_DualBase (const double m[]) const
 Get current dual base vectors. More...
 
EntityHandle getCoordSysMeshSet () const
 Returns meshset on which Tags defining coordinate system are stored. More...
 
std::string getCoordSysName () const
 Get coordinate system name. More...
 
boost::string_ref getCoordSysNameRef () const
 Get coordinate system name. More...
 
const BitFieldIdgetId () const
 Get unique field id. More...
 
boost::string_ref getNameRef () const
 Get string reference to field name. More...
 
std::string getName () const
 Get field name. More...
 
FieldSpace getSpace () const
 Get field approximation space. More...
 
FieldApproximationBase getApproxBase () const
 Get approximation base. More...
 
FieldCoefficientsNumber getNbOfCoeffs () const
 Get number of field coefficients. More...
 
unsigned int getBitNumber () const
 Get number of set bit in Field ID. Each field has uid, get getBitNumber get number of bit set for given field. Field ID has only one bit set for each field. More...
 
unsigned int getBitNumberCalculate () const
 Calculate number of set bit in Field ID. Each field has uid, get getBitNumber get number of bit set for given field. Field ID has only one bit set for each field. More...
 
boost::shared_ptr< SequenceEntContainer > & getEntSequenceContainer () const
 Get reference to sequence data container. More...
 
boost::shared_ptr< SequenceDofContainer > & getDofSequenceContainer () const
 Get reference to sequence data container. More...
 
std::vector< ApproximationOrder > & getDofOrderMap (const EntityType type) const
 get hash-map relating dof index on entity with its order More...
 

Static Public Member Functions

static UId generateGlobalUniqueIdForTypeLo (const char bit_number, const EntityType type, const int owner_proc)
 
static UId generateGlobalUniqueIdForTypeHi (const char bit_number, const EntityType type, const int owner_proc)
 

Public Attributes

moab::Interface & moab
 
EntityHandle meshSet
 keeps entities for this meshset More...
 
boost::shared_ptr< CoordSyscoordSysPtr
 Pointer to field coordinate system data structure. More...
 
TagType th_FieldDataVertsType
 
Tag th_FieldDataVerts
 Tag storing field values on vertices in the field. More...
 
Tag th_FieldData
 Tag storing field values on entity in the field. More...
 
Tag th_AppOrder
 Tag storing approximation order on entity. More...
 
BitFieldIdtagId
 tag keeps field id More...
 
FieldSpacetagSpaceData
 tag keeps field space More...
 
FieldApproximationBasetagBaseData
 tag keeps field base More...
 
FieldCoefficientsNumbertagNbCoeffData
 
const void * tagName
 tag keeps name of the field More...
 
int tagNameSize
 number of bits necessary to keep field name More...
 
const void * tagNamePrefixData
 tag keeps name prefix of the field More...
 
int tagNamePrefixSize
 
FieldOrderTable forderTable
 nb. DOFs table for entities More...
 
unsigned int bitNumber
 

Private Attributes

boost::shared_ptr< SequenceEntContainersequenceEntContainer
 
boost::shared_ptr< SequenceDofContainersequenceDofContainer
 
std::map< EntityType, std::vector< int > > dofOrderMap
 

Friends

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

Detailed Description

Provide data structure for (tensor) field approximation.

The Field is intended to provide support for fields, with a strong bias towards supporting first and best the capabilities required for scientific computing applications. Since we work with discrete spaces, data structure has to carry information about type of approximation space, its regularity.

Field data structure storing information about space, approximation base, coordinate systems, etc. It stores additional data needed for book keeping, like tags to data on the mesh.

Each filed has unique ID and name. This data structure is shared between entities on which is spanning and DOFs on those entities.

Examples:
forces_and_sources_testing_users_base.cpp.

Definition at line 64 of file FieldMultiIndices.hpp.

Member Typedef Documentation

◆ SequenceDofContainer

typedef multi_index_container<boost::weak_ptr<std::vector<DofEntity> >, indexed_by<sequenced<> > > MoFEM::Field::SequenceDofContainer

Definition at line 72 of file FieldMultiIndices.hpp.

◆ SequenceEntContainer

typedef multi_index_container<boost::weak_ptr<std::vector<FieldEntity> >, indexed_by<sequenced<> > > MoFEM::Field::SequenceEntContainer

Definition at line 68 of file FieldMultiIndices.hpp.

Constructor & Destructor Documentation

◆ Field()

MoFEM::Field::Field ( const moab::Interface &  moab,
const EntityHandle  meshset,
const boost::shared_ptr< CoordSys coord_sys_ptr 
)

constructor for moab field

Parameters
meshsetwhich keeps entities for this field

Definition at line 31 of file CoreDataStructures.cpp.

33  : moab(const_cast<moab::Interface &>(moab)), meshSet(meshset),
34  coordSysPtr(coord_sys_ptr), tagId(NULL), tagSpaceData(NULL),
35  tagNbCoeffData(NULL), tagName(NULL), tagNameSize(0),
36  sequenceEntContainer(boost::make_shared<SequenceEntContainer>()),
37  sequenceDofContainer(boost::make_shared<SequenceDofContainer>()) {
38 
39  auto get_tag_data_ptr = [&moab, meshset](const auto name, auto &tag_data) {
41  Tag th;
42  CHKERR moab.tag_get_handle(name, th);
43  CHKERR moab.tag_get_by_ptr(th, &meshset, 1, (const void **)&tag_data);
45  };
46  // id
47  ierr = get_tag_data_ptr("_FieldId", tagId);
48  CHKERRABORT(PETSC_COMM_SELF, ierr);
49  // space
50  ierr = get_tag_data_ptr("_FieldSpace", tagSpaceData);
51  CHKERRABORT(PETSC_COMM_SELF, ierr);
52  // approx. base
53  ierr = get_tag_data_ptr("_FieldBase", tagBaseData);
54  CHKERRABORT(PETSC_COMM_SELF, ierr);
55 
56  // name
57  Tag th_field_name;
58  rval = moab.tag_get_handle("_FieldName", th_field_name);
60  rval = moab.tag_get_by_ptr(th_field_name, &meshSet, 1,
61  (const void **)&tagName, &tagNameSize);
63  // name prefix
64  Tag th_field_name_data_name_prefix;
65  rval = moab.tag_get_handle("_FieldName_DataNamePrefix",
66  th_field_name_data_name_prefix);
68  rval = moab.tag_get_by_ptr(th_field_name_data_name_prefix, &meshSet, 1,
69  (const void **)&tagNamePrefixData,
72  std::string name_data_prefix((char *)tagNamePrefixData, tagNamePrefixSize);
73  // data
74  std::string tag_data_name = name_data_prefix + getName();
75  rval = moab.tag_get_handle(tag_data_name.c_str(), th_FieldData);
77  std::string tag_data_name_verts = name_data_prefix + getName() + "V";
78  rval = moab.tag_get_handle(tag_data_name_verts.c_str(), th_FieldDataVerts);
82  // order
83  std::string tag_approximation_order_name = "_App_Order_" + getName();
84  rval = moab.tag_get_handle(tag_approximation_order_name.c_str(), th_AppOrder);
86  // rank
87  Tag th_rank;
88  std::string Tag_rank_name = "_Field_Rank_" + getName();
89  rval = moab.tag_get_handle(Tag_rank_name.c_str(), th_rank);
91  rval =
92  moab.tag_get_by_ptr(th_rank, &meshSet, 1, (const void **)&tagNbCoeffData);
94 
96  for (int tt = 0; tt != MBMAXTYPE; ++tt) {
97  forderTable[tt] = NULL;
98  }
99  switch (*tagBaseData) {
102  switch (*tagSpaceData) {
103  case H1:
104  forderTable[MBVERTEX] = fNBVERTEX_H1;
105  forderTable[MBEDGE] = fNBEDGE_H1;
106  forderTable[MBTRI] = fNBFACETRI_H1;
107  forderTable[MBQUAD] = fNBFACEQUAD_H1;
108  forderTable[MBTET] = fNBVOLUMETET_H1;
109  forderTable[MBPRISM] = fNBVOLUMEPRISM_H1;
110  break;
111  case HCURL:
112  forderTable[MBVERTEX] = fNBVERTEX_HCURL;
116  break;
117  case HDIV:
118  forderTable[MBVERTEX] = fNBVERTEX_HDIV;
119  forderTable[MBEDGE] = fNBEDGE_HDIV;
122  break;
123  case L2:
124  forderTable[MBVERTEX] = fNBVERTEX_L2;
125  forderTable[MBEDGE] = fNBEDGE_L2;
126  forderTable[MBTRI] = fNBFACETRI_L2;
127  forderTable[MBTET] = fNBVOLUMETET_L2;
128  break;
129  case NOFIELD:
130  for (EntityType t = MBVERTEX; t < MBMAXTYPE; t++) {
131  // Concept of approximation order make no sense if there is no field
133  }
134  break;
135  default:
136  THROW_MESSAGE("unknown approximation space");
137  }
138  break;
140  switch (*tagSpaceData) {
141  case HCURL:
142  forderTable[MBVERTEX] = fNBVERTEX_HCURL;
146  break;
147  case HDIV:
148  forderTable[MBVERTEX] = fNBVERTEX_HDIV;
149  forderTable[MBEDGE] = fNBEDGE_HDIV;
152  break;
153  default:
154  THROW_MESSAGE("unknown approximation space or not yet implemented");
155  }
156  break;
158  THROW_MESSAGE("AINSWORTH_BERNSTEIN_BEZIER_BASE not implemented yer")
159  break;
160  case USER_BASE:
161  for (int ee = 0; ee < MBMAXTYPE; ee++) {
163  }
164  break;
165  default:
166  if (*tagSpaceData != NOFIELD) {
167  THROW_MESSAGE("unknown approximation base");
168  } else {
169  for (EntityType t = MBVERTEX; t < MBMAXTYPE; t++) {
171  }
172  }
173  }
174 }
int fNBFACETRI_AINSWORTH_HDIV(int P)
number of approx. functions for HDIV space on face
Tag th_AppOrder
Tag storing approximation order on entity.
std::string getName() const
Get field name.
const void * tagName
tag keeps name of the field
field with continuous normal traction
Definition: definitions.h:171
user implemented approximation base
Definition: definitions.h:152
int fNBVERTEX_L2(int P)
int fNBEDGE_DEMKOWICZ_HCURL(int P)
const void * tagNamePrefixData
tag keeps name prefix of the field
TagType th_FieldDataVertsType
scalar or vector of scalars describe (no true field)
Definition: definitions.h:168
int fNBEDGE_H1(int P)
number of approx. functions for H1 space on edge
int fNBENTITY_GENERIC(int P)
int fNBFACETRI_AINSWORTH_HCURL(int P)
int fNBVOLUMEPRISM_H1(int P)
EntityHandle meshSet
keeps entities for this meshset
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
int fNBVOLUMETET_L2(int P)
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:618
int fNBFACETRI_DEMKOWICZ_HDIV(int P)
#define MOAB_THROW(a)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:600
int fNBEDGE_AINSWORTH_HCURL(int P)
int fNBVOLUMETET_H1(int P)
number of approx. functions for H1 space on volume
int fNBVOLUMETET_DEMKOWICZ_HCURL(int P)
FieldOrderTable forderTable
nb. DOFs table for entities
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:84
FieldSpace * tagSpaceData
tag keeps field space
int fNBFACEQUAD_H1(int P)
int fNBVOLUMETET_DEMKOWICZ_HDIV(int P)
number of approx. functions for HDIV space on volume
FieldCoefficientsNumber * tagNbCoeffData
int fNBEDGE_L2(int P)
boost::shared_ptr< CoordSys > coordSysPtr
Pointer to field coordinate system data structure.
Ainsworth Cole (Legendre) approx. base .
Definition: definitions.h:143
field with continuous tangents
Definition: definitions.h:170
Tag th_FieldDataVerts
Tag storing field values on vertices in the field.
boost::shared_ptr< SequenceEntContainer > sequenceEntContainer
int fNBFACETRI_DEMKOWICZ_HCURL(int P)
FieldApproximationBase * tagBaseData
tag keeps field base
#define CHKERR
Inline error check.
Definition: definitions.h:594
int fNBFACETRI_H1(int P)
number of approx. functions for H1 space on face
unsigned int getBitNumberCalculate() const
Calculate number of set bit in Field ID. Each field has uid, get getBitNumber get number of bit set f...
int fNBVERTEX_HCURL(int P)
number of approx. functions for HCURL space on vertex
int fNBVOLUMETET_AINSWORTH_HCURL(int P)
boost::shared_ptr< SequenceDofContainer > sequenceDofContainer
int tagNameSize
number of bits necessary to keep field name
int fNBVERTEX_H1(int P)
number of approx. functions for H1 space on vertex
moab::Interface & moab
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405
continuous field
Definition: definitions.h:169
int fNBFACETRI_L2(int P)
int fNBENTITYSET_NOFIELD(int P)
int fNBVERTEX_HDIV(int P)
number of approx. functions for HDIV space on vertex
unsigned int bitNumber
Tag th_FieldData
Tag storing field values on entity in the field.
int fNBVOLUMETET_AINSWORTH_HDIV(int P)
number of approx. functions for HDIV space on volume
int fNBEDGE_HDIV(int P)
number of approx. functions for HDIV space on edge
BitFieldId * tagId
tag keeps field id
field with C-1 continuity
Definition: definitions.h:172

Member Function Documentation

◆ generateGlobalUniqueIdForTypeHi() [1/2]

static UId MoFEM::Field::generateGlobalUniqueIdForTypeHi ( const char  bit_number,
const EntityType  type,
const int  owner_proc 
)
static

Definition at line 127 of file FieldMultiIndices.hpp.

129  {
130  constexpr int ent_shift = 8 * sizeof(EntityHandle);
131  return (static_cast<UId>(type) << MB_ID_WIDTH |
132  static_cast<UId>(bit_number) << ent_shift |
133  static_cast<UId>(owner_proc) << 5 + ent_shift)
134  << 9;
135  }
#define MB_ID_WIDTH
Definition: definitions.h:287
uint128_t UId
Unique Id.
Definition: Types.hpp:41

◆ generateGlobalUniqueIdForTypeHi() [2/2]

UId MoFEM::Field::generateGlobalUniqueIdForTypeHi ( const EntityType  type,
const int  owner_proc 
) const

Definition at line 137 of file FieldMultiIndices.hpp.

138  {
139  return generateGlobalUniqueIdForTypeHi(bitNumber, type, owner_proc);
140  }
static UId generateGlobalUniqueIdForTypeHi(const char bit_number, const EntityType type, const int owner_proc)
unsigned int bitNumber

◆ generateGlobalUniqueIdForTypeLo() [1/2]

static UId MoFEM::Field::generateGlobalUniqueIdForTypeLo ( const char  bit_number,
const EntityType  type,
const int  owner_proc 
)
static

Definition at line 112 of file FieldMultiIndices.hpp.

114  {
115  constexpr int ent_shift = 8 * sizeof(EntityHandle);
116  return (static_cast<UId>(type) << MB_ID_WIDTH |
117  static_cast<UId>(bit_number) << 8 * sizeof(EntityHandle) |
118  static_cast<UId>(owner_proc) << 5 + ent_shift)
119  << 9;
120  }
#define MB_ID_WIDTH
Definition: definitions.h:287
uint128_t UId
Unique Id.
Definition: Types.hpp:41

◆ generateGlobalUniqueIdForTypeLo() [2/2]

UId MoFEM::Field::generateGlobalUniqueIdForTypeLo ( const EntityType  type,
const int  owner_proc 
) const

Definition at line 122 of file FieldMultiIndices.hpp.

123  {
124  return generateGlobalUniqueIdForTypeLo(bitNumber, type, owner_proc);
125  }
static UId generateGlobalUniqueIdForTypeLo(const char bit_number, const EntityType type, const int owner_proc)
unsigned int bitNumber

◆ get_E_Base()

MoFEMErrorCode MoFEM::Field::get_E_Base ( const double  m[]) const

Get reference base vectors.

Parameters
Arraywhere coefficients (covariant) are returned
Returns
Error code

Definition at line 182 of file FieldMultiIndices.hpp.

182  {
184  MoFEMFunctionReturnHot(coordSysPtr->get_E_Base(m));
185  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
boost::shared_ptr< CoordSys > coordSysPtr
Pointer to field coordinate system data structure.

◆ get_e_Base()

MoFEMErrorCode MoFEM::Field::get_e_Base ( const double  m[]) const

Get current dual base vectors.

Parameters
Arraywhere coefficients (covariant) are returned
Returns
Error code

Definition at line 202 of file FieldMultiIndices.hpp.

202  {
204  MoFEMFunctionReturnHot(coordSysPtr->get_e_Base(m));
205  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
boost::shared_ptr< CoordSys > coordSysPtr
Pointer to field coordinate system data structure.

◆ get_E_DualBase()

MoFEMErrorCode MoFEM::Field::get_E_DualBase ( const double  m[]) const

Get reference dual base vectors.

Parameters
Arraywhere coefficients (contravariant) are returned
Returns
Error code

Definition at line 192 of file FieldMultiIndices.hpp.

192  {
194  MoFEMFunctionReturnHot(coordSysPtr->get_E_DualBase(m));
195  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
boost::shared_ptr< CoordSys > coordSysPtr
Pointer to field coordinate system data structure.

◆ get_e_DualBase()

MoFEMErrorCode MoFEM::Field::get_e_DualBase ( const double  m[]) const

Get current dual base vectors.

Parameters
Arraywhere coefficients (covariant) are returned
Returns
Error code

Definition at line 212 of file FieldMultiIndices.hpp.

212  {
214  MoFEMFunctionReturnHot(coordSysPtr->get_e_DualBase(m));
215  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506
boost::shared_ptr< CoordSys > coordSysPtr
Pointer to field coordinate system data structure.

◆ getApproxBase()

FieldApproximationBase MoFEM::Field::getApproxBase ( ) const

Get approximation base.

Returns
Approximation base

Definition at line 271 of file FieldMultiIndices.hpp.

271 { return *tagBaseData; }
FieldApproximationBase * tagBaseData
tag keeps field base

◆ getBitNumber()

unsigned int MoFEM::Field::getBitNumber ( ) const

Get number of set bit in Field ID. Each field has uid, get getBitNumber get number of bit set for given field. Field ID has only one bit set for each field.

Definition at line 296 of file FieldMultiIndices.hpp.

296 { return bitNumber; }
unsigned int bitNumber

◆ getBitNumberCalculate()

unsigned int MoFEM::Field::getBitNumberCalculate ( ) const

Calculate number of set bit in Field ID. Each field has uid, get getBitNumber get number of bit set for given field. Field ID has only one bit set for each field.

Definition at line 303 of file FieldMultiIndices.hpp.

303  {
304  int b = ffsl(((BitFieldId *)tagId)->to_ulong());
305  if (b != 0)
306  return b;
307  for (int ll = 1; ll < BITFIELDID_SIZE / 32; ll++) {
308  BitFieldId id;
309  id = (*tagId) >> ll * 32;
310  b = ll * 32 + ffsl(id.to_ulong());
311  if (b != 0)
312  return b;
313  }
314  return 0;
315  }
#define BITFIELDID_SIZE
max number of fields
Definition: definitions.h:278
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
BitFieldId * tagId
tag keeps field id

◆ getCoordSysDim()

int MoFEM::Field::getCoordSysDim ( const int  d = 0) const

Get dimension of general two-point tensor MoFEM::CoordSys::getDim.

See details here MoFEM::CoordSys::getDim

Definition at line 173 of file FieldMultiIndices.hpp.

173  {
174  return coordSysPtr->getDim(d);
175  }
const Tensor1_Expr< const dTensor0< T, Dim, i >, typename promote< T, double >::V, Dim, i > d(const Tensor0< T *> &a, const Index< i, Dim > index, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition: dTensor0.hpp:27
boost::shared_ptr< CoordSys > coordSysPtr
Pointer to field coordinate system data structure.

◆ getCoordSysMeshSet()

EntityHandle MoFEM::Field::getCoordSysMeshSet ( ) const

Returns meshset on which Tags defining coordinate system are stored.

Returns
Coordinate system EntityHandle

Definition at line 221 of file FieldMultiIndices.hpp.

221  {
222  return coordSysPtr->getMeshset();
223  }
boost::shared_ptr< CoordSys > coordSysPtr
Pointer to field coordinate system data structure.

◆ getCoordSysName()

std::string MoFEM::Field::getCoordSysName ( ) const

Get coordinate system name.

Returns
Coordinate system name

Definition at line 229 of file FieldMultiIndices.hpp.

229 { return coordSysPtr->getName(); }
boost::shared_ptr< CoordSys > coordSysPtr
Pointer to field coordinate system data structure.

◆ getCoordSysNameRef()

boost::string_ref MoFEM::Field::getCoordSysNameRef ( ) const

Get coordinate system name.

Returns
Return string_ref with name.

Definition at line 235 of file FieldMultiIndices.hpp.

235  {
236  return coordSysPtr->getNameRef();
237  }
boost::shared_ptr< CoordSys > coordSysPtr
Pointer to field coordinate system data structure.

◆ getDofOrderMap()

std::vector<ApproximationOrder>& MoFEM::Field::getDofOrderMap ( const EntityType  type) const

get hash-map relating dof index on entity with its order

Dofs of given field are indexed on entity of the same type, same space, approximation base and number of coefficients, are sorted in the way.

Definition at line 370 of file FieldMultiIndices.hpp.

370  {
371  return dofOrderMap[type];
372  }
std::map< EntityType, std::vector< int > > dofOrderMap

◆ getDofSequenceContainer()

boost::shared_ptr<SequenceDofContainer>& MoFEM::Field::getDofSequenceContainer ( ) const

Get reference to sequence data container.

In sequence data container data are physically stored. The purpose of this is to allocate DofEntity data in bulk, having only one allocation instead each time entity is inserted. That makes code efficient.

The vector in sequence is destroyed if last entity inside that vector is destroyed. All MoFEM::MoFEMEntities have aliased shared_ptr which points to the vector.

Not all DOFs are starred in this way, currently such cases are considered;

  • DOFs on vertices. That is exploited that for H1 space, there is some fixed number of DOFs on each vertex

For other cases, DOFs are stored locally in each MoFEM::MoFEMEntities.

Returns
MoFEM::Field::SequenceDofContainer

Definition at line 357 of file FieldMultiIndices.hpp.

357  {
358  return sequenceDofContainer;
359  }
boost::shared_ptr< SequenceDofContainer > sequenceDofContainer

◆ getEntSequenceContainer()

boost::shared_ptr<SequenceEntContainer>& MoFEM::Field::getEntSequenceContainer ( ) const

Get reference to sequence data container.

In sequence data container data are physically stored. The purpose of this is to allocate MoFEMEntities data in bulk, having only one allocation instead each time entity is inserted. That makes code efficient.

The vector in sequence is destroyed if last entity inside that vector is destroyed. All MoFEM::MoFEMEntities have aliased shared_ptr which points to the vector.

Returns
MoFEM::Field::SequenceEntContainer

Definition at line 333 of file FieldMultiIndices.hpp.

333  {
334  return sequenceEntContainer;
335  }
boost::shared_ptr< SequenceEntContainer > sequenceEntContainer

◆ getFieldOrderTable()

FieldOrderTable& MoFEM::Field::getFieldOrderTable ( )

Get the Field Order Table.

Returns
FieldOrderTable&

Definition at line 104 of file FieldMultiIndices.hpp.

104 { return forderTable; }
FieldOrderTable forderTable
nb. DOFs table for entities

◆ getId()

const BitFieldId& MoFEM::Field::getId ( ) const

Get unique field id.

Returns
Filed ID

Definition at line 243 of file FieldMultiIndices.hpp.

243 { return *((BitFieldId *)tagId); }
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
BitFieldId * tagId
tag keeps field id

◆ getMeshset()

EntityHandle MoFEM::Field::getMeshset ( ) const

Get field meshset.

To meshsets entity are attached Tags which keeps basic information about field. Those information is field name, approximation base, approximation space, id, etc.

In meshset contains entities on which given filed is sparing. Type of entities depended on approximations space.

Returns
EntityHandle

Definition at line 164 of file FieldMultiIndices.hpp.

164 { return meshSet; }
EntityHandle meshSet
keeps entities for this meshset

◆ getName()

std::string MoFEM::Field::getName ( ) const

Get field name.

Returns
Field name

Definition at line 257 of file FieldMultiIndices.hpp.

257  {
258  return std::string((char *)tagName, tagNameSize);
259  }
const void * tagName
tag keeps name of the field
int tagNameSize
number of bits necessary to keep field name

◆ getNameRef()

boost::string_ref MoFEM::Field::getNameRef ( ) const

Get string reference to field name.

Returns
Field name

Definition at line 249 of file FieldMultiIndices.hpp.

249  {
250  return boost::string_ref((char *)tagName, tagNameSize);
251  }
const void * tagName
tag keeps name of the field
int tagNameSize
number of bits necessary to keep field name

◆ getNbOfCoeffs()

FieldCoefficientsNumber MoFEM::Field::getNbOfCoeffs ( ) const

Get number of field coefficients.

Scalar field has only one coefficient, vector field in 3D has three. In general number determine space needed to keep data on entities. What coefficient means depend on interpretation and associated coordinate system. For example 3 coefficient means could be covariant or contravariant, or mean three temperatures for mixture of solid, air and water, etc.

Definition at line 287 of file FieldMultiIndices.hpp.

287  {
288  return *tagNbCoeffData;
289  };
FieldCoefficientsNumber * tagNbCoeffData

◆ getSpace()

FieldSpace MoFEM::Field::getSpace ( ) const

Get field approximation space.

Returns
approximation space

Definition at line 265 of file FieldMultiIndices.hpp.

265 { return *tagSpaceData; }
FieldSpace * tagSpaceData
tag keeps field space

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 176 of file CoreDataStructures.cpp.

176  {
177  os << "name " << e.getNameRef() << " BitFieldId " << e.getId().to_ulong()
178  << " bit number " << e.getBitNumber() << " space "
179  << FieldSpaceNames[e.getSpace()] << " approximation base "
180  << ApproximationBaseNames[e.getApproxBase()] << " rank "
181  << e.getNbOfCoeffs() << " meshset " << e.meshSet;
182  return os;
183 }
static const char *const ApproximationBaseNames[]
Definition: definitions.h:156
static const char *const FieldSpaceNames[]
Definition: definitions.h:176

Member Data Documentation

◆ bitNumber

unsigned int MoFEM::Field::bitNumber

Field Id is bit set. Each field has only one bit on, bitNumber stores number of set bit

Definition at line 110 of file FieldMultiIndices.hpp.

◆ coordSysPtr

boost::shared_ptr<CoordSys> MoFEM::Field::coordSysPtr

Pointer to field coordinate system data structure.

Definition at line 78 of file FieldMultiIndices.hpp.

◆ dofOrderMap

std::map<EntityType, std::vector<int> > MoFEM::Field::dofOrderMap
mutableprivate

Definition at line 378 of file FieldMultiIndices.hpp.

◆ forderTable

FieldOrderTable MoFEM::Field::forderTable

nb. DOFs table for entities

Definition at line 97 of file FieldMultiIndices.hpp.

◆ meshSet

EntityHandle MoFEM::Field::meshSet

keeps entities for this meshset

Definition at line 76 of file FieldMultiIndices.hpp.

◆ moab

moab::Interface& MoFEM::Field::moab

Definition at line 74 of file FieldMultiIndices.hpp.

◆ sequenceDofContainer

boost::shared_ptr<SequenceDofContainer> MoFEM::Field::sequenceDofContainer
mutableprivate

Definition at line 376 of file FieldMultiIndices.hpp.

◆ sequenceEntContainer

boost::shared_ptr<SequenceEntContainer> MoFEM::Field::sequenceEntContainer
mutableprivate

Definition at line 375 of file FieldMultiIndices.hpp.

◆ tagBaseData

FieldApproximationBase* MoFEM::Field::tagBaseData

tag keeps field base

Definition at line 87 of file FieldMultiIndices.hpp.

◆ tagId

BitFieldId* MoFEM::Field::tagId

tag keeps field id

Definition at line 85 of file FieldMultiIndices.hpp.

◆ tagName

const void* MoFEM::Field::tagName

tag keeps name of the field

Definition at line 92 of file FieldMultiIndices.hpp.

◆ tagNamePrefixData

const void* MoFEM::Field::tagNamePrefixData

tag keeps name prefix of the field

Definition at line 94 of file FieldMultiIndices.hpp.

◆ tagNamePrefixSize

int MoFEM::Field::tagNamePrefixSize

number of bits necessary to keep field name prefix

Definition at line 95 of file FieldMultiIndices.hpp.

◆ tagNameSize

int MoFEM::Field::tagNameSize

number of bits necessary to keep field name

Definition at line 93 of file FieldMultiIndices.hpp.

◆ tagNbCoeffData

FieldCoefficientsNumber* MoFEM::Field::tagNbCoeffData

tag keeps field rank (dimension, f.e. Temperature field has rank 1, displacements field in 3d has rank 3)

Definition at line 91 of file FieldMultiIndices.hpp.

◆ tagSpaceData

FieldSpace* MoFEM::Field::tagSpaceData

tag keeps field space

Definition at line 86 of file FieldMultiIndices.hpp.

◆ th_AppOrder

Tag MoFEM::Field::th_AppOrder

Tag storing approximation order on entity.

Definition at line 83 of file FieldMultiIndices.hpp.

◆ th_FieldData

Tag MoFEM::Field::th_FieldData

Tag storing field values on entity in the field.

Definition at line 82 of file FieldMultiIndices.hpp.

◆ th_FieldDataVerts

Tag MoFEM::Field::th_FieldDataVerts

Tag storing field values on vertices in the field.

Definition at line 81 of file FieldMultiIndices.hpp.

◆ th_FieldDataVertsType

TagType MoFEM::Field::th_FieldDataVertsType

Definition at line 80 of file FieldMultiIndices.hpp.


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