v0.9.1
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)
 
virtual ~EntFiniteElement ()=default
 
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)
 
virtual ~interface_FiniteElement ()=default
 
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)
 
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
 
const boost::shared_ptr< RefElement > & getRefElement () const
 
- 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 ()=default
 
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
 
int & getOwnerProc ()
 
int getPartProc () const
 
int & getPartProc ()
 
unsigned char getPStatus () const
 
int * getSharingProcsPtr () 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 433 of file FEMultiIndices.hpp.

Member Typedef Documentation

◆ interface_type_FiniteElement

Definition at line 438 of file FEMultiIndices.hpp.

◆ interface_type_RefElement

Definition at line 437 of file FEMultiIndices.hpp.

◆ interface_type_RefEntity

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

925  : interface_FiniteElement<FiniteElement>(fe_ptr),
926  interface_RefElement<RefElement>(ref_finite_element),
931  // get finite element entity
933 }
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

◆ ~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 
)

Definition at line 524 of file FEMultiIndices.hpp.

525  {
526  return getDofView(*col_field_ents_view, mofem_dofs, dofs_view,
527  operation_type);
528  }
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 490 of file FEMultiIndices.hpp.

490  {
491  return *data_dofs;
492  };
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 545 of file FEMultiIndices.hpp.

545  {
546  return dofsSequce;
547  }
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 498 of file FEMultiIndices.hpp.

499  {
501  if (operation_type == moab::Interface::UNION) {
502  for (auto &it : fe_ents_view) {
503  if (auto e = it.lock()) {
504  auto r = mofem_dofs.template get<Unique_Ent_mi_tag>().equal_range(
505  e->getGlobalUniqueId());
506  dofs_view.insert(r.first, r.second);
507  }
508  }
509  } else
510  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
512  }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:507
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:514

◆ getElementAdjacency()

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

Definition at line 958 of file FEMultiIndices.cpp.

959  {
960  moab::Interface &moab = getRefEntityPtr()->basicDataPtr->moab;
962  const EntFiniteElement *this_fe_ptr = this;
963  if (get_MoFEMFiniteElementPtr()->elementAdjacencyTable[getEntType()] ==
964  NULL) {
965  SETERRQ(PETSC_COMM_SELF, MOFEM_NOT_IMPLEMENTED, "not implemented");
966  }
967  CHKERR get_MoFEMFiniteElementPtr()->elementAdjacencyTable[getEntType()](
968  moab, *field_ptr, *this_fe_ptr, adjacency);
970 }
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:483
boost::shared_ptr< RefEntity > & getRefEntityPtr() const
#define CHKERR
Inline error check.
Definition: definitions.h:602
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413

◆ getEnt()

EntityHandle MoFEM::EntFiniteElement::getEnt ( ) const

Get element entity.

Returns
Element entity handle

Definition at line 478 of file FEMultiIndices.hpp.

478 { return getRefEnt(); }

◆ getGlobalUniqueId()

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

Get unique UId for finite element entity.

Returns
UId

Definition at line 453 of file FEMultiIndices.hpp.

453 { 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 459 of file FEMultiIndices.hpp.

460  {
461  assert(bit_number <= 32);
462  return static_cast<UId>(ent) | static_cast<UId>(bit_number)
463  << 8 * sizeof(EntityHandle);
464  }

◆ getGlobalUniqueIdCalculate() [2/2]

UId MoFEM::EntFiniteElement::getGlobalUniqueIdCalculate ( ) const

Generate UId for finite element entity.

Returns
finite element entity unique Id

Definition at line 470 of file FEMultiIndices.hpp.

470  {
471  return getGlobalUniqueIdCalculate(sPtr->getRefEnt(), getBitNumber());
472  }
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 484 of file FEMultiIndices.hpp.

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

◆ getRefElement()

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

Definition at line 533 of file FEMultiIndices.hpp.

533  {
534  return this->sPtr;
535  }
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 516 of file FEMultiIndices.hpp.

517  {
518  return getDofView(*row_field_ents_view, mofem_dofs, dofs_view,
519  operation_type);
520  }
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 935 of file FEMultiIndices.cpp.

935  {
936  os << *e.sFePtr << std::endl;
937  os << *e.sPtr << std::endl;
938  os << "data dof_uids ";
939  for (auto &dit : *e.data_dofs) {
940  if (!dit) {
941  os << "null ptr";
942  } else {
943  if (!dit->getDofEntityPtr()) {
944  os << "( null ptr to dof ) ";
945  } else {
946  if (!dit->getFieldEntityPtr()) {
947  os << "(( null ptr to field entity )) ";
948  } else {
949  os << dit->getGlobalUniqueId() << " ";
950  }
951  }
952  }
953  }
954  return os;
955 }

Member Data Documentation

◆ col_field_ents_view

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

Definition at line 441 of file FEMultiIndices.hpp.

◆ data_dofs

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

Definition at line 439 of file FEMultiIndices.hpp.

◆ data_field_ents_view

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

Definition at line 442 of file FEMultiIndices.hpp.

◆ dofsSequce

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

Definition at line 551 of file FEMultiIndices.hpp.

◆ globalUId

UId MoFEM::EntFiniteElement::globalUId

Definition at line 443 of file FEMultiIndices.hpp.

◆ row_field_ents_view

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

Definition at line 440 of file FEMultiIndices.hpp.


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