v0.13.0
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Friends | List of all members
MoFEM::EntFiniteElement Struct Reference

Finite element data for entity. More...

#include <src/multi_indices/FEMultiIndices.hpp>

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

Public Types

using interface_type_RefEntity = interface_RefEntity< RefElement >
 
using interface_type_RefElement = interface_RefElement< RefElement >
 
using interface_type_FiniteElement = interface_FiniteElement< FiniteElement, RefElement >
 
- Public Types inherited from MoFEM::interface_RefElement< T >
typedef interface_RefEntity< Tinterface_type_RefEntity
 
typedef interface_RefElement< Tinterface_type_RefElement
 

Public Member Functions

 EntFiniteElement (const boost::shared_ptr< RefElement > &ref_finite_element, const boost::shared_ptr< FiniteElement > &fe_ptr)
 
virtual ~EntFiniteElement ()=default
 
UId getLocalUniqueId () const
 Get unique UId for finite element entity. More...
 
UId getLocalUniqueIdCalculate () const
 Generate UId for finite element entity. More...
 
boost::shared_ptr< FEDofEntity_multiIndexgetDataDofsPtr () const
 Get the Data Dofs Ptr object. More...
 
boost::shared_ptr< std::vector< boost::shared_ptr< FEDofEntity > > > getDataVectorDofsPtr () const
 Get data data dos multi-index structure. More...
 
FieldEntity_vector_viewgetDataFieldEnts () const
 
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr () const
 
FieldEntity_vector_viewgetRowFieldEnts () const
 
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr () const
 
FieldEntity_vector_viewgetColFieldEnts () const
 
boost::shared_ptr< FieldEntity_vector_view > & getColFieldEntsPtr () const
 
template<typename MOFEM_DOFS , typename MOFEM_DOFS_VIEW >
MoFEMErrorCode getRowDofView (const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view)
 
template<typename MOFEM_DOFS , typename MOFEM_DOFS_VIEW >
MoFEMErrorCode getColDofView (const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, const int operation_type=moab::Interface::UNION)
 
MoFEMErrorCode getElementAdjacency (const boost::shared_ptr< Field > field_ptr, std::vector< EntityHandle > &adjacency)
 
- Public Member Functions inherited from MoFEM::interface_FiniteElement< FiniteElement, RefElement >
 interface_FiniteElement (const boost::shared_ptr< FiniteElement > fe_ptr, const boost::shared_ptr< RefElement > ref_ents_ptr)
 
virtual ~interface_FiniteElement ()=default
 
const UIdgetFEUId () const
 Get finite element uid. More...
 
BitFEId getId () const
 Get finite element id. More...
 
EntityHandle getMeshset () const
 Get meshset containing element entities. More...
 
boost::string_ref getNameRef () const
 Get finite element name. More...
 
std::string getName () const
 Get finite element name. More...
 
BitFieldId getBitFieldIdCol () const
 Get field ids on columns. More...
 
BitFieldId getBitFieldIdRow () const
 Get field ids on rows. More...
 
BitFieldId getBitFieldIdData () const
 Get field ids on data. More...
 
unsigned int getBitNumber () const
 Get bit identifying this element. More...
 
boost::shared_ptr< FiniteElement > & getFiniteElementPtr () const
 
- Public Member Functions inherited from MoFEM::interface_RefElement< T >
 interface_RefElement (const boost::shared_ptr< T > &sptr)
 
virtual ~interface_RefElement ()=default
 
int getBitRefEdgesUlong () const
 
SideNumber_multiIndexgetSideNumberTable () const
 
const boost::shared_ptr< SideNumber > & getSideNumberPtr (const EntityHandle ent) const
 
boost::shared_ptr< RefEntity > & getRefEntityPtr () const
 
boost::shared_ptr< T > & getRefElement () const
 
