v0.14.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
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 = interface_FiniteElement< EntFiniteElement, EntFiniteElement >
 
using interface_type_EntFiniteElement = interface_EntFiniteElement< EntFiniteElement >
 
- Public Types inherited from MoFEM::interface_RefElement< REFENT >
typedef interface_RefEntity< REFENT > interface_type_RefEntity
 
typedef interface_RefElement< REFENT > interface_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. More...
 
boost::shared_ptr< FENumeredDofEntity_multiIndexgetRowDofsPtr () const
 get FE dof on row More...
 
boost::shared_ptr< FENumeredDofEntity_multiIndexgetColDofsPtr () const
 get FE dof on column More...
 
boost::weak_ptr< FENumeredDofEntitygetRowDofsByPetscGlobalDofIdx (const int idx) const
 get FE dof by petsc index More...
 
boost::weak_ptr< FENumeredDofEntitygetColDofsByPetscGlobalDofIdx (const int idx) const
 get FE dof by petsc index More...
 
- 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. More...
 
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< FE, REFENT >
 interface_FiniteElement (const boost::shared_ptr< FE > fe_ptr, const boost::shared_ptr< REFENT > 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< FE > & getFiniteElementPtr () const
 
- Public Member Functions inherited from MoFEM::interface_RefElement< REFENT >
 interface_RefElement (const boost::shared_ptr< REFENT > &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< REFENT > & 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
 

Public Attributes

unsigned int part
 Partition number. More...
 
- Public Attributes inherited from MoFEM::interface_RefEntity< T >
boost::shared_ptr< TsPtr
 

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

Member Typedef Documentation

◆ interface_type_EntFiniteElement

Definition at line 735 of file FEMultiIndices.hpp.

◆ interface_type_FiniteElement

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

449 : 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 470 of file FEMultiIndices.cpp.

470 {
471
472 auto comp = [idx](const auto &a) { return a->getPetscGlobalDofIdx() == idx; };
473
474 for (auto &it : getColFieldEnts()) {
475 if (auto e = it.lock()) {
476 if (auto cache = e->entityCacheColDofs.lock()) {
477 auto dit = std::find_if(cache->loHi[0], cache->loHi[1], comp);
478 if (dit != cache->loHi[1])
479 return boost::reinterpret_pointer_cast<FENumeredDofEntity>(*dit);
480 } else
481 THROW_MESSAGE("Cache not set");
482 }
483 }
484
485 return boost::weak_ptr<FENumeredDofEntity>();
486}
constexpr double a
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
Definition: definitions.h:561
BlockParamData * cache

◆ getColDofsPtr()

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

get FE dof on column

Definition at line 603 of file FEMultiIndices.cpp.

603 {
604 RefEntityTmp<0>::refElementPtr = this->getRefElement();
605
606 struct Extractor {
607 boost::weak_ptr<EntityCacheNumeredDofs>
608 operator()(boost::shared_ptr<FieldEntity> &e) {
609 return e->entityCacheColDofs;
610 }
611 };
612
613 struct Inserter {
615 using It = Idx::iterator;
616 It operator()(boost::shared_ptr<Idx> &dofs_view, It &hint,
617 boost::shared_ptr<FENumeredDofEntity> &&dof) {
618 return dofs_view->emplace_hint(hint, dof);
619 }
620 };
621
622 auto col_dofs = boost::make_shared<FENumeredDofEntity_multiIndex>();
623 if (get_cache_data_dofs_view(getColFieldEntsPtr(), col_dofs, Extractor(),
624 Inserter()))
625 THROW_MESSAGE("col_dofs can not be created");
626
627 return col_dofs;
628}
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 740 of file FEMultiIndices.hpp.

740 {
741 return this->sPtr;
742 }

◆ getPart()

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

Get partition number.

Returns
[description]

Definition at line 753 of file FEMultiIndices.hpp.

753{ return part; };

◆ getRowDofsByPetscGlobalDofIdx()

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

get FE dof by petsc index

Definition at line 452 of file FEMultiIndices.cpp.

452 {
453 auto comp = [idx](const auto &a) { return a->getPetscGlobalDofIdx() == idx; };
454
455 for (auto &it : getRowFieldEnts()) {
456 if (auto e = it.lock()) {
457 if (auto cache = e->entityCacheColDofs.lock()) {
458 auto dit = std::find_if(cache->loHi[0], cache->loHi[1], comp);
459 if (dit != cache->loHi[1])
460 return boost::reinterpret_pointer_cast<FENumeredDofEntity>(*dit);
461 } else
462 THROW_MESSAGE("Cache not set");
463 }
464 }
465
466 return boost::weak_ptr<FENumeredDofEntity>();
467}

◆ getRowDofsPtr()

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

get FE dof on row

Definition at line 575 of file FEMultiIndices.cpp.

575 {
576 RefEntityTmp<0>::refElementPtr = this->getRefElement();
577
578 struct Extractor {
579 boost::weak_ptr<EntityCacheNumeredDofs>
580 operator()(boost::shared_ptr<FieldEntity> &e) {
581 return e->entityCacheRowDofs;
582 }
583 };
584
585 struct Inserter {
587 using It = Idx::iterator;
588 It operator()(boost::shared_ptr<Idx> &dofs_view, It &hint,
589 boost::shared_ptr<FENumeredDofEntity> &&dof) {
590 return dofs_view->emplace_hint(hint, dof);
591 }
592 };
593
594 auto row_dofs = boost::make_shared<FENumeredDofEntity_multiIndex>();
595 if (get_cache_data_dofs_view(getRowFieldEntsPtr(), row_dofs, Extractor(),
596 Inserter()))
597 THROW_MESSAGE("row_dofs can not be created");
598
599 return row_dofs;
600}
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr() const

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 488 of file FEMultiIndices.cpp.

488 {
489 os << "part " << e.part << " " << *(e.getEntFiniteElement());
490 return os;
491}

Member Data Documentation

◆ part

unsigned int MoFEM::NumeredEntFiniteElement::part

Partition number.

Definition at line 738 of file FEMultiIndices.hpp.


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