v0.15.0
Loading...
Searching...
No Matches
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
 
- 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.
 
UId getLocalUniqueIdCalculate () const
 Generate UId for finite element entity.
 
boost::shared_ptr< FEDofEntity_multiIndexgetDataDofsPtr () const
 Get the Data Dofs Ptr object.
 
boost::shared_ptr< std::vector< boost::shared_ptr< FEDofEntity > > > getDataVectorDofsPtr () const
 Get data data dos multi-index structure.
 
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.
 
BitFEId getId () const
 Get finite element id.
 
EntityHandle getMeshset () const
 Get meshset containing element entities.
 
boost::string_ref getNameRef () const
 Get finite element name.
 
std::string getName () const
 Get finite element name.
 
BitFieldId getBitFieldIdCol () const
 Get field ids on columns.
 
BitFieldId getBitFieldIdRow () const
 Get field ids on rows.
 
BitFieldId getBitFieldIdData () const
 Get field ids on data.
 
unsigned int getBitNumber () const
 Get bit identifying this element.
 
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
 
const boost::shared_ptr< BasicEntityDatagetBasicDataPtr () const
 
EntityHandle getEnt () const
 
EntityType getParentEntType () const
 
EntityHandle getParentEnt () const
 
BitRefLevelgetBitRefLevelPtr () const
 
const BitRefLevelgetBitRefLevel () const
 
unsigned long int getBitRefLevelULong () const
 
EntityType getEntType () const
 
int getEntDimension () const
 
const char * getEntTypeName () const
 
EntityID getEntId () const
 
EntityHandle getOwnerEnt () const
 
EntityHandlegetOwnerEnt ()
 
int getOwnerProc () const
 
int getPartProc () const
 
int * getPartProcPtr () const
 
unsigned char getPStatus () const
 
int * getSharingProcsPtr () const
 
EntityHandlegetSharingHandlersPtr () const
 
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 550 of file FEMultiIndices.hpp.

Member Typedef Documentation

◆ interface_type_FiniteElement

Initial value:
interface_FiniteElement<FiniteElement, RefElement>

Definition at line 555 of file FEMultiIndices.hpp.

◆ interface_type_RefElement

◆ interface_type_RefEntity

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

482 : interface_FiniteElement<FiniteElement, RefElement>(fe_ptr,
483 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 )
inline

Definition at line 677 of file FEMultiIndices.hpp.

678 {
679
680 auto hint = dofs_view.end();
681 using ValType = typename std::remove_reference<decltype(**hint)>::type;
682 using IndexType = MOFEM_DOFS_VIEW;
683
684 struct Inserter {
685 using Idx = IndexType;
686 using It = typename Idx::iterator;
687 It operator()(Idx &dofs_view, It &hint,
688 boost::shared_ptr<ValType> &&dof) {
689 return dofs_view.emplace_hint(hint, dof);
690 }
691 };
692
693 return getDofView(getColFieldEnts(), mofem_dofs, dofs_view, operation_type);
694 }
static MoFEMErrorCode getDofView(const FE_ENTS &fe_ents_view, const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, INSERTER &&inserter)
FieldEntity_vector_view & getColFieldEnts() const

◆ getColFieldEnts()

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

Definition at line 617 of file FEMultiIndices.hpp.

617 {
618 return *getColFieldEntsPtr();
619 };
boost::shared_ptr< FieldEntity_vector_view > & getColFieldEntsPtr() const

◆ getColFieldEntsPtr()

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

Definition at line 622 of file FEMultiIndices.hpp.

622 {
623 RefEntityTmp<0>::refElementPtr = this->getRefElement();
624 return colFieldEnts;
625 };
boost::shared_ptr< RefElement > & 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 584 of file FEMultiIndices.cpp.

584 {
585 RefEntityTmp<0>::refElementPtr = this->getRefElement();
586 struct Extractor {
587 boost::weak_ptr<EntityCacheDofs>
588 operator()(boost::shared_ptr<FieldEntity> &e) {
589 return e->entityCacheDataDofs;
590 }
591 };
592
593 struct Inserter {
594 FEDofEntity_multiIndex::iterator
595 operator()(boost::shared_ptr<FEDofEntity_multiIndex> &dofs_view,
596 FEDofEntity_multiIndex::iterator &hint,
597 boost::shared_ptr<FEDofEntity> &&dof) {
598 return dofs_view->emplace_hint(hint, dof);
599 }
600 };
601
602 auto data_dofs = boost::make_shared<FEDofEntity_multiIndex>();
603 if (get_cache_data_dofs_view(dataFieldEnts, data_dofs, Extractor(),
604 Inserter()))
605 THROW_MESSAGE("data_dofs can not be created");
606 return data_dofs;
607};
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
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
inline

Definition at line 597 of file FEMultiIndices.hpp.

597 {
598 return *getDataFieldEntsPtr();
599 };
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr() const

◆ getDataFieldEntsPtr()

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

Definition at line 602 of file FEMultiIndices.hpp.

