v0.14.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< RefElement >
typedef interface_RefEntity< RefElementinterface_type_RefEntity
 
typedef interface_RefElement< RefElementinterface_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< RefElement >
 interface_RefElement (const boost::shared_ptr< RefElement > &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< RefElement > & getRefElement () const
 
- Public Member Functions inherited from MoFEM::interface_RefEntity< RefElement >
 interface_RefEntity (const boost::shared_ptr< RefElement > &sptr)
 
 interface_RefEntity (const interface_RefEntity< RefElement > &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< RefElement > & 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< RefElement >
boost::shared_ptr< RefElementsPtr
 

Detailed Description

Finite element data for entity.

Examples
scalar_check_approximation.cpp.

Definition at line 501 of file FEMultiIndices.hpp.

Member Typedef Documentation

◆ interface_type_FiniteElement

Definition at line 507 of file FEMultiIndices.hpp.

◆ interface_type_RefElement

Definition at line 505 of file FEMultiIndices.hpp.

◆ interface_type_RefEntity

Definition at line 504 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 416 of file FEMultiIndices.cpp.

419  : interface_FiniteElement<FiniteElement, RefElement>(fe_ptr,
420  ref_finite_element),

◆ ~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 
)
inline

Definition at line 628 of file FEMultiIndices.hpp.

629  {
630 
631  auto hint = dofs_view.end();
632  using ValType = typename std::remove_reference<decltype(**hint)>::type;
633  using IndexType = MOFEM_DOFS_VIEW;
634 
635  struct Inserter {
636  using Idx = IndexType;
637  using It = typename Idx::iterator;
638  It operator()(Idx &dofs_view, It &hint,
639  boost::shared_ptr<ValType> &&dof) {
640  return dofs_view.emplace_hint(hint, dof);
641  }
642  };
643 
644  return getDofView(getColFieldEnts(), mofem_dofs, dofs_view, operation_type);
645  }

◆ getColFieldEnts()

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

Definition at line 568 of file FEMultiIndices.hpp.

568  {
569  return *getColFieldEntsPtr();
570  };

◆ getColFieldEntsPtr()

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

Definition at line 573 of file FEMultiIndices.hpp.

573  {
575  return colFieldEnts;
576  };

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

519  {
521  struct Extractor {
522  boost::weak_ptr<EntityCacheDofs>
523  operator()(boost::shared_ptr<FieldEntity> &e) {
524  return e->entityCacheDataDofs;
525  }
526  };
527 
528  struct Inserter {
529  FEDofEntity_multiIndex::iterator
530  operator()(boost::shared_ptr<FEDofEntity_multiIndex> &dofs_view,
531  FEDofEntity_multiIndex::iterator &hint,
532  boost::shared_ptr<FEDofEntity> &&dof) {
533  return dofs_view->emplace_hint(hint, dof);
534  }
535  };
536 
537  auto data_dofs = boost::make_shared<FEDofEntity_multiIndex>();
538  if (get_cache_data_dofs_view(dataFieldEnts, data_dofs, Extractor(),
539  Inserter()))
540  THROW_MESSAGE("data_dofs can not be created");
541  return data_dofs;
542 };

◆ getDataFieldEnts()

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

Definition at line 548 of file FEMultiIndices.hpp.

548  {
549  return *getDataFieldEntsPtr();
550  };

◆ getDataFieldEntsPtr()

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

Definition at line 553 of file FEMultiIndices.hpp.

553  {
555  return dataFieldEnts;
556  };

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

545  {
547 
548  struct Extractor {
549  boost::weak_ptr<EntityCacheDofs>
550  operator()(boost::shared_ptr<FieldEntity> &e) {
551  return e->entityCacheDataDofs;
552  }
553  };
554 
555  struct Inserter {
556  using Vec = std::vector<boost::shared_ptr<FEDofEntity>>;
557  using It = Vec::iterator;
558  It operator()(boost::shared_ptr<Vec> &dofs_view, It &hint,
559  boost::shared_ptr<FEDofEntity> &&dof) {
560  dofs_view->emplace_back(dof);
561  return dofs_view->end();
562  }
563  };
564 
565  auto data_vector_dofs =
566  boost::make_shared<std::vector<boost::shared_ptr<FEDofEntity>>>();
567  if (get_cache_data_dofs_view(dataFieldEnts, data_vector_dofs, Extractor(),
568  Inserter()))
569  THROW_MESSAGE("dataDofs can not be created");
570 
571  return data_vector_dofs;
572 };

◆ 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 
)
inlinestatic

