v0.16.3
Loading...
Searching...
No Matches
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< T > interface_type_RefEntity
 
typedef interface_RefElement< T > interface_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_multiIndex > getDataDofsPtr () 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_view & getDataFieldEnts () const
 
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr () const
 
FieldEntity_vector_view & getRowFieldEnts () const
 
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr () const
 
FieldEntity_vector_view & getColFieldEnts () 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 UId & getFEUId () 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< T >
 interface_RefElement (const boost::shared_ptr< T > &sptr)
 
virtual ~interface_RefElement ()=default
 
int getBitRefEdgesUlong () const
 
SideNumber_multiIndex & getSideNumberTable () 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< SideNumber > getSideNumberPtr () const
 
const boost::shared_ptr< BasicEntityData > getBasicDataPtr () const
 
EntityHandle getEnt () const
 
EntityType getParentEntType () const
 
EntityHandle getParentEnt () const
 
BitRefLevel * getBitRefLevelPtr () const
 
const BitRefLevel & getBitRefLevel () const
 
unsigned long int getBitRefLevelULong () const
 
EntityType getEntType () const
 
int getEntDimension () const
 
const char * getEntTypeName () const
 
EntityID getEntId () const
 
EntityHandle getOwnerEnt () const
 
EntityHandle & getOwnerEnt ()
 
int getOwnerProc () const
 
int getOwnerProc (ParallelComm *pcomm) const
 
int getPartProc () const
 
int * getPartProcPtr () const
 
unsigned char getPStatus () const
 
unsigned char getPStatus (ParallelComm *pcomm) const
 
int * getSharingProcsPtr () const
 
int * getSharingProcsPtr (ParallelComm *pcomm) const
 
EntityHandle * getSharingHandlersPtr () const
 
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_view > dataFieldEnts
 
boost::shared_ptr< FieldEntity_vector_view > rowFieldEnts
 
boost::shared_ptr< FieldEntity_vector_view > colFieldEnts
 

Friends

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

Additional Inherited Members

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

Detailed Description

Finite element data for entity.

Examples
mofem/atom_tests/scalar_check_approximation.cpp.

Definition at line 550 of file FEMultiIndices.hpp.

Member Typedef Documentation

◆ interface_type_FiniteElement

Definition at line 555 of file FEMultiIndices.hpp.

◆ interface_type_RefElement

Definition at line 554 of file FEMultiIndices.hpp.

◆ interface_type_RefEntity

Definition at line 553 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 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 682 of file FEMultiIndices.hpp.

683 {
684
685 auto hint = dofs_view.end();
686 using ValType = typename std::remove_reference<decltype(**hint)>::type;
687 using IndexType = MOFEM_DOFS_VIEW;
688
689 struct Inserter {
690 using Idx = IndexType;
691 using It = typename Idx::iterator;
692 It operator()(Idx &dofs_view, It &hint,
693 boost::shared_ptr<ValType> &&dof) {
694 return dofs_view.emplace_hint(hint, dof);
695 }
696 };
697
698 return getDofView(getColFieldEnts(), mofem_dofs, dofs_view, operation_type);
699 }
std::string type
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< 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 587 of file FEMultiIndices.cpp.

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

613 {
614 RefEntityTmp<0>::refElementPtr = this->getRefElement();
615
616 struct Extractor {
617 boost::weak_ptr<EntityCacheDofs>
618 operator()(boost::shared_ptr<FieldEntity> &e) {
619 return e->entityCacheDataDofs;
620 }
621 };
622
623 struct Inserter {
624 using Vec = std::vector<boost::shared_ptr<FEDofEntity>>;
625 using It = Vec::iterator;
626 It operator()(boost::shared_ptr<Vec> &dofs_view, It &hint,
627 boost::shared_ptr<FEDofEntity> &&dof) {
628 dofs_view->emplace_back(dof);
629 return dofs_view->end();
630 }
631 };
632
633 auto data_vector_dofs =
634 boost::make_shared<std::vector<boost::shared_ptr<FEDofEntity>>>();
635 if (get_cache_data_dofs_view(dataFieldEnts, data_vector_dofs, Extractor(),
636 Inserter()))
637 THROW_MESSAGE("dataDofs can not be created");
638
639 return data_vector_dofs;
640};
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 
)
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 // Ordered insertion returns the new node; vector callbacks return
650 // end(). Advance only a node iterator to obtain its successor.
651 if (hint != dofs_view.end())
652 ++hint;
653 }
654 }
655 }
656 }
658 }
It it
Definition Schur.cpp:2568
#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.

577 {
579 }
const UId & getFEUId() const
Get finite element uid.

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

662 {
663
664 auto hint = dofs_view.end();
665 using ValType = typename std::remove_reference<decltype(**hint)>::type;
666 using IndexType = MOFEM_DOFS_VIEW;
667
668 struct Inserter {
669 using Idx = IndexType;
670 using It = typename Idx::iterator;
671 It operator()(Idx &dofs_view, It &hint,
672 boost::shared_ptr<ValType> &&dof) {
673 return dofs_view.emplace_hint(hint, dof);
674 }
675 };
676
677 return getDofView(getRowFieldEnts(), mofem_dofs, dofs_view, Inserter());
678 }
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 707 of file FEMultiIndices.hpp.

◆ dataFieldEnts

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

Definition at line 705 of file FEMultiIndices.hpp.

◆ rowFieldEnts

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

Definition at line 706 of file FEMultiIndices.hpp.


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