v0.8.23
AdjacencyMultiIndices.hpp
Go to the documentation of this file.
1 /** \file AdjacencyMultiIndices.hpp
2  * \brief Myltindex containes, data structures for mofem adjacencies and other low-level functions
3  *
4  * MoFEM is free software: you can redistribute it and/or modify it under
5  * the terms of the GNU Lesser General Public License as published by the
6  * Free Software Foundation, either version 3 of the License, or (at your
7  * option) any later version.
8  *
9  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
12  * License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
16 */
17 
18 #ifndef __ADJACENCYMULTIINDICES_HPP__
19 #define __ADJACENCYMULTIINDICES_HPP__
20 
21 
22 namespace MoFEM {
23 
24 /**
25  * \brief FieldEntityEntFiniteElementAdjacencyMap of mofem finite element and entities
26  *
27  */
29  unsigned int byWhat; ///< see options \ref ByWhat
30  const boost::shared_ptr<FieldEntity> entFieldPtr; ///< field entity
31  const boost::shared_ptr<EntFiniteElement> entFePtr; ///< finite element entity
33  const boost::shared_ptr<FieldEntity> &ent_field_ptr,
34  const boost::shared_ptr<EntFiniteElement> &ent_fe_ptr);
35 
36  /**
37  * \brief get unique iD of finite element entity
38  */
39  inline UId getFeUniqueId() const { return entFePtr->getGlobalUniqueId(); }
40 
41  /**
42  * \brief get meshset of finite element
43  */
44  inline EntityHandle getFeMeshset() const { return entFePtr->getMeshset(); }
45 
46  /**
47  * \brief get finite element handle
48  */
49  inline EntityHandle getFeHandle() const { return entFePtr->getEnt(); }
50 
51  /**
52  * \brief get unique iD of entity on field
53  */
54  inline UId getEntUniqueId() const { return entFieldPtr->getGlobalUniqueId(); }
55 
56  /**
57  * \brief get entity meshset carrying its field
58  */
59  inline EntityHandle getEntMeshset() const { return entFieldPtr->getMeshset(); }
60 
61  /**
62  * \brief get entity handle
63  */
64  inline EntityHandle getEntHandle() const { return entFieldPtr->getEnt(); }
65 
66  /**
67  * \brief get field iD
68  */
69  BitFieldId getEntId() const { return entFieldPtr->getId(); }
70 
71  /**
72  * \brief get finite element iD
73  */
74  BitFEId getBitFEId() const { return entFePtr->getId(); }
75 
76  // /** \deprecated use getFeUniqueId
77  // */
78  // DEPRECATED inline UId get_MoFEMFiniteElement_unique_id() const { return getFeUniqueId(); }
79  //
80  // /** \deprecated use getFeMeshset
81  // */
82  // DEPRECATED inline EntityHandle get_MoFEMFiniteElement_meshset() const { return getFeMeshset(); }
83  //
84  // /** \deprecated use getFeHandle
85  // */
86  // DEPRECATED inline EntityHandle get_MoFEMFiniteElement_entity_handle() const { return getFeHandle(); }
87  //
88  // /** \deprecated use getEntUniqueId
89  // */
90  // DEPRECATED inline UId get_ent_unique_id() const { return getEntUniqueId(); }
91  //
92  // /** \deprecated use getEntMeshset
93  // */
94  // DEPRECATED inline EntityHandle get_ent_meshset() const { return getEntMeshset(); }
95  //
96  // /** \deprecated use getEntHandle
97  // */
98  // DEPRECATED inline EntityHandle get_ent_entity_handle() const { return getEntHandle(); }
99  //
100  // /** \deprecated use getBitFEId
101  // */
102  // DEPRECATED BitFEId get_BitFEId() const { return getBitFEId(); }
103 
104  friend std::ostream& operator<<(std::ostream& os,const FieldEntityEntFiniteElementAdjacencyMap &e);
105 };
106 
107 /**
108  * @relates multi_index_container
109  * \brief MultiIndex container keeps Adjacencies Element and dof entities adjacencies and vice versa.
110 
111  */
112 typedef multi_index_container<
113  FieldEntityEntFiniteElementAdjacencyMap,
114  indexed_by<
115  ordered_unique<
116  tag<Composite_Unique_mi_tag>,
117  composite_key<
118  FieldEntityEntFiniteElementAdjacencyMap,
119  const_mem_fun<
120  FieldEntityEntFiniteElementAdjacencyMap,UId,
122  >,
123  const_mem_fun<
124  FieldEntityEntFiniteElementAdjacencyMap,UId,
126  >
127  >
128  >,
129  ordered_non_unique<
130  tag<Unique_mi_tag>,
131  const_mem_fun<
132  FieldEntityEntFiniteElementAdjacencyMap,UId,
134  >
135  >,
136  ordered_non_unique<
137  tag<FE_Unique_mi_tag>,
138  const_mem_fun<
139  FieldEntityEntFiniteElementAdjacencyMap,UId,
141  >
142  >,
143  ordered_non_unique<
144  tag<FEEnt_mi_tag>,
145  const_mem_fun<
146  FieldEntityEntFiniteElementAdjacencyMap,EntityHandle,
148  >
149  >,
150  ordered_non_unique<
151  tag<Ent_mi_tag>,
152  const_mem_fun<
153  FieldEntityEntFiniteElementAdjacencyMap,EntityHandle,
155  >
156  >
157  >
159 
161  int bY;
164  e.byWhat |= bY;
165  }
166 };
167 
168 }
169 
170 #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.
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.
void operator()(FieldEntityEntFiniteElementAdjacencyMap &e)
BitFEId getBitFEId() const
get finite element iD
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:41