v0.5.86
Public Member Functions | Static Public Member Functions | Friends | List of all members
MoFEM::RefEntity Struct Reference

Struct keeps handle to refined handle. More...

#include <src/multi_indices/EntsMultiIndices.hpp>

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

Public Member Functions

 RefEntity (const boost::shared_ptr< BasicEntityData > &basic_data_ptr, const EntityHandle ent)
 
EntityHandlegetParentEntPtr () const
 Get pointer to parent entity tag. More...
 
BitRefLevelgetBitRefLevelPtr () const
 Get pointer to bit ref level tag. More...
 
EntityHandle getRefEnt () const
 Get entity. More...
 
EntityType getParentEntType () const
 Get patent entity. More...
 
EntityHandle getParentEnt () const
 Get parent entity, i.e. entity form one refinement level up. More...
 
const BitRefLevelgetBitRefLevel () const
 Get entity ref bit refinement signature. More...
 
unsigned long int getBitRefLevelULong () const
 Get entity ref bit refinement as ulong. More...
 
- Public Member Functions inherited from MoFEM::BasicEntity
 BasicEntity (const boost::shared_ptr< BasicEntityData > &basic_data_ptr, const EntityHandle ent)
 
boost::shared_ptr< BasicEntityData > & getBasicDataPtr ()
 
const boost::shared_ptr< BasicEntityData > & getBasicDataPtr () const
 
EntityType getEntType () const
 Get entity type. More...
 
EntityID getEntId () const
 get entity id More...
 
EntityHandle getOwnerEnt () const
 Owner handle on this or other processors. More...
 
EntityHandlegetOwnerEnt ()
 Owner handle on this or other processors. More...
 
int getOwnerProc () const
 Get processor owning entity. More...
 
intgetOwnerProc ()
 Get processor owning entity. More...
 
int getPartProc () const
 Get processor. More...
 
intgetPartProc ()
 Get processor owning entity. More...
 
unsigned char getPStatus () const
 get pstatus This tag stores various aspects of parallel status in bits; see also #define's following, to be used in bit mask operations. If an entity is not shared with any other processors, the pstatus is 0, otherwise it's > 0 More...
 
intgetSharingProcsPtr () const
 
EntityHandlegetSharingHandlersPtr () const
 

Static Public Member Functions

static PetscErrorCode getPatentEnt (Interface &moab, Range ents, std::vector< EntityHandle > vec_patent_ent)
 
static PetscErrorCode getBitRefLevel (Interface &moab, Range ents, std::vector< BitRefLevel > vec_bit_ref_level)
 

Friends

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

Additional Inherited Members

- Public Attributes inherited from MoFEM::BasicEntity
boost::shared_ptr< BasicEntityDatabasicDataPtr
 
EntityHandle ent
 
int owner_proc
 this never can not be changed if distributed mesh More...
 
int part_proc
 this can be changed on distributed More...
 
EntityHandle moab_owner_handle
 

Detailed Description

Struct keeps handle to refined handle.

Todo:
th_RefType "_RefType" is set as two integers, need to be fixed, it is waste of space.

Definition at line 256 of file EntsMultiIndices.hpp.

Constructor & Destructor Documentation

◆ RefEntity()

MoFEM::RefEntity::RefEntity ( const boost::shared_ptr< BasicEntityData > &  basic_data_ptr,
const EntityHandle  ent 
)

Definition at line 105 of file EntsMultiIndices.cpp.

107  :
108 BasicEntity(basic_data_ptr,ent) {
109 }
BasicEntity(const boost::shared_ptr< BasicEntityData > &basic_data_ptr, const EntityHandle ent)

Member Function Documentation

◆ getBitRefLevel() [1/2]

PetscErrorCode MoFEM::RefEntity::getBitRefLevel ( Interface moab,
Range  ents,
std::vector< BitRefLevel vec_bit_ref_level 
)
static

Definition at line 133 of file EntsMultiIndices.cpp.

133  {
134 
135  PetscFunctionBegin;
136  Tag th_ref_bit_level;
137  rval = moab.tag_get_handle("_RefBitLevel",th_ref_bit_level); MOAB_THROW(rval);
138  vec_bit_ref_level.resize(ents.size());
139  rval = moab.tag_get_data(th_ref_bit_level,ents,&*vec_bit_ref_level.begin()); CHKERRQ_MOAB(rval);
140  PetscFunctionReturn(0);
141 }
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:362
static MoABErrorCode rval
Definition: Common.hpp:25
#define MOAB_THROW(a)
Definition: definitions.h:376

