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

keeps data about abstract TRI finite element More...

#include <src/multi_indices/FEMultiIndices.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
 
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
 
int & getOwnerProc ()
 
int getPartProc () const
 
int & getPartProc ()
 
unsigned char getPStatus () const
 
int * getSharingProcsPtr () const
 
EntityHandlegetSharingHandlersPtr () const
 
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< SideNumber > nullSideNumber
 

Detailed Description

keeps data about abstract TRI finite element

Definition at line 113 of file FEMultiIndices.hpp.

Constructor & Destructor Documentation

◆ RefElementFace()

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

Definition at line 350 of file FEMultiIndices.cpp.

351  : RefElement(ref_ents_ptr) {
352 
353  int nb_nodes = 0;
354  int nb_edges = 0;
355  switch (ref_ents_ptr->getEntType()) {
356  case MBTRI:
357  nb_nodes = nb_edges = 3;
358  break;
359  case MBQUAD:
360  nb_nodes = nb_edges = 4;
361  break;
362  default:
363  THROW_MESSAGE("this works only for TRIs and QUADs");
364  }
365  int side_number, sense, offset;
366  EntityHandle tri = getRefEnt();
367  int num_nodes;
368  const EntityHandle *conn;
369  moab::Interface &moab = getRefEntityPtr()->basicDataPtr->moab;
370  rval = moab.get_connectivity(tri, conn, num_nodes, true);
371  MOAB_THROW(rval);
372  for (int nn = 0; nn < nb_nodes; nn++) {
373  const_cast<SideNumber_multiIndex &>(side_number_table)
374  .insert(
375  boost::shared_ptr<SideNumber>(new SideNumber(conn[nn], nn, 0, 0)));
376  }
377  for (int ee = 0; ee < nb_edges; ee++) {
378  EntityHandle edge;
379  rval = moab.side_element(tri, 1, ee, edge);
380  MOAB_THROW(rval);
381  rval = moab.side_number(tri, edge, side_number, sense, offset);
382  MOAB_THROW(rval);
383  const_cast<SideNumber_multiIndex &>(side_number_table)
384  .insert(boost::shared_ptr<SideNumber>(
385  new SideNumber(edge, ee, sense, offset)));
386  }
387  const_cast<SideNumber_multiIndex &>(side_number_table)
388  .insert(boost::shared_ptr<SideNumber>(new SideNumber(tri, 0, 0, 0)));
389 }
RefElement(const boost::shared_ptr< RefEntity > &ref_ents_ptr)
SideNumber_multiIndex side_number_table
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:626
#define MOAB_THROW(a)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:608
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:85
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
Get pointer to RefEntity.
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879

◆ ~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 391 of file FEMultiIndices.cpp.

391  {
392  moab::Interface &moab = getRefEntityPtr()->basicDataPtr->moab;
393  SideNumber_multiIndex::iterator miit = side_number_table.find(ent);
394  if (miit != side_number_table.end())
395  return *miit;
396  if (sPtr->ent == ent) {
397  miit =
398  const_cast<SideNumber_multiIndex &>(side_number_table)
399  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, 0, 0, 0)))
400  .first;
401  return *miit;
402  }
403  if (moab.type_from_handle(ent) == MBENTITYSET) {
404  miit =
405  const_cast<SideNumber_multiIndex &>(side_number_table)
406  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, 0, 0, 0)))
407  .first;
408  return *miit;
409  }
410  int side_number, sense, offset;
411  rval = moab.side_number(sPtr->ent, ent, side_number, sense, offset);
412  MOAB_THROW(rval);
413  miit = const_cast<SideNumber_multiIndex &>(side_number_table)
414  .insert(boost::shared_ptr<SideNumber>(
415  new SideNumber(ent, side_number, sense, offset)))
416  .first;
417  // std::cerr << side_number << " " << sense << " " << offset << std::endl;
418  return *miit;
419 }
boost::shared_ptr< RefEntity > sPtr
SideNumber_multiIndex side_number_table
#define MOAB_THROW(a)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:608
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:85
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
Get pointer to RefEntity.
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 420 of file FEMultiIndices.cpp.

420  {
421  os << *e.sPtr;
422  return os;
423 }

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