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

Struct keeps handle to entity in the field. More...

#include <src/multi_indices/EntsMultiIndices.hpp>

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

Public Types

typedef interface_Field< Fieldinterface_type_Field
 
typedef interface_RefEntity< RefEntityinterface_type_RefEntity
 

Public Member Functions

 FieldEntity (const boost::shared_ptr< Field > &field_ptr, const boost::shared_ptr< RefEntity > &ref_ent_ptr)
 
 ~FieldEntity ()
 
EntityHandle getEnt () const
 Get entity handle. More...
 
int getNbDofsOnEnt () const
 Get number of active DOFs on entity. More...
 
VectorAdaptor getEntFieldData () const
 Get vector of DOFs active values on entity. More...
 
int getOrderNbDofs (int order) const
 Get number of DOFs on entity for given order of approximation. More...
 
int getOrderNbDofsDiff (int order) const
 Get difference of number of DOFs between order and order-1. More...
 
ApproximationOrdergetMaxOrderPtr ()
 Get pinter to Tag keeping approximation order. More...
 
ApproximationOrder getMaxOrder () const
 Get order set to the entity (Allocated tag size for such number) More...
 
const UIdgetGlobalUniqueId () const
 Get global unique id. More...
 
UId getGlobalUniqueIdCalculate () const
 Calculate global UId. More...
 
boost::shared_ptr< RefEntity > & getRefEntityPtr ()
 Get pointer to RefEntity. More...
 
boost::shared_ptr< Field > & getFieldPtr () const
 Get pointer to Field data structure associated with this entity. More...
 
std::vector< ApproximationOrder > & getDofOrderMap () const
 get hash-map relating dof index on entity with its order More...
 
- Public Member Functions inherited from MoFEM::interface_Field< Field >
 interface_Field (const boost::shared_ptr< Field > &field_ptr)
 
 interface_Field (const interface_Field< Field > &interface)
 
virtual ~interface_Field ()
 
EntityHandle getMeshset () const
 
int getCoordSysId () const
 
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
 
MoFEMErrorCode get_E_DualBase (const double m[]) const
 
MoFEMErrorCode get_e_Base (const double m[]) const
 
MoFEMErrorCode get_e_DualBase (const double m[]) const
 
EntityHandle getCoordSysMeshSet () const
 
std::string getCoordSysName () const
 
boost::string_ref getCoordSysNameRef () const
 
const BitFieldIdgetId () const
 
boost::string_ref getNameRef () const
 
std::string getName () const
 
FieldSpace getSpace () const
 
FieldApproximationBase getApproxBase () const
 
FieldCoefficientsNumber getNbOfCoeffs () const
 
unsigned int getBitNumber () const
 
boost::shared_ptr< Field > & getFieldPtr () const
 
std::vector< ApproximationOrder > & getDofOrderMap (const EntityType type) const
 get hash-map relating dof index on entity with its order More...
 
- Public Member Functions inherited from MoFEM::interface_RefEntity< RefEntity >
 interface_RefEntity (const boost::shared_ptr< RefEntity > &sptr)
 
 interface_RefEntity (const interface_RefEntity< RefEntity > &interface)
 
virtual ~interface_RefEntity ()
 
boost::shared_ptr< BasicEntityData > & getBasicDataPtr ()
 
const boost::shared_ptr< BasicEntityData > & getBasicDataPtr () const
 
EntityHandle getRefEnt () const
 
EntityType getParentEntType () const
 
EntityHandle getParentEnt () const
 
BitRefLevelgetBitRefLevelPtr () const
 
const BitRefLevelgetBitRefLevel () const
 
unsigned long int getBitRefLevelULong () const
 
EntityType getEntType () const
 
EntityID getEntId () const
 
EntityHandle getOwnerEnt () const
 
EntityHandlegetOwnerEnt ()
 
int getOwnerProc () const
 
intgetOwnerProc ()
 
int getPartProc () const
 
intgetPartProc ()
 
unsigned char getPStatus () const
 
intgetSharingProcsPtr () const
 
EntityHandlegetSharingHandlersPtr () const
 
boost::shared_ptr< RefEntity > & getRefEntityPtr () const
 

Static Public Member Functions

static UId getGlobalUniqueIdCalculate (const int owner_proc, const char bit_number, const EntityHandle moab_owner_handle, const bool true_if_distributed_mesh)
 Calculate UId for field entity. More...
 
