|
| v0.14.0
|
Go to the documentation of this file.
8 #ifndef __FEMMULTIINDICES_HPP__
9 #define __FEMMULTIINDICES_HPP__
13 struct EntFiniteElement;
19 Interface &moab,
const Field &field,
const EntFiniteElement &fe,
20 std::vector<EntityHandle> &adjacency)>;
132 std::vector<EntityHandle> &adjacency);
135 std::vector<EntityHandle> &adjacency);
138 std::vector<EntityHandle> &adjacency);
141 std::vector<EntityHandle> &adjacency);
144 std::vector<EntityHandle> &adjacency);
147 std::vector<EntityHandle> &adjacency);
287 static constexpr std::array<const DefEntTypeMap *, MBMAXTYPE>
defTypeMap = {
305 const EntityType ent_type) {
307 return (*ptr)[ent_type];
308 THROW_MESSAGE(
"DefTypeMap is not defined by this element. This is propably "
309 "new implementation, and has to be implemented");
318 template <
typename FE,
typename REFENT>
322 const boost::shared_ptr<REFENT> ref_ents_ptr)
327 template <
typename FE,
typename REFENT>
330 const boost::shared_ptr<REFENT> ref_ents_ptr)
404 template <
typename T>
409 const boost::shared_ptr<T> ref_ents_ptr)
475 ->getFiniteElementPtr();
480 std::array<DofEntity_multiIndex::iterator, 2>
loHi;
484 std::array<NumeredDofEntity_multiIndex::iterator, 2>
loHi;
489 std::vector<EntityCacheDofs>, std::vector<EntityCacheNumeredDofs>,
490 std::vector<EntityCacheNumeredDofs>
510 const boost::shared_ptr<FiniteElement> &fe_ptr);
521 return fe_uid |= ent;
545 boost::shared_ptr<std::vector<boost::shared_ptr<FEDofEntity>>>
552 inline boost::shared_ptr<FieldEntity_vector_view> &
562 inline boost::shared_ptr<FieldEntity_vector_view> &
572 inline boost::shared_ptr<FieldEntity_vector_view> &
580 template <
typename FE_ENTS,
typename MOFEM_DOFS,
typename MOFEM_DOFS_VIEW,
583 getDofView(
const FE_ENTS &fe_ents_view,
const MOFEM_DOFS &mofem_dofs,
584 MOFEM_DOFS_VIEW &dofs_view, INSERTER &&inserter) {
587 auto hint = dofs_view.end();
588 using ValType =
typename std::remove_reference<decltype(**hint)>
::type;
590 for (
auto &it : fe_ents_view) {
591 if (
auto e = it.lock()) {
592 const auto &uid = e->getLocalUniqueId();
593 auto dit = mofem_dofs.lower_bound(uid);
594 if (dit != mofem_dofs.end()) {
595 const auto hi_dit = mofem_dofs.upper_bound(
597 for (; dit != hi_dit; ++dit)
598 hint = inserter(dofs_view, hint,
599 boost::reinterpret_pointer_cast<ValType>(*dit));
606 template <
typename MOFEM_DOFS,
typename MOFEM_DOFS_VIEW>
608 MOFEM_DOFS_VIEW &dofs_view) {
610 auto hint = dofs_view.end();
611 using ValType =
typename std::remove_reference<decltype(**hint)>
::type;
612 using IndexType = MOFEM_DOFS_VIEW;
615 using Idx = IndexType;
616 using It =
typename Idx::iterator;
617 It operator()(Idx &dofs_view, It &hint,
618 boost::shared_ptr<ValType> &&dof) {
619 return dofs_view.emplace_hint(hint, dof);
626 template <
typename MOFEM_DOFS,
typename MOFEM_DOFS_VIEW>
629 const int operation_type = moab::Interface::UNION) {
631 auto hint = dofs_view.end();
632 using ValType =
typename std::remove_reference<decltype(**hint)>
::type;
633 using IndexType = MOFEM_DOFS_VIEW;
636 using Idx = IndexType;
637 using It =
typename Idx::iterator;
638 It operator()(Idx &dofs_view, It &hint,
639 boost::shared_ptr<ValType> &&dof) {
640 return dofs_view.emplace_hint(hint, dof);
648 std::vector<EntityHandle> &adjacency);
660 template <
typename T>
670 return this->
sPtr->getDataVectorDofsPtr();
674 return this->
sPtr->getDataFieldEnts();
678 return this->
sPtr->getDataFieldEntsPtr();
682 return this->
sPtr->getRowFieldEnts();
685 inline boost::shared_ptr<FieldEntity_vector_view> &
687 return this->
sPtr->getRowFieldEntsPtr();
691 return this->
sPtr->getColFieldEnts();
694 inline boost::shared_ptr<FieldEntity_vector_view> &
696 return this->
sPtr->getColFieldEntsPtr();
706 return this->
sPtr->getSideNumberTable();
715 return this->
sPtr->getRefElement();
758 boost::shared_ptr<FENumeredDofEntity_multiIndex>
getRowDofsPtr()
const;
763 boost::shared_ptr<FENumeredDofEntity_multiIndex>
getColDofsPtr()
const;
768 boost::weak_ptr<FENumeredDofEntity>
774 boost::weak_ptr<FENumeredDofEntity>
777 friend std::ostream &
operator<<(std::ostream &os,
788 boost::shared_ptr<EntFiniteElement>,
791 ordered_unique<tag<Unique_mi_tag>,
792 const_mem_fun<EntFiniteElement,
UId,
808 boost::shared_ptr<NumeredEntFiniteElement>,
815 ordered_non_unique<tag<Part_mi_tag>,
816 member<NumeredEntFiniteElement,
unsigned int,
823 tag<Composite_Name_And_Part_mi_tag>,
825 NumeredEntFiniteElement,
829 member<NumeredEntFiniteElement,
unsigned int,
837 typedef multi_index_container<
838 boost::shared_ptr<FiniteElement>,
839 indexed_by<hashed_unique<tag<FiniteElement_Meshset_mi_tag>,
844 const_mem_fun<FiniteElement, BitFEId, &FiniteElement::getId>,
845 HashBit<BitFEId>, EqBit<BitFEId>>,
846 ordered_unique<tag<FiniteElement_name_mi_tag>,
847 const_mem_fun<FiniteElement, boost::string_ref,
861 void operator()(boost::shared_ptr<NumeredEntFiniteElement> &fe) {
876 void operator()(boost::shared_ptr<FiniteElement> &fe);
888 void operator()(boost::shared_ptr<FiniteElement> &fe);
900 void operator()(boost::shared_ptr<FiniteElement> &fe);
912 void operator()(boost::shared_ptr<FiniteElement> &fe);
924 void operator()(boost::shared_ptr<FiniteElement> &fe);
936 void operator()(boost::shared_ptr<FiniteElement> &fe);
946 void operator()(boost::shared_ptr<FiniteElement> &fe);
956 void operator()(boost::shared_ptr<FiniteElement> &fe);
966 void operator()(boost::shared_ptr<FiniteElement> &fe);
971 #endif // __FEMMULTIINDICES_HPP__
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
boost::shared_ptr< FiniteElement > & getFiniteElementPtr() const
boost::shared_ptr< FENumeredDofEntity_multiIndex > getColDofsPtr() const
get FE dof on column
FiniteElement_change_bit_reset()=default
void operator()(boost::shared_ptr< FiniteElement > &fe)
interface_RefEntity< EntFiniteElement > interface_type_RefEntity
FieldEntity_vector_view & getDataFieldEnts() const
boost::shared_ptr< std::vector< boost::shared_ptr< FEDofEntity > > > getDataVectorDofsPtr() const
Get data data dos multi-index structure.
BitFEId getId() const
Get finite element id.
virtual ~interface_EntFiniteElement()=default
interface_EntFiniteElement< EntFiniteElement > interface_type_EntFiniteElement
interface_FiniteElement< EntFiniteElement, EntFiniteElement > interface_type_FiniteElement
SideNumber_multiIndex & getSideNumberTable() const
unsigned int getPart() const
Get partition number.
FieldEntity_vector_view & getDataFieldEnts() const
void operator()(boost::shared_ptr< FiniteElement > &fe)
BitFEId getId() const
Get finite element id.
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::vector< boost::weak_ptr< FieldEntity > > FieldEntity_vector_view
interface_FiniteElementImpl(const boost::shared_ptr< FE > fe_ptr, const boost::shared_ptr< REFENT > ref_ents_ptr)
std::array< DofEntity_multiIndex::iterator, 2 > loHi
static MoFEMErrorCode defaultEdge(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
interface_RefEntity< RefElement > interface_type_RefEntity
std::array< ElementAdjacencyFunct, MBMAXTYPE > elementAdjacencyTable
Table of functions retrieving adjacencies for finite element User can alter and change default behavi...
boost::shared_ptr< T > sPtr
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
boost::string_ref getNameRef() const
Get finite element name.
EntityHandle getEnt() const
Get the entity handle.
EntityHandle getMeshset() const
Get meshset containing element entities.
unsigned int getBitNumber() const
Get bit identifying this element.
boost::shared_ptr< FEDofEntity_multiIndex > getDataDofsPtr() const
Get the Data Dofs Ptr object.
Finite element data for entity.
FiniteElement_col_change_bit_add(const BitFieldId f_id_col)
BitFEId * tagId
ptr to tag storing FE id
BitFieldId getBitFieldIdCol() const
Get field ids on columns.
auto getDataDofsPtr() const
NumeredEntFiniteElement_change_part(unsigned int part)
BitFEId getId() const
Get finite element id.
friend std::ostream & operator<<(std::ostream &os, const FiniteElement &e)
print finite element
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
#define THROW_MESSAGE(msg)
Throw MoFEM exception.
MoFEMErrorCode getRowDofView(const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view)
friend std::ostream & operator<<(std::ostream &os, const NumeredEntFiniteElement &e)
Provide data structure for (tensor) field approximation.
void operator()(boost::shared_ptr< FiniteElement > &fe)
Deprecated interface functions.
FiniteElement_change_bit_off(const BitFieldId f_id_data)
BitFieldId * tag_BitFieldId_row_data
tag stores row id_id for fields
static constexpr DefEntTypeMap defVertexTypeMap
DeprecatedCoreInterface Interface
static constexpr std::array< const DefEntTypeMap *, MBMAXTYPE > defTypeMap
virtual ~interface_FiniteElementImpl()=default
boost::shared_ptr< FE > sFiniteElementPtr
static MoFEMErrorCode defaultPrism(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
EntityHandle meshset
meshset stores FE ents
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr() const
boost::weak_ptr< FENumeredDofEntity > getColDofsByPetscGlobalDofIdx(const int idx) const
get FE dof by petsc index
Change finite element part.
static constexpr DefEntTypeMap defEdgeTypeMap
boost::shared_ptr< EntFiniteElement > & getEntFiniteElement() const
void operator()(boost::shared_ptr< FiniteElement > &fe)
std::string getName() const
Get finite element name.
implementation of Data Operators for Forces and Sources
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr()
static MoFEMErrorCode defaultVertex(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
boost::shared_ptr< FENumeredDofEntity_multiIndex > getRowDofsPtr() const
get FE dof on row
unsigned int getBitNumber() const
Get bit identifying this element.
void operator()(boost::shared_ptr< FiniteElement > &fe)
static MoFEMErrorCode defaultMeshset(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
boost::shared_ptr< FieldEntity_vector_view > & getDataFieldEntsPtr() const
boost::string_ref getNameRef() const
Get finite element name.
boost::shared_ptr< FE > & getFiniteElementPtr() const
void operator()(NumeredEntFiniteElement &fe)
UId getLocalUniqueId() const
Get unique UId for finite element entity.
const boost::shared_ptr< RefElement > & getRefElement() const
multi_index_container< boost::shared_ptr< SideNumber >, indexed_by< ordered_unique< member< SideNumber, EntityHandle, &SideNumber::ent > >, ordered_non_unique< composite_key< SideNumber, const_mem_fun< SideNumber, EntityType, &SideNumber::getEntType >, member< SideNumber, signed char, &SideNumber::side_number > > > > > SideNumber_multiIndex
SideNumber_multiIndex for SideNumber.
UId getLocalUniqueIdCalculate() const
Generate UId for finite element entity.
void operator()(boost::shared_ptr< FiniteElement > &fe)
static MoFEMErrorCode defaultVolume(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
static constexpr int ent_shift
unsigned int getBitNumber() const
Get bit identifying this element.
unsigned int part
Partition number.
BitFieldId * tag_BitFieldId_col_data
tag stores col id_id for fields
int tagNameSize
numer of characters in FE name
BitFieldId getBitFieldIdRow() const
Get field ids on rows.
auto getDataVectorDofsPtr() const
static MoFEMErrorCode defaultFace(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)
virtual ~interface_FiniteElement()=default
FiniteElement_row_change_bit_off(const BitFieldId f_id_row)
UId getLocalUniqueId() const
Get unique UId for finite element entity.
interface_EntFiniteElement(const boost::shared_ptr< T > &sptr)
BitFieldId * tag_BitFieldId_data
tag stores data id_id for fields
BitFieldId getBitFieldIdCol() const
Get field ids on columns.
boost::shared_ptr< FieldEntity_vector_view > colFieldEnts
FiniteElement_col_change_bit_reset()=default
boost::shared_ptr< CacheTuple > CacheTupleSharedPtr
FieldEntity_vector_view & getColFieldEnts() const
FieldEntity_vector_view & getColFieldEnts() const
Finite element definition.
void operator()(boost::shared_ptr< FiniteElement > &fe)
multi_index_container< boost::shared_ptr< NumeredEntFiniteElement >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< NumeredEntFiniteElement::interface_type_EntFiniteElement, UId, &NumeredEntFiniteElement::getLocalUniqueId > >, ordered_non_unique< tag< Part_mi_tag >, member< NumeredEntFiniteElement, unsigned int, &NumeredEntFiniteElement::part > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< NumeredEntFiniteElement::interface_type_RefEntity, EntityHandle, &NumeredEntFiniteElement::getEnt > >, ordered_non_unique< tag< Composite_Name_And_Part_mi_tag >, composite_key< NumeredEntFiniteElement, const_mem_fun< NumeredEntFiniteElement::interface_type_FiniteElement, boost::string_ref, &NumeredEntFiniteElement::getNameRef >, member< NumeredEntFiniteElement, unsigned int, &NumeredEntFiniteElement::part > >> >> NumeredEntFiniteElement_multiIndex
MultiIndex for entities for NumeredEntFiniteElement.
boost::shared_ptr< FieldEntity_vector_view > & getColFieldEntsPtr() const
EntityHandle getMeshset() const
Get meshset containing element entities.
EntFiniteElement(const boost::shared_ptr< RefElement > &ref_finite_element, const boost::shared_ptr< FiniteElement > &fe_ptr)
FiniteElement_change_bit_add(const BitFieldId f_id_data)
std::array< bool, MBMAXTYPE > DefEntTypeMap
BitFieldId getBitFieldIdData() const
Get field ids on data.
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
BitFieldId getBitFieldIdCol() const
Get field ids on columns.
std::string getName() const
Get finite element name.
virtual ~NumeredEntFiniteElement()=default
MoFEMErrorCode getElementAdjacency(const Field *field_ptr, Range &adjacency)
BitFieldId getBitFieldIdData() const
Get field ids on data.
boost::function< MoFEMErrorCode(Interface &moab, const Field &field, const EntFiniteElement &fe, std::vector< EntityHandle > &adjacency)> ElementAdjacencyFunct
user adjacency function
interface_FiniteElement(const boost::shared_ptr< FE > fe_ptr, const boost::shared_ptr< REFENT > ref_ents_ptr)
std::string getName() const
Get finite element name.
static MoFEMErrorCode getDofView(const FE_ENTS &fe_ents_view, const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, INSERTER &&inserter)
boost::shared_ptr< FieldEntity_vector_view > & getColFieldEntsPtr() const
MoFEMErrorCode getElementAdjacency(const boost::shared_ptr< Field > field_ptr, std::vector< EntityHandle > &adjacency)
interface to EntFiniteElement
boost::weak_ptr< FENumeredDofEntity > getRowDofsByPetscGlobalDofIdx(const int idx) const
get FE dof by petsc index
const UId & getFEUId() const
Get finite element uid.
BitFieldId getBitFieldIdRow() const
Get field ids on rows.
static constexpr DefEntTypeMap defHexTypeMap
boost::shared_ptr< FieldEntity_vector_view > rowFieldEnts
static constexpr DefEntTypeMap defMeshsetTypeMap
BitFieldId getBitFieldIdData() const
Get field ids on data.
void operator()(boost::shared_ptr< FiniteElement > &fe)
const UId & getFEUId() const
Get finite element uid.
boost::weak_ptr< CacheTuple > CacheTupleWeakPtr
static constexpr DefEntTypeMap defTriTypeMap
boost::string_ref getNameRef() const
Get finite element name.
void operator()(boost::shared_ptr< FiniteElement > &fe)
friend std::ostream & operator<<(std::ostream &os, const EntFiniteElement &e)
std::array< NumeredDofEntity_multiIndex::iterator, 2 > loHi
boost::shared_ptr< REFENT > & getRefElement() const
multi_index_container< boost::shared_ptr< FiniteElement >, indexed_by< hashed_unique< tag< FiniteElement_Meshset_mi_tag >, member< FiniteElement, EntityHandle, &FiniteElement::meshset > >, hashed_unique< tag< BitFEId_mi_tag >, const_mem_fun< FiniteElement, BitFEId, &FiniteElement::getId >, HashBit< BitFEId >, EqBit< BitFEId > >, ordered_unique< tag< FiniteElement_name_mi_tag >, const_mem_fun< FiniteElement, boost::string_ref, &FiniteElement::getNameRef > > > > FiniteElement_multiIndex
MultiIndex for entities for FiniteElement.
Partitioned (Indexed) Finite Element in Problem.
FieldEntity_vector_view & getRowFieldEnts() const
FieldEntity_vector_view & getRowFieldEnts() const
std::tuple< std::vector< EntityCacheDofs >, std::vector< EntityCacheNumeredDofs >, std::vector< EntityCacheNumeredDofs > > CacheTuple
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
static UId getLocalUniqueIdCalculate(const EntityHandle ent, UId fe_uid)
boost::shared_ptr< FieldEntity_vector_view > dataFieldEnts
static constexpr DefEntTypeMap defTetTypeMap
static constexpr DefEntTypeMap defPrismTypeMap
virtual ~EntFiniteElement()=default
void operator()(boost::shared_ptr< NumeredEntFiniteElement > &fe)
FiniteElement_row_change_bit_reset()=default
FiniteElement_row_change_bit_add(const BitFieldId f_id_row)
interface_FiniteElement(const boost::shared_ptr< T > fe_ptr, const boost::shared_ptr< T > ref_ents_ptr)
MoFEMErrorCode getColDofView(const MOFEM_DOFS &mofem_dofs, MOFEM_DOFS_VIEW &dofs_view, const int operation_type=moab::Interface::UNION)
boost::shared_ptr< FieldEntity_vector_view > & getRowFieldEntsPtr() const
NumeredEntFiniteElement(const boost::shared_ptr< EntFiniteElement > &sptr)
void * tagName
ptr to tag storing FE name
multi_index_container< boost::shared_ptr< EntFiniteElement >, indexed_by< ordered_unique< tag< Unique_mi_tag >, const_mem_fun< EntFiniteElement, UId, &EntFiniteElement::getLocalUniqueId > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< EntFiniteElement::interface_type_RefEntity, EntityHandle, &EntFiniteElement::getEnt > > > > EntFiniteElement_multiIndex
MultiIndex container for EntFiniteElement.
EntityHandle getMeshset() const
Get meshset containing element entities.
FiniteElement_col_change_bit_off(const BitFieldId f_id_col)
FiniteElement(Interface &moab, const EntityHandle _meshset)
BitFieldId getBitFieldIdRow() const
Get field ids on rows.
const UId & getFEUId() const
Get finite element uid.
static constexpr DefEntTypeMap defQuadTypeMap
static bool getDefTypeMap(const EntityType fe_type, const EntityType ent_type)