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

keeps information about DOF on the entity More...

#include <src/multi_indices/DofsMultiIndices.hpp>

Inheritance diagram for MoFEM::DofEntity:
[legend]
Collaboration diagram for MoFEM::DofEntity:
[legend]

Public Types

using interface_type_Field = interface_FieldImpl< FieldEntity, FieldEntity >
 
using interface_type_FieldEntity = interface_FieldEntity< FieldEntity >
 
using interface_type_RefEntity = interface_RefEntity< FieldEntity >
 
- Public Types inherited from MoFEM::interface_FieldImpl< FieldEntity, FieldEntity >
using interface_type_RefEntity = interface_RefEntity< FieldEntity >
 

Public Member Functions

virtual ~DofEntity ()=default
 
 DofEntity (const boost::shared_ptr< FieldEntity > &entity_ptr, const ApproximationOrder dof_order, const FieldCoefficientsNumber dof_rank, const DofIdx dof)
 
DofIdx getEntDofIdx () const
 
FieldDatagetFieldData () const
 
const UIdgetEntLocalUniqueId () const
 
const UId getEntGlobalUniqueId () const
 
UId getLocalUniqueId () const
 
UId getGlobalUniqueId () const
 
ShortId getNonNonuniqueShortId () const
 get short uid it is unique in combination with entity handle More...
 
EntityHandle getEnt () const
 
ApproximationOrder getDofOrder () const
 
FieldCoefficientsNumber getDofCoeffIdx () const
 
char getActive () const
 
- Public Member Functions inherited from MoFEM::interface_FieldEntity< FieldEntity >
 interface_FieldEntity (const boost::shared_ptr< FieldEntity > &sptr)
 
int getNbDofsOnEnt () const
 
VectorAdaptor getEntFieldData () const
 
int getOrderNbDofs (ApproximationOrder order) const
 
int getOrderNbDofsDiff (ApproximationOrder order) const
 
ApproximationOrder getMaxOrder () const
 
UId getGlobalUniqueId () const
 
UIdgetLocalUniqueId () const
 
boost::shared_ptr< RefEntity > & getRefEntityPtr () const
 
boost::shared_ptr< FieldEntity > & getFieldEntityPtr () const
 
const std::array< int, MAX_DOFS_ON_ENTITY > & getDofOrderMap () const
 get hash-map relating dof index on entity with its order More...
 
boost::shared_ptr< S > getSharedStoragePtr () const
 
boost::weak_ptr< EntityStorage > & getWeakStoragePtr () const
 
- Public Member Functions inherited from MoFEM::interface_Field< FieldEntity, FieldEntity >
 interface_Field (const boost::shared_ptr< FieldEntity > &field_ptr, const boost::shared_ptr< FieldEntity > &ref_ents_ptr)
 
EntityHandle getMeshset () const
 
int getCoordSysDim (const int d=0) const
 
const BitFieldIdgetId () const
 
boost::string_ref getNameRef () const
 
std::string getName () const
 
FieldSpace getSpace () const
 
FieldApproximationBase getApproxBase () const
 
FieldCoefficientsNumber getNbOfCoeffs () const
 
FieldBitNumber getBitNumber () const
 
std::array< ApproximationOrder, MAX_DOFS_ON_ENTITY > & getDofOrderMap (const EntityType type) const
 get hash-map relating dof index on entity with its order More...
 
const FieldgetFieldRawPtr () const
 
FieldOrderTable & getFieldOrderTable ()
 
- Public Member Functions inherited from MoFEM::interface_FieldImpl< FieldEntity, FieldEntity >
 interface_FieldImpl (const boost::shared_ptr< FieldEntity > &field_ptr, const boost::shared_ptr< FieldEntity > &ref_ents_ptr)
 
virtual ~interface_FieldImpl ()=default
 
- Public Member Functions inherited from MoFEM::interface_RefEntity< FieldEntity >
 interface_RefEntity (const boost::shared_ptr< FieldEntity > &sptr)
 
 interface_RefEntity (const interface_RefEntity< FieldEntity > &interface)
 
virtual ~interface_RefEntity ()=default
 
int getSideNumber () const
 
boost::shared_ptr< SideNumbergetSideNumberPtr () const
 Get the Side number. More...
 
const boost::shared_ptr< BasicEntityDatagetBasicDataPtr () const
 Get pointer to basic data struture. More...
 
EntityHandle getEnt () const
 Get the entity handle. More...
 
EntityType getParentEntType () const
 Get patent entity. More...
 
EntityHandle getParentEnt () const
 
