v0.8.20
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | 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

typedef interface_RefEntity< RefElementinterface_type_RefEntity
 
typedef interface_RefElement< RefElementinterface_type_RefElement
 
typedef interface_FiniteElement< FiniteElementinterface_type_FiniteElement
 
- Public Types inherited from MoFEM::interface_RefElement< RefElement >
typedef interface_RefEntity< RefElementinterface_type_RefEntity
 
typedef interface_RefElement< RefElementinterface_type_RefElement
 

Public Member Functions

 EntFiniteElement (const boost::shared_ptr< RefElement > &ref_finite_element, const boost::shared_ptr< FiniteElement > &fe_ptr)
 
const UIdgetGlobalUniqueId () const
 Get unique UId for finite element entity. More...
 
UId getGlobalUniqueIdCalculate () const
 Generate UId for finite element entity. More...
 
EntityHandle getEnt () const
 Get element entity. More...
 
DofIdx getNbDofsData () const
 Get number of DOFs on data. More...
 
const FEDofEntity_multiIndexgetDataDofs () const
 Get data data dos multi-index structure. More...
 
template<typename FE_ENTS , typename MOFEM_DOFS , typename MOFEM_DOFS_VIEW >
MoFEMErrorCode getDofView (const FE_ENTS &fe_ents_view, const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, const int operation_type)
 
template<typename MOFEM_DOFS , typename MOFEM_DOFS_VIEW >
MoFEMErrorCode getRowDofView (const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, const int operation_type=moab::Interface::UNION)
 
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, Range &adjacency)
 
boost::shared_ptr< RefElement > & getRefElement () const
 
boost::weak_ptr< std::vector< FEDofEntity > > & getDofsSequence () const
 Get weak_ptr reference to sequence/vector storing dofs on entity. More...
 
- Public Member Functions inherited from MoFEM::interface_FiniteElement< FiniteElement >
 interface_FiniteElement (const boost::shared_ptr< FiniteElement > &ptr)
 
const boost::shared_ptr< FiniteElement > & get_MoFEMFiniteElementPtr ()
 
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...
 
- Public Member Functions inherited from MoFEM::interface_RefElement< RefElement >
 interface_RefElement (const boost::shared_ptr< RefElement > &sptr)
 
int getBitRefEdgesUlong () const
 
SideNumber_multiIndexgetSideNumberTable () const
 
const boost::shared_ptr< SideNumber > & getSideNumberPtr (const EntityHandle ent) const
 
boost::shared_ptr< RefEntity > & getRefEntityPtr () const
 
const boost::shared_ptr< RefElement > & getRefElement () const
 
virtual ~interface_RefElement ()
 
- Public Member Functions inherited from MoFEM::interface_RefEntity< RefElement >
 interface_RefEntity (const boost::shared_ptr< RefElement > &sptr)
 
 interface_RefEntity (const interface_RefEntity< RefElement > &interface)
 
virtual ~interface_RefEntity ()
 
boost::shared_ptr< BasicEntityData > & getBasicDataPtr ()
 
const boost::shared_ptr< BasicEntityData > & getBasicDataPtr () const
 
EntityHandle getRefEnt () const
 
EntityType getParentEntType () const
 
EntityHandle getParentEnt () const
 
BitRefLevelgetBitRefLevelPtr () const
 
const BitRefLevelgetBitRefLevel () const
 
unsigned long int getBitRefLevelULong () const
 
EntityType getEntType () const
 
EntityID getEntId () const
 
EntityHandle getOwnerEnt () const
 
EntityHandlegetOwnerEnt ()
 
int getOwnerProc () const
 
intgetOwnerProc ()
 
int getPartProc () const
 
intgetPartProc ()
 
unsigned char getPStatus () const
 
intgetSharingProcsPtr () const
 
EntityHandlegetSharingHandlersPtr () const
 
boost::shared_ptr< RefElement > & getRefEntityPtr () const
 

Static Public Member Functions

static UId getGlobalUniqueIdCalculate (const EntityHandle ent, const int bit_number)
 Generate UId for finite element entity. More...
 

Public Attributes

boost::shared_ptr< FEDofEntity_multiIndexdata_dofs
 
boost::shared_ptr< FieldEntity_vector_viewrow_field_ents_view
 
