v0.7.26
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)
 
static MoFEMErrorCode getBitRefLevel (Interface &moab, Range ents, std::vector< const BitRefLevel *> &vec_ptr_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 253 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 110 of file EntsMultiIndices.cpp.

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

Member Function Documentation

◆ getBitRefLevel() [1/3]

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

Definition at line 139 of file EntsMultiIndices.cpp.

140  {
141 
143  Tag th_ref_bit_level;
144  CHKERR moab.tag_get_handle("_RefBitLevel", th_ref_bit_level);
145  vec_bit_ref_level.resize(ents.size());
146  CHKERR moab.tag_get_data(th_ref_bit_level, ents, &*vec_bit_ref_level.begin());
148 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
#define CHKERR
Inline error check.
Definition: definitions.h:617
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:443

◆ getBitRefLevel() [2/3]

MoFEMErrorCode MoFEM::RefEntity::getBitRefLevel ( Interface moab,
Range  ents,
std::vector< const BitRefLevel *> &  vec_ptr_bit_ref_level 
)
static

Definition at line 150 of file EntsMultiIndices.cpp.

152  {
154  Tag th_ref_bit_level;
155  CHKERR moab.tag_get_handle("_RefBitLevel", th_ref_bit_level);
156  vec_ptr_bit_ref_level.resize(ents.size());
157  CHKERR moab.tag_get_by_ptr(
158  th_ref_bit_level, ents,
159  reinterpret_cast<const void **>(&*vec_ptr_bit_ref_level.begin()));
161 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:498
#define CHKERR
Inline error check.
Definition: definitions.h:617
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:443

◆ getBitRefLevel() [3/3]

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

Get entity ref bit refinement signature.

Definition at line 313 of file EntsMultiIndices.hpp.

313  {
314  return *getBitRefLevelPtr();
315  }
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 120 of file EntsMultiIndices.cpp.

120  {
121  return static_cast<BitRefLevel *>(get_tag_ptr(
122  static_cast<moab::Core *>(&basicDataPtr->moab)->sequence_manager(),
123  basicDataPtr->th_RefBitLevel, ent, NULL));
124 }
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 319 of file EntsMultiIndices.hpp.

319  {
320  return getBitRefLevel().to_ulong();
321  }
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 307 of file EntsMultiIndices.hpp.

307  {
308  return *(getParentEntPtr());
309  }
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 114 of file EntsMultiIndices.cpp.

114  {
115  return static_cast<EntityHandle *>(get_tag_ptr(
116  static_cast<moab::Core *>(&basicDataPtr->moab)->sequence_manager(),
117  basicDataPtr->th_RefParentHandle, ent, NULL));
118 }
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 298 of file EntsMultiIndices.hpp.

298  {
299  EntityHandle *tag_parent_ent = getParentEntPtr();
300  if (*tag_parent_ent == 0)
301  return MBMAXTYPE;
302  return (EntityType)((*tag_parent_ent & MB_TYPE_MASK) >> MB_ID_WIDTH);
303  }
EntityHandle * getParentEntPtr() const
Get pointer to parent entity tag.
#define MB_TYPE_MASK
Definition: definitions.h:329
#define MB_ID_WIDTH
Definition: definitions.h:328

◆ getRefEnt()

EntityHandle MoFEM::RefEntity::getRefEnt ( ) const

Get entity.

Definition at line 294 of file EntsMultiIndices.hpp.

294 { return ent; }

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 163 of file EntsMultiIndices.cpp.

163  {
164  os << "ent " << e.ent;
165  os << " pstatus " << std::bitset<8>(e.getPStatus());
166  os << " owner ent " << e.getOwnerEnt();
167  os << " owner proc " << e.getOwnerProc();
168  os << " parent ent " << e.getParentEnt();
169  // os << " BitRefLevel " << e.getBitRefLevel();
170  os << " ent type " << e.getEntType();
171  os << " ent parent type " << e.getParentEntType();
172  return os;
173 }

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