v0.8.23
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
 
typedef std::array< std::array< int, MAX_DOFS_ON_ENTITY >, MBMAXTYPE > DofsOrderMap
 

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...
 
SequenceEntContainergetEntSequenceContainer () const
 Get reference to sequence data container. More...
 
SequenceDofContainergetDofSequenceContainer () const
 Get reference to sequence data container. More...
 
std::array< int, MAX_DOFS_ON_ENTITY > & getDofOrderMap (const EntityType type) const
 get hash-map relating dof index on entity with its order More...
 
DofsOrderMapgetDofOrderMap () const
 get hash-map relating dof index on entity with its order More...
 
MoFEMErrorCode rebuildDofsOrderMap () const
 

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

SequenceEntContainer sequenceEntContainer
 
SequenceDofContainer sequenceDofContainer
 
DofsOrderMap 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.

Definition at line 64 of file FieldMultiIndices.hpp.

Member Typedef Documentation

◆ DofsOrderMap

typedef std::array<std::array<int, MAX_DOFS_ON_ENTITY>, MBMAXTYPE> MoFEM::Field::DofsOrderMap

Definition at line 75 of file FieldMultiIndices.hpp.

◆ 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 
37  auto get_tag_data_ptr = [&](const auto name, auto &tag_data) {
39  Tag th;
40  CHKERR moab.tag_get_handle(name, th);
41  CHKERR moab.tag_get_by_ptr(th, &meshset, 1, (const void **)&tag_data);
43  };
44 
45  // id
46  ierr = get_tag_data_ptr("_FieldId", tagId);
47  CHKERRABORT(PETSC_COMM_SELF, ierr);
48  // space
49  ierr = get_tag_data_ptr("_FieldSpace", tagSpaceData);
50  CHKERRABORT(PETSC_COMM_SELF, ierr);
51 
52  // approx. base
53  ierr = get_tag_data_ptr("_FieldBase", tagBaseData);
54  CHKERRABORT(PETSC_COMM_SELF, ierr);
55 
56  auto get_all_tags = [&]() {
58  // name
59  Tag th_field_name;
60  CHKERR moab.tag_get_handle("_FieldName", th_field_name);
61  CHKERR moab.tag_get_by_ptr(th_field_name, &meshSet, 1,
62  (const void **)&tagName, &tagNameSize);
63  // name prefix
64  Tag th_field_name_data_name_prefix;
65  CHKERR moab.tag_get_handle("_FieldName_DataNamePrefix",
66  th_field_name_data_name_prefix);
67  CHKERR moab.tag_get_by_ptr(th_field_name_data_name_prefix, &meshSet, 1,
68  (const void **)&tagNamePrefixData,
70  std::string name_data_prefix((char *)tagNamePrefixData, tagNamePrefixSize);
71  // data
72  std::string tag_data_name = name_data_prefix + getName();
73  CHKERR moab.tag_get_handle(tag_data_name.c_str(), th_FieldData);
74  std::string tag_data_name_verts = name_data_prefix + getName() + "V";
75  CHKERR moab.tag_get_handle(tag_data_name_verts.c_str(), th_FieldDataVerts);
77  // order
78  std::string tag_approximation_order_name = "_App_Order_" + getName();
79  CHKERR moab.tag_get_handle(tag_approximation_order_name.c_str(),
80  th_AppOrder);
81  // rank
82  Tag th_rank;
83  std::string Tag_rank_name = "_Field_Rank_" + getName();
84  CHKERR moab.tag_get_handle(Tag_rank_name.c_str(), th_rank);
85  CHKERR moab.tag_get_by_ptr(th_rank, &meshSet, 1,
86  (const void **)&tagNbCoeffData);
88  };
89 
90  ierr = get_all_tags();
91  CHKERRABORT(PETSC_COMM_SELF, ierr);
92 
94 
95  auto reset_entity_order_table = [&]() {
96  for (int tt = 0; tt != MBMAXTYPE; ++tt) {
97  forderTable[tt] = NULL;
98  }
99  };
100 
101  auto set_entity_order_table = [&]() {
102  switch (*tagBaseData) {
105  switch (*tagSpaceData) {
106  case H1:
107  forderTable[MBVERTEX] = fNBVERTEX_H1;
108  forderTable[MBEDGE] = fNBEDGE_H1;
109  forderTable[MBTRI] = fNBFACETRI_H1;
110  forderTable[MBQUAD] = fNBFACEQUAD_H1;
111  forderTable[MBTET] = fNBVOLUMETET_H1;
112  forderTable[MBPRISM] = fNBVOLUMEPRISM_H1;
113  break;
114  case HCURL:
115  forderTable[MBVERTEX] = fNBVERTEX_HCURL;
119  break;
120  case HDIV:
121  forderTable[MBVERTEX] = fNBVERTEX_HDIV;
122  forderTable[MBEDGE] = fNBEDGE_HDIV;
125  break;
126  case L2:
127  forderTable[MBVERTEX] = fNBVERTEX_L2;
128  forderTable[MBEDGE] = fNBEDGE_L2;
129  forderTable[MBTRI] = fNBFACETRI_L2;
130  forderTable[MBTET] = fNBVOLUMETET_L2;
131  break;
132  case NOFIELD:
133  for (EntityType t = MBVERTEX; t < MBMAXTYPE; t++) {
134  // Concept of approximation order make no sense if there is no field
136  }
137  break;
138  default:
139  THROW_MESSAGE("unknown approximation space");
140  }
141  break;
143  switch (*tagSpaceData) {
144  case HCURL:
145  forderTable[MBVERTEX] = fNBVERTEX_HCURL;
149  break;
150  case HDIV:
151  forderTable[MBVERTEX] = fNBVERTEX_HDIV;
152  forderTable[MBEDGE] = fNBEDGE_HDIV;
155  break;
156  default:
157  THROW_MESSAGE("unknown approximation space or not yet implemented");
158  }
159  break;
161  THROW_MESSAGE("AINSWORTH_BERNSTEIN_BEZIER_BASE not implemented yer")
162  break;
163  case USER_BASE:
164  for (int ee = 0; ee < MBMAXTYPE; ee++) {
166  }
167  break;
168  default:
169  if (*tagSpaceData != NOFIELD) {
170  THROW_MESSAGE("unknown approximation base");
171  } else {
172  for (EntityType t = MBVERTEX; t < MBMAXTYPE; t++) {
174  }
175  }
176  }
177  };
178 
179  reset_entity_order_table();
180  set_entity_order_table();
182  CHKERRABORT(PETSC_COMM_SELF, ierr);
183 };
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:173
user implemented approximation base
Definition: definitions.h:154
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:170
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:477
int fNBVOLUMETET_L2(int P)
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:620
int fNBFACETRI_DEMKOWICZ_HDIV(int P)
int fNBEDGE_AINSWORTH_HCURL(int P)
int fNBVOLUMETET_H1(int P)
number of approx. functions for H1 space on volume
MoFEMErrorCode rebuildDofsOrderMap() const
int fNBVOLUMETET_DEMKOWICZ_HCURL(int P)
FieldOrderTable forderTable
nb. DOFs table for entities
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:145
field with continuous tangents
Definition: definitions.h:172
Tag th_FieldDataVerts
Tag storing field values on vertices in the field.
int fNBFACETRI_DEMKOWICZ_HCURL(int P)
FieldApproximationBase * tagBaseData
tag keeps field base
#define CHKERR
Inline error check.
Definition: definitions.h:596
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)
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:407
continuous field
Definition: definitions.h:171
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:174

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 130 of file FieldMultiIndices.hpp.

132  {
133  constexpr int ent_shift = 8 * sizeof(EntityHandle);
134  return (static_cast<UId>(type) << MB_ID_WIDTH |
135  static_cast<UId>(bit_number) << ent_shift |
136  static_cast<UId>(owner_proc) << 5 + ent_shift)
137  << 9;
138  }
#define MB_ID_WIDTH
Definition: definitions.h:289

◆ generateGlobalUniqueIdForTypeHi() [2/2]

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

Definition at line 140 of file FieldMultiIndices.hpp.

141  {
142  return generateGlobalUniqueIdForTypeHi(bitNumber, type, owner_proc);
143  }
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 115 of file FieldMultiIndices.hpp.

117  {
118  constexpr int ent_shift = 8 * sizeof(EntityHandle);
119  return (static_cast<UId>(type) << MB_ID_WIDTH |
120  static_cast<UId>(bit_number) << 8 * sizeof(EntityHandle) |
121  static_cast<UId>(owner_proc) << 5 + ent_shift)
122  << 9;
123  }
#define MB_ID_WIDTH
Definition: definitions.h:289

◆ generateGlobalUniqueIdForTypeLo() [2/2]

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

Definition at line 125 of file FieldMultiIndices.hpp.

126  {
127  return generateGlobalUniqueIdForTypeLo(bitNumber, type, owner_proc);
128  }
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 185 of file FieldMultiIndices.hpp.

185  {
187  MoFEMFunctionReturnHot(coordSysPtr->get_E_Base(m));
188  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
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 205 of file FieldMultiIndices.hpp.

205  {
207  MoFEMFunctionReturnHot(coordSysPtr->get_e_Base(m));
208  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
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 195 of file FieldMultiIndices.hpp.

195  {
197  MoFEMFunctionReturnHot(coordSysPtr->get_E_DualBase(m));
198  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
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 215 of file FieldMultiIndices.hpp.

215  {
217  MoFEMFunctionReturnHot(coordSysPtr->get_e_DualBase(m));
218  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:501
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:508
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 274 of file FieldMultiIndices.hpp.

274 { 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 299 of file FieldMultiIndices.hpp.

299 { 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 306 of file FieldMultiIndices.hpp.

306  {
307  int b = ffsl(((BitFieldId *)tagId)->to_ulong());
308  if (b != 0)
309  return b;
310  for (int ll = 1; ll < BITFIELDID_SIZE / 32; ll++) {
311  BitFieldId id;
312  id = (*tagId) >> ll * 32;
313  b = ll * 32 + ffsl(id.to_ulong());
314  if (b != 0)
315  return b;
316  }
317  return 0;
318  }
#define BITFIELDID_SIZE
max number of fields
Definition: definitions.h:280
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 176 of file FieldMultiIndices.hpp.

176  {
177  return coordSysPtr->getDim(d);
178  }
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 224 of file FieldMultiIndices.hpp.

224  {
225  return coordSysPtr->getMeshset();
226  }
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 232 of file FieldMultiIndices.hpp.

232 { 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 238 of file FieldMultiIndices.hpp.

238  {
239  return coordSysPtr->getNameRef();
240  }
boost::shared_ptr< CoordSys > coordSysPtr
Pointer to field coordinate system data structure.

◆ getDofOrderMap() [1/2]

std::array<int, MAX_DOFS_ON_ENTITY>& 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 371 of file FieldMultiIndices.hpp.

371  {
372  return dofOrderMap[type];
373  }
DofsOrderMap dofOrderMap

◆ getDofOrderMap() [2/2]

DofsOrderMap& MoFEM::Field::getDofOrderMap ( ) 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 383 of file FieldMultiIndices.hpp.

383  {
384  return const_cast<DofsOrderMap&>(dofOrderMap);
385  }
DofsOrderMap dofOrderMap

◆ getDofSequenceContainer()

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 358 of file FieldMultiIndices.hpp.

358  {
359  return sequenceDofContainer;
360  }
SequenceDofContainer sequenceDofContainer

◆ getEntSequenceContainer()

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 335 of file FieldMultiIndices.hpp.

335  {
336  return sequenceEntContainer;
337  }
SequenceEntContainer sequenceEntContainer

◆ getFieldOrderTable()

FieldOrderTable& MoFEM::Field::getFieldOrderTable ( )

Get the Field Order Table.

Returns
FieldOrderTable&
Examples
forces_and_sources_testing_users_base.cpp.

Definition at line 107 of file FieldMultiIndices.hpp.

107 { 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 246 of file FieldMultiIndices.hpp.

246 { 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 167 of file FieldMultiIndices.hpp.

167 { 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 260 of file FieldMultiIndices.hpp.

260  {
261  return std::string((char *)tagName, tagNameSize);
262  }
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 252 of file FieldMultiIndices.hpp.

252  {
253  return boost::string_ref((char *)tagName, tagNameSize);
254  }
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 290 of file FieldMultiIndices.hpp.

290  {
291  return *tagNbCoeffData;
292  };
FieldCoefficientsNumber * tagNbCoeffData

◆ getSpace()

FieldSpace MoFEM::Field::getSpace ( ) const

Get field approximation space.

Returns
approximation space

Definition at line 268 of file FieldMultiIndices.hpp.

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

◆ rebuildDofsOrderMap()

MoFEMErrorCode MoFEM::Field::rebuildDofsOrderMap ( ) const

Definition at line 185 of file CoreDataStructures.cpp.

185  {
187 
188  for (auto t = MBVERTEX; t != MBMAXTYPE; ++t) {
189 
190  int DD = 0;
191  int nb_last_order_dofs = 0;
192  const int rank = (*tagNbCoeffData);
193 
194  if (forderTable[t]) {
195 
196  for (int oo = 0; oo < MAX_DOFS_ON_ENTITY; ++oo) {
197 
198  const int nb_order_dofs = forderTable[t](oo);
199  const int diff_oo = nb_order_dofs - nb_last_order_dofs;
200  if (diff_oo >= 0) {
201 
202  if ((DD + rank * diff_oo) < MAX_DOFS_ON_ENTITY)
203  for (int dd = 0; dd < diff_oo; ++dd)
204  for (int rr = 0; rr != rank; ++rr, ++DD)
205  dofOrderMap[t][DD] = oo;
206  else
207  break;
208 
209  nb_last_order_dofs = nb_order_dofs;
210 
211  } else {
212  break;
213  }
214  }
215  }
216 
217  std::fill(&dofOrderMap[t][DD], dofOrderMap[t].end(), -1);
218  }
219 
221 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
FieldOrderTable forderTable
nb. DOFs table for entities
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)
Definition: ddTensor0.hpp:33
DofsOrderMap dofOrderMap
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
Definition: definitions.h:298
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 223 of file CoreDataStructures.cpp.

223  {
224  os << "name " << e.getNameRef() << " BitFieldId " << e.getId().to_ulong()
225  << " bit number " << e.getBitNumber() << " space "
226  << FieldSpaceNames[e.getSpace()] << " approximation base "
227  << ApproximationBaseNames[e.getApproxBase()] << " rank "
228  << e.getNbOfCoeffs() << " meshset " << e.meshSet;
229  return os;
230 }
static const char *const ApproximationBaseNames[]
Definition: definitions.h:158
static const char *const FieldSpaceNames[]
Definition: definitions.h:178

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 113 of file FieldMultiIndices.hpp.

◆ coordSysPtr

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

Pointer to field coordinate system data structure.

Definition at line 81 of file FieldMultiIndices.hpp.

◆ dofOrderMap

DofsOrderMap MoFEM::Field::dofOrderMap
mutableprivate

Definition at line 392 of file FieldMultiIndices.hpp.

◆ forderTable

FieldOrderTable MoFEM::Field::forderTable

nb. DOFs table for entities

Definition at line 100 of file FieldMultiIndices.hpp.

◆ meshSet

EntityHandle MoFEM::Field::meshSet

keeps entities for this meshset

Definition at line 79 of file FieldMultiIndices.hpp.

◆ moab

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

Definition at line 77 of file FieldMultiIndices.hpp.

◆ sequenceDofContainer

SequenceDofContainer MoFEM::Field::sequenceDofContainer
mutableprivate

Definition at line 391 of file FieldMultiIndices.hpp.

◆ sequenceEntContainer

SequenceEntContainer MoFEM::Field::sequenceEntContainer
mutableprivate

Definition at line 390 of file FieldMultiIndices.hpp.

◆ tagBaseData

FieldApproximationBase* MoFEM::Field::tagBaseData

tag keeps field base

Definition at line 90 of file FieldMultiIndices.hpp.

◆ tagId

BitFieldId* MoFEM::Field::tagId

tag keeps field id

Definition at line 88 of file FieldMultiIndices.hpp.

◆ tagName

const void* MoFEM::Field::tagName

tag keeps name of the field

Definition at line 95 of file FieldMultiIndices.hpp.

◆ tagNamePrefixData

const void* MoFEM::Field::tagNamePrefixData

tag keeps name prefix of the field

Definition at line 97 of file FieldMultiIndices.hpp.

◆ tagNamePrefixSize

int MoFEM::Field::tagNamePrefixSize

number of bits necessary to keep field name prefix

Definition at line 98 of file FieldMultiIndices.hpp.

◆ tagNameSize

int MoFEM::Field::tagNameSize

number of bits necessary to keep field name

Definition at line 96 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 94 of file FieldMultiIndices.hpp.

◆ tagSpaceData

FieldSpace* MoFEM::Field::tagSpaceData

tag keeps field space

Definition at line 89 of file FieldMultiIndices.hpp.

◆ th_AppOrder

Tag MoFEM::Field::th_AppOrder

Tag storing approximation order on entity.

Definition at line 86 of file FieldMultiIndices.hpp.

◆ th_FieldData

Tag MoFEM::Field::th_FieldData

Tag storing field values on entity in the field.

Definition at line 85 of file FieldMultiIndices.hpp.

◆ th_FieldDataVerts

Tag MoFEM::Field::th_FieldDataVerts

Tag storing field values on vertices in the field.

Definition at line 84 of file FieldMultiIndices.hpp.

◆ th_FieldDataVertsType

TagType MoFEM::Field::th_FieldDataVertsType

Definition at line 83 of file FieldMultiIndices.hpp.


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