v0.7.2
Public Member Functions | Public Attributes | List of all members
MoFEM::BasicEntity Struct Reference

this struct keeps basic methods for moab entity More...

#include <src/multi_indices/EntsMultiIndices.hpp>

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

Public Member Functions

 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...
 

Public Attributes

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

this struct keeps basic methods for moab entity

Todo:
BasicEntity in should be linked to directly to MoAB data structures such that connectivity and nodal coordinates could be quickly accessed, without need of using native MoAB functions.

Definition at line 91 of file EntsMultiIndices.hpp.

Constructor & Destructor Documentation

◆ BasicEntity()

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

Definition at line 75 of file EntsMultiIndices.cpp.

78  : basicDataPtr(basic_data_ptr), ent(ent) {
79  switch (getEntType()) {
80  case MBVERTEX:
81  case MBEDGE:
82  case MBTRI:
83  case MBQUAD:
84  case MBTET:
85  case MBPRISM:
86  case MBENTITYSET:
87  break;
88  default:
89  THROW_MESSAGE("this entity type is currently not implemented");
90  }
91  ParallelComm *pcomm =
92  ParallelComm::get_pcomm(&basicDataPtr->moab, basicDataPtr->pcommID);
93  if (pcomm == NULL)
94  THROW_MESSAGE("pcomm is null");
95  rval = pcomm->get_owner_handle(ent, owner_proc, moab_owner_handle);
98 }
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:634
#define MOAB_THROW(a)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:616
int part_proc
this can be changed on distributed
EntityType getEntType() const
Get entity type.
int owner_proc
this never can not be changed if distributed mesh
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Common.hpp:78
EntityHandle moab_owner_handle
boost::shared_ptr< BasicEntityData > basicDataPtr

Member Function Documentation

◆ getBasicDataPtr() [1/2]

boost::shared_ptr<BasicEntityData>& MoFEM::BasicEntity::getBasicDataPtr ( )

Definition at line 105 of file EntsMultiIndices.hpp.

105  {
106  return basicDataPtr;
107  }
boost::shared_ptr< BasicEntityData > basicDataPtr

◆ getBasicDataPtr() [2/2]

const boost::shared_ptr<BasicEntityData>& MoFEM::BasicEntity::getBasicDataPtr ( ) const

Definition at line 109 of file EntsMultiIndices.hpp.

109  {
110  return basicDataPtr;
111  }
boost::shared_ptr< BasicEntityData > basicDataPtr

◆ getEntId()

EntityID MoFEM::BasicEntity::getEntId ( ) const

get entity id

Definition at line 121 of file EntsMultiIndices.hpp.

121 { return (EntityID)(ent & MB_ID_MASK); };
#define MB_ID_MASK
Definition: definitions.h:326

◆ getEntType()

EntityType MoFEM::BasicEntity::getEntType ( ) const

Get entity type.

Definition at line 115 of file EntsMultiIndices.hpp.

115  {
116  return (EntityType)((ent & MB_TYPE_MASK) >> MB_ID_WIDTH);
117  }
#define MB_TYPE_MASK
Definition: definitions.h:321
#define MB_ID_WIDTH
Definition: definitions.h:320

◆ getOwnerEnt() [1/2]

EntityHandle MoFEM::BasicEntity::getOwnerEnt ( ) const

Owner handle on this or other processors.

Definition at line 125 of file EntsMultiIndices.hpp.

125 { return moab_owner_handle; }
EntityHandle moab_owner_handle

◆ getOwnerEnt() [2/2]

EntityHandle& MoFEM::BasicEntity::getOwnerEnt ( )

Owner handle on this or other processors.

Definition at line 129 of file EntsMultiIndices.hpp.

129 { return moab_owner_handle; }
EntityHandle moab_owner_handle

◆ getOwnerProc() [1/2]

int MoFEM::BasicEntity::getOwnerProc ( ) const

Get processor owning entity.

Definition at line 133 of file EntsMultiIndices.hpp.

133 { return owner_proc; }
int owner_proc
this never can not be changed if distributed mesh

◆ getOwnerProc() [2/2]

int& MoFEM::BasicEntity::getOwnerProc ( )

Get processor owning entity.

Definition at line 137 of file EntsMultiIndices.hpp.

137 { return owner_proc; }
int owner_proc
this never can not be changed if distributed mesh

◆ getPartProc() [1/2]

int MoFEM::BasicEntity::getPartProc ( ) const

Get processor.

Definition at line 141 of file EntsMultiIndices.hpp.

141 { return part_proc; }
int part_proc
this can be changed on distributed

◆ getPartProc() [2/2]

int& MoFEM::BasicEntity::getPartProc ( )

Get processor owning entity.

Definition at line 145 of file EntsMultiIndices.hpp.

145 { return part_proc; }
int part_proc
this can be changed on distributed

◆ getPStatus()

unsigned char MoFEM::BasicEntity::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

bit 0: !owned (0=owned, 1=not owned) bit 1: shared (0=not shared, 1=shared) bit 2: multishared (shared by > 2 procs; 0=not shared, 1=shared) bit 3: interface (0=not interface, 1=interface) bit 4: ghost (0=not ghost, 1=ghost)

Definition at line 100 of file EntsMultiIndices.cpp.