602 {
603 RefEntityTmp<0>::refElementPtr = this->getRefElement();
604 return dataFieldEnts;
605 };

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

610 {
611 RefEntityTmp<0>::refElementPtr = this->getRefElement();
612
613 struct Extractor {
614 boost::weak_ptr<EntityCacheDofs>
615 operator()(boost::shared_ptr<FieldEntity> &e) {
616 return e->entityCacheDataDofs;
617 }
618 };
619
620 struct Inserter {
621 using Vec = std::vector<boost::shared_ptr<FEDofEntity>>;
622 using It = Vec::iterator;
623 It operator()(boost::shared_ptr<Vec> &dofs_view, It &hint,
624 boost::shared_ptr<FEDofEntity> &&dof) {
625 dofs_view->emplace_back(dof);
626 return dofs_view->end();
627 }
628 };
629
630 auto data_vector_dofs =
631 boost::make_shared<std::vector<boost::shared_ptr<FEDofEntity>>>();
632 if (get_cache_data_dofs_view(dataFieldEnts, data_vector_dofs, Extractor(),
633 Inserter()))
634 THROW_MESSAGE("dataDofs can not be created");
635
636 return data_vector_dofs;
637};

◆ 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 632 of file FEMultiIndices.hpp.

633 {
635
636 auto hint = dofs_view.end();
637 using ValType = typename std::remove_reference<decltype(**hint)>::type;
638
639 for (auto &it : fe_ents_view) {
640 if (auto e = it.lock()) {
641 const auto &uid = e->getLocalUniqueId();
642 auto dit = mofem_dofs.lower_bound(uid);
643 if (dit != mofem_dofs.end()) {
644 const auto hi_dit = mofem_dofs.upper_bound(
645 uid | static_cast<UId>(MAX_DOFS_ON_ENTITY - 1));
646 for (; dit != hi_dit; ++dit)
647 hint = inserter(dofs_view, hint,
648 boost::reinterpret_pointer_cast<ValType>(*dit));
649 }
650 }
651 }
653 }
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
uint128_t UId
Unique Id.
Definition Types.hpp:31

◆ getElementAdjacency()

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

Definition at line 495 of file FEMultiIndices.cpp.

496 {
497 moab::Interface &moab = getRefEntityPtr()->getBasicDataPtr()->moab;
499 const EntFiniteElement *this_fe_ptr = this;
500#ifndef NDEBUG
501 if (getFiniteElementPtr()->elementAdjacencyTable[getEntType()] == NULL)
502 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
503#endif
504 CHKERR getFiniteElementPtr() -> elementAdjacencyTable[getEntType()](
505 moab, *field_ptr, *this_fe_ptr, adjacency);
507}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
@ MOFEM_NOT_IMPLEMENTED
Definition definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
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

◆ getLocalUniqueId()

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

Get unique UId for finite element entity.

Returns
UId

Definition at line 566 of file FEMultiIndices.hpp.

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

◆ getLocalUniqueIdCalculate() [1/2]

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

Generate UId for finite element entity.

Returns
finite element entity unique Id

Definition at line 577 of file FEMultiIndices.hpp.

◆ getLocalUniqueIdCalculate() [2/2]

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

Definition at line 568 of file FEMultiIndices.hpp.

569 {
570 return fe_uid |= ent;
571 }

◆ 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 656 of file FEMultiIndices.hpp.

657 {
658
659 auto hint = dofs_view.end();
660 using ValType = typename std::remove_reference<decltype(**hint)>::type;
661 using IndexType = MOFEM_DOFS_VIEW;
662
663 struct Inserter {
664 using Idx = IndexType;
665 using It = typename Idx::iterator;
666 It operator()(Idx &dofs_view, It &hint,
667 boost::shared_ptr<ValType> &&dof) {
668 return dofs_view.emplace_hint(hint, dof);
669 }
670 };
671
672 return getDofView(getRowFieldEnts(), mofem_dofs, dofs_view, Inserter());
673 }
FieldEntity_vector_view & getRowFieldEnts() const

◆ getRowFieldEnts()

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

Definition at line 607 of file FEMultiIndices.hpp.

607 {
608 return *getRowFieldEntsPtr();
609 };
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr() const

◆ getRowFieldEntsPtr()

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

Definition at line 612 of file FEMultiIndices.hpp.

612 {
613 RefEntityTmp<0>::refElementPtr = this->getRefElement();
614 return rowFieldEnts;
615 };

Friends And Related Symbol Documentation

◆ operator<<

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

Definition at line 488 of file FEMultiIndices.cpp.

488 {
489 os << *e.getFiniteElementPtr() << std::endl;
490 os << *e.sPtr;
491 return os;
492}

Member Data Documentation

◆ colFieldEnts

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

Definition at line 702 of file FEMultiIndices.hpp.

◆ dataFieldEnts

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

Definition at line 700 of file FEMultiIndices.hpp.

◆ rowFieldEnts

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

Definition at line 701 of file FEMultiIndices.hpp.


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