v0.14.0
Public Member Functions | Friends | List of all members
MoFEM::RefElementFace Struct Reference

keeps data about abstract TRI finite element More...

#include <src/multi_indices/RefElementMultiIndices.hpp>

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

Public Member Functions

 RefElementFace (const boost::shared_ptr< RefEntity > &ref_ents_ptr)
 
virtual ~RefElementFace ()=default
 
const boost::shared_ptr< SideNumber > & getSideNumberPtr (const EntityHandle ent) const
 
- Public Member Functions inherited from MoFEM::RefElement
 RefElement (const boost::shared_ptr< RefEntity > &ref_ents_ptr)
 
virtual ~RefElement ()=default
 
virtual const BitRefEdgesgetBitRefEdges () const
 
virtual int getBitRefEdgesUlong () const
 
SideNumber_multiIndexgetSideNumberTable () const
 
boost::shared_ptr< RefEntity > & getRefEntityPtr () const
 Get pointer to RefEntity. 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 ()=default
 
int getSideNumber () const
 
boost::shared_ptr< SideNumbergetSideNumberPtr () const
 Get the Side number. More...
 
const boost::shared_ptr< BasicEntityDatagetBasicDataPtr () const
 Get pointer to basic data struture. More...
 
EntityHandle getEnt () const
 Get the entity handle. More...
 
EntityType getParentEntType () const
 Get patent entity. More...
 
EntityHandle getParentEnt () const
 
BitRefLevelgetBitRefLevelPtr () const
 Get pointer to bit ref level tag. More...
 
const BitRefLevelgetBitRefLevel () const
 
unsigned long int getBitRefLevelULong () const
 Get entity ref bit refinement as ulong. More...
 
EntityType getEntType () const
 Get entity type. More...
 
int getEntDimension () const
 Get the Ent Dimension. More...
 
const char * getEntTypeName () const
 Get the Ent Type Name. More...
 
EntityID getEntId () const
 get entity id More...
 
EntityHandle getOwnerEnt () const
 
EntityHandlegetOwnerEnt ()
 
int getOwnerProc () const
 
int getPartProc () const
 
int * getPartProcPtr () const
 Get pointer to partition tag. More...
 
unsigned char getPStatus () const
 
int * getSharingProcsPtr () const
 get shared processors More...
 
EntityHandlegetSharingHandlersPtr () const
 get sharid entity handlers More...
 
boost::shared_ptr< RefEntity > & getRefEntityPtr () const
 

Friends

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

Additional Inherited Members

- Public Types inherited from MoFEM::RefElement
typedef interface_RefEntity< RefEntityinterface_type_RefEntity
 
- Public Attributes inherited from MoFEM::RefElement
SideNumber_multiIndex side_number_table
 
- Public Attributes inherited from MoFEM::interface_RefEntity< RefEntity >
boost::shared_ptr< RefEntitysPtr
 
- Static Public Attributes inherited from MoFEM::RefElement
static BitRefEdges DummyBitRefEdges = BitRefEdges(0)
 
static const boost::shared_ptr< SideNumbernullSideNumber
 

Detailed Description

keeps data about abstract TRI finite element

Definition at line 99 of file RefElementMultiIndices.hpp.

Constructor & Destructor Documentation

◆ RefElementFace()

MoFEM::RefElementFace::RefElementFace ( const boost::shared_ptr< RefEntity > &  ref_ents_ptr)

Definition at line 338 of file RefElementMultiIndices.cpp.

339  : RefElement(ref_ents_ptr) {
340 
341  int nb_nodes = 0;
342  int nb_edges = 0;
343  switch (ref_ents_ptr->getEntType()) {
344  case MBTRI:
345  nb_nodes = nb_edges = 3;
346  break;
347  case MBQUAD:
348  nb_nodes = nb_edges = 4;
349  break;
350  default:
351  THROW_MESSAGE("this works only for TRIs and QUADs");
352  }
353  int side_number, sense, offset;
354  EntityHandle tri = getEnt();
355  int num_nodes;
356  const EntityHandle *conn;
357  moab::Interface &moab = getRefEntityPtr()->getBasicDataPtr()->moab;
358  rval = moab.get_connectivity(tri, conn, num_nodes, true);
359  MOAB_THROW(rval);
360  for (int nn = 0; nn < nb_nodes; nn++) {
362  .insert(
363  boost::shared_ptr<SideNumber>(new SideNumber(conn[nn], nn, 0, 0)));
364  }
365  for (int ee = 0; ee < nb_edges; ee++) {
366  EntityHandle edge;
367  rval = moab.side_element(tri, 1, ee, edge);
368  MOAB_THROW(rval);
369  rval = moab.side_number(tri, edge, side_number, sense, offset);
370  MOAB_THROW(rval);
372  .insert(boost::shared_ptr<SideNumber>(
373  new SideNumber(edge, ee, sense, offset)));
374  }
376  .insert(boost::shared_ptr<SideNumber>(new SideNumber(tri, 0, 0, 0)));
377 }

◆ ~RefElementFace()

virtual MoFEM::RefElementFace::~RefElementFace ( )
virtualdefault

Member Function Documentation

◆ getSideNumberPtr()

const boost::shared_ptr< SideNumber > & MoFEM::RefElementFace::getSideNumberPtr ( const EntityHandle  ent) const
virtual

Reimplemented from MoFEM::RefElement.

Definition at line 379 of file RefElementMultiIndices.cpp.

379  {
380  moab::Interface &moab = getRefEntityPtr()->getBasicDataPtr()->moab;
381  SideNumber_multiIndex::iterator miit = side_number_table.find(ent);
382  if (miit != side_number_table.end())
383  return *miit;
384  if (sPtr->ent == ent) {
385  miit =
387  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, 0, 0, 0)))
388  .first;
389  return *miit;
390  }
391  if (type_from_handle(ent) == MBENTITYSET) {
392  miit =
394  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, 0, 0, 0)))
395  .first;
396  return *miit;
397  }
398  int side_number, sense, offset;
399  rval = moab.side_number(sPtr->ent, ent, side_number, sense, offset);
400  MOAB_THROW(rval);
401  miit = const_cast<SideNumber_multiIndex &>(side_number_table)
402  .insert(boost::shared_ptr<SideNumber>(
403  new SideNumber(ent, side_number, sense, offset)))
404  .first;
405  // std::cerr << side_number << " " << sense << " " << offset << std::endl;
406  return *miit;
407 }

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 408 of file RefElementMultiIndices.cpp.

408  {
409  os << *e.sPtr;
410  return os;
411 }

The documentation for this struct was generated from the following files:
MoFEM::RefElement::RefElement
RefElement(const boost::shared_ptr< RefEntity > &ref_ents_ptr)
Definition: RefElementMultiIndices.cpp:15
EntityHandle
MoFEM::interface_RefEntity< RefEntity >::sPtr
boost::shared_ptr< RefEntity > sPtr
Definition: RefEntsMultiIndices.hpp:711
MoFEM::interface_RefEntity< RefEntity >::getEnt
EntityHandle getEnt() const
Get the entity handle.
Definition: RefEntsMultiIndices.hpp:603
MOAB_THROW
#define MOAB_THROW(err)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:554
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
MoFEM::Exceptions::rval
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:74
SideNumber_multiIndex
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< ordered_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, signed char, &SideNumber::side_number > > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
Definition: RefEntsMultiIndices.hpp:101
MoFEM::RefElement::getRefEntityPtr
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
Get pointer to RefEntity.
Definition: RefElementMultiIndices.hpp:45
MoFEM::type_from_handle
auto type_from_handle(const EntityHandle h)
get type from entity handle
Definition: Templates.hpp:1898
MoFEM::RefElement::side_number_table
SideNumber_multiIndex side_number_table
Definition: RefElementMultiIndices.hpp:22