Definition at line 583 of file FEMultiIndices.hpp.

584  {
586 
587  auto hint = dofs_view.end();
588  using ValType = typename std::remove_reference<decltype(**hint)>::type;
589 
590  for (auto &it : fe_ents_view) {
591  if (auto e = it.lock()) {
592  const auto &uid = e->getLocalUniqueId();
593  auto dit = mofem_dofs.lower_bound(uid);
594  if (dit != mofem_dofs.end()) {
595  const auto hi_dit = mofem_dofs.upper_bound(
596  uid | static_cast<UId>(MAX_DOFS_ON_ENTITY - 1));
597  for (; dit != hi_dit; ++dit)
598  hint = inserter(dofs_view, hint,
599  boost::reinterpret_pointer_cast<ValType>(*dit));
600  }
601  }
602  }
604  }

◆ getElementAdjacency()

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

Definition at line 432 of file FEMultiIndices.cpp.

433  {
434  moab::Interface &moab = getRefEntityPtr()->getBasicDataPtr()->moab;
436  const EntFiniteElement *this_fe_ptr = this;
437  if (getFiniteElementPtr()->elementAdjacencyTable[getEntType()] == NULL)
438  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
439  CHKERR getFiniteElementPtr()->elementAdjacencyTable[getEntType()](
440  moab, *field_ptr, *this_fe_ptr, adjacency);
442 }

◆ getLocalUniqueId()

UId MoFEM::EntFiniteElement::getLocalUniqueId ( ) const
inline

Get unique UId for finite element entity.

Returns
UId

Definition at line 517 of file FEMultiIndices.hpp.

517 { return getLocalUniqueIdCalculate(); }

◆ getLocalUniqueIdCalculate() [1/2]

UId MoFEM::EntFiniteElement::getLocalUniqueIdCalculate ( ) const
inline

Generate UId for finite element entity.

Returns
finite element entity unique Id

Definition at line 528 of file FEMultiIndices.hpp.

528  {
530  }

◆ getLocalUniqueIdCalculate() [2/2]

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

Definition at line 519 of file FEMultiIndices.hpp.

520  {
521  return fe_uid |= ent;
522  }

◆ getRowDofView()

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

Definition at line 607 of file FEMultiIndices.hpp.

608  {
609 
610  auto hint = dofs_view.end();
611  using ValType = typename std::remove_reference<decltype(**hint)>::type;
612  using IndexType = MOFEM_DOFS_VIEW;
613 
614  struct Inserter {
615  using Idx = IndexType;
616  using It = typename Idx::iterator;
617  It operator()(Idx &dofs_view, It &hint,
618  boost::shared_ptr<ValType> &&dof) {
619  return dofs_view.emplace_hint(hint, dof);
620  }
621  };
622 
623  return getDofView(getRowFieldEnts(), mofem_dofs, dofs_view, Inserter());
624  }

◆ getRowFieldEnts()

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

Definition at line 558 of file FEMultiIndices.hpp.

558  {
559  return *getRowFieldEntsPtr();
560  };

◆ getRowFieldEntsPtr()

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

Definition at line 563 of file FEMultiIndices.hpp.

563  {
565  return rowFieldEnts;
566  };

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 425 of file FEMultiIndices.cpp.

425  {
426  os << *e.getFiniteElementPtr() << std::endl;
427  os << *e.sPtr;
428  return os;
429 }

Member Data Documentation

◆ colFieldEnts

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

Definition at line 653 of file FEMultiIndices.hpp.

◆ dataFieldEnts

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

Definition at line 651 of file FEMultiIndices.hpp.

◆ rowFieldEnts

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

Definition at line 652 of file FEMultiIndices.hpp.