100  {
101  ParallelComm *pcomm =
102  ParallelComm::get_pcomm(&basicDataPtr->moab, basicDataPtr->pcommID);
103  return *((unsigned char *)MoFEM::get_tag_ptr(
104  static_cast<moab::Core *>(&basicDataPtr->moab)->sequence_manager(),
105  pcomm->pstatus_tag(), ent, NULL));
106 }
boost::shared_ptr< BasicEntityData > basicDataPtr
void * get_tag_ptr(SequenceManager *sequence_manager, Tag th, EntityHandle ent, int *tag_size)

◆ getSharingHandlersPtr()

EntityHandle* MoFEM::BasicEntity::getSharingHandlersPtr ( ) const

get sharid entity handlers

Returning list to shared entity handlers. Use it with getSharingProcsPtr()

DO NOT MODIFY LIST.

BasicEntity *ent_ptr = BasicEntity(moan,entity_handle);
for(int proc = 0; proc<MAX_SHARING_PROCS && -1 !=
ent_ptr->getSharingProcsPtr[proc]; proc++) {
if(ent_ptr->getSharingProcsPtr[proc] == -1) {
// End of the list
break;
}
int sharing_proc = ent_ptr->getSharingProcsPtr[proc];
EntityHandle sharing_ent = ent_ptr->getSharingHandlersPtr[proc];
if(!(ent_ptr->getPStatus()&PSTATUS_MULTISHARED)) {
break;
}
}

Definition at line 226 of file EntsMultiIndices.hpp.

226  {
227  EntityHandle *sharing_handlers_ptr = NULL;
228  moab::Interface &moab = basicDataPtr->moab;
229  ParallelComm *pcomm = ParallelComm::get_pcomm(&moab, basicDataPtr->pcommID);
230  if (getPStatus() & PSTATUS_MULTISHARED) {
231  // entity is multi shared
232  rval = moab.tag_get_by_ptr(pcomm->sharedhs_tag(), &ent, 1,
233  (const void **)&sharing_handlers_ptr);
234  MOAB_THROW(rval);
235  } else if (getPStatus() & PSTATUS_SHARED) {
236  // shared
237  rval = moab.tag_get_by_ptr(pcomm->sharedh_tag(), &ent, 1,
238  (const void **)&sharing_handlers_ptr);
239  MOAB_THROW(rval);
240  }
241  return sharing_handlers_ptr;
242  }
unsigned char getPStatus() const
get pstatus This tag stores various aspects of parallel status in bits; see also define following...
#define MOAB_THROW(a)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:616
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Common.hpp:78
boost::shared_ptr< BasicEntityData > basicDataPtr

◆ getSharingProcsPtr()

int* MoFEM::BasicEntity::getSharingProcsPtr ( ) const

get shared processors

Returning list to shared processors. Lists end with -1. Returns NULL if not sharing processors.

DO NOT MODIFY LIST.

BasicEntity *ent_ptr = BasicEntity(moan,entity_handle);
for(int proc = 0; proc<MAX_SHARING_PROCS && -1 !=
ent_ptr->getSharingProcsPtr[proc]; proc++) {
if(ent_ptr->getSharingProcsPtr[proc] == -1) {
// End of the list
break;
}
int sharing_proc = ent_ptr->getSharingProcsPtr[proc];
EntityHandle sharing_ent = ent_ptr->getSharingHandlersPtr[proc];
if(!(ent_ptr->getPStatus()&PSTATUS_MULTISHARED)) {
break;
}
}

Definition at line 185 of file EntsMultiIndices.hpp.

185  {
186  moab::Interface &moab = basicDataPtr->moab;
187  int *sharing_procs_ptr = NULL;
188  ParallelComm *pcomm = ParallelComm::get_pcomm(&moab, basicDataPtr->pcommID);
189  if (getPStatus() & PSTATUS_MULTISHARED) {
190  // entity is multi shared
191  rval = moab.tag_get_by_ptr(pcomm->sharedps_tag(), &ent, 1,
192  (const void **)&sharing_procs_ptr);
193  MOAB_THROW(rval);
194  } else if (getPStatus() & PSTATUS_SHARED) {
195  // shared
196  rval = moab.tag_get_by_ptr(pcomm->sharedp_tag(), &ent, 1,
197  (const void **)&sharing_procs_ptr);
198  MOAB_THROW(rval);
199  }
200  return sharing_procs_ptr;
201  }
unsigned char getPStatus() const
get pstatus This tag stores various aspects of parallel status in bits; see also define following...
#define MOAB_THROW(a)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:616
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Common.hpp:78
boost::shared_ptr< BasicEntityData > basicDataPtr

Member Data Documentation

◆ basicDataPtr

boost::shared_ptr<BasicEntityData> MoFEM::BasicEntity::basicDataPtr
mutable

Definition at line 93 of file EntsMultiIndices.hpp.

◆ ent

EntityHandle MoFEM::BasicEntity::ent

Definition at line 95 of file EntsMultiIndices.hpp.

◆ moab_owner_handle

EntityHandle MoFEM::BasicEntity::moab_owner_handle

Definition at line 100 of file EntsMultiIndices.hpp.

◆ owner_proc

int MoFEM::BasicEntity::owner_proc

this never can not be changed if distributed mesh

Definition at line 97 of file EntsMultiIndices.hpp.

◆ part_proc

int MoFEM::BasicEntity::part_proc

this can be changed on distributed

Definition at line 98 of file EntsMultiIndices.hpp.


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