v0.8.13
Public Types | Public Member Functions | Static Public Member Functions | Public 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
 

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:331

◆ ~FieldEntity()

MoFEM::FieldEntity::~FieldEntity ( )

Definition at line 190 of file EntsMultiIndices.cpp.

190 {}

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 688 of file EntsMultiIndices.hpp.

688  {
689  return getFieldPtr()->getDofOrderMap(getEntType());
690  }
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 180 of file EntsMultiIndices.cpp.

180  {
181  int size = getNbDofsOnEnt();
182  int tag_size;
183  double *ptr = static_cast<double *>(MoFEM::get_tag_ptr(
184  sFieldPtr->moab, sFieldPtr->th_FieldData, sPtr->ent, &tag_size));
185  tag_size /= sizeof(FieldData);
186  return VectorAdaptor(size,
187  ublas::shallow_array_adaptor<FieldData>(tag_size, ptr));
188 }
boost::shared_ptr< RefEntity > sPtr
double FieldData
Field data type.
Definition: Common.hpp:130
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Common.hpp:234
void * get_tag_ptr(moab::Interface &moab, Tag th, EntityHandle ent, int *tag_size)
int getNbDofsOnEnt() const
Get number of active DOFs on entity.
boost::shared_ptr< Field > sFieldPtr

◆ getFieldPtr()

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

Get pointer to Field data structure associated with this entity.

Definition at line 674 of file EntsMultiIndices.hpp.

674  {
675  return this->sFieldPtr;
676  }
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  if (true_if_distributed_mesh) {
637  return static_cast<UId>(bit_number) |
638  static_cast<UId>(moab_owner_handle) << 5 |
639  static_cast<UId>(owner_proc) << 5 + 8 * sizeof(EntityHandle);
640  } else {
641  return static_cast<UId>(bit_number) | static_cast<UId>(moab_owner_handle)
642  << 5;
643  }
644  }
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 660 of file EntsMultiIndices.hpp.

660  {
662  sPtr->owner_proc, getBitNumber(), sPtr->moab_owner_handle,
663  getBasicDataPtr()->trueIfDistributedMesh());
664  }
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 650 of file EntsMultiIndices.hpp.

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

◆ getGlobalUniqueIdCalculate_Low_Proc()

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

Definition at line 646 of file EntsMultiIndices.hpp.

646  {
647  return (UId)owner_proc << 5 + 8 * sizeof(EntityHandle);
648  }
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->forder_table[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 669 of file EntsMultiIndices.hpp.

669 { 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 191 of file EntsMultiIndices.cpp.

191  {
192  os << "ent_global_uid "
193  << (UId)e.getGlobalUniqueId()
194  // << " ent_local_uid " << (UId)e.get_local_unique_id()
195  << " entity " << e.getEnt() << " type " << e.getEntType() << " pstatus "
196  << std::bitset<8>(e.getPStatus()) << " owner handle " << e.getOwnerEnt()
197  << " owner proc " << e.getOwnerProc() << " order " << e.getMaxOrder()
198  << " " << *e.sFieldPtr;
199  return os;
200 }
uint128_t UId
Unique Id.
Definition: Common.hpp:136

Member Data Documentation

◆ 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: