v0.10.0
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< 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. 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< 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. 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< 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< SideNumber > getSideNumberPtr () const
 Get the Side number. More...
 
const boost::shared_ptr< BasicEntityDatagetBasicDataPtr () const
 Get pointer to basic data struture. More...
 
EntityHandle getEnt () const
 Get the entity handle. More...
 
EntityType getParentEntType () const
 Get patent entity. More...
 
EntityHandle getParentEnt () const
 
BitRefLevelgetBitRefLevelPtr () const
 Get pointer to bit ref level tag. More...
 
const BitRefLevelgetBitRefLevel () const
 
unsigned long int getBitRefLevelULong () const
 Get entity ref bit refinement as ulong. More...
 
EntityType getEntType () const
 Get entity type. More...
 
int getEntDimension () const
 Get the Ent Dimension. More...
 
const char * getEntTypeName () const
 Get the Ent Type Name. More...
 
EntityID getEntId () const
 get entity id More...
 
EntityHandle getOwnerEnt () const
 
EntityHandlegetOwnerEnt ()
 
int getOwnerProc () const
 
int getPartProc () const
 
int * getPartProcPtr () const
 Get pointer to partition tag. More...
 
unsigned char getPStatus () const
 
int * getSharingProcsPtr () const
 get shared processors More...
 
EntityHandlegetSharingHandlersPtr () const
 get sharid entity handlers More...
 
boost::shared_ptr< EntFiniteElement > & getRefEntityPtr () const
 

Public Attributes

unsigned int part
 Partition number. More...
 
- 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 738 of file FEMultiIndices.hpp.

Member Typedef Documentation

◆ interface_type_EntFiniteElement

Definition at line 746 of file FEMultiIndices.hpp.

◆ interface_type_FiniteElement

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

490  : 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 511 of file FEMultiIndices.cpp.

511  {
512 
513  auto comp = [idx](const auto &a) { return a->getPetscGlobalDofIdx() == idx; };
514 
515  for (auto &it : getColFieldEnts()) {
516  if (auto e = it.lock()) {
517  if (auto cache = e->entityCacheColDofs.lock()) {
518  auto dit = std::find_if(cache->loHi[0], cache->loHi[1], comp);
519  if (dit != cache->loHi[1])
520  return boost::reinterpret_pointer_cast<FENumeredDofEntity>(*dit);
521  } else
522  THROW_MESSAGE("Cache not set");
523  }
524  }
525 
526  return boost::weak_ptr<FENumeredDofEntity>();
527 }
BlockParamData * cache
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getColDofsPtr()

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

get FE dof on column

Definition at line 644 of file FEMultiIndices.cpp.

644  {
646 
647  struct Extractor {
648  boost::weak_ptr<EntityCacheNumeredDofs>
649  operator()(boost::shared_ptr<FieldEntity> &e) {
650  return e->entityCacheColDofs;
651  }
652  };
653 
654  struct Inserter {
655  using Idx = FENumeredDofEntity_multiIndex;
656  using It = Idx::iterator;
657  It operator()(boost::shared_ptr<Idx> &dofs_view, It &hint,
658  boost::shared_ptr<FENumeredDofEntity> &&dof) {
659  return dofs_view->emplace_hint(hint, dof);
660  }
661  };
662 
663  auto col_dofs = boost::make_shared<FENumeredDofEntity_multiIndex>();
664  if (get_cache_data_dofs_view(getColFieldEntsPtr(), col_dofs, Extractor(),
665  Inserter()))
666  THROW_MESSAGE("col_dofs can not be created");
667 
668  return col_dofs;
669 }
static MoFEMErrorCode get_cache_data_dofs_view(ENTSVIEW &ents_view, DOFSVIEW &dofs_view, EXTRACTOR &&extractor, INSERTER &&inserter)
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628
static boost::weak_ptr< RefElement > refElementPtr
const boost::shared_ptr< RefElement > & getRefElement() const
boost::shared_ptr< FieldEntity_vector_view > & getColFieldEntsPtr() const
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.

◆ getEntFiniteElement()

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

Definition at line 750 of file FEMultiIndices.hpp.

750  {
751  return this->sPtr;
752  }
boost::shared_ptr< EntFiniteElement > sPtr

◆ getPart()

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

Get partition number.

Returns
[description]

Definition at line 763 of file FEMultiIndices.hpp.

763 { return part; };
unsigned int part
Partition number.

◆ getRowDofsByPetscGlobalDofIdx()

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

get FE dof by petsc index

Definition at line 493 of file FEMultiIndices.cpp.

493  {
494  auto comp = [idx](const auto &a) { return a->getPetscGlobalDofIdx() == idx; };
495 
496  for (auto &it : getRowFieldEnts()) {
497  if (auto e = it.lock()) {
498  if (auto cache = e->entityCacheColDofs.lock()) {
499  auto dit = std::find_if(cache->loHi[0], cache->loHi[1], comp);
500  if (dit != cache->loHi[1])
501  return boost::reinterpret_pointer_cast<FENumeredDofEntity>(*dit);
502  } else
503  THROW_MESSAGE("Cache not set");
504  }
505  }
506 
507  return boost::weak_ptr<FENumeredDofEntity>();
508 }
BlockParamData * cache
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628

◆ getRowDofsPtr()

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

get FE dof on row

Definition at line 616 of file FEMultiIndices.cpp.

616  {
618 
619  struct Extractor {
620  boost::weak_ptr<EntityCacheNumeredDofs>
621  operator()(boost::shared_ptr<FieldEntity> &e) {
622  return e->entityCacheRowDofs;
623  }
624  };
625 
626  struct Inserter {
627  using Idx = FENumeredDofEntity_multiIndex;
628  using It = Idx::iterator;
629  It operator()(boost::shared_ptr<Idx> &dofs_view, It &hint,
630  boost::shared_ptr<FENumeredDofEntity> &&dof) {
631  return dofs_view->emplace_hint(hint, dof);
632  }
633  };
634 
635  auto row_dofs = boost::make_shared<FENumeredDofEntity_multiIndex>();
636  if (get_cache_data_dofs_view(getRowFieldEntsPtr(), row_dofs, Extractor(),
637  Inserter()))
638  THROW_MESSAGE("row_dofs can not be created");
639 
640  return row_dofs;
641 }
static MoFEMErrorCode get_cache_data_dofs_view(ENTSVIEW &ents_view, DOFSVIEW &dofs_view, EXTRACTOR &&extractor, INSERTER &&inserter)
#define THROW_MESSAGE(a)
Throw MoFEM exception.
Definition: definitions.h:628
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr() const
static boost::weak_ptr< RefElement > refElementPtr
const boost::shared_ptr< RefElement > & getRefElement() const
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.

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 529 of file FEMultiIndices.cpp.

529  {
530  os << "part " << e.part << " " << *(e.getEntFiniteElement());
531  return os;
532 }

Member Data Documentation

◆ part

unsigned int MoFEM::NumeredEntFiniteElement::part

Partition number.

Definition at line 748 of file FEMultiIndices.hpp.


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