BitRefLevelgetBitRefLevelPtr () const
 Get pointer to bit ref level tag. More...
 
const BitRefLevelgetBitRefLevel () const
 
unsigned long int getBitRefLevelULong () const
 Get entity ref bit refinement as ulong. More...
 
EntityType getEntType () const
 Get entity type. More...
 
int getEntDimension () const
 Get the Ent Dimension. More...
 
const char * getEntTypeName () const
 Get the Ent Type Name. More...
 
EntityID getEntId () const
 get entity id More...
 
EntityHandle getOwnerEnt () const
 
EntityHandlegetOwnerEnt ()
 
int getOwnerProc () const
 
int getPartProc () const
 
int * getPartProcPtr () const
 Get pointer to partition tag. More...
 
unsigned char getPStatus () const
 
int * getSharingProcsPtr () const
 get shared processors More...
 
EntityHandlegetSharingHandlersPtr () const
 get sharid entity handlers More...
 
boost::shared_ptr< FieldEntity > & getRefEntityPtr () const
 

Static Public Member Functions

static ShortId getNonNonuniqueShortId (const DofIdx dof, const boost::shared_ptr< FieldEntity > &ent_ptr)
 
static UId getUniqueIdCalculate (const DofIdx dof, UId ent_uid)
 
static UId getLocalUniqueIdCalculate (const DofIdx dof, const boost::shared_ptr< FieldEntity > &ent_ptr)
 
static UId getLoFieldEntityUId (const FieldBitNumber bit, const EntityHandle ent)
 
static UId getHiFieldEntityUId (const FieldBitNumber bit, const EntityHandle ent)
 
static UId getGlobalUniqueIdCalculate (const DofIdx dof, const boost::shared_ptr< FieldEntity > &ent_ptr)
 Calculate UId for DOF. More...
 

Private Attributes

DofIdx dof
 

Friends

struct DofEntity_active_change
 
std::ostream & operator<< (std::ostream &os, const DofEntity &e)
 

Additional Inherited Members

- Public Attributes inherited from MoFEM::interface_RefEntity< FieldEntity >
boost::shared_ptr< FieldEntitysPtr
 

Detailed Description

keeps information about DOF on the entity

Definition at line 16 of file DofsMultiIndices.hpp.

Member Typedef Documentation

◆ interface_type_Field

Definition at line 20 of file DofsMultiIndices.hpp.

◆ interface_type_FieldEntity

Definition at line 21 of file DofsMultiIndices.hpp.

◆ interface_type_RefEntity

Definition at line 22 of file DofsMultiIndices.hpp.

Constructor & Destructor Documentation

◆ ~DofEntity()

virtual MoFEM::DofEntity::~DofEntity ( )
virtualdefault

◆ DofEntity()

MoFEM::DofEntity::DofEntity ( const boost::shared_ptr< FieldEntity > &  entity_ptr,
const ApproximationOrder  dof_order,
const FieldCoefficientsNumber  dof_rank,
const DofIdx  dof 
)

Definition at line 10 of file DofsMultiIndices.cpp.

13  : interface_FieldEntity<FieldEntity>(entity_ptr), dof(dof) {
14 
15 #ifndef NDEBUG
16  if (PetscUnlikely(!entity_ptr))
17  THROW_MESSAGE("FieldEntity pointer not initialized");
18  if (PetscUnlikely(!sPtr))
19  THROW_MESSAGE("FieldEntity pointer not initialized");
20  if (PetscUnlikely(!getFieldEntityPtr()))
21  THROW_MESSAGE("FieldEntity pointer not initialized");
22  // verify dof order
23  if (PetscUnlikely(dof_order != getDofOrderMap()[dof])) {
25  "Inconsistent DOF order with order set before for entity " +
26  boost::lexical_cast<std::string>(*entity_ptr) + "\n" + "dof->" +
27  boost::lexical_cast<std::string>(dof) + " dof_order->" +
28  boost::lexical_cast<std::string>(dof_order) +
29  " != " + boost::lexical_cast<std::string>(getDofOrderMap()[dof]) +
30  "<-getDofOrderMap()[dof]");
31  }
32 
33  // verify dof rank
34  if (PetscUnlikely(dof_rank != dof % getNbOfCoeffs()))
35  THROW_MESSAGE("Inconsistent DOFs rank with index of DOF on entity");
36 #endif
37 }

Member Function Documentation

◆ getActive()

char MoFEM::DofEntity::getActive ( ) const
inline
Returns
return true if dof us active

Definition at line 136 of file DofsMultiIndices.hpp.

136 { return dof < 0 ? 0 : 1; }