◆ getBitRefLevel() [2/2]

const BitRefLevel& MoFEM::RefEntity::getBitRefLevel ( ) const

Get entity ref bit refinement signature.

Definition at line 310 of file EntsMultiIndices.hpp.

310 { return *getBitRefLevelPtr(); }
BitRefLevel * getBitRefLevelPtr() const
Get pointer to bit ref level tag.

◆ getBitRefLevelPtr()

BitRefLevel * MoFEM::RefEntity::getBitRefLevelPtr ( ) const

Get pointer to bit ref level tag.

Every entity belongs to some refinement level or levels. Each level is marked by bit set in BitRefLevel() (bitset) structure.

See Explaining mesh BitRefLevel for explanation.

Returns
Return pointer to tag.

Definition at line 117 of file EntsMultiIndices.cpp.

117  {
118  return (BitRefLevel*)get_tag_ptr(
119  static_cast<moab::Core*>(&basicDataPtr->moab)->sequence_manager(),basicDataPtr->th_RefBitLevel,ent,NULL
120  );
121 }
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Common.hpp:48
boost::shared_ptr< BasicEntityData > basicDataPtr
void * get_tag_ptr(SequenceManager *sequence_manager, Tag th, EntityHandle ent, int *tag_size)

◆ getBitRefLevelULong()

unsigned long int MoFEM::RefEntity::getBitRefLevelULong ( ) const

Get entity ref bit refinement as ulong.

Definition at line 314 of file EntsMultiIndices.hpp.

314 { return getBitRefLevel().to_ulong(); }
const BitRefLevel & getBitRefLevel() const
Get entity ref bit refinement signature.

◆ getParentEnt()

EntityHandle MoFEM::RefEntity::getParentEnt ( ) const

Get parent entity, i.e. entity form one refinement level up.

Definition at line 303 of file EntsMultiIndices.hpp.

303  {
304  EntityHandle* tag_parent_ent = getParentEntPtr();
305  return *tag_parent_ent;
306  }
EntityHandle * getParentEntPtr() const
Get pointer to parent entity tag.

◆ getParentEntPtr()

EntityHandle * MoFEM::RefEntity::getParentEntPtr ( ) const

Get pointer to parent entity tag.

Each refined entity has his parent. Such information is stored on tags. This function get pinter to tag.

Returns
Pointer to tag on entity

Definition at line 111 of file EntsMultiIndices.cpp.

111  {
112  return (EntityHandle*)get_tag_ptr(
113  static_cast<moab::Core*>(&basicDataPtr->moab)->sequence_manager(),basicDataPtr->th_RefParentHandle,ent,NULL
114  );
115 }
boost::shared_ptr< BasicEntityData > basicDataPtr
void * get_tag_ptr(SequenceManager *sequence_manager, Tag th, EntityHandle ent, int *tag_size)

◆ getParentEntType()

EntityType MoFEM::RefEntity::getParentEntType ( ) const

Get patent entity.

Definition at line 295 of file EntsMultiIndices.hpp.

295  {
296  EntityHandle* tag_parent_ent = getParentEntPtr();
297  if(*tag_parent_ent == 0) return MBMAXTYPE;
298  return (EntityType)((*tag_parent_ent&MB_TYPE_MASK)>>MB_ID_WIDTH);
299  }
EntityHandle * getParentEntPtr() const
Get pointer to parent entity tag.
#define MB_TYPE_MASK
Definition: definitions.h:310
#define MB_ID_WIDTH
Definition: definitions.h:309

◆ getPatentEnt()

static PetscErrorCode MoFEM::RefEntity::getPatentEnt ( Interface moab,
Range  ents,
std::vector< EntityHandle vec_patent_ent 
)
static

◆ getRefEnt()

EntityHandle MoFEM::RefEntity::getRefEnt ( ) const

Get entity.

Definition at line 291 of file EntsMultiIndices.hpp.

291 { return ent; }

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 143 of file EntsMultiIndices.cpp.

143  {
144  os << "ent " << e.ent;
145  os << " pstatus "<< std::bitset<8>(e.getPStatus());
146  os << " owner ent " << e.getOwnerEnt();
147  os << " owner proc " << e.getOwnerProc();
148  os << " parent ent " << e.getParentEnt();
149  //os << " BitRefLevel " << e.getBitRefLevel();
150  os << " ent type " << e.getEntType();
151  os << " ent parent type " << e.getParentEntType();
152  return os;
153 }

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