v0.6.9
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 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
 get shared processors More...
 
EntityHandlegetSharingHandlersPtr () const
 get sharid entity handlers More...
 

Static Public Member Functions

static MoFEMErrorCode getParentEnt (Interface &moab, Range ents, std::vector< EntityHandle > vec_patent_ent)
 
static MoFEMErrorCode 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 264 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]

MoFEMErrorCode 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 
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);
141 }
#define CHKERRQ_MOAB(a)
check error code of MoAB function
Definition: definitions.h:482
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:468
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:474
#define MOAB_THROW(a)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:569
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Common.hpp:78

◆ getBitRefLevel() [2/2]

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

Get entity ref bit refinement signature.

Definition at line 321 of file EntsMultiIndices.hpp.

321  {
322  return *getBitRefLevelPtr();
323  }
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:147
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 327 of file EntsMultiIndices.hpp.

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

◆ getParentEnt() [1/2]

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

◆ getParentEnt() [2/2]

EntityHandle MoFEM::RefEntity::getParentEnt ( ) const

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

Definition at line 314 of file EntsMultiIndices.hpp.

314  {
315  EntityHandle* tag_parent_ent = getParentEntPtr();
316  return *tag_parent_ent;
317  }
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 306 of file EntsMultiIndices.hpp.

306  {
307  EntityHandle* tag_parent_ent = getParentEntPtr();
308  if(*tag_parent_ent == 0) return MBMAXTYPE;
309  return (EntityType)((*tag_parent_ent&MB_TYPE_MASK)>>MB_ID_WIDTH);
310  }
EntityHandle * getParentEntPtr() const
Get pointer to parent entity tag.
#define MB_TYPE_MASK
Definition: definitions.h:320
#define MB_ID_WIDTH
Definition: definitions.h:319

◆ getRefEnt()

EntityHandle MoFEM::RefEntity::getRefEnt ( ) const

Get entity.

Definition at line 302 of file EntsMultiIndices.hpp.

302 { 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: