v0.13.1
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 497 of file FEMultiIndices.hpp.

Member Typedef Documentation

◆ interface_type_FiniteElement

Definition at line 502 of file FEMultiIndices.hpp.

◆ interface_type_RefElement

Definition at line 501 of file FEMultiIndices.hpp.

◆ interface_type_RefEntity

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

422 : interface_FiniteElement<FiniteElement, RefElement>(fe_ptr,
423 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 624 of file FEMultiIndices.hpp.

625 {
626
627 auto hint = dofs_view.end();
628 using ValType = typename std::remove_reference<decltype(**hint)>::type;
629 using IndexType = MOFEM_DOFS_VIEW;
630
631 struct Inserter {
632 using Idx = IndexType;
633 using It = typename Idx::iterator;
634 It operator()(Idx &dofs_view, It &hint,
635 boost::shared_ptr<ValType> &&dof) {
636 return dofs_view.emplace_hint(hint, dof);
637 }
638 };
639
640 return getDofView(getColFieldEnts(), mofem_dofs, dofs_view, operation_type);
641 }
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 564 of file FEMultiIndices.hpp.

564 {
565 return *getColFieldEntsPtr();
566 };
boost::shared_ptr< FieldEntity_vector_view > & getColFieldEntsPtr() const

◆ getColFieldEntsPtr()

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

Definition at line 569 of file FEMultiIndices.hpp.

569 {
570 RefEntityTmp<0>::refElementPtr = this->getRefElement();
571 return colFieldEnts;
572 };
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 522 of file FEMultiIndices.cpp.

522 {
523 RefEntityTmp<0>::refElementPtr = this->getRefElement();
524 struct Extractor {
525 boost::weak_ptr<EntityCacheDofs>
526 operator()(boost::shared_ptr<FieldEntity> &e) {
527 return e->entityCacheDataDofs;
528 }
529 };
530
531 struct Inserter {
532 FEDofEntity_multiIndex::iterator
533 operator()(boost::shared_ptr<FEDofEntity_multiIndex> &dofs_view,
534 FEDofEntity_multiIndex::iterator &hint,
535 boost::shared_ptr<FEDofEntity> &&dof) {
536 return dofs_view->emplace_hint(hint, dof);
537 }
538 };
539
540 auto data_dofs = boost::make_shared<FEDofEntity_multiIndex>();
541 if (get_cache_data_dofs_view(dataFieldEnts, data_dofs, Extractor(),
542 Inserter()))
543 THROW_MESSAGE("data_dofs can not be created");
544 return data_dofs;
545};
#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 544 of file FEMultiIndices.hpp.

544 {
545 return *getDataFieldEntsPtr();
546 };
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr() const

◆ getDataFieldEntsPtr()

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

Definition at line 549 of file FEMultiIndices.hpp.

549 {
550 RefEntityTmp<0>::refElementPtr = this->getRefElement();
551 return dataFieldEnts;
552 };

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

548 {
549 RefEntityTmp<0>::refElementPtr = this->getRefElement();
550
551 struct Extractor {
552 boost::weak_ptr<EntityCacheDofs>
553 operator()(boost::shared_ptr<FieldEntity> &e) {
554 return e->entityCacheDataDofs;
555 }
556 };
557
558 struct Inserter {
559 using Vec = std::vector<boost::shared_ptr<FEDofEntity>>;
560 using It = Vec::iterator;
561 It operator()(boost::shared_ptr<Vec> &dofs_view, It &hint,
562 boost::shared_ptr<FEDofEntity> &&dof) {
563 dofs_view->emplace_back(dof);
564 return dofs_view->end();
565 }
566 };
567
568 auto data_vector_dofs =
569 boost::make_shared<std::vector<boost::shared_ptr<FEDofEntity>>>();
570 if (get_cache_data_dofs_view(dataFieldEnts, data_vector_dofs, Extractor(),
571 Inserter()))
572 THROW_MESSAGE("dataDofs can not be created");
573
574 return data_vector_dofs;
575};
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 579 of file FEMultiIndices.hpp.

580 {
582
583 auto hint = dofs_view.end();
584 using ValType = typename std::remove_reference<decltype(**hint)>::type;
585
586 for (auto &it : fe_ents_view) {
587 if (auto e = it.lock()) {
588 const auto &uid = e->getLocalUniqueId();
589 auto dit = mofem_dofs.lower_bound(uid);
590 if (dit != mofem_dofs.end()) {
591 const auto hi_dit = mofem_dofs.upper_bound(
592 uid | static_cast<UId>(MAX_DOFS_ON_ENTITY - 1));
593 for (; dit != hi_dit; ++dit)
594 hint = inserter(dofs_view, hint,
595 boost::reinterpret_pointer_cast<ValType>(*dit));
596 }
597 }
598 }
600 }
#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 435 of file FEMultiIndices.cpp.

436 {
437 moab::Interface &moab = getRefEntityPtr()->getBasicDataPtr()->moab;
439 const EntFiniteElement *this_fe_ptr = this;
440 if (getFiniteElementPtr()->elementAdjacencyTable[getEntType()] == NULL)
441 SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
442 CHKERR getFiniteElementPtr()->elementAdjacencyTable[getEntType()](
443 moab, *field_ptr, *this_fe_ptr, adjacency);
445}
#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 513 of file FEMultiIndices.hpp.

513{ 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 524 of file FEMultiIndices.hpp.

524 {
526 }
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 515 of file FEMultiIndices.hpp.

516 {
517 return fe_uid |= ent;
518 }

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

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

◆ getRowFieldEnts()

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

Definition at line 554 of file FEMultiIndices.hpp.

554 {
555 return *getRowFieldEntsPtr();
556 };
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr() const

◆ getRowFieldEntsPtr()

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

Definition at line 559 of file FEMultiIndices.hpp.

559 {
560 RefEntityTmp<0>::refElementPtr = this->getRefElement();
561 return rowFieldEnts;
562 };

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 428 of file FEMultiIndices.cpp.

428 {
429 os << *e.getFiniteElementPtr() << std::endl;
430 os << *e.sPtr;
431 return os;
432}

Member Data Documentation

◆ colFieldEnts

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

Definition at line 649 of file FEMultiIndices.hpp.

◆ dataFieldEnts

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

Definition at line 647 of file FEMultiIndices.hpp.

◆ rowFieldEnts

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

Definition at line 648 of file FEMultiIndices.hpp.


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