boost::shared_ptr< FieldEntity_vector_viewcol_field_ents_view
 
boost::shared_ptr< FieldEntity_multiIndex_spaceType_viewdata_field_ents_view
 
UId globalUId
 
- Public Attributes inherited from MoFEM::interface_FiniteElement< FiniteElement >
boost::shared_ptr< FiniteElementsFePtr
 
- Public Attributes inherited from MoFEM::interface_RefEntity< RefElement >
boost::shared_ptr< RefElementsPtr
 

Private Attributes

boost::weak_ptr< std::vector< FEDofEntity > > dofsSequce
 

Friends

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

Detailed Description

Finite element data for entity.

Definition at line 423 of file FEMultiIndices.hpp.

Member Typedef Documentation

◆ interface_type_FiniteElement

Definition at line 428 of file FEMultiIndices.hpp.

◆ interface_type_RefElement

Definition at line 427 of file FEMultiIndices.hpp.

◆ interface_type_RefEntity

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

901  : interface_FiniteElement<FiniteElement>(fe_ptr),
902  interface_RefElement<RefElement>(ref_finite_element),
907  // get finite element entity
909 }
std::vector< boost::weak_ptr< FieldEntity > > FieldEntity_vector_view
UId getGlobalUniqueIdCalculate() const
Generate UId for finite element entity.
boost::shared_ptr< FieldEntity_vector_view > col_field_ents_view
multi_index_container< boost::shared_ptr< FieldEntity >, indexed_by< sequenced<>, ordered_non_unique< tag< Composite_EntType_and_Space_mi_tag >, composite_key< FieldEntity, const_mem_fun< FieldEntity::interface_type_RefEntity, EntityType, &FieldEntity::getEntType >, const_mem_fun< FieldEntity::interface_type_Field, FieldSpace, &FieldEntity::getSpace > > > > > FieldEntity_multiIndex_spaceType_view
boost::shared_ptr< FEDofEntity_multiIndex > data_dofs
multi_index_container< boost::shared_ptr< FEDofEntity >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< FEDofEntity::interface_type_DofEntity, const UId &, &FEDofEntity::getGlobalUniqueId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FEDofEntity::interface_type_DofEntity, EntityHandle, &FEDofEntity::getEnt > >, ordered_non_unique< tag< FieldName_mi_tag >, const_mem_fun< FEDofEntity::interface_type_Field, boost::string_ref, &FEDofEntity::getNameRef > >, ordered_non_unique< tag< EntType_mi_tag >, const_mem_fun< FEDofEntity::interface_type_RefEntity, EntityType, &FEDofEntity::getEntType > >, ordered_non_unique< tag< Composite_Name_And_Type_mi_tag >, composite_key< FEDofEntity, const_mem_fun< FEDofEntity::interface_type_Field, boost::string_ref, &FEDofEntity::getNameRef >, const_mem_fun< FEDofEntity::interface_type_RefEntity, EntityType, &FEDofEntity::getEntType > > >, ordered_non_unique< tag< Composite_Name_And_Ent_mi_tag >, composite_key< FEDofEntity, const_mem_fun< FEDofEntity::interface_type_Field, boost::string_ref, &FEDofEntity::getNameRef >, const_mem_fun< FEDofEntity::interface_type_DofEntity, EntityHandle, &FEDofEntity::getEnt > > >, ordered_non_unique< tag< Composite_Name_Type_And_Side_Number_mi_tag >, composite_key< FEDofEntity, const_mem_fun< FEDofEntity::interface_type_Field, boost::string_ref, &FEDofEntity::getNameRef >, const_mem_fun< FEDofEntity::interface_type_RefEntity, EntityType, &FEDofEntity::getEntType >, KeyFromKey< member< SideNumber, char, &SideNumber::side_number >, member< FEDofEntity::BaseFEEntity, boost::shared_ptr< SideNumber >, &FEDofEntity::sideNumberPtr > > > > > > FEDofEntity_multiIndex
MultiIndex container keeps FEDofEntity.
boost::shared_ptr< FieldEntity_multiIndex_spaceType_view > data_field_ents_view
boost::shared_ptr< FieldEntity_vector_view > row_field_ents_view

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 
)

Definition at line 513 of file FEMultiIndices.hpp.

514  {
515  return getDofView(*col_field_ents_view, mofem_dofs, dofs_view,
516  operation_type);
517  }
MoFEMErrorCode getDofView(const FE_ENTS &fe_ents_view, const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, const int operation_type)
boost::shared_ptr< FieldEntity_vector_view > col_field_ents_view

◆ getDataDofs()

const FEDofEntity_multiIndex& MoFEM::EntFiniteElement::getDataDofs ( ) const

Get data data dos multi-index structure.

Returns
Reference multi-index FEDofEntity_multiIndex

Definition at line 479 of file FEMultiIndices.hpp.

479  {
480  return *data_dofs;
481  };
boost::shared_ptr< FEDofEntity_multiIndex > data_dofs

◆ getDofsSequence()

boost::weak_ptr<std::vector<FEDofEntity> >& MoFEM::EntFiniteElement::getDofsSequence ( ) const

Get weak_ptr reference to sequence/vector storing dofs on entity.

Vector is automatically destroy when last DOF in vector os destroyed. Every shared_ptr to the DOF has aliased shared_ptr to vector of DOFs in that vector. That do the trick.

Definition at line 534 of file FEMultiIndices.hpp.

534  {
535  return dofsSequce;
536  }
boost::weak_ptr< std::vector< FEDofEntity > > dofsSequce

◆ getDofView()

template<typename FE_ENTS , typename MOFEM_DOFS , typename MOFEM_DOFS_VIEW >
MoFEMErrorCode MoFEM::EntFiniteElement::getDofView ( const FE_ENTS &  fe_ents_view,
const MOFEM_DOFS &  mofem_dofs,
MOFEM_DOFS_VIEW &  dofs_view,
const int  operation_type 
)

Definition at line 487 of file FEMultiIndices.hpp.

488  {
490  if (operation_type == moab::Interface::UNION) {
491  for (auto &it : fe_ents_view) {
492  if (auto e = it.lock()) {
493  auto r = mofem_dofs.template get<Unique_Ent_mi_tag>().equal_range(
494  e->getGlobalUniqueId());
495  dofs_view.insert(r.first, r.second);
496  }
497  }
498  } else
499  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
501  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:499
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:506

◆ getElementAdjacency()

MoFEMErrorCode MoFEM::EntFiniteElement::getElementAdjacency ( const boost::shared_ptr< Field field_ptr,
Range &  adjacency 
)

Definition at line 936 of file FEMultiIndices.cpp.

937  {
938  moab::Interface &moab = getRefEntityPtr()->basicDataPtr->moab;
940  const EntFiniteElement *this_fe_ptr = this;
941  if (get_MoFEMFiniteElementPtr()->elementAdjacencyTable[getEntType()] ==
942  NULL) {
943  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
944  }
945  CHKERR get_MoFEMFiniteElementPtr()->elementAdjacencyTable[getEntType()](
946  moab, *field_ptr, *this_fe_ptr, adjacency);
948 }
EntFiniteElement(const boost::shared_ptr< RefElement > &ref_finite_element, const boost::shared_ptr< FiniteElement > &fe_ptr)
const boost::shared_ptr< FiniteElement > & get_MoFEMFiniteElementPtr()
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return() ...
Definition: definitions.h:475
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
#define CHKERR
Inline error check.
Definition: definitions.h:594
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:405

◆ getEnt()

EntityHandle MoFEM::EntFiniteElement::getEnt ( ) const

Get element entity.

Returns
Element entity handle

Definition at line 467 of file FEMultiIndices.hpp.

467 { return getRefEnt(); }

◆ getGlobalUniqueId()

const UId& MoFEM::EntFiniteElement::getGlobalUniqueId ( ) const

Get unique UId for finite element entity.

Returns
UId

Definition at line 442 of file FEMultiIndices.hpp.

442 { return globalUId; }

◆ getGlobalUniqueIdCalculate() [1/2]

static UId MoFEM::EntFiniteElement::getGlobalUniqueIdCalculate ( const EntityHandle  ent,
const int  bit_number 
)
static

Generate UId for finite element entity.

Returns
finite element entity unique Id

Definition at line 448 of file FEMultiIndices.hpp.

449  {
450  assert(bit_number <= 32);
451  return static_cast<UId>(ent) | static_cast<UId>(bit_number)
452  << 8 * sizeof(EntityHandle);
453  }
uint128_t UId
Unique Id.
Definition: Types.hpp:41

◆ getGlobalUniqueIdCalculate() [2/2]

UId MoFEM::EntFiniteElement::getGlobalUniqueIdCalculate ( ) const

Generate UId for finite element entity.

Returns
finite element entity unique Id

Definition at line 459 of file FEMultiIndices.hpp.

459  {
460  return getGlobalUniqueIdCalculate(sPtr->getRefEnt(), getBitNumber());
461  }
boost::shared_ptr< RefElement > sPtr
unsigned int getBitNumber() const
Get bit identifying this element.
UId getGlobalUniqueIdCalculate() const
Generate UId for finite element entity.

◆ getNbDofsData()

DofIdx MoFEM::EntFiniteElement::getNbDofsData ( ) const

Get number of DOFs on data.

Returns
Number of dofs on data

Definition at line 473 of file FEMultiIndices.hpp.

473 { return data_dofs->size(); }
boost::shared_ptr< FEDofEntity_multiIndex > data_dofs

◆ getRefElement()

boost::shared_ptr<RefElement>& MoFEM::EntFiniteElement::getRefElement ( ) const

Definition at line 522 of file FEMultiIndices.hpp.

522  {
523  return this->sPtr;
524  }
boost::shared_ptr< RefElement > sPtr

◆ getRowDofView()

template<typename MOFEM_DOFS , typename MOFEM_DOFS_VIEW >
MoFEMErrorCode MoFEM::EntFiniteElement::getRowDofView ( const MOFEM_DOFS &  mofem_dofs,
MOFEM_DOFS_VIEW &  dofs_view,
const int  operation_type = moab::Interface::UNION 
)

Definition at line 505 of file FEMultiIndices.hpp.

506  {
507  return getDofView(*row_field_ents_view, mofem_dofs, dofs_view,
508  operation_type);
509  }
MoFEMErrorCode getDofView(const FE_ENTS &fe_ents_view, const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, const int operation_type)
boost::shared_ptr< FieldEntity_vector_view > row_field_ents_view

Friends And Related Function Documentation

◆ operator<<

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

Definition at line 911 of file FEMultiIndices.cpp.

911  {
912  os << *e.sFePtr << std::endl;
913  os << *e.sPtr << std::endl;
914  os << "data dof_uids ";
915  FEDofEntity_multiIndex::iterator dit;
916  dit = e.data_dofs->begin();
917  for (; dit != e.data_dofs->end(); dit++) {
918  if (!(*dit)) {
919  os << "null ptr";
920  } else {
921  if (!(*dit)->getDofEntityPtr()) {
922  os << "( null ptr to dof ) ";
923  } else {
924  if (!(*dit)->getFieldEntityPtr()) {
925  os << "(( null ptr to field entity )) ";
926  } else {
927  os << (*dit)->getGlobalUniqueId() << " ";
928  }
929  }
930  }
931  }
932  return os;
933 }

Member Data Documentation

◆ col_field_ents_view

boost::shared_ptr<FieldEntity_vector_view> MoFEM::EntFiniteElement::col_field_ents_view

Definition at line 431 of file FEMultiIndices.hpp.

◆ data_dofs

boost::shared_ptr<FEDofEntity_multiIndex> MoFEM::EntFiniteElement::data_dofs

Definition at line 429 of file FEMultiIndices.hpp.

◆ data_field_ents_view

boost::shared_ptr<FieldEntity_multiIndex_spaceType_view> MoFEM::EntFiniteElement::data_field_ents_view

Definition at line 432 of file FEMultiIndices.hpp.

◆ dofsSequce

boost::weak_ptr<std::vector<FEDofEntity> > MoFEM::EntFiniteElement::dofsSequce
mutableprivate

Definition at line 540 of file FEMultiIndices.hpp.

◆ globalUId

UId MoFEM::EntFiniteElement::globalUId

Definition at line 433 of file FEMultiIndices.hpp.

◆ row_field_ents_view

boost::shared_ptr<FieldEntity_vector_view> MoFEM::EntFiniteElement::row_field_ents_view

Definition at line 430 of file FEMultiIndices.hpp.


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