static UId getGlobalUniqueIdCalculate_Low_Proc (const int owner_proc)
 
static UId getGlobalUniqueIdCalculate_Hi_Proc (const int owner_proc)
 

Public Attributes

UId globalUid
 Global unique id for this entity. More...
 
- Public Attributes inherited from MoFEM::interface_Field< Field >
boost::shared_ptr< FieldsFieldPtr
 
- Public Attributes inherited from MoFEM::interface_RefEntity< RefEntity >
boost::shared_ptr< RefEntitysPtr
 

Static Private Attributes

static UIdgetEntFieldDataLastUid = NULL
 
static doublegetEntFieldDataLastPtr = NULL
 
static int getEntFieldDataLastSize = 0
 
static int getEntFieldDataLastTagSize = 0
 

Friends

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

Detailed Description

Struct keeps handle to entity in the field.

Definition at line 550 of file EntsMultiIndices.hpp.

Member Typedef Documentation

◆ interface_type_Field

Definition at line 553 of file EntsMultiIndices.hpp.

◆ interface_type_RefEntity

Definition at line 554 of file EntsMultiIndices.hpp.

Constructor & Destructor Documentation

◆ FieldEntity()

MoFEM::FieldEntity::FieldEntity ( const boost::shared_ptr< Field > &  field_ptr,
const boost::shared_ptr< RefEntity > &  ref_ent_ptr 
)

Definition at line 163 of file EntsMultiIndices.cpp.

165  : interface_Field<Field>(field_ptr), interface_RefEntity<RefEntity>(
166  ref_ent_ptr) {
168  getDofOrderMap().resize(MAX_DOFS_ON_ENTITY, -1);
169 }
UId globalUid
Global unique id for this entity.
UId getGlobalUniqueIdCalculate() const
Calculate global UId.
std::vector< ApproximationOrder > & getDofOrderMap() const
get hash-map relating dof index on entity with its order
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
Definition: definitions.h:295

◆ ~FieldEntity()

MoFEM::FieldEntity::~FieldEntity ( )

Definition at line 205 of file EntsMultiIndices.cpp.

205 {}

Member Function Documentation

◆ getDofOrderMap()

std::vector<ApproximationOrder>& MoFEM::FieldEntity::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 690 of file EntsMultiIndices.hpp.

690  {
691  return getFieldPtr()->getDofOrderMap(getEntType());
692  }
boost::shared_ptr< Field > & getFieldPtr() const
Get pointer to Field data structure associated with this entity.

◆ getEnt()

EntityHandle MoFEM::FieldEntity::getEnt ( ) const

Get entity handle.

Returns
EntityHandle

Definition at line 565 of file EntsMultiIndices.hpp.

565 { return getRefEnt(); }

◆ getEntFieldData()

VectorAdaptor MoFEM::FieldEntity::getEntFieldData ( ) const

Get vector of DOFs active values on entity.

Returns
Vector of DOFs values

Definition at line 185 of file EntsMultiIndices.cpp.