The documentation for this struct was generated from the following files:
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
MoFEM::interface_RefElement< RefElement >::getRefEntityPtr
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
Definition: RefElementMultiIndices.hpp:157
MoFEM::RefEntityTmp< 0 >::refElementPtr
static boost::weak_ptr< RefElement > refElementPtr
Definition: RefEntsMultiIndices.hpp:540
MoFEM::FieldEntity_vector_view
std::vector< boost::weak_ptr< FieldEntity > > FieldEntity_vector_view
Definition: FieldEntsMultiIndices.hpp:478
MoFEM::interface_RefEntity< RefElement >::getEnt
EntityHandle getEnt() const
Get the entity handle.
Definition: RefEntsMultiIndices.hpp:603
THROW_MESSAGE
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:561
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MoFEM::Types::UId
uint128_t UId
Unique Id.
Definition: Types.hpp:31
MoFEM::EntFiniteElement::getDataFieldEntsPtr
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr() const
Definition: FEMultiIndices.hpp:553
MoFEM::interface_FiniteElement< FiniteElement, RefElement >::getFiniteElementPtr
boost::shared_ptr< FiniteElement > & getFiniteElementPtr() const
Definition: FEMultiIndices.hpp:396
convert.type
type
Definition: convert.py:64
MoFEM::EntFiniteElement::getLocalUniqueIdCalculate
UId getLocalUniqueIdCalculate() const
Generate UId for finite element entity.
Definition: FEMultiIndices.hpp:528
MoFEM::EntFiniteElement::colFieldEnts
boost::shared_ptr< FieldEntity_vector_view > colFieldEnts
Definition: FEMultiIndices.hpp:653
MoFEM::EntFiniteElement::getColFieldEnts
FieldEntity_vector_view & getColFieldEnts() const
Definition: FEMultiIndices.hpp:568
MoFEM::EntFiniteElement::getColFieldEntsPtr
boost::shared_ptr< FieldEntity_vector_view > & getColFieldEntsPtr() const
Definition: FEMultiIndices.hpp:573
MoFEM::EntFiniteElement::EntFiniteElement
EntFiniteElement(const boost::shared_ptr< RefElement > &ref_finite_element, const boost::shared_ptr< FiniteElement > &fe_ptr)
Definition: FEMultiIndices.cpp:416
MAX_DOFS_ON_ENTITY
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
Definition: definitions.h:236
MoFEM::EntFiniteElement::getDofView
static MoFEMErrorCode getDofView(const FE_ENTS &fe_ents_view, const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, INSERTER &&inserter)
Definition: FEMultiIndices.hpp:583
MoFEM::EntFiniteElement::rowFieldEnts
boost::shared_ptr< FieldEntity_vector_view > rowFieldEnts
Definition: FEMultiIndices.hpp:652
EigenMatrix::Vec
const FTensor::Tensor2< T, Dim, Dim > Vec
Definition: MatrixFunction.hpp:66
MoFEM::interface_FiniteElement< FiniteElement, RefElement >::getFEUId
const UId & getFEUId() const
Get finite element uid.
Definition: FEMultiIndices.hpp:338
MoFEM::interface_RefEntity< RefElement >::getEntType
EntityType getEntType() const
Get entity type.
Definition: RefEntsMultiIndices.hpp:643
MoFEM::interface_RefElement< RefElement >::getRefElement
boost::shared_ptr< RefElement > & getRefElement() const
Definition: RefElementMultiIndices.hpp:161
MoFEM::EntFiniteElement::getRowFieldEnts
FieldEntity_vector_view & getRowFieldEnts() const
Definition: FEMultiIndices.hpp:558
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
MoFEM::EntFiniteElement::dataFieldEnts
boost::shared_ptr< FieldEntity_vector_view > dataFieldEnts
Definition: FEMultiIndices.hpp:651
MoFEM::get_cache_data_dofs_view
static MoFEMErrorCode get_cache_data_dofs_view(ENTSVIEW &ents_view, DOFSVIEW &dofs_view, EXTRACTOR &&extractor, INSERTER &&inserter)
Definition: FEMultiIndices.cpp:496
MoFEM::EntFiniteElement::getRowFieldEntsPtr
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr() const
Definition: FEMultiIndices.hpp:563
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MOFEM_NOT_IMPLEMENTED
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346