- Public Member Functions inherited from MoFEM::interface_RefEntity< T >
 interface_RefEntity (const boost::shared_ptr< T > &sptr)
 
 interface_RefEntity (const interface_RefEntity< T > &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< T > & getRefEntityPtr () const
 

Static Public Member Functions

static UId getLocalUniqueIdCalculate (const EntityHandle ent, UId fe_uid)
 
template<typename FE_ENTS , typename MOFEM_DOFS , typename MOFEM_DOFS_VIEW , typename INSERTER >
static MoFEMErrorCode getDofView (const FE_ENTS &fe_ents_view, const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, INSERTER &&inserter)
 

Private Attributes

boost::shared_ptr< FieldEntity_vector_viewdataFieldEnts
 
boost::shared_ptr< FieldEntity_vector_viewrowFieldEnts
 
boost::shared_ptr< FieldEntity_vector_viewcolFieldEnts
 

Friends

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

Additional Inherited Members

- Public Attributes inherited from MoFEM::interface_RefEntity< T >
boost::shared_ptr< TsPtr
 

Detailed Description

Finite element data for entity.

Definition at line 511 of file FEMultiIndices.hpp.

Member Typedef Documentation

◆ interface_type_FiniteElement

Definition at line 516 of file FEMultiIndices.hpp.

◆ interface_type_RefElement

Definition at line 515 of file FEMultiIndices.hpp.

◆ interface_type_RefEntity

Definition at line 514 of file FEMultiIndices.hpp.

Constructor & Destructor Documentation

◆ EntFiniteElement()

MoFEM::EntFiniteElement::EntFiniteElement ( const boost::shared_ptr< RefElement > &  ref_finite_element,
const boost::shared_ptr< FiniteElement > &  fe_ptr 
)

Definition at line 432 of file FEMultiIndices.cpp.

435  : interface_FiniteElement<FiniteElement, RefElement>(fe_ptr,
436  ref_finite_element),
std::vector< boost::weak_ptr< FieldEntity > > FieldEntity_vector_view
boost::shared_ptr< FieldEntity_vector_view > dataFieldEnts
boost::shared_ptr< FieldEntity_vector_view > colFieldEnts
boost::shared_ptr< FieldEntity_vector_view > rowFieldEnts

◆ ~EntFiniteElement()

virtual MoFEM::EntFiniteElement::~EntFiniteElement ( )
virtualdefault

Member Function Documentation

◆ getColDofView()

template<typename MOFEM_DOFS , typename MOFEM_DOFS_VIEW >
MoFEMErrorCode MoFEM::EntFiniteElement::getColDofView ( const MOFEM_DOFS &  mofem_dofs,
MOFEM_DOFS_VIEW &  dofs_view,
const int  operation_type = moab::Interface::UNION 
)

Definition at line 638 of file FEMultiIndices.hpp.

639  {
640 
641  auto hint = dofs_view.end();
642  using ValType = typename std::remove_reference<decltype(**hint)>::type;
643  using IndexType = MOFEM_DOFS_VIEW;
644 
645  struct Inserter {
646  using Idx = IndexType;
647  using It = typename Idx::iterator;
648  It operator()(Idx &dofs_view, It &hint,
649  boost::shared_ptr<ValType> &&dof) {
650  return dofs_view.emplace_hint(hint, dof);
651  }
652  };
653 
654  return getDofView(getColFieldEnts(), mofem_dofs, dofs_view, operation_type);
655  }
FieldEntity_vector_view & getColFieldEnts() const
static MoFEMErrorCode getDofView(const FE_ENTS &fe_ents_view, const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, INSERTER &&inserter)

◆ getColFieldEnts()

FieldEntity_vector_view& MoFEM::EntFiniteElement::getColFieldEnts ( ) const

Definition at line 578 of file FEMultiIndices.hpp.

578  {
579  return *getColFieldEntsPtr();
580  };
boost::shared_ptr< FieldEntity_vector_view > & getColFieldEntsPtr() const

◆ getColFieldEntsPtr()

boost::shared_ptr<FieldEntity_vector_view>& MoFEM::EntFiniteElement::getColFieldEntsPtr ( ) const

Definition at line 583 of file FEMultiIndices.hpp.

583  {
585  return colFieldEnts;
586  };
static boost::weak_ptr< RefElement > refElementPtr
boost::shared_ptr< T > & getRefElement() const

◆ getDataDofsPtr()

boost::shared_ptr< FEDofEntity_multiIndex > MoFEM::EntFiniteElement::getDataDofsPtr ( ) const

Get the Data Dofs Ptr object.

Returns
boost::shared_ptr<FEDofEntity_multiIndex>

Definition at line 535 of file FEMultiIndices.cpp.

535  {
537  struct Extractor {
538  boost::weak_ptr<EntityCacheDofs>
539  operator()(boost::shared_ptr<FieldEntity> &e) {
540  return e->entityCacheDataDofs;
541  }
542  };
543 
544  struct Inserter {
545  FEDofEntity_multiIndex::iterator
546  operator()(boost::shared_ptr<FEDofEntity_multiIndex> &dofs_view,
547  FEDofEntity_multiIndex::iterator &hint,
548  boost::shared_ptr<FEDofEntity> &&dof) {
549  return dofs_view->emplace_hint(hint, dof);
550  }
551  };
552 
553  auto data_dofs = boost::make_shared<FEDofEntity_multiIndex>();
554  if (get_cache_data_dofs_view(dataFieldEnts, data_dofs, Extractor(),
555  Inserter()))
556  THROW_MESSAGE("data_dofs can not be created");
557  return data_dofs;
558 };
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:574
static MoFEMErrorCode get_cache_data_dofs_view(ENTSVIEW &ents_view, DOFSVIEW &dofs_view, EXTRACTOR &&extractor, INSERTER &&inserter)

◆ getDataFieldEnts()

FieldEntity_vector_view& MoFEM::EntFiniteElement::getDataFieldEnts ( ) const

Definition at line 558 of file FEMultiIndices.hpp.

558  {
559  return *getDataFieldEntsPtr();
560  };
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr() const

◆ getDataFieldEntsPtr()

boost::shared_ptr<FieldEntity_vector_view>& MoFEM::EntFiniteElement::getDataFieldEntsPtr ( ) const

Definition at line 563 of file FEMultiIndices.hpp.

563  {
565  return dataFieldEnts;
566  };

◆ getDataVectorDofsPtr()

boost::shared_ptr< std::vector< boost::shared_ptr< FEDofEntity > > > MoFEM::EntFiniteElement::getDataVectorDofsPtr ( ) const

Get data data dos multi-index structure.

Returns
Reference multi-index FEDofEntity_multiIndex

Definition at line 561 of file FEMultiIndices.cpp.

561  {
563 
564  struct Extractor {
565  boost::weak_ptr<EntityCacheDofs>
566  operator()(boost::shared_ptr<FieldEntity> &e) {
567  return e->entityCacheDataDofs;
568  }
569  };
570 
571  struct Inserter {
572  using Vec = std::vector<boost::shared_ptr<FEDofEntity>>;
573  using It = Vec::iterator;
574  It operator()(boost::shared_ptr<Vec> &dofs_view, It &hint,
575  boost::shared_ptr<FEDofEntity> &&dof) {
576  dofs_view->emplace_back(dof);
577  return dofs_view->end();
578  }
579  };
580 
581  auto data_vector_dofs =
582  boost::make_shared<std::vector<boost::shared_ptr<FEDofEntity>>>();
583  if (get_cache_data_dofs_view(dataFieldEnts, data_vector_dofs, Extractor(),
584  Inserter()))
585  THROW_MESSAGE("dataDofs can not be created");
586 
587  return data_vector_dofs;
588 };
const FTensor::Tensor2< T, Dim, Dim > Vec

◆ getDofView()

template<typename FE_ENTS , typename MOFEM_DOFS , typename MOFEM_DOFS_VIEW , typename INSERTER >
static MoFEMErrorCode MoFEM::EntFiniteElement::getDofView ( const FE_ENTS &  fe_ents_view,
const MOFEM_DOFS &  mofem_dofs,
MOFEM_DOFS_VIEW &  dofs_view,
INSERTER &&  inserter 
)
static

Definition at line 593 of file FEMultiIndices.hpp.

594  {
596 
597  auto hint = dofs_view.end();
598  using ValType = typename std::remove_reference<decltype(**hint)>::type;
599 
600  for (auto &it : fe_ents_view) {
601  if (auto e = it.lock()) {
602  const auto &uid = e->getLocalUniqueId();
603  auto dit = mofem_dofs.lower_bound(uid);
604  if (dit != mofem_dofs.end()) {
605  const auto hi_dit = mofem_dofs.upper_bound(
606  uid | static_cast<UId>(MAX_DOFS_ON_ENTITY - 1));
607  for (; dit != hi_dit; ++dit)
608  hint = inserter(dofs_view, hint,
609  boost::reinterpret_pointer_cast<ValType>(*dit));
610  }
611  }
612  }
614  }
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
Definition: definitions.h:249
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
uint128_t UId
Unique Id.
Definition: Types.hpp:42

◆ getElementAdjacency()

MoFEMErrorCode MoFEM::EntFiniteElement::getElementAdjacency ( const boost::shared_ptr< Field field_ptr,
std::vector< EntityHandle > &  adjacency 
)

Definition at line 448 of file FEMultiIndices.cpp.

449  {
450  moab::Interface &moab = getRefEntityPtr()->getBasicDataPtr()->moab;
452  const EntFiniteElement *this_fe_ptr = this;
453  if (getFiniteElementPtr()->elementAdjacencyTable[getEntType()] == NULL)
454  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
455  CHKERR getFiniteElementPtr()->elementAdjacencyTable[getEntType()](
456  moab, *field_ptr, *this_fe_ptr, adjacency);
458 }
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:45
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
#define CHKERR
Inline error check.
Definition: definitions.h:548
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1965
EntFiniteElement(const boost::shared_ptr< RefElement > &ref_finite_element, const boost::shared_ptr< FiniteElement > &fe_ptr)
boost::shared_ptr< FiniteElement > & getFiniteElementPtr() const
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
EntityType getEntType() const
Get entity type.

◆ getLocalUniqueId()

UId MoFEM::EntFiniteElement::getLocalUniqueId ( ) const

Get unique UId for finite element entity.

Returns
UId

Definition at line 527 of file FEMultiIndices.hpp.

527 { return getLocalUniqueIdCalculate(); }
UId getLocalUniqueIdCalculate() const
Generate UId for finite element entity.

◆ getLocalUniqueIdCalculate() [1/2]

UId MoFEM::EntFiniteElement::getLocalUniqueIdCalculate ( ) const

Generate UId for finite element entity.

Returns
finite element entity unique Id

Definition at line 538 of file FEMultiIndices.hpp.

538  {
540  }
const UId & getFEUId() const
Get finite element uid.
EntityHandle getEnt() const
Get the entity handle.

◆ getLocalUniqueIdCalculate() [2/2]

static UId MoFEM::EntFiniteElement::getLocalUniqueIdCalculate ( const EntityHandle  ent,
UId  fe_uid 
)
static

Definition at line 529 of file FEMultiIndices.hpp.

530  {
531  return fe_uid |= ent;
532  }

◆ getRowDofView()

template<typename MOFEM_DOFS , typename MOFEM_DOFS_VIEW >
MoFEMErrorCode MoFEM::EntFiniteElement::getRowDofView ( const MOFEM_DOFS &  mofem_dofs,
MOFEM_DOFS_VIEW &  dofs_view 
)

Definition at line 617 of file FEMultiIndices.hpp.

618  {
619 
620  auto hint = dofs_view.end();
621  using ValType = typename std::remove_reference<decltype(**hint)>::type;
622  using IndexType = MOFEM_DOFS_VIEW;
623 
624  struct Inserter {
625  using Idx = IndexType;
626  using It = typename Idx::iterator;
627  It operator()(Idx &dofs_view, It &hint,
628  boost::shared_ptr<ValType> &&dof) {
629  return dofs_view.emplace_hint(hint, dof);
630  }
631  };
632 
633  return getDofView(getRowFieldEnts(), mofem_dofs, dofs_view, Inserter());
634  }
FieldEntity_vector_view & getRowFieldEnts() const

◆ getRowFieldEnts()

FieldEntity_vector_view& MoFEM::EntFiniteElement::getRowFieldEnts ( ) const

Definition at line 568 of file FEMultiIndices.hpp.

568  {
569  return *getRowFieldEntsPtr();
570  };
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr() const

◆ getRowFieldEntsPtr()

boost::shared_ptr<FieldEntity_vector_view>& MoFEM::EntFiniteElement::getRowFieldEntsPtr ( ) const

Definition at line 573 of file FEMultiIndices.hpp.

573  {
575  return rowFieldEnts;
576  };

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 441 of file FEMultiIndices.cpp.

441  {
442  os << *e.getFiniteElementPtr() << std::endl;
443  os << *e.sPtr;
444  return os;
445 }

Member Data Documentation

◆ colFieldEnts

boost::shared_ptr<FieldEntity_vector_view> MoFEM::EntFiniteElement::colFieldEnts
mutableprivate

Definition at line 663 of file FEMultiIndices.hpp.

◆ dataFieldEnts

boost::shared_ptr<FieldEntity_vector_view> MoFEM::EntFiniteElement::dataFieldEnts
mutableprivate

Definition at line 661 of file FEMultiIndices.hpp.

◆ rowFieldEnts

boost::shared_ptr<FieldEntity_vector_view> MoFEM::EntFiniteElement::rowFieldEnts
mutableprivate

Definition at line 662 of file FEMultiIndices.hpp.


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