v0.14.0
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< 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
 
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< 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.

Examples
scalar_check_approximation.cpp.

Definition at line 501 of file FEMultiIndices.hpp.

Member Typedef Documentation

◆ interface_type_FiniteElement

Definition at line 506 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),
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 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 }
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 568 of file FEMultiIndices.hpp.

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

◆ getColFieldEntsPtr()

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

Definition at line 573 of file FEMultiIndices.hpp.

573 {
574 RefEntityTmp<0>::refElementPtr = this->getRefElement();
575 return colFieldEnts;
576 };
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 519 of file FEMultiIndices.cpp.

519 {
520 RefEntityTmp<0>::refElementPtr = this->getRefElement();
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};
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:561
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 548 of file FEMultiIndices.hpp.

548 {
549 return *getDataFieldEntsPtr();
550 };
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr() const

◆ getDataFieldEntsPtr()

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

Definition at line 553 of file FEMultiIndices.hpp.

553 {
554 RefEntityTmp<0>::refElementPtr = this->getRefElement();
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 {
546 RefEntityTmp<0>::refElementPtr = this->getRefElement();
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};
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 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 }
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
Definition: definitions.h:236
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
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 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}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
@ MOFEM_NOT_IMPLEMENTED
Definition: definitions.h:32
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
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 517 of file FEMultiIndices.hpp.

517{ 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 528 of file FEMultiIndices.hpp.

528 {
530 }
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 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 }
FieldEntity_vector_view & getRowFieldEnts() const

◆ getRowFieldEnts()

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

Definition at line 558 of file FEMultiIndices.hpp.

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

◆ getRowFieldEntsPtr()

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

Definition at line 563 of file FEMultiIndices.hpp.

563 {
564 RefEntityTmp<0>::refElementPtr = this->getRefElement();
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: