v0.15.0
Loading...
Searching...
No Matches
MoFEM::NumeredEntFiniteElement Struct Reference

Partitioned (Indexed) Finite Element in Problem. More...

#include "src/multi_indices/FEMultiIndices.hpp"

Inheritance diagram for MoFEM::NumeredEntFiniteElement:
[legend]
Collaboration diagram for MoFEM::NumeredEntFiniteElement:
[legend]

Public Types

using interface_type_FiniteElement
 
using interface_type_EntFiniteElement
 
- Public Types inherited from MoFEM::interface_RefElement< EntFiniteElement >
typedef interface_RefEntity< EntFiniteElementinterface_type_RefEntity
 
typedef interface_RefElement< EntFiniteElementinterface_type_RefElement
 

Public Member Functions

virtual ~NumeredEntFiniteElement ()=default
 
boost::shared_ptr< EntFiniteElement > & getEntFiniteElement () const
 
 NumeredEntFiniteElement (const boost::shared_ptr< EntFiniteElement > &sptr)
 
unsigned int getPart () const
 Get partition number.
 
boost::shared_ptr< FENumeredDofEntity_multiIndexgetRowDofsPtr () const
 get FE dof on row
 
boost::shared_ptr< FENumeredDofEntity_multiIndexgetColDofsPtr () const
 get FE dof on column
 
boost::weak_ptr< FENumeredDofEntitygetRowDofsByPetscGlobalDofIdx (const int idx) const
 get FE dof by petsc index
 
boost::weak_ptr< FENumeredDofEntitygetColDofsByPetscGlobalDofIdx (const int idx) const
 get FE dof by petsc index
 
- Public Member Functions inherited from MoFEM::interface_EntFiniteElement< EntFiniteElement >
 interface_EntFiniteElement (const boost::shared_ptr< EntFiniteElement > &sptr)
 
virtual ~interface_EntFiniteElement ()=default
 
auto getDataDofsPtr () const
 
auto getDataVectorDofsPtr () const
 
FieldEntity_vector_viewgetDataFieldEnts () const
 
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr ()
 
FieldEntity_vector_viewgetRowFieldEnts () const
 
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr () const
 
FieldEntity_vector_viewgetColFieldEnts () const
 
boost::shared_ptr< FieldEntity_vector_view > & getColFieldEntsPtr () const
 
UId getLocalUniqueId () const
 Get unique UId for finite element entity.
 
SideNumber_multiIndexgetSideNumberTable () const
 
MoFEMErrorCode getElementAdjacency (const Field *field_ptr, Range &adjacency)
 
const boost::shared_ptr< RefElement > & getRefElement () const
 
- Public Member Functions inherited from MoFEM::interface_FiniteElement< EntFiniteElement, EntFiniteElement >
 interface_FiniteElement (const boost::shared_ptr< EntFiniteElement > fe_ptr, const boost::shared_ptr< EntFiniteElement > 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< EntFiniteElement > & getFiniteElementPtr () const
 
- Public Member Functions inherited from MoFEM::interface_RefElement< EntFiniteElement >
 interface_RefElement (const boost::shared_ptr< EntFiniteElement > &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< EntFiniteElement > & getRefElement () const
 
- Public Member Functions inherited from MoFEM::interface_RefEntity< EntFiniteElement >
 interface_RefEntity (const boost::shared_ptr< EntFiniteElement > &sptr)
 
 interface_RefEntity (const interface_RefEntity< EntFiniteElement > &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< EntFiniteElement > & getRefEntityPtr () const
 

Public Attributes

unsigned int part
 Partition number.
 
- Public Attributes inherited from MoFEM::interface_RefEntity< EntFiniteElement >
boost::shared_ptr< EntFiniteElementsPtr
 

Friends

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

Detailed Description

Partitioned (Indexed) Finite Element in Problem.

This type of structure is used to compose problem. Problem is build from indexed finite elements. This data structure carry information about partition, which is specific to problem.

Definition at line 777 of file FEMultiIndices.hpp.

Member Typedef Documentation

◆ interface_type_EntFiniteElement

Initial value:
interface_EntFiniteElement<EntFiniteElement>

Definition at line 784 of file FEMultiIndices.hpp.

◆ interface_type_FiniteElement

Initial value:
interface_FiniteElement<EntFiniteElement, EntFiniteElement>

Definition at line 782 of file FEMultiIndices.hpp.

Constructor & Destructor Documentation

◆ ~NumeredEntFiniteElement()

virtual MoFEM::NumeredEntFiniteElement::~NumeredEntFiniteElement ( )
virtualdefault

◆ NumeredEntFiniteElement()

MoFEM::NumeredEntFiniteElement::NumeredEntFiniteElement ( const boost::shared_ptr< EntFiniteElement > & sptr)

\Construct indexed finite element

Definition at line 512 of file FEMultiIndices.cpp.

514 : interface_EntFiniteElement<EntFiniteElement>(sptr), part(-1) {};
unsigned int part
Partition number.

Member Function Documentation

◆ getColDofsByPetscGlobalDofIdx()

boost::weak_ptr< FENumeredDofEntity > MoFEM::NumeredEntFiniteElement::getColDofsByPetscGlobalDofIdx ( const int idx) const

get FE dof by petsc index

Definition at line 535 of file FEMultiIndices.cpp.

535 {
536
537 auto comp = [idx](const auto &a) { return a->getPetscGlobalDofIdx() == idx; };
538
539 for (auto &it : getColFieldEnts()) {
540 if (auto e = it.lock()) {
541 if (auto cache = e->entityCacheColDofs.lock()) {
542 auto dit = std::find_if(cache->loHi[0], cache->loHi[1], comp);
543 if (dit != cache->loHi[1])
544 return boost::reinterpret_pointer_cast<FENumeredDofEntity>(*dit);
545 } else
546 THROW_MESSAGE("Cache not set");
547 }
548 }
549
550 return boost::weak_ptr<FENumeredDofEntity>();
551}
constexpr double a
#define THROW_MESSAGE(msg)
Throw MoFEM exception.

◆ getColDofsPtr()

boost::shared_ptr< FENumeredDofEntity_multiIndex > MoFEM::NumeredEntFiniteElement::getColDofsPtr ( ) const

get FE dof on column

Definition at line 668 of file FEMultiIndices.cpp.

668 {
669 RefEntityTmp<0>::refElementPtr = this->getRefElement();
670
671 struct Extractor {
672 boost::weak_ptr<EntityCacheNumeredDofs>
673 operator()(boost::shared_ptr<FieldEntity> &e) {
674 return e->entityCacheColDofs;
675 }
676 };
677
678 struct Inserter {
680 using It = Idx::iterator;
681 It operator()(boost::shared_ptr<Idx> &dofs_view, It &hint,
682 boost::shared_ptr<FENumeredDofEntity> &&dof) {
683 return dofs_view->emplace_hint(hint, dof);
684 }
685 };
686
687 auto col_dofs = boost::make_shared<FENumeredDofEntity_multiIndex>();
688 if (get_cache_data_dofs_view(getColFieldEntsPtr(), col_dofs, Extractor(),
689 Inserter()))
690 THROW_MESSAGE("col_dofs can not be created");
691
692 return col_dofs;
693}
multi_index_container< boost::shared_ptr< FENumeredDofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< FENumeredDofEntity::interface_type_DofEntity, UId, &FENumeredDofEntity::getLocalUniqueId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FENumeredDofEntity::interface_type_DofEntity, EntityHandle, &FENumeredDofEntity::getEnt > > > > FENumeredDofEntity_multiIndex
MultiIndex container keeps FENumeredDofEntity.
static MoFEMErrorCode get_cache_data_dofs_view(ENTSVIEW &ents_view, DOFSVIEW &dofs_view, EXTRACTOR &&extractor, INSERTER &&inserter)
boost::shared_ptr< FieldEntity_vector_view > & getColFieldEntsPtr() const
const boost::shared_ptr< RefElement > & getRefElement() const

◆ getEntFiniteElement()

boost::shared_ptr< EntFiniteElement > & MoFEM::NumeredEntFiniteElement::getEntFiniteElement ( ) const
inline

Definition at line 789 of file FEMultiIndices.hpp.

789 {
790 return this->sPtr;
791 }
boost::shared_ptr< EntFiniteElement > sPtr

◆ getPart()

unsigned int MoFEM::NumeredEntFiniteElement::getPart ( ) const
inline

Get partition number.

Returns
[description]

Definition at line 802 of file FEMultiIndices.hpp.

802{ return part; };

◆ getRowDofsByPetscGlobalDofIdx()

boost::weak_ptr< FENumeredDofEntity > MoFEM::NumeredEntFiniteElement::getRowDofsByPetscGlobalDofIdx ( const int idx) const

get FE dof by petsc index

Definition at line 517 of file FEMultiIndices.cpp.

517 {
518 auto comp = [idx](const auto &a) { return a->getPetscGlobalDofIdx() == idx; };
519
520 for (auto &it : getRowFieldEnts()) {
521 if (auto e = it.lock()) {
522 if (auto cache = e->entityCacheColDofs.lock()) {
523 auto dit = std::find_if(cache->loHi[0], cache->loHi[1], comp);
524 if (dit != cache->loHi[1])
525 return boost::reinterpret_pointer_cast<FENumeredDofEntity>(*dit);
526 } else
527 THROW_MESSAGE("Cache not set");
528 }
529 }
530
531 return boost::weak_ptr<FENumeredDofEntity>();
532}

◆ getRowDofsPtr()

boost::shared_ptr< FENumeredDofEntity_multiIndex > MoFEM::NumeredEntFiniteElement::getRowDofsPtr ( ) const

get FE dof on row

Definition at line 640 of file FEMultiIndices.cpp.

640 {
641 RefEntityTmp<0>::refElementPtr = this->getRefElement();
642
643 struct Extractor {
644 boost::weak_ptr<EntityCacheNumeredDofs>
645 operator()(boost::shared_ptr<FieldEntity> &e) {
646 return e->entityCacheRowDofs;
647 }
648 };
649
650 struct Inserter {
652 using It = Idx::iterator;
653 It operator()(boost::shared_ptr<Idx> &dofs_view, It &hint,
654 boost::shared_ptr<FENumeredDofEntity> &&dof) {
655 return dofs_view->emplace_hint(hint, dof);
656 }
657 };
658
659 auto row_dofs = boost::make_shared<FENumeredDofEntity_multiIndex>();
660 if (get_cache_data_dofs_view(getRowFieldEntsPtr(), row_dofs, Extractor(),
661 Inserter()))
662 THROW_MESSAGE("row_dofs can not be created");
663
664 return row_dofs;
665}
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr() const

Friends And Related Symbol Documentation

◆ operator<<

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

Definition at line 553 of file FEMultiIndices.cpp.

553 {
554 os << "part " << e.part << " " << *(e.getEntFiniteElement());
555 return os;
556}

Member Data Documentation

◆ part

unsigned int MoFEM::NumeredEntFiniteElement::part

Partition number.

Definition at line 787 of file FEMultiIndices.hpp.


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