v0.8.13
Public Member Functions | Friends | List of all members
MoFEM::RefElement_TRI Struct Reference

keeps data about abstract TRI finite element More...

#include <src/multi_indices/FEMultiIndices.hpp>

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

Public Member Functions

 RefElement_TRI (const boost::shared_ptr< RefEntity > &ref_ent_ptr)
 
const boost::shared_ptr< SideNumber > & getSideNumberPtr (const EntityHandle ent) const
 
- Public Member Functions inherited from MoFEM::RefElement
 RefElement (const boost::shared_ptr< RefEntity > &ref_ent_ptr)
 
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 ()
 
boost::shared_ptr< BasicEntityData > & getBasicDataPtr ()
 
const boost::shared_ptr< BasicEntityData > & getBasicDataPtr () const
 
EntityHandle getRefEnt () const
 
EntityType getParentEntType () const
 
EntityHandle getParentEnt () const
 
BitRefLevelgetBitRefLevelPtr () const
 
const BitRefLevelgetBitRefLevel () const
 
unsigned long int getBitRefLevelULong () const
 
EntityType getEntType () const
 
EntityID getEntId () const
 
EntityHandle getOwnerEnt () const
 
EntityHandlegetOwnerEnt ()
 
int getOwnerProc () const
 
intgetOwnerProc ()
 
int getPartProc () const
 
intgetPartProc ()
 
unsigned char getPStatus () const
 
intgetSharingProcsPtr () const
 
EntityHandlegetSharingHandlersPtr () const
 
boost::shared_ptr< RefEntity > & getRefEntityPtr () const
 

Friends

std::ostream & operator<< (std::ostream &os, const RefElement_TRI &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< SideNumber > nullSideNumber
 

Detailed Description

keeps data about abstract TRI finite element

Definition at line 122 of file FEMultiIndices.hpp.

Constructor & Destructor Documentation

◆ RefElement_TRI()

MoFEM::RefElement_TRI::RefElement_TRI ( const boost::shared_ptr< RefEntity > &  ref_ent_ptr)

Definition at line 372 of file FEMultiIndices.cpp.

373  : RefElement(ref_ent_ptr) {
374  switch (ref_ent_ptr->getEntType()) {
375  case MBTRI:
376  break;
377  default:
378  THROW_MESSAGE("this work only for TRIs");
379  }
380  ErrorCode rval;
381  int side_number, sense, offset;
382  EntityHandle tri = getRefEnt();
383  int num_nodes;
384  const EntityHandle *conn;
385  moab::Interface &moab = getRefEntityPtr()->basicDataPtr->moab;
386  rval = moab.get_connectivity(tri, conn, num_nodes, true);
387  MOAB_THROW(rval);
388  for (int nn = 0; nn < 3; nn++) {
390  .insert(
391  boost::shared_ptr<SideNumber>(new SideNumber(conn[nn], nn, 0, 0)));
392  }
393  for (int ee = 0; ee < 3; ee++) {
394  EntityHandle edge;
395  rval = moab.side_element(tri, 1, ee, edge);
396  MOAB_THROW(rval);
397  rval = moab.side_number(tri, edge, side_number, sense, offset);
398  MOAB_THROW(rval);
400  .insert(boost::shared_ptr<SideNumber>(
401  new SideNumber(edge, ee, sense, offset)));
402  }
404  .insert(boost::shared_ptr<SideNumber>(new SideNumber(tri, 0, 0, 0)));
405 }
SideNumber_multiIndex side_number_table
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< hashed_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, char, &SideNumber::side_number > > >, ordered_non_unique< const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:638
#define MOAB_THROW(a)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:620
RefElement(const boost::shared_ptr< RefEntity > &ref_ent_ptr)
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Common.hpp:78
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
Get pointer to RefEntity.

Member Function Documentation

◆ getSideNumberPtr()

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

Reimplemented from MoFEM::RefElement.

Definition at line 407 of file FEMultiIndices.cpp.

407  {
408  moab::Interface &moab = getRefEntityPtr()->basicDataPtr->moab;
409  SideNumber_multiIndex::iterator miit = side_number_table.find(ent);
410  if (miit != side_number_table.end())
411  return *miit;
412  if (sPtr->ent == ent) {
413  miit =
415  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, 0, 0, 0)))
416  .first;
417  return *miit;
418  }
419  if (moab.type_from_handle(ent) == MBENTITYSET) {
420  miit =
422  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, 0, 0, 0)))
423  .first;
424  return *miit;
425  }
426  ErrorCode rval;
427  int side_number, sense, offset;
428  rval = moab.side_number(sPtr->ent, ent, side_number, sense, offset);
429  MOAB_THROW(rval);
430  miit = const_cast<SideNumber_multiIndex &>(side_number_table)
431  .insert(boost::shared_ptr<SideNumber>(
432  new SideNumber(ent, side_number, sense, offset)))
433  .first;
434  // std::cerr << side_number << " " << sense << " " << offset << std::endl;
435  return *miit;
436 }
boost::shared_ptr< RefEntity > sPtr
SideNumber_multiIndex side_number_table
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< hashed_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, char, &SideNumber::side_number > > >, ordered_non_unique< const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
#define MOAB_THROW(a)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:620
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Common.hpp:78
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
Get pointer to RefEntity.

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 437 of file FEMultiIndices.cpp.

437  {
438  os << *e.sPtr;
439  return os;
440 }

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