v0.13.1
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
21namespace MoFEM {
22
23/**
24 * @brief Types
25 *
26 */
27namespace Types {
28
29typedef int DofIdx; ///< Index of DOF
30typedef int MoFEMDofIdx; ///< Index of DOF using mofem native index
31typedef int PetscLocalDofIdx; ///< Index of DOF using local petsc index
32typedef int PetscGlobalDofIdx; ///< Index of DOF using global pets index
33typedef int FEIdx; ///< Index of the element
34typedef int EntIdx; ///< Index of DOF on the entity
35typedef int EntPart; ///< Partition owning entity
36typedef double FieldData; ///< Field data type
37typedef int ApproximationOrder; ///< Approximation on the entity
38typedef int FieldCoefficientsNumber; ///< Number of field coefficients
39typedef char FieldBitNumber; ///< Field bit number
40
41// typedef checked_uint128_t UId;
42typedef uint128_t UId; ///< Unique Id
43typedef int ShortId; ///< Unique Id in the field
44
45typedef std::bitset<BITREFEDGES_SIZE> BitRefEdges;
46
47/**
48 * \brief Bit structure attached to each entity identifying to what mesh entity
49 * is attached.
50 */
51typedef std::bitset<BITREFLEVEL_SIZE> BitRefLevel;
52
53typedef std::bitset<BITFIELDID_SIZE> BitFieldId; ///< Field Id
54typedef std::bitset<BITFEID_SIZE> BitFEId; ///< Finite element Id
55typedef std::bitset<BITPROBLEMID_SIZE> BitProblemId; ///< Problem Id
56typedef std::bitset<BITINTERFACEUID_SIZE> BitIntefaceId;
57
58/**
59 * \typedef CubitBCType
60 * bc & material meshsets
61 *
62 */
63typedef 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;
69template <typename T>
70using VecAllocator = std::vector<T, std::allocator<T>>;
71
75
76template <typename T>
77using UBlasVector = ublas::vector<T, VecAllocator<T>>;
81#ifdef WITH_ADOL_C
83#endif
84
85template <typename T>
86using UBlasMatrix = ublas::matrix<T, ublas::row_major, VecAllocator<T>>;
90#ifdef WITH_ADOL_C
92#endif
93
94// bounded vector & matrices
95template <typename T, size_t N>
96using VectorBoundedArray = ublas::vector<T, ublas::bounded_array<T, N>>;
97
109#ifdef WITH_ADOL_C
111#endif
112
113template <typename T, size_t N>
115 ublas::matrix<T, ublas::row_major, ublas::bounded_array<T, N>>;
118#ifdef WITH_ADOL_C
120#endif
121
122// shallow adaptor classes
123template <typename T>
125 ublas::vector<T, ublas::shallow_array_adaptor<T>>;
128
129template <typename T>
131 ublas::matrix<double, ublas::row_major,
132 ublas::shallow_array_adaptor<double>>;
133
134/**
135 * @brief Matrix adaptor.
136 *
137 * \code
138 * MatrixAdaptor mat = MatrixAdaptor(3, 3,
139 * ublas::shallow_array_adaptor<double>(9, ptr));
140 * \endcode
141 *
142 */
144
145} // namespace Types
146
147using namespace Types;
148
149} // namespace MoFEM
150
151#endif // __TYPES_HPP__
@ row_major
Definition: Layout.hpp:13
std::vector< T, std::allocator< T > > VecAllocator
Definition: Types.hpp:70
UBlasVector< std::complex< double > > VectorComplexDouble
Definition: Types.hpp:80
VectorBoundedArray< int, 6 > VectorInt6
Definition: Types.hpp:101
std::bitset< BITFEID_SIZE > BitFEId
Finite element Id.
Definition: Types.hpp:54
int EntIdx
Index of DOF on the entity.
Definition: Types.hpp:34
ublas::vector< T, ublas::bounded_array< T, N > > VectorBoundedArray
Definition: Types.hpp:96
VectorBoundedArray< double, 3 > VectorDouble3
Definition: Types.hpp:103
int DofIdx
Index of DOF.
Definition: Types.hpp:29
VectorBoundedArray< int, 3 > VectorInt3
Definition: Types.hpp:98
std::bitset< BITINTERFACEUID_SIZE > BitIntefaceId
Definition: Types.hpp:56
VectorShallowArrayAdaptor< int > VectorIntAdaptor
Definition: Types.hpp:127
double FieldData
Field data type.
Definition: Types.hpp:36
std::bitset< 32 > CubitBCType
Definition: Types.hpp:63
std::bitset< BITPROBLEMID_SIZE > BitProblemId
Problem Id.
Definition: Types.hpp:55
ublas::vector< T, VecAllocator< T > > UBlasVector
Definition: Types.hpp:77
int MoFEMDofIdx
Index of DOF using mofem native index.
Definition: Types.hpp:30
int PetscLocalDofIdx
Index of DOF using local petsc index.
Definition: Types.hpp:31
int ApproximationOrder
Approximation on the entity.
Definition: Types.hpp:37
VectorBoundedArray< double, 6 > VectorDouble6
Definition: Types.hpp:106
ublas::matrix< T, ublas::row_major, ublas::bounded_array< T, N > > MatrixBoundedArray
Definition: Types.hpp:115
std::bitset< BITFIELDID_SIZE > BitFieldId
Field Id.
Definition: Types.hpp:53
VectorBoundedArray< adouble, 9 > VectorADouble9
Definition: Types.hpp:110
VectorShallowArrayAdaptor< double > VectorAdaptor
Definition: Types.hpp:126
UBlasMatrix< std::complex< double > > MatrixComplexDouble
Definition: Types.hpp:89
MatrixBoundedArray< std::complex< double >, 9 > MatrixComplexDouble3by3
Definition: Types.hpp:117
ublas::vector< T, ublas::shallow_array_adaptor< T > > VectorShallowArrayAdaptor
Definition: Types.hpp:125
int PetscGlobalDofIdx
Index of DOF using global pets index.
Definition: Types.hpp:32
VectorBoundedArray< double, 12 > VectorDouble12
Definition: Types.hpp:108
VectorBoundedArray< int, 5 > VectorInt5
Definition: Types.hpp:100
uint128_t UId
Unique Id.
Definition: Types.hpp:42
UBlasMatrix< adouble > MatrixADouble
Definition: Types.hpp:91
VectorBoundedArray< int, 9 > VectorInt9
Definition: Types.hpp:102
int FieldCoefficientsNumber
Number of field coefficients.
Definition: Types.hpp:38
VectorBoundedArray< double, 9 > VectorDouble9
Definition: Types.hpp:107
UBlasVector< adouble > VectorADouble
Definition: Types.hpp:82
std::bitset< BITREFEDGES_SIZE > BitRefEdges
Definition: Types.hpp:45
int EntPart
Partition owning entity.
Definition: Types.hpp:35
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
VectorBoundedArray< double, 4 > VectorDouble4
Definition: Types.hpp:104
VecAllocator< double > DoubleAllocator
Definition: Types.hpp:73
VectorBoundedArray< double, 5 > VectorDouble5
Definition: Types.hpp:105
MatrixShallowArrayAdaptor< double > MatrixAdaptor
Matrix adaptor.
Definition: Types.hpp:143
UBlasMatrix< int > MatrixInt
Definition: Types.hpp:87
VecAllocator< std::complex< double > > ComplexDoubleAllocator
Definition: Types.hpp:74
VecAllocator< int > IntAllocator
Definition: Types.hpp:72
VectorBoundedArray< int, 4 > VectorInt4
Definition: Types.hpp:99
char FieldBitNumber
Field bit number.
Definition: Types.hpp:39
UBlasVector< int > VectorInt
Definition: Types.hpp:78
ublas::matrix< double, ublas::row_major, ublas::shallow_array_adaptor< double > > MatrixShallowArrayAdaptor
Definition: Types.hpp:132
int ShortId
Unique Id in the field.
Definition: Types.hpp:43
int FEIdx
Index of the element.
Definition: Types.hpp:33
ublas::matrix< T, ublas::row_major, VecAllocator< T > > UBlasMatrix
Definition: Types.hpp:86
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21