www.mooseframework.org
MooseTypes.h
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #ifndef MOOSETYPES_H
16 #define MOOSETYPES_H
17 
18 #include "Moose.h"
19 
20 #include "libmesh/libmesh.h"
21 #include "libmesh/id_types.h"
22 #include "libmesh/stored_range.h"
23 #include "libmesh/elem.h"
24 #include "libmesh/petsc_macro.h"
25 #include "libmesh/boundary_info.h"
26 
27 #include <string>
28 #include <vector>
29 #include <memory>
30 
31 // DO NOT USE (Deprecated)
32 #define MooseSharedPointer std::shared_ptr
33 #define MooseSharedNamespace std
34 
42 // The multiple macros that you would need anyway [as per: Crazy Eddie (stack overflow)]
43 #ifdef __clang__
44 #pragma clang diagnostic push
45 #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
46 #endif
47 
48 #define beginIndex_0() ERROR-- > "beginIndex() requires one or two arguments"
49 #define beginIndex_1(A) decltype(A.size())(0)
50 #define beginIndex_2(A, B) decltype(A.size())(B)
51 #define beginIndex_3(A, B, C) ERROR-- > "beginIndex() requires one or two arguments"
52 #define beginIndex_4(A, B, C, D) ERROR-- > "beginIndex() requires one or two arguments"
53 
54 // The interim macro that simply strips the excess and ends up with the required macro
55 #define beginIndex_X(x, A, B, C, D, FUNC, ...) FUNC
56 
57 // The macro that the programmer uses
58 #define beginIndex(...) \
59  beginIndex_X(, \
60  ##__VA_ARGS__, \
61  beginIndex_4(__VA_ARGS__), \
62  beginIndex_3(__VA_ARGS__), \
63  beginIndex_2(__VA_ARGS__), \
64  beginIndex_1(__VA_ARGS__), \
65  beginIndex_0(__VA_ARGS__))
66 #ifdef __clang__
67 #pragma clang diagnostic pop
68 #endif
69 
73 typedef Real PostprocessorValue;
74 typedef std::vector<Real> VectorPostprocessorValue;
75 typedef boundary_id_type BoundaryID;
76 typedef unsigned int InterfaceID;
77 typedef subdomain_id_type SubdomainID;
78 typedef unsigned int MooseObjectID;
79 typedef unsigned int THREAD_ID;
80 
81 typedef StoredRange<std::vector<dof_id_type>::iterator, dof_id_type> NodeIdRange;
82 typedef StoredRange<std::vector<const Elem *>::iterator, const Elem *> ConstElemPointerRange;
83 
85 // Note: If this enum is changed, make sure to modify:
86 // (1) the local function populateExecTypes in Moose.C.
87 // (2) the function in Conversion.C: initExecStoreType()
88 // (3) the method SetupInterface::getExecuteOptions
89 // (4) the function Output::getExecuteOptions
91 {
92  EXEC_NONE = 0x00, // 0
94  EXEC_INITIAL = 0x01, // 1
96  EXEC_LINEAR = 0x02, // 2
98  EXEC_NONLINEAR = 0x04, // 4
100  EXEC_TIMESTEP_END = 0x08, // 8
102  EXEC_TIMESTEP_BEGIN = 0x10, // 16
104  EXEC_FINAL = 0x20, // 32
106  EXEC_FORCED = 0x40, // 64
108  EXEC_FAILED = 0x80, // 128
110  EXEC_CUSTOM = 0x100, // 256
112  EXEC_SUBDOMAIN = 0x200 // 512
113 };
114 
115 namespace Moose
116 {
117 const SubdomainID ANY_BLOCK_ID = libMesh::Elem::invalid_subdomain_id - 1;
118 const SubdomainID INVALID_BLOCK_ID = libMesh::Elem::invalid_subdomain_id;
119 const BoundaryID ANY_BOUNDARY_ID = static_cast<BoundaryID>(-1);
120 const BoundaryID INVALID_BOUNDARY_ID = libMesh::BoundaryInfo::invalid_id;
121 const std::set<SubdomainID> EMPTY_BLOCK_IDS = {};
122 const std::set<BoundaryID> EMPTY_BOUNDARY_IDS = {};
123 
130 {
135 };
136 
141 {
142  PRE_IC = 0,
143  PRE_AUX = 1,
144  POST_AUX = 2,
145  ALL = 3
146 };
147 
151 extern const std::vector<ExecFlagType> exec_types;
152 
157 {
160 };
161 
163 {
164  KT_TIME = 0,
167  KT_EIGEN = 3,
169 };
170 
172 {
176 };
177 
179 {
182 };
183 
185 {
188 };
189 
191 {
196 };
197 
199 {
202 };
203 
205 {
210 };
211 
213 {
217 };
218 
223 {
228 };
229 
234 {
240 };
241 
246 {
252 };
253 
258 {
267 };
268 
273 {
281 };
282 
287 {
299 };
300 
305 {
313 };
314 
319 {
322 };
327 {
332 #ifdef LIBMESH_HAVE_PETSC
333 #if PETSC_VERSION_LESS_THAN(3, 3, 0)
337 #else
342 #endif
343 #endif
344 };
345 
350 {
354 };
355 }
356 
362 #define DerivativeStringClass(TheName) \
363  class TheName : public std::string \
364  { \
365  public: \
366  TheName() : std::string() {} \
367  TheName(const std::string & str) : std::string(str) {} \
368  TheName(const std::string & str, size_t pos, size_t n = npos) : std::string(str, pos, n) {} \
369  TheName(const char * s, size_t n) : std::string(s, n) {} \
370  TheName(const char * s) : std::string(s) {} \
371  TheName(size_t n, char c) : std::string(n, c) {} \
372  } /* No semicolon here because this is a macro */
373 
374 // Instantiate new Types
375 
380 DerivativeStringClass(FileName);
381 
383 DerivativeStringClass(FileNameNoExtension);
384 
386 DerivativeStringClass(MeshFileName);
387 
389 DerivativeStringClass(OutFileBase);
390 
392 DerivativeStringClass(NonlinearVariableName);
393 
395 DerivativeStringClass(AuxVariableName);
396 
398 DerivativeStringClass(VariableName);
399 
401 DerivativeStringClass(BoundaryName);
402 
404 DerivativeStringClass(SubdomainName);
405 
407 DerivativeStringClass(PostprocessorName);
408 
410 DerivativeStringClass(VectorPostprocessorName);
411 
413 DerivativeStringClass(FunctionName);
414 
416 DerivativeStringClass(DistributionName);
417 
419 DerivativeStringClass(SamplerName);
420 
422 DerivativeStringClass(UserObjectName);
423 
425 DerivativeStringClass(IndicatorName);
426 
428 DerivativeStringClass(MarkerName);
429 
431 DerivativeStringClass(MultiAppName);
432 
434 DerivativeStringClass(OutputName);
435 
437 DerivativeStringClass(MaterialPropertyName);
438 
440 DerivativeStringClass(MaterialName);
441 
442 #endif // MOOSETYPES_H
Object is evaluated in every residual computation.
Definition: MooseTypes.h:96
ConstraintFormulationType
Type of constraint formulation.
Definition: MooseTypes.h:318
Generalized Non-Hermitian.
Definition: MooseTypes.h:278
Newton-based eigen solver.
Definition: MooseTypes.h:265
Generalized Hermitian indefinite.
Definition: MooseTypes.h:277
Full Newton Solve.
Definition: MooseTypes.h:249
ConstraintType
Definition: MooseTypes.h:198
smallest magnitude
Definition: MooseTypes.h:289
EigenSolveType
Type of the eigen solve.
Definition: MooseTypes.h:257
For use with custom executioners that want to fire objects at a specific time.
Definition: MooseTypes.h:110
Object is evaluated only once at the beginning of the simulation.
Definition: MooseTypes.h:94
subdomain_id_type SubdomainID
Definition: MooseTypes.h:77
const BoundaryID INVALID_BOUNDARY_ID
Definition: MooseTypes.h:120
Matrix-free Newton-based eigen solver.
Definition: MooseTypes.h:266
StoredRange< std::vector< dof_id_type >::iterator, dof_id_type > NodeIdRange
Definition: MooseTypes.h:81
MaterialDataType
MaterialData types.
Definition: MooseTypes.h:129
Solving a linear problem.
Definition: MooseTypes.h:251
Matrix-free nonlinear inverse power.
Definition: MooseTypes.h:264
use whatever SLPEC has by default
Definition: MooseTypes.h:280
target magnitude
Definition: MooseTypes.h:294
DGResidualType
Definition: MooseTypes.h:184
Generalized Non-Hermitian with positive (semi-)definite B.
Definition: MooseTypes.h:279
MffdType
Type of the matrix-free finite-differencing parameter.
Definition: MooseTypes.h:349
Object is evaluated at the end of every time step.
Definition: MooseTypes.h:100
Power / Inverse / RQI.
Definition: MooseTypes.h:259
Krylov-Schur.
Definition: MooseTypes.h:261
AuxGroup
Flag for AuxKernel related exeuction type.
Definition: MooseTypes.h:140
MooseKSPNormType
Norm type for converge test.
Definition: MooseTypes.h:233
const SubdomainID INVALID_BLOCK_ID
Definition: MooseTypes.h:118
StoredRange< std::vector< const Elem * >::iterator, const Elem * > ConstElemPointerRange
Definition: MooseTypes.h:82
Forces execution to occur (output only)
Definition: MooseTypes.h:106
Use whatever we have in PETSc.
Definition: MooseTypes.h:227
WhichEigenPairs
Which eigen pairs.
Definition: MooseTypes.h:286
LineSearchType
Type of the line search.
Definition: MooseTypes.h:326
Use whatever we have in PETSc.
Definition: MooseTypes.h:239
VarKindType
Framework-wide stuff.
Definition: MooseTypes.h:156
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:248
Real PostprocessorValue
MOOSE typedefs.
Definition: MooseTypes.h:73
unsigned int InterfaceID
Definition: MooseTypes.h:76
target imaginary
Definition: MooseTypes.h:296
Use finite differences to compute Jacobian.
Definition: MooseTypes.h:250
Objects is evaluated on subdomain.
Definition: MooseTypes.h:112
Nonlinear inverse power.
Definition: MooseTypes.h:263
KernelType
Definition: MooseTypes.h:162
CoordinateSystemType
Definition: MooseTypes.h:212
Jacobi-Davidson.
Definition: MooseTypes.h:262
DGJacobianType
Definition: MooseTypes.h:190
ConstraintSideType
Definition: MooseTypes.h:178
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:74
const SubdomainID ANY_BLOCK_ID
Definition: MooseTypes.h:117
Forces execution on failed solve (output only)
Definition: MooseTypes.h:108
const std::set< SubdomainID > EMPTY_BLOCK_IDS
Definition: MooseTypes.h:121
smallest imaginary
Definition: MooseTypes.h:293
const std::set< BoundaryID > EMPTY_BOUNDARY_IDS
Definition: MooseTypes.h:122
means not set
Definition: MooseTypes.h:351
ConstraintJacobianType
Definition: MooseTypes.h:204
largest imaginary
Definition: MooseTypes.h:292
Non-Hermitian.
Definition: MooseTypes.h:275
CouplingType
Definition: MooseTypes.h:171
TimeIntegratorType
Time integrators.
Definition: MooseTypes.h:304
Object is evaluated at the end of the simulations (output only)
Definition: MooseTypes.h:104
Object is evaluated at the beginning of every time step.
Definition: MooseTypes.h:102
DerivativeStringClass(FileName)
This type is for expected (i.e.
PCSideType
Preconditioning side.
Definition: MooseTypes.h:222
all eigenvalues
Definition: MooseTypes.h:297
const std::vector< ExecFlagType > exec_types
A static list of all the exec types.
Definition: MooseTypes.C:40
Preconditioned Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:247
ExecFlagType
Execution flags - when is the object executed/evaluated.
Definition: MooseTypes.h:90
Object is evaluated in every jacobian computation.
Definition: MooseTypes.h:98
Definition: Moose.h:84
use whatever we have in SLEPC
Definition: MooseTypes.h:298
means not set
Definition: MooseTypes.h:328
largest magnitude
Definition: MooseTypes.h:288
SolveType
Type of the solve.
Definition: MooseTypes.h:245
unsigned int MooseObjectID
Definition: MooseTypes.h:78
EigenProblemType
Type of the eigen problem.
Definition: MooseTypes.h:272
Generalized Hermitian.
Definition: MooseTypes.h:276
const BoundaryID ANY_BOUNDARY_ID
Definition: MooseTypes.h:119
unsigned int THREAD_ID
Definition: MooseTypes.h:79
boundary_id_type BoundaryID
Definition: MooseTypes.h:75