v0.10.0
AdjacencyMultiIndices.hpp
Go to the documentation of this file.
1 /** \file AdjacencyMultiIndices.hpp
2  * \brief Myltindex containes, data structures for mofem adjacencies and other
3  * low-level functions
4  *
5  * MoFEM is free software: you can redistribute it and/or modify it under
6  * the terms of the GNU Lesser General Public License as published by the
7  * Free Software Foundation, either version 3 of the License, or (at your
8  * option) any later version.
9  *
10  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13  * License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
17  */
18 
19 #ifndef __ADJACENCYMULTIINDICES_HPP__
20 #define __ADJACENCYMULTIINDICES_HPP__
21 
22 namespace MoFEM {
23 
24 /**
25  * \brief FieldEntityEntFiniteElementAdjacencyMap of mofem finite element and
26  * entities
27  *
28  */
30  unsigned int byWhat; ///< see options \ref ByWhat
31  const boost::shared_ptr<FieldEntity> entFieldPtr; ///< field entity
32  const boost::shared_ptr<EntFiniteElement> entFePtr; ///< finite element entity
34  const boost::shared_ptr<FieldEntity> &ent_field_ptr,
35  const boost::shared_ptr<EntFiniteElement> &ent_fe_ptr);
36 
37  virtual ~FieldEntityEntFiniteElementAdjacencyMap() = default;
38 
39  /**
40  * \brief get unique iD of finite element entity
41  */
42  inline UId getFeUniqueId() const { return entFePtr->getLocalUniqueId(); }
43 
44  /**
45  * \brief get meshset of finite element
46  */
47  inline EntityHandle getFeMeshset() const { return entFePtr->getMeshset(); }
48 
49  /**
50  * \brief get finite element handle
51  */
52  inline EntityHandle getFeHandle() const { return entFePtr->getEnt(); }
53 
54  /**
55  * \brief get unique iD of entity on field
56  */
57  inline UId getEntUniqueId() const { return entFieldPtr->getLocalUniqueId(); }
58 
59  /**
60  * \brief get entity meshset carrying its field
61  */
62  inline EntityHandle getEntMeshset() const {
63  return entFieldPtr->getMeshset();
64  }
65 
66  /**
67  * \brief get entity handle
68  */
69  inline EntityHandle getEntHandle() const { return entFieldPtr->getEnt(); }
70 
71  /**
72  * \brief get field iD
73  */
74  BitFieldId getEntId() const { return entFieldPtr->getId(); }
75 
76  /**
77  * \brief get finite element iD
78  */
79  BitFEId getBitFEId() const { return entFePtr->getId(); }
80 
81  friend std::ostream &
82  operator<<(std::ostream &os,
84 };
85 
86 /**
87  * @relates multi_index_container
88  * \brief MultiIndex container keeps Adjacencies Element and dof entities
89  adjacencies and vice versa.
90 
91  */
92 typedef multi_index_container<
93  FieldEntityEntFiniteElementAdjacencyMap,
94  indexed_by<
95  ordered_unique<
96  tag<Composite_Unique_mi_tag>,
97  composite_key<
98  FieldEntityEntFiniteElementAdjacencyMap,
99  const_mem_fun<
100  FieldEntityEntFiniteElementAdjacencyMap, UId,
102  const_mem_fun<
103  FieldEntityEntFiniteElementAdjacencyMap, UId,
105  ordered_non_unique<
106  tag<Unique_mi_tag>,
107  const_mem_fun<
108  FieldEntityEntFiniteElementAdjacencyMap, UId,
110  ordered_non_unique<
111  tag<FE_Unique_mi_tag>,
112  const_mem_fun<
113  FieldEntityEntFiniteElementAdjacencyMap, UId,
115  ordered_non_unique<
116  tag<FEEnt_mi_tag>,
117  const_mem_fun<
118  FieldEntityEntFiniteElementAdjacencyMap, EntityHandle,
120  ordered_non_unique<
121  tag<Ent_mi_tag>,
122  const_mem_fun<
123  FieldEntityEntFiniteElementAdjacencyMap, EntityHandle,
126 
128  int bY;
130  : bY(by) {}
132  e.byWhat |= bY;
133  }
134 };
135 
136 } // namespace MoFEM
137 
138 #endif // __ADJACENCYMULTIINDICES_HPP__
EntityHandle getFeHandle() const
get finite element handle
UId getFeUniqueId() const
get unique iD of finite element entity
FieldEntityEntFiniteElementAdjacencyMap of mofem finite element and entities.
void operator()(FieldEntityEntFiniteElementAdjacencyMap &e)
BitFEId getBitFEId() const
get finite element iD
multi_index_container< FieldEntityEntFiniteElementAdjacencyMap, indexed_by< ordered_unique< tag< Composite_Unique_mi_tag >, composite_key< FieldEntityEntFiniteElementAdjacencyMap, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, UId, &FieldEntityEntFiniteElementAdjacencyMap::getEntUniqueId >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, UId, &FieldEntityEntFiniteElementAdjacencyMap::getFeUniqueId > > >, ordered_non_unique< tag< Unique_mi_tag >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, UId, &FieldEntityEntFiniteElementAdjacencyMap::getEntUniqueId > >, ordered_non_unique< tag< FE_Unique_mi_tag >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, UId, &FieldEntityEntFiniteElementAdjacencyMap::getFeUniqueId > >, ordered_non_unique< tag< FEEnt_mi_tag >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, EntityHandle, &FieldEntityEntFiniteElementAdjacencyMap::getFeHandle > >, ordered_non_unique< tag< Ent_mi_tag >, const_mem_fun< FieldEntityEntFiniteElementAdjacencyMap, EntityHandle, &FieldEntityEntFiniteElementAdjacencyMap::getEntHandle > > > > FieldEntityEntFiniteElementAdjacencyMap_multiIndex
MultiIndex container keeps Adjacencies Element and dof entities adjacencies and vice versa.
UId getEntUniqueId() const
get unique iD of entity on field
EntityHandle getFeMeshset() const
get meshset of finite element
EntityHandle getEntMeshset() const
get entity meshset carrying its field
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
FieldEntityEntFiniteElementAdjacencyMap(const boost::shared_ptr< FieldEntity > &ent_field_ptr, const boost::shared_ptr< EntFiniteElement > &ent_fe_ptr)
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:54
EntityHandle getEntHandle() const
get entity handle
const boost::shared_ptr< FieldEntity > entFieldPtr
field entity
const boost::shared_ptr< EntFiniteElement > entFePtr
finite element entity
friend std::ostream & operator<<(std::ostream &os, const FieldEntityEntFiniteElementAdjacencyMap &e)
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
uint128_t UId
Unique Id.
Definition: Types.hpp:42