v0.9.0
Types.hpp
Go to the documentation of this file.
1 /** \file Types.hpp
2  * \brief Types
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 __TYPES_HPP__
19 #define __TYPES_HPP__
20 
21 namespace MoFEM {
22 
23 /**
24  * @brief Types
25  *
26  */
27 namespace Types {
28 
29 typedef int DofIdx; ///< Index of DOF
30 typedef int MoFEMDofIdx; ///< Index of DOF using mofem native index
31 typedef int PetscLocalDofIdx; ///< Index of DOF using local petsc index
32 typedef int PetscGlobalDofIdx; ///< Index of DOF using global pets index
33 typedef int FEIdx; ///< Index of the element
34 typedef int EntIdx; ///< Index of DOF on the entity
35 typedef int EntPart; ///< Partition owning entity
36 typedef double FieldData; ///< Field data type
37 typedef int ApproximationOrder; ///< Approximation on the entity
38 typedef int FieldCoefficientsNumber; ///< Number of field coefficients
39 
40 // typedef checked_uint128_t UId;
41 typedef uint128_t UId; ///< Unique Id
42 typedef int ShortId; ///< Unique Id in the field
43 
44 
45 typedef std::bitset<BITREFEDGES_SIZE> BitRefEdges;
46 
47 /**
48  * \brief Bit structure attached to each entity identifying to what mesh entity
49  * is attached.
50  */
51 typedef std::bitset<BITREFLEVEL_SIZE> BitRefLevel;
52 
53 typedef std::bitset<BITFIELDID_SIZE> BitFieldId; ///< Field Id
54 typedef std::bitset<BITFEID_SIZE> BitFEId; ///< Finite element Id
55 typedef std::bitset<BITPROBLEMID_SIZE> BitProblemId; ///< Problem Id
56 typedef std::bitset<BITINTERFACEUID_SIZE> BitIntefaceId;
57 
58 /**
59  * \typedef CubitBCType
60  * bc & material meshsets
61  *
62  */
63 typedef std::bitset<32> CubitBCType;
64 
65 // array with std allocators (i.e. concept of capacity is useful here)
66 // typedef ublas::unbounded_array<int,std::allocator<int> > IntAllocator;
67 // typedef ublas::unbounded_array<double,std::allocator<double> >
68 // DoubleAllocator;
69 typedef std::vector<int, std::allocator<int>> IntAllocator;
70 typedef std::vector<double, std::allocator<double>> DoubleAllocator;
71 typedef ublas::vector<int, IntAllocator> VectorInt;
72 typedef ublas::vector<double, DoubleAllocator> VectorDouble;
73 typedef ublas::matrix<int, ublas::row_major, IntAllocator> MatrixInt;
74 typedef ublas::matrix<double, ublas::row_major, DoubleAllocator> MatrixDouble;
75 typedef ublas::matrix<std::complex<double>, ublas::row_major, DoubleAllocator>
77 
78 // bounded vector & matrices
79 template <typename T, size_t N>
80 using VectorBoundedArray = ublas::vector<T, ublas::bounded_array<T, N>>;
81 
93 
94 template <typename T, size_t N>
95 using MatrixBoundedArray =
96  ublas::matrix<T, ublas::row_major, ublas::bounded_array<T, N>>;
99 
100 // shallow adaptor classes
101 template <typename T>
103  ublas::vector<T, ublas::shallow_array_adaptor<T>>;
106 
107 template <typename T>
109  ublas::matrix<double, ublas::row_major,
110  ublas::shallow_array_adaptor<double>>;
111 
112 /**
113  * @brief Matrix adaptor.
114  *
115  * \code
116  * MatrixAdaptor mat = MatrixAdaptor(3, 3,
117  * ublas::shallow_array_adaptor<double>(9, ptr));
118  * \endcode
119  *
120  */
122 
123 } // namespace Types
124 
125 using namespace Types;
126 
127 } // namespace MoFEM
128 
129 #endif // __TYPES_HPP__
MatrixBoundedArray< std::complex< double >, 9 > MatrixComplexDouble3by3
Definition: Types.hpp:98
ublas::matrix< T, ublas::row_major, ublas::bounded_array< T, N > > MatrixBoundedArray
Definition: Types.hpp:96
ublas::vector< T, ublas::bounded_array< T, N > > VectorBoundedArray
Definition: Types.hpp:80
int ApproximationOrder
Approximation on the entity.
Definition: Types.hpp:37
VectorBoundedArray< double, 5 > VectorDouble5
Definition: Types.hpp:89
ublas::matrix< double, ublas::row_major, ublas::shallow_array_adaptor< double > > MatrixShallowArrayAdaptor
Definition: Types.hpp:110
ublas::matrix< double, ublas::row_major, DoubleAllocator > MatrixDouble
Definition: Types.hpp:74
int MoFEMDofIdx
Index of DOF using mofem native index.
Definition: Types.hpp:30
VectorBoundedArray< int, 4 > VectorInt4
Definition: Types.hpp:83
VectorBoundedArray< int, 3 > VectorInt3
Definition: Types.hpp:82
VectorBoundedArray< int, 6 > VectorInt6
Definition: Types.hpp:85
std::bitset< BITPROBLEMID_SIZE > BitProblemId
Problem Id.
Definition: Types.hpp:55
ublas::matrix< int, ublas::row_major, IntAllocator > MatrixInt
Definition: Types.hpp:73
std::vector< int, std::allocator< int > > IntAllocator
Definition: Types.hpp:69
int EntIdx
Index of DOF on the entity.
Definition: Types.hpp:34
std::bitset< BITINTERFACEUID_SIZE > BitIntefaceId
Definition: Types.hpp:56
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
std::bitset< BITREFEDGES_SIZE > BitRefEdges
Definition: Types.hpp:45
VectorBoundedArray< double, 6 > VectorDouble6
Definition: Types.hpp:90
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:54
VectorBoundedArray< double, 4 > VectorDouble4
Definition: Types.hpp:88
VectorBoundedArray< double, 12 > VectorDouble12
Definition: Types.hpp:92
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:121
int PetscLocalDofIdx
Index of DOF using local petsc index.
Definition: Types.hpp:31
int FEIdx
Index of the element.
Definition: Types.hpp:33
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Types.hpp:104
MatrixBoundedArray< double, 9 > MatrixDouble3by3
Definition: Types.hpp:97
VectorBoundedArray< int, 5 > VectorInt5
Definition: Types.hpp:84
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
int PetscGlobalDofIdx
Index of DOF using global pets index.
Definition: Types.hpp:32
ublas::matrix< std::complex< double >, ublas::row_major, DoubleAllocator > MatrixComplexDouble
Definition: Types.hpp:76
double FieldData
Field data type.
Definition: Types.hpp:36
ublas::vector< int, IntAllocator > VectorInt
Definition: Types.hpp:71
VectorBoundedArray< double, 3 > VectorDouble3
Definition: Types.hpp:87
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
ublas::vector< T, ublas::shallow_array_adaptor< T > > VectorShallowArrayAdaptor
Definition: Types.hpp:103
int EntPart
Partition owning entity.
Definition: Types.hpp:35
int ShortId
Unique Id in the field.
Definition: Types.hpp:42
std::bitset< 32 > CubitBCType
Definition: Types.hpp:63
int FieldCoefficientsNumber
Number of field coefficients.
Definition: Types.hpp:38
int DofIdx
Index of DOF.
Definition: Types.hpp:29
VectorShallowArrayAdaptor< int > VectorIntAdaptor
Definition: Types.hpp:105
VectorBoundedArray< double, 9 > VectorDouble9
Definition: Types.hpp:91
ublas::vector< double, DoubleAllocator > VectorDouble
Definition: Types.hpp:72
std::vector< double, std::allocator< double > > DoubleAllocator
Definition: Types.hpp:70
VectorBoundedArray< int, 9 > VectorInt9
Definition: Types.hpp:86
uint128_t UId
Unique Id.
Definition: Types.hpp:41