◆ getDofCoeffIdx()

FieldCoefficientsNumber MoFEM::DofEntity::getDofCoeffIdx ( ) const
inline
Returns
get dof coefficient index

Definition at line 131 of file DofsMultiIndices.hpp.

131  {
132  return getEntDofIdx() % getNbOfCoeffs();
133  }

◆ getDofOrder()

ApproximationOrder MoFEM::DofEntity::getDofOrder ( ) const
inline
Returns
get dof approximation order

Definition at line 126 of file DofsMultiIndices.hpp.

126  {
127  return getDofOrderMap()[getEntDofIdx()];
128  }

◆ getEnt()

EntityHandle MoFEM::DofEntity::getEnt ( ) const
inline
Returns
get dof entity handle

Definition at line 123 of file DofsMultiIndices.hpp.

123 { return this->sPtr->getEnt(); }

◆ getEntDofIdx()

DofIdx MoFEM::DofEntity::getEntDofIdx ( ) const
inline
Returns
get dof index on entity

Definition at line 36 of file DofsMultiIndices.hpp.

36 { return std::abs(dof); }

◆ getEntGlobalUniqueId()

const UId MoFEM::DofEntity::getEntGlobalUniqueId ( ) const
inline
Returns
get entity unique dof id

Definition at line 50 of file DofsMultiIndices.hpp.

50  {
51  return this->sPtr->getGlobalUniqueId();
52  }

◆ getEntLocalUniqueId()

const UId& MoFEM::DofEntity::getEntLocalUniqueId ( ) const
inline
Returns
get entity unique dof id

Definition at line 45 of file DofsMultiIndices.hpp.

45  {
46  return this->sPtr->getLocalUniqueId();
47  }

◆ getFieldData()

FieldData& MoFEM::DofEntity::getFieldData ( ) const
inline
Returns
get field data on dof

Definition at line 39 of file DofsMultiIndices.hpp.

39  {
40  return const_cast<FieldData &>(
41  (*this->sPtr->getEntFieldDataPtr())[getEntDofIdx()]);
42  }

◆ getGlobalUniqueId()

UId MoFEM::DofEntity::getGlobalUniqueId ( ) const
inline
Returns
get unique dof id

Definition at line 99 of file DofsMultiIndices.hpp.

99  {
100  return getUniqueIdCalculate(std::abs(dof), this->sPtr->getGlobalUniqueId());
101  }

◆ getGlobalUniqueIdCalculate()

static UId MoFEM::DofEntity::getGlobalUniqueIdCalculate ( const DofIdx  dof,
const boost::shared_ptr< FieldEntity > &  ent_ptr 
)
inlinestatic

Calculate UId for DOF.

UId is constructed such that all DOFs are ordered by processor, entity, field and dof index on entity, On entity dofs index is constructed such that coefficient number and dofs increase with dofs index on entity.

Parameters
dofdof index on entity
ent_ptrpointer to field entity
Returns
UId

Definition at line 93 of file DofsMultiIndices.hpp.

94  {
95  return getUniqueIdCalculate(dof, ent_ptr->getGlobalUniqueId());
96  }

◆ getHiFieldEntityUId()

static UId MoFEM::DofEntity::getHiFieldEntityUId ( const FieldBitNumber  bit,
const EntityHandle  ent 
)
inlinestatic

Definition at line 75 of file DofsMultiIndices.hpp.

◆ getLocalUniqueId()

UId MoFEM::DofEntity::getLocalUniqueId ( ) const
inline
Returns
get unique dof id

Definition at line 65 of file DofsMultiIndices.hpp.

65  {
66  return getUniqueIdCalculate(std::abs(dof), this->sPtr->getLocalUniqueId());
67  }

◆ getLocalUniqueIdCalculate()

static UId MoFEM::DofEntity::getLocalUniqueIdCalculate ( const DofIdx  dof,
const boost::shared_ptr< FieldEntity > &  ent_ptr 
)
inlinestatic

Definition at line 59 of file DofsMultiIndices.hpp.

60  {
61  return getUniqueIdCalculate(dof, ent_ptr->getLocalUniqueId());
62  }

◆ getLoFieldEntityUId()

static UId MoFEM::DofEntity::getLoFieldEntityUId ( const FieldBitNumber  bit,
const EntityHandle  ent 
)
inlinestatic

Definition at line 69 of file DofsMultiIndices.hpp.

◆ getNonNonuniqueShortId() [1/2]

ShortId MoFEM::DofEntity::getNonNonuniqueShortId ( ) const
inline

get short uid it is unique in combination with entity handle

