v0.9.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/FEMultiIndices.hpp>

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

Public Member Functions

 RefElementFace (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 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 106 of file FEMultiIndices.hpp.

Constructor & Destructor Documentation

◆ RefElementFace()

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

Definition at line 355 of file FEMultiIndices.cpp.

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

Member Function Documentation

◆ getSideNumberPtr()

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

Reimplemented from MoFEM::RefElement.

Definition at line 396 of file FEMultiIndices.cpp.

396  {
397  moab::Interface &moab = getRefEntityPtr()->basicDataPtr->moab;
398  SideNumber_multiIndex::iterator miit = side_number_table.find(ent);
399  if (miit != side_number_table.end())
400  return *miit;
401  if (sPtr->ent == ent) {
402  miit =
403  const_cast<SideNumber_multiIndex &>(side_number_table)
404  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, 0, 0, 0)))
405  .first;
406  return *miit;
407  }
408  if (moab.type_from_handle(ent) == MBENTITYSET) {
409  miit =
410  const_cast<SideNumber_multiIndex &>(side_number_table)
411  .insert(boost::shared_ptr<SideNumber>(new SideNumber(ent, 0, 0, 0)))
412  .first;
413  return *miit;
414  }
415  int side_number, sense, offset;
416  rval = moab.side_number(sPtr->ent, ent, side_number, sense, offset);
417  MOAB_THROW(rval);
418  miit = const_cast<SideNumber_multiIndex &>(side_number_table)
419  .insert(boost::shared_ptr<SideNumber>(
420  new SideNumber(ent, side_number, sense, offset)))
421  .first;
422  // std::cerr << side_number << " " << sense << " " << offset << std::endl;
423  return *miit;
424 }
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:602
static MoFEMErrorCodeGeneric< moab::ErrorCode > rval
Definition: Exceptions.hpp:84
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
Get pointer to RefEntity.

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 425 of file FEMultiIndices.cpp.

425  {
426  os << *e.sPtr;
427  return os;
428 }

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