185  {
187  getEntFieldDataLastUid = const_cast<UId *>(&globalUid);
189  getEntFieldDataLastPtr = static_cast<double *>(
190  MoFEM::get_tag_ptr(sFieldPtr->moab, sFieldPtr->th_FieldData, sPtr->ent,
193  return VectorAdaptor(
195  ublas::shallow_array_adaptor<double>(getEntFieldDataLastTagSize,
197  } else {
198  return VectorAdaptor(
200  ublas::shallow_array_adaptor<double>(getEntFieldDataLastTagSize,
202  }
203 }
boost::shared_ptr< RefEntity > sPtr
UId globalUid
Global unique id for this entity.
static double * getEntFieldDataLastPtr
uint128_t UId
Unique Id.
Definition: Common.hpp:136
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Common.hpp:234
static int getEntFieldDataLastSize
void * get_tag_ptr(moab::Interface &moab, Tag th, EntityHandle ent, int *tag_size)
int getNbDofsOnEnt() const
Get number of active DOFs on entity.
static int getEntFieldDataLastTagSize
boost::shared_ptr< Field > sFieldPtr
static UId * getEntFieldDataLastUid

◆ getFieldPtr()

boost::shared_ptr<Field>& MoFEM::FieldEntity::getFieldPtr ( ) const

Get pointer to Field data structure associated with this entity.

Definition at line 676 of file EntsMultiIndices.hpp.

676  {
677  return this->sFieldPtr;
678  }
boost::shared_ptr< Field > sFieldPtr

◆ getGlobalUniqueId()

const UId& MoFEM::FieldEntity::getGlobalUniqueId ( ) const

Get global unique id.

Returns
Global UId

Definition at line 615 of file EntsMultiIndices.hpp.

615 { return globalUid; }
UId globalUid
Global unique id for this entity.

◆ getGlobalUniqueIdCalculate() [1/2]

static UId MoFEM::FieldEntity::getGlobalUniqueIdCalculate ( const int  owner_proc,
const char  bit_number,
const EntityHandle  moab_owner_handle,
const bool  true_if_distributed_mesh 
)
static

Calculate UId for field entity.

UId is constructed such that all DOFs are ordered by processor, entity, field.

Parameters
owner_procowning processor
bit_numberfield bit number
moab_owner_handleentity handle on owning processor
true_if_distributed_meshif true UId is constructed for distributed meshes
Returns
UId

Definition at line 631 of file EntsMultiIndices.hpp.

633  {
634  // assert(bit_number < 32);
635  // assert(owner_proc < 1024);
636  constexpr int ent_shift = 8 * sizeof(EntityHandle);
637  if (true_if_distributed_mesh)
638  return (static_cast<UId>(moab_owner_handle) |
639  static_cast<UId>(bit_number) << ent_shift |
640  static_cast<UId>(owner_proc) << 5 + ent_shift)
641  << 9;
642  else
643  return (static_cast<UId>(moab_owner_handle) | static_cast<UId>(bit_number)
644  << ent_shift)
645  << 9;
646  }
uint128_t UId
Unique Id.
Definition: Common.hpp:136

◆ getGlobalUniqueIdCalculate() [2/2]

UId MoFEM::FieldEntity::getGlobalUniqueIdCalculate ( ) const

Calculate global UId.

Returns
Global UId

Definition at line 662 of file EntsMultiIndices.hpp.

662  {
664  sPtr->owner_proc, getBitNumber(), sPtr->moab_owner_handle,
665  getBasicDataPtr()->trueIfDistributedMesh());
666  }
boost::shared_ptr< RefEntity > sPtr
UId getGlobalUniqueIdCalculate() const
Calculate global UId.
boost::shared_ptr< BasicEntityData > & getBasicDataPtr()

◆ getGlobalUniqueIdCalculate_Hi_Proc()

static UId MoFEM::FieldEntity::getGlobalUniqueIdCalculate_Hi_Proc ( const int  owner_proc)
static

Definition at line 652 of file EntsMultiIndices.hpp.

652  {
653  return (UId)MBMAXTYPE |
654  (UId)(BITFIELDID_SIZE - 1) << 8 * sizeof(EntityHandle) |
655  (UId)owner_proc << 5 + 8 * sizeof(EntityHandle);
656  }
uint128_t UId
Unique Id.
Definition: Common.hpp:136
#define BITFIELDID_SIZE
max number of fields
Definition: definitions.h:277

◆ getGlobalUniqueIdCalculate_Low_Proc()

static UId MoFEM::FieldEntity::getGlobalUniqueIdCalculate_Low_Proc ( const int  owner_proc)
static

Definition at line 648 of file EntsMultiIndices.hpp.

648  {
649  return (UId)owner_proc << 5 + 8 * sizeof(EntityHandle);
650  }
uint128_t UId
Unique Id.
Definition: Common.hpp:136

◆ getMaxOrder()

ApproximationOrder MoFEM::FieldEntity::getMaxOrder ( ) const

Get order set to the entity (Allocated tag size for such number)

Returns
Approximation order

Definition at line 175 of file EntsMultiIndices.cpp.

175  {
176  return *static_cast<ApproximationOrder *>(MoFEM::get_tag_ptr(
177  sFieldPtr->moab, sFieldPtr->th_AppOrder, sPtr->ent, NULL));
178 }
boost::shared_ptr< RefEntity > sPtr
int ApproximationOrder
Approximation on the entity.
Definition: Common.hpp:131
void * get_tag_ptr(moab::Interface &moab, Tag th, EntityHandle ent, int *tag_size)
boost::shared_ptr< Field > sFieldPtr

◆ getMaxOrderPtr()

ApproximationOrder * MoFEM::FieldEntity::getMaxOrderPtr ( )

Get pinter to Tag keeping approximation order.

Returns
Pointer to Tag

Definition at line 171 of file EntsMultiIndices.cpp.

171  {
172  return static_cast<ApproximationOrder *>(MoFEM::get_tag_ptr(
173  sFieldPtr->moab, sFieldPtr->th_AppOrder, sPtr->ent, NULL));
174 }
boost::shared_ptr< RefEntity > sPtr
int ApproximationOrder
Approximation on the entity.
Definition: Common.hpp:131
void * get_tag_ptr(moab::Interface &moab, Tag th, EntityHandle ent, int *tag_size)
boost::shared_ptr< Field > sFieldPtr

◆ getNbDofsOnEnt()

int MoFEM::FieldEntity::getNbDofsOnEnt ( ) const

Get number of active DOFs on entity.

Returns
Number of DOFs

Definition at line 571 of file EntsMultiIndices.hpp.

571  {
573  }
int getOrderNbDofs(int order) const
Get number of DOFs on entity for given order of approximation.
FieldCoefficientsNumber getNbOfCoeffs() const
ApproximationOrder getMaxOrder() const
Get order set to the entity (Allocated tag size for such number)

◆ getOrderNbDofs()

int MoFEM::FieldEntity::getOrderNbDofs ( int  order) const

Get number of DOFs on entity for given order of approximation.

Parameters
orderOrder of approximation
Returns
Number of DOFs

Definition at line 586 of file EntsMultiIndices.hpp.

586  {
587  return (this->sFieldPtr->forderTable[getEntType()])(order);
588  }
boost::shared_ptr< Field > sFieldPtr

◆ getOrderNbDofsDiff()

int MoFEM::FieldEntity::getOrderNbDofsDiff ( int  order) const

Get difference of number of DOFs between order and order-1.

Parameters
orderApproximation order
Returns
Difference number of DOFs

Definition at line 595 of file EntsMultiIndices.hpp.

595  {
596  return getOrderNbDofs(order) - getOrderNbDofs(order - 1);
597  }
int getOrderNbDofs(int order) const
Get number of DOFs on entity for given order of approximation.

◆ getRefEntityPtr()

boost::shared_ptr<RefEntity>& MoFEM::FieldEntity::getRefEntityPtr ( )

Get pointer to RefEntity.

Definition at line 671 of file EntsMultiIndices.hpp.

671 { return this->sPtr; }
boost::shared_ptr< RefEntity > sPtr

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 206 of file EntsMultiIndices.cpp.

206  {
207  os << "ent_global_uid "
208  << (UId)e.getGlobalUniqueId()
209  // << " ent_local_uid " << (UId)e.get_local_unique_id()
210  << " entity " << e.getEnt() << " type " << e.getEntType() << " pstatus "
211  << std::bitset<8>(e.getPStatus()) << " owner handle " << e.getOwnerEnt()
212  << " owner proc " << e.getOwnerProc() << " order " << e.getMaxOrder()
213  << " " << *e.sFieldPtr;
214  return os;
215 }
uint128_t UId
Unique Id.
Definition: Common.hpp:136

Member Data Documentation

◆ getEntFieldDataLastPtr

double * MoFEM::FieldEntity::getEntFieldDataLastPtr = NULL
staticprivate

Definition at line 698 of file EntsMultiIndices.hpp.

◆ getEntFieldDataLastSize

int MoFEM::FieldEntity::getEntFieldDataLastSize = 0
staticprivate

Definition at line 699 of file EntsMultiIndices.hpp.

◆ getEntFieldDataLastTagSize

int MoFEM::FieldEntity::getEntFieldDataLastTagSize = 0
staticprivate

Definition at line 700 of file EntsMultiIndices.hpp.

◆ getEntFieldDataLastUid

UId * MoFEM::FieldEntity::getEntFieldDataLastUid = NULL
staticprivate

Definition at line 697 of file EntsMultiIndices.hpp.

◆ globalUid

UId MoFEM::FieldEntity::globalUid

Global unique id for this entity.

Definition at line 555 of file EntsMultiIndices.hpp.


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