EntityHandle are controlled by MOAB, which is unique in MOAB instance. However two MOAB instances, can have attached different EntityHandles to the same entity.

Relation between MoAB EntityHandle can be handled by saving entity handle data into tag, see MB_TYPE_HANDLE. MOAB at time of file reading or creating new MOAB instance, substitute tag value by approbate entity handle.

ShortId is created to handle problems related to saving data series, and reading those data using different MoAB instances.

Definition at line 118 of file DofsMultiIndices.hpp.

118  {
120  }

◆ getNonNonuniqueShortId() [2/2]

static ShortId MoFEM::DofEntity::getNonNonuniqueShortId ( const DofIdx  dof,
const boost::shared_ptr< FieldEntity > &  ent_ptr 
)
inlinestatic

Definition at line 25 of file DofsMultiIndices.hpp.

26  {
27  return static_cast<ShortId>(dof) |
28  (static_cast<ShortId>(ent_ptr->getBitNumber()) << 9);
29  }

◆ getUniqueIdCalculate()

static UId MoFEM::DofEntity::getUniqueIdCalculate ( const DofIdx  dof,
UId  ent_uid 
)
inlinestatic
Examples
eigen_elastic.cpp, and heat_method.cpp.

Definition at line 54 of file DofsMultiIndices.hpp.

54  {
55  return ent_uid | dof;
56  }

Friends And Related Function Documentation

◆ DofEntity_active_change

friend struct DofEntity_active_change
friend

Definition at line 143 of file DofsMultiIndices.hpp.

◆ operator<<

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

Definition at line 39 of file DofsMultiIndices.cpp.

39  {
40  os << "dof_uid " << e.getLocalUniqueId() << " dof_order " << e.getDofOrder()
41  << " dof_rank " << e.getDofCoeffIdx() << " dof " << e.getEntDofIdx()
42  << " active " << (e.dof < 0 ? false : true) << " "
43  << *e.getFieldEntityPtr();
44  return os;
45 }

Member Data Documentation

◆ dof

DofIdx MoFEM::DofEntity::dof
private

Definition at line 141 of file DofsMultiIndices.hpp.


The documentation for this struct was generated from the following files:
MoFEM::FieldEntity::getLoFieldEntityUId
static UId getLoFieldEntityUId(const UId &uid)
Definition: FieldEntsMultiIndices.hpp:236
MoFEM::DofEntity::getUniqueIdCalculate
static UId getUniqueIdCalculate(const DofIdx dof, UId ent_uid)
Definition: DofsMultiIndices.hpp:54
MoFEM::interface_RefEntity< FieldEntity >::sPtr
boost::shared_ptr< FieldEntity > sPtr
Definition: RefEntsMultiIndices.hpp:711
MoFEM::DofEntity::getEntDofIdx
DofIdx getEntDofIdx() const
Definition: DofsMultiIndices.hpp:36
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:561
MoFEM::FieldEntity::getHiFieldEntityUId
static UId getHiFieldEntityUId(const UId &uid)
Definition: FieldEntsMultiIndices.hpp:240
MoFEM::interface_FieldEntity< FieldEntity >::getFieldEntityPtr
boost::shared_ptr< FieldEntity > & getFieldEntityPtr() const
Definition: FieldEntsMultiIndices.hpp:363
MoFEM::Types::ShortId
int ShortId
Unique Id in the field.
Definition: Types.hpp:32
MoFEM::DofEntity::dof
DofIdx dof
Definition: DofsMultiIndices.hpp:141
bit
auto bit
set bit
Definition: hanging_node_approx.cpp:75
MoFEM::FieldEntity::getLocalUniqueIdCalculate
UId getLocalUniqueIdCalculate()
Get the Local Unique Id Calculate object.
Definition: FieldEntsMultiIndices.hpp:136
MoFEM::interface_Field< FieldEntity, FieldEntity >::getNbOfCoeffs
FieldCoefficientsNumber getNbOfCoeffs() const
Definition: FieldMultiIndices.hpp:342
MoFEM::DofEntity::getNonNonuniqueShortId
ShortId getNonNonuniqueShortId() const
get short uid it is unique in combination with entity handle
Definition: DofsMultiIndices.hpp:118
MoFEM::Types::FieldData
double FieldData
Field data type.
Definition: Types.hpp:25
MoFEM::interface_FieldEntity< FieldEntity >::getDofOrderMap
const std::array< int, MAX_DOFS_ON_ENTITY > & getDofOrderMap() const
get hash-map relating dof index on entity with its order
Definition: FieldEntsMultiIndices.hpp:375