Line data Source code
1 : //* This file is part of the MOOSE framework
2 : //* https://mooseframework.inl.gov
3 : //*
4 : //* All rights reserved, see COPYRIGHT for full restrictions
5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 : //*
7 : //* Licensed under LGPL 2.1, please see LICENSE for details
8 : //* https://www.gnu.org/licenses/lgpl-2.1.html
9 :
10 : #pragma once
11 :
12 : #include "Moose.h"
13 : #include "ADReal.h"
14 : #include "EigenADReal.h"
15 : #include "ChainedReal.h"
16 : #include "ChainedADReal.h"
17 : #include "ADRankTwoTensorForward.h"
18 : #include "ADRankThreeTensorForward.h"
19 : #include "ADRankFourTensorForward.h"
20 : #include "ADSymmetricRankTwoTensorForward.h"
21 : #include "ADSymmetricRankFourTensorForward.h"
22 :
23 : // This is not strictly needed here, but it used to be included by ADReal.h
24 : // so developers relied heavily on it being already available
25 : #include "MooseError.h"
26 :
27 : #include "libmesh/libmesh.h"
28 : #include "libmesh/id_types.h"
29 : #include "libmesh/stored_range.h"
30 : #include "libmesh/petsc_macro.h"
31 : #include "libmesh/boundary_info.h"
32 : #include "libmesh/parameters.h"
33 : #include "libmesh/dense_vector.h"
34 : #include "libmesh/dense_matrix.h"
35 : #include "libmesh/int_range.h"
36 :
37 : // BOOST include
38 : #include "boost/bitmask_operators.h"
39 :
40 : #include "libmesh/ignore_warnings.h"
41 : #include "Eigen/Core"
42 : #include "libmesh/restore_warnings.h"
43 : #include "libmesh/tensor_tools.h"
44 :
45 : #include "metaphysicl/ct_types.h"
46 :
47 : #include <string>
48 : #include <vector>
49 : #include <memory>
50 : #include <type_traits>
51 : #include <functional>
52 : #include <iterator> // std::data
53 :
54 : #if !defined(INCLUDE_NLOHMANN_JSON_HPP_) && !defined(MOOSE_NLOHMANN_INCLUDED)
55 : #undef INCLUDE_NLOHMANN_JSON_FWD_HPP_
56 : #include "nlohmann/json_fwd.h"
57 : #define MOOSE_NLOHMANN_INCLUDED
58 : #endif
59 :
60 : // DO NOT USE (Deprecated)
61 : #define MooseSharedPointer std::shared_ptr
62 : #define MooseSharedNamespace std
63 :
64 : /**
65 : * Macro for inferring the proper type of a normal loop index compatible
66 : * with the "auto" keyword.
67 : * Usage:
68 : * for (auto i = beginIndex(v); i < v.size(); ++i) // default index is zero
69 : * for (auto i = beginIndex(v, 1); i < v.size(); ++i) // index is supplied
70 : */
71 : // The multiple macros that you would need anyway [as per: Crazy Eddie (stack overflow)]
72 : #ifdef __clang__
73 : #pragma clang diagnostic push
74 : #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
75 : #endif
76 :
77 : #define beginIndex_0() ERROR-- > "beginIndex() requires one or two arguments"
78 : #define beginIndex_1(A) decltype(A.size())(0)
79 : #define beginIndex_2(A, B) decltype(A.size())(B)
80 : #define beginIndex_3(A, B, C) ERROR-- > "beginIndex() requires one or two arguments"
81 : #define beginIndex_4(A, B, C, D) ERROR-- > "beginIndex() requires one or two arguments"
82 :
83 : // The interim macro that simply strips the excess and ends up with the required macro
84 : #define beginIndex_X(x, A, B, C, D, FUNC, ...) FUNC
85 :
86 : // The macro that the programmer uses
87 : #define beginIndex(...) \
88 : beginIndex_X(, \
89 : ##__VA_ARGS__, \
90 : beginIndex_4(__VA_ARGS__), \
91 : beginIndex_3(__VA_ARGS__), \
92 : beginIndex_2(__VA_ARGS__), \
93 : beginIndex_1(__VA_ARGS__), \
94 : beginIndex_0(__VA_ARGS__))
95 :
96 : /**
97 : * MooseIndex Macro for creating an index type of the right type for loops and other places where
98 : * type matching is important.
99 : * Usage:
100 : *
101 : * Type t;
102 : *
103 : * Container type:
104 : * for (MooseIndex(t) i = 0; i < t.size(); ++i)
105 : *
106 : * POD type:
107 : * for (MooseIndex(t) i = 0; i < t; ++i)
108 : */
109 : #define MooseIndex(type) decltype(_MooseIndex(type, 0))
110 :
111 : // SFINAE templates for type MooseIndex type selection
112 : template <typename T, typename std::enable_if<std::is_integral<T>::value>::type * = nullptr>
113 : typename std::remove_const<T>::type
114 : _MooseIndex(T, int)
115 : {
116 : }
117 :
118 : template <typename T>
119 : decltype(std::declval<T>().size())
120 : _MooseIndex(T &&, int)
121 : {
122 : }
123 :
124 : template <typename T>
125 : decltype("NOTE: MooseIndex only works with integers and objects with size()!")
126 : _MooseIndex(T, double) = delete;
127 :
128 : #ifdef __clang__
129 : #pragma clang diagnostic pop
130 : #endif
131 :
132 : /**
133 : * forward declarations
134 : */
135 : template <typename>
136 : class MooseArray;
137 : template <typename>
138 : class MaterialProperty;
139 : template <typename>
140 : class ADMaterialProperty;
141 : class InputParameters;
142 :
143 : namespace libMesh
144 : {
145 : typedef VectorValue<Real> RealVectorValue;
146 : typedef Eigen::Matrix<Real, Moose::dim, 1> RealDIMValue;
147 : typedef Eigen::Matrix<Real, Eigen::Dynamic, 1> RealEigenVector;
148 : typedef Eigen::Matrix<ADReal, Eigen::Dynamic, 1> ADRealEigenVector;
149 : typedef Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim> RealVectorArrayValue;
150 : typedef Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim * Moose::dim> RealTensorArrayValue;
151 : typedef Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic> RealEigenMatrix;
152 : typedef Eigen::Matrix<ADReal, Eigen::Dynamic, Eigen::Dynamic> ADRealEigenMatrix;
153 : typedef TensorValue<Real> RealTensorValue;
154 :
155 : namespace TensorTools
156 : {
157 : template <>
158 : struct IncrementRank<Eigen::Matrix<Real, Eigen::Dynamic, 1>>
159 : {
160 : typedef Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim> type;
161 : };
162 :
163 : template <>
164 : struct IncrementRank<Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim>>
165 : {
166 : typedef Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim * Moose::dim> type;
167 : };
168 :
169 : template <>
170 : struct DecrementRank<Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim>>
171 : {
172 : typedef Eigen::Matrix<Real, Eigen::Dynamic, 1> type;
173 : };
174 :
175 : template <>
176 : struct IncrementRank<Eigen::Matrix<ADReal, Eigen::Dynamic, 1>>
177 : {
178 : typedef Eigen::Matrix<ADReal, Eigen::Dynamic, Moose::dim> type;
179 : };
180 :
181 : template <>
182 : struct IncrementRank<Eigen::Matrix<ADReal, Eigen::Dynamic, Moose::dim>>
183 : {
184 : typedef Eigen::Matrix<ADReal, Eigen::Dynamic, Moose::dim * Moose::dim> type;
185 : };
186 :
187 : template <>
188 : struct DecrementRank<Eigen::Matrix<ADReal, Eigen::Dynamic, Moose::dim>>
189 : {
190 : typedef Eigen::Matrix<ADReal, Eigen::Dynamic, 1> type;
191 : };
192 : }
193 : }
194 :
195 : // Common types defined in libMesh
196 : using libMesh::Gradient;
197 : using libMesh::RealGradient;
198 :
199 : // Bring these common types added to the libMesh namespace in this header
200 : // to global namespace
201 : using libMesh::ADRealEigenMatrix;
202 : using libMesh::ADRealEigenVector;
203 : using libMesh::DenseMatrix;
204 : using libMesh::DenseVector;
205 : using libMesh::RealDIMValue;
206 : using libMesh::RealEigenMatrix;
207 : using libMesh::RealEigenVector;
208 : using libMesh::RealTensorArrayValue;
209 : using libMesh::RealTensorValue;
210 : using libMesh::RealVectorArrayValue;
211 : using libMesh::RealVectorValue;
212 :
213 : namespace MetaPhysicL
214 : {
215 : template <typename U>
216 : struct ReplaceAlgebraicType<libMesh::RealEigenVector, U>
217 : {
218 : typedef U type;
219 : };
220 : template <typename U>
221 : struct ReplaceAlgebraicType<libMesh::ADRealEigenVector, U>
222 : {
223 : typedef U type;
224 : };
225 : }
226 :
227 : /**
228 : * various MOOSE typedefs
229 : */
230 : typedef Real PostprocessorValue;
231 : typedef std::vector<Real> VectorPostprocessorValue;
232 : typedef Real ScatterVectorPostprocessorValue;
233 : typedef boundary_id_type BoundaryID;
234 : typedef unsigned int InterfaceID;
235 : typedef subdomain_id_type SubdomainID;
236 : typedef unsigned int MooseObjectID;
237 : typedef unsigned int THREAD_ID;
238 : typedef unsigned int TagID;
239 : typedef unsigned int TagTypeID;
240 : typedef unsigned int PerfID;
241 : typedef unsigned int InvalidSolutionID;
242 : using RestartableDataMapName = std::string; // see MooseApp.h
243 :
244 : typedef libMesh::StoredRange<std::vector<dof_id_type>::iterator, dof_id_type> NodeIdRange;
245 : typedef libMesh::StoredRange<std::vector<const Elem *>::iterator, const Elem *>
246 : ConstElemPointerRange;
247 :
248 : namespace Moose
249 : {
250 :
251 : /// This is used for places where we initialize some qp-sized data structures
252 : /// that would end up being sized too small after the quadrature order gets
253 : /// bumped (dynamically in-sim). So for these cases, we just use this constant
254 : /// to size those data structures overly large to accommodate rather than come
255 : /// up with some overkill complex mechanism for dynamically resizing them.
256 : /// Eventually, we may need or implement that more sophisticated mechanism and
257 : /// will no longer need this.
258 : constexpr std::size_t constMaxQpsPerElem = 1000;
259 :
260 : // These are used by MooseVariableData and MooseVariableDataFV
261 : enum SolutionState : int
262 : {
263 : Current = 0,
264 : Old = 1,
265 : Older = 2,
266 : PreviousNL = -1
267 : };
268 :
269 : enum class SolutionIterationType : unsigned short
270 : {
271 : Time = 0,
272 : Nonlinear = 1,
273 : FixedPoint = 2
274 : };
275 :
276 : // These are used by MooseVariableData and MooseVariableDataFV
277 : enum GeometryType
278 : {
279 : Volume,
280 : Face
281 : };
282 :
283 : template <typename OutputType>
284 : struct ShapeType
285 : {
286 : typedef OutputType type;
287 : };
288 : template <>
289 : struct ShapeType<Eigen::Matrix<Real, Eigen::Dynamic, 1>>
290 : {
291 : typedef Real type;
292 : };
293 :
294 : template <typename OutputType>
295 : struct DOFType
296 : {
297 : typedef OutputType type;
298 : };
299 : template <>
300 : struct DOFType<RealVectorValue>
301 : {
302 : typedef Real type;
303 : };
304 : } // namespace Moose
305 :
306 : template <typename OutputType>
307 : struct OutputTools
308 : {
309 : typedef typename libMesh::TensorTools::IncrementRank<OutputType>::type OutputGradient;
310 : typedef typename libMesh::TensorTools::IncrementRank<OutputGradient>::type OutputSecond;
311 : typedef typename libMesh::TensorTools::DecrementRank<OutputType>::type OutputDivergence;
312 :
313 : typedef MooseArray<OutputType> VariableValue;
314 : typedef MooseArray<OutputGradient> VariableGradient;
315 : typedef MooseArray<OutputSecond> VariableSecond;
316 : typedef MooseArray<OutputType> VariableCurl;
317 : typedef MooseArray<OutputDivergence> VariableDivergence;
318 :
319 : typedef typename Moose::ShapeType<OutputType>::type OutputShape;
320 : typedef typename libMesh::TensorTools::IncrementRank<OutputShape>::type OutputShapeGradient;
321 : typedef typename libMesh::TensorTools::IncrementRank<OutputShapeGradient>::type OutputShapeSecond;
322 : typedef typename libMesh::TensorTools::DecrementRank<OutputShape>::type OutputShapeDivergence;
323 :
324 : typedef MooseArray<std::vector<OutputShape>> VariablePhiValue;
325 : typedef MooseArray<std::vector<OutputShapeGradient>> VariablePhiGradient;
326 : typedef MooseArray<std::vector<OutputShapeSecond>> VariablePhiSecond;
327 : typedef MooseArray<std::vector<OutputShape>> VariablePhiCurl;
328 : typedef MooseArray<std::vector<OutputShapeDivergence>> VariablePhiDivergence;
329 :
330 : typedef MooseArray<std::vector<OutputShape>> VariableTestValue;
331 : typedef MooseArray<std::vector<OutputShapeGradient>> VariableTestGradient;
332 : typedef MooseArray<std::vector<OutputShapeSecond>> VariableTestSecond;
333 : typedef MooseArray<std::vector<OutputShape>> VariableTestCurl;
334 : typedef MooseArray<std::vector<OutputShapeDivergence>> VariableTestDivergence;
335 :
336 : // DoF value type for the template class OutputType
337 : typedef typename Moose::DOFType<OutputType>::type OutputData;
338 : typedef MooseArray<OutputData> DofValue;
339 : typedef OutputType OutputValue;
340 : };
341 :
342 : // types for standard variable
343 : typedef typename OutputTools<Real>::VariableValue VariableValue;
344 : typedef typename OutputTools<Real>::VariableGradient VariableGradient;
345 : typedef typename OutputTools<Real>::VariableSecond VariableSecond;
346 : typedef typename OutputTools<Real>::VariableCurl VariableCurl;
347 : typedef typename OutputTools<Real>::VariableDivergence VariableDivergence;
348 : typedef typename OutputTools<Real>::VariablePhiValue VariablePhiValue;
349 : typedef typename OutputTools<Real>::VariablePhiGradient VariablePhiGradient;
350 : typedef typename OutputTools<Real>::VariablePhiSecond VariablePhiSecond;
351 : typedef typename OutputTools<Real>::VariablePhiCurl VariablePhiCurl;
352 : typedef typename OutputTools<Real>::VariablePhiDivergence VariablePhiDivergence;
353 : typedef typename OutputTools<Real>::VariableTestValue VariableTestValue;
354 : typedef typename OutputTools<Real>::VariableTestGradient VariableTestGradient;
355 : typedef typename OutputTools<Real>::VariableTestSecond VariableTestSecond;
356 : typedef typename OutputTools<Real>::VariableTestCurl VariableTestCurl;
357 : typedef typename OutputTools<Real>::VariableTestDivergence VariableTestDivergence;
358 :
359 : // types for vector variable
360 : typedef typename OutputTools<RealVectorValue>::VariableValue VectorVariableValue;
361 : typedef typename OutputTools<RealVectorValue>::VariableGradient VectorVariableGradient;
362 : typedef typename OutputTools<RealVectorValue>::VariableSecond VectorVariableSecond;
363 : typedef typename OutputTools<RealVectorValue>::VariableCurl VectorVariableCurl;
364 : typedef typename OutputTools<RealVectorValue>::VariableDivergence VectorVariableDivergence;
365 : typedef typename OutputTools<RealVectorValue>::VariablePhiValue VectorVariablePhiValue;
366 : typedef typename OutputTools<RealVectorValue>::VariablePhiGradient VectorVariablePhiGradient;
367 : typedef typename OutputTools<RealVectorValue>::VariablePhiSecond VectorVariablePhiSecond;
368 : typedef typename OutputTools<RealVectorValue>::VariablePhiCurl VectorVariablePhiCurl;
369 : typedef typename OutputTools<RealVectorValue>::VariablePhiDivergence VectorVariablePhiDivergence;
370 : typedef typename OutputTools<RealVectorValue>::VariableTestValue VectorVariableTestValue;
371 : typedef typename OutputTools<RealVectorValue>::VariableTestGradient VectorVariableTestGradient;
372 : typedef typename OutputTools<RealVectorValue>::VariableTestSecond VectorVariableTestSecond;
373 : typedef typename OutputTools<RealVectorValue>::VariableTestCurl VectorVariableTestCurl;
374 : typedef typename OutputTools<RealVectorValue>::VariableTestDivergence VectorVariableTestDivergence;
375 :
376 : // types for array variable
377 : typedef typename OutputTools<RealEigenVector>::VariableValue ArrayVariableValue;
378 : typedef typename OutputTools<ADRealEigenVector>::VariableValue ADArrayVariableValue;
379 : typedef typename OutputTools<RealEigenVector>::VariableGradient ArrayVariableGradient;
380 : typedef typename OutputTools<ADRealEigenVector>::VariableGradient ADArrayVariableGradient;
381 : typedef typename OutputTools<RealEigenVector>::VariableSecond ArrayVariableSecond;
382 : typedef typename OutputTools<RealEigenVector>::VariableCurl ArrayVariableCurl;
383 : typedef typename OutputTools<RealEigenVector>::VariableDivergence ArrayVariableDivergence;
384 : typedef typename OutputTools<RealEigenVector>::VariablePhiValue ArrayVariablePhiValue;
385 : typedef typename OutputTools<RealEigenVector>::VariablePhiGradient ArrayVariablePhiGradient;
386 : typedef std::vector<std::vector<Eigen::Map<RealDIMValue>>> MappedArrayVariablePhiGradient;
387 : typedef typename OutputTools<RealEigenVector>::VariablePhiSecond ArrayVariablePhiSecond;
388 : typedef typename OutputTools<RealEigenVector>::VariablePhiCurl ArrayVariablePhiCurl;
389 : typedef typename OutputTools<RealEigenVector>::VariablePhiDivergence ArrayVariablePhiDivergence;
390 : typedef typename OutputTools<RealEigenVector>::VariableTestValue ArrayVariableTestValue;
391 : typedef typename OutputTools<RealEigenVector>::VariableTestGradient ArrayVariableTestGradient;
392 : typedef typename OutputTools<RealEigenVector>::VariableTestSecond ArrayVariableTestSecond;
393 : typedef typename OutputTools<RealEigenVector>::VariableTestCurl ArrayVariableTestCurl;
394 : typedef typename OutputTools<RealEigenVector>::VariableTestDivergence ArrayVariableTestDivergence;
395 :
396 : /**
397 : * AD Array typedefs
398 : */
399 : /*
400 : typedef typename OutputTools<ADRealEigenVector>::VariableTestValue ADArrayVariableTestValue;
401 : typedef typename OutputTools<ADRealEigenVector>::VariableTestGradient ADArrayVariableTestGradient;
402 : */
403 : /**
404 : * AD typedefs
405 : */
406 : typedef libMesh::VectorValue<ADReal> ADRealVectorValue;
407 : typedef ADRealVectorValue ADRealGradient;
408 : typedef libMesh::VectorValue<ADReal> ADPoint;
409 : typedef libMesh::TensorValue<ADReal> ADRealTensorValue;
410 : typedef libMesh::DenseMatrix<ADReal> ADDenseMatrix;
411 : typedef libMesh::DenseVector<ADReal> ADDenseVector;
412 : typedef MooseArray<ADReal> ADVariableValue;
413 : typedef MooseArray<ADRealVectorValue> ADVariableGradient;
414 : typedef MooseArray<ADRealTensorValue> ADVariableSecond;
415 : typedef MooseArray<ADRealVectorValue> ADVectorVariableValue;
416 : typedef MooseArray<ADRealTensorValue> ADVectorVariableGradient;
417 : typedef MooseArray<libMesh::TypeNTensor<3, ADReal>> ADVectorVariableSecond;
418 : typedef MooseArray<ADRealVectorValue> ADVectorVariableCurl;
419 :
420 : namespace Moose
421 : {
422 :
423 : // type conversion from regular to AD
424 : template <typename T>
425 : struct ADType
426 : {
427 : // unless a specialization exists we assume there is no specific AD type
428 : typedef T type;
429 : };
430 :
431 : template <>
432 : struct ADType<Real>
433 : {
434 : typedef ADReal type;
435 : };
436 : template <>
437 : struct ADType<ChainedReal>
438 : {
439 : typedef ChainedADReal type;
440 : };
441 : template <>
442 : struct ADType<Point>
443 : {
444 : typedef ADPoint type;
445 : };
446 :
447 : template <>
448 : struct ADType<RealVectorValue>
449 : {
450 : typedef ADRealVectorValue type;
451 : };
452 : template <>
453 : struct ADType<RankTwoTensor>
454 : {
455 : typedef ADRankTwoTensor type;
456 : };
457 : template <>
458 : struct ADType<RankThreeTensor>
459 : {
460 : typedef ADRankThreeTensor type;
461 : };
462 : template <>
463 : struct ADType<RankFourTensor>
464 : {
465 : typedef ADRankFourTensor type;
466 : };
467 :
468 : template <>
469 : struct ADType<SymmetricRankTwoTensor>
470 : {
471 : typedef ADSymmetricRankTwoTensor type;
472 : };
473 : template <>
474 : struct ADType<SymmetricRankFourTensor>
475 : {
476 : typedef ADSymmetricRankFourTensor type;
477 : };
478 :
479 : template <template <typename T> class W, typename T>
480 : struct ADType<W<T>>
481 : {
482 : typedef W<typename ADType<T>::type> type;
483 : };
484 :
485 : template <typename T>
486 : struct ADType<std::vector<T, std::allocator<T>>>
487 : {
488 : typedef typename ADType<T>::type adT;
489 : typedef std::vector<adT, std::allocator<adT>> type;
490 : };
491 :
492 : template <typename T>
493 : struct ADType<std::list<T, std::allocator<T>>>
494 : {
495 : typedef typename ADType<T>::type adT;
496 : typedef std::list<adT, std::allocator<adT>> type;
497 : };
498 :
499 : template <typename T>
500 : struct ADType<std::set<T, std::less<T>, std::allocator<T>>>
501 : {
502 : typedef typename ADType<T>::type adT;
503 : typedef std::set<adT, std::less<adT>, std::allocator<adT>> type;
504 : };
505 :
506 : template <typename T>
507 : struct ADType<DenseVector<T>>
508 : {
509 : typedef DenseVector<typename ADType<T>::type> type;
510 : };
511 :
512 : template <typename T>
513 : struct ADType<DenseMatrix<T>>
514 : {
515 : typedef DenseMatrix<typename ADType<T>::type> type;
516 : };
517 :
518 : template <>
519 : struct ADType<RealEigenVector>
520 : {
521 : typedef ADRealEigenVector type;
522 : };
523 :
524 : template <>
525 : struct ADType<RealEigenMatrix>
526 : {
527 : typedef ADRealEigenMatrix type;
528 : };
529 :
530 : template <>
531 : struct ADType<VariableValue>
532 : {
533 : typedef ADVariableValue type;
534 : };
535 : template <>
536 : struct ADType<VariableGradient>
537 : {
538 : typedef ADVariableGradient type;
539 : };
540 : template <>
541 : struct ADType<VariableSecond>
542 : {
543 : typedef ADVariableSecond type;
544 : };
545 :
546 : template <>
547 : struct ADType<ADReal>
548 : {
549 : typedef ADReal type;
550 : };
551 : template <>
552 : struct ADType<ChainedADReal>
553 : {
554 : typedef ChainedADReal type;
555 : };
556 : template <>
557 : struct ADType<ADRankTwoTensor>
558 : {
559 : typedef ADRankTwoTensor type;
560 : };
561 : template <>
562 : struct ADType<ADRankThreeTensor>
563 : {
564 : typedef ADRankThreeTensor type;
565 : };
566 : template <>
567 : struct ADType<ADRankFourTensor>
568 : {
569 : typedef ADRankFourTensor type;
570 : };
571 :
572 : template <>
573 : struct ADType<ADSymmetricRankTwoTensor>
574 : {
575 : typedef ADSymmetricRankTwoTensor type;
576 : };
577 : template <>
578 : struct ADType<ADSymmetricRankFourTensor>
579 : {
580 : typedef ADSymmetricRankFourTensor type;
581 : };
582 :
583 : template <>
584 : struct ADType<ADVariableValue>
585 : {
586 : typedef ADVariableValue type;
587 : };
588 : template <>
589 : struct ADType<ADVariableGradient>
590 : {
591 : typedef ADVariableGradient type;
592 : };
593 : template <>
594 : struct ADType<ADVariableSecond>
595 : {
596 : typedef ADVariableSecond type;
597 : };
598 :
599 : template <typename T>
600 : struct IsADType
601 : {
602 : static constexpr bool value = false;
603 : };
604 :
605 : template <>
606 : struct IsADType<ADReal>
607 : {
608 : static constexpr bool value = true;
609 : };
610 :
611 : template <>
612 : struct IsADType<ADPoint>
613 : {
614 : static constexpr bool value = true;
615 : };
616 :
617 : template <template <typename T, typename... Args> class W, typename T, typename... Args>
618 : struct IsADType<W<T, Args...>>
619 : {
620 : static constexpr bool value = IsADType<T>::value;
621 : };
622 :
623 : template <typename T, typename... Args>
624 : struct IsADType<MetaPhysicL::DualNumber<T, Args...>>
625 : {
626 : static constexpr bool value = true;
627 : };
628 :
629 : /**
630 : * This is a helper variable template for cases when we want to use a default compile-time
631 : * error with constexpr-based if conditions. The templating delays the triggering
632 : * of the static assertion until the template is instantiated.
633 : */
634 : template <class... Ts>
635 : constexpr std::false_type always_false{};
636 :
637 : } // namespace Moose
638 :
639 : /**
640 : * some AD typedefs for backwards compatibility
641 : */
642 : typedef ADRealVectorValue ADRealVectorValue;
643 : typedef ADRealTensorValue ADRealTensorValue;
644 : typedef ADRealGradient ADRealGradient;
645 :
646 : template <typename T>
647 : using ADTemplateVariableValue =
648 : typename OutputTools<typename Moose::ADType<T>::type>::VariableValue;
649 : template <typename T>
650 : using ADTemplateVariableGradient =
651 : typename OutputTools<typename Moose::ADType<T>::type>::VariableGradient;
652 : template <typename T>
653 : using ADTemplateVariableSecond =
654 : typename OutputTools<typename Moose::ADType<T>::type>::VariableSecond;
655 : template <typename T>
656 : using ADTemplateVariableCurl = typename OutputTools<typename Moose::ADType<T>::type>::VariableCurl;
657 :
658 : typedef VariableTestValue ADVariableTestValue;
659 : typedef VariableTestGradient ADVariableTestGradient;
660 : typedef VariableTestSecond ADVariableTestSecond;
661 : typedef VectorVariableTestValue ADVectorVariableTestValue;
662 : typedef VectorVariableTestGradient ADVectorVariableTestGradient;
663 : typedef VectorVariableTestSecond ADVectorVariableTestSecond;
664 :
665 : // We can use the non-ad version for test values because these don't depend on the mesh
666 : // displacements (unless the location of the quadrature points depend on the mesh displacements...)
667 : template <typename T>
668 : using ADTemplateVariableTestValue = typename OutputTools<T>::VariableTestValue;
669 : template <typename T>
670 : using ADTemplateVariablePhiValue = typename OutputTools<T>::VariablePhiValue;
671 :
672 : // We need to use the AD version for test gradients and seconds because these *do* depend on the
673 : // mesh displacements
674 : template <typename T>
675 : using ADTemplateVariableTestGradient =
676 : typename OutputTools<typename Moose::ADType<T>::type>::VariableTestGradient;
677 : template <typename T>
678 : using ADTemplateVariableTestSecond =
679 : typename OutputTools<typename Moose::ADType<T>::type>::VariableTestSecond;
680 : template <typename T>
681 : using ADTemplateVariablePhiGradient =
682 : typename OutputTools<typename Moose::ADType<T>::type>::VariablePhiGradient;
683 : using ADVariablePhiGradient = ADTemplateVariablePhiGradient<Real>;
684 :
685 : // Templated typed to support is_ad templated classes
686 : namespace Moose
687 : {
688 : template <typename T, bool is_ad>
689 : using GenericType = typename std::conditional<is_ad, typename ADType<T>::type, T>::type;
690 : }
691 :
692 : template <bool is_ad>
693 : using GenericReal = Moose::GenericType<Real, is_ad>;
694 : template <bool is_ad>
695 : using GenericChainedReal = Moose::GenericType<ChainedReal, is_ad>;
696 : template <bool is_ad>
697 : using GenericRealVectorValue = Moose::GenericType<RealVectorValue, is_ad>;
698 : template <bool is_ad>
699 : using GenericRealTensorValue = Moose::GenericType<RealTensorValue, is_ad>;
700 : template <bool is_ad>
701 : using GenericRankTwoTensor = Moose::GenericType<RankTwoTensor, is_ad>;
702 : template <bool is_ad>
703 : using GenericRankThreeTensor = Moose::GenericType<RankThreeTensor, is_ad>;
704 : template <bool is_ad>
705 : using GenericRankFourTensor = Moose::GenericType<RankFourTensor, is_ad>;
706 : template <bool is_ad>
707 : using GenericVariableValue = Moose::GenericType<VariableValue, is_ad>;
708 : template <bool is_ad>
709 : using GenericVectorVariableValue = Moose::GenericType<VectorVariableValue, is_ad>;
710 : template <bool is_ad>
711 : using GenericVariableGradient = Moose::GenericType<VariableGradient, is_ad>;
712 : template <bool is_ad>
713 : using GenericVariableSecond = Moose::GenericType<VariableSecond, is_ad>;
714 : template <bool is_ad>
715 : using GenericDenseVector = Moose::GenericType<DenseVector<Real>, is_ad>;
716 : template <bool is_ad>
717 : using GenericDenseMatrix = Moose::GenericType<DenseMatrix<Real>, is_ad>;
718 : template <bool is_ad>
719 : using GenericRealEigenVector = Moose::GenericType<RealEigenVector, is_ad>;
720 : template <bool is_ad>
721 : using GenericRealEigenMatrix = Moose::GenericType<RealEigenMatrix, is_ad>;
722 :
723 : namespace Moose
724 : {
725 : extern const processor_id_type INVALID_PROCESSOR_ID;
726 : extern const SubdomainID ANY_BLOCK_ID;
727 : extern const SubdomainID INVALID_BLOCK_ID;
728 : extern const BoundaryID ANY_BOUNDARY_ID;
729 : extern const BoundaryID INVALID_BOUNDARY_ID;
730 : extern const TagID INVALID_TAG_ID;
731 : extern const TagTypeID INVALID_TAG_TYPE_ID;
732 : const std::set<SubdomainID> EMPTY_BLOCK_IDS = {};
733 : const std::set<BoundaryID> EMPTY_BOUNDARY_IDS = {};
734 :
735 : /**
736 : * MaterialData types
737 : *
738 : * @see FEProblemBase, MaterialPropertyInterface
739 : */
740 : enum MaterialDataType
741 : {
742 : BLOCK_MATERIAL_DATA,
743 : BOUNDARY_MATERIAL_DATA,
744 : FACE_MATERIAL_DATA,
745 : NEIGHBOR_MATERIAL_DATA,
746 : INTERFACE_MATERIAL_DATA
747 : };
748 :
749 : /**
750 : * Flag for AuxKernel related execution type.
751 : */
752 : enum AuxGroup
753 : {
754 : PRE_IC = 0,
755 : PRE_AUX = 1,
756 : POST_AUX = 2,
757 : ALL = 3
758 : };
759 :
760 : /**
761 : * Framework-wide stuff
762 : */
763 : enum VarKindType
764 : {
765 : VAR_SOLVER,
766 : VAR_AUXILIARY,
767 : VAR_ANY
768 : };
769 :
770 : enum VarFieldType
771 : {
772 : VAR_FIELD_STANDARD,
773 : VAR_FIELD_SCALAR,
774 : VAR_FIELD_VECTOR,
775 : VAR_FIELD_ARRAY,
776 : VAR_FIELD_ANY
777 : };
778 :
779 : enum CouplingType
780 : {
781 : COUPLING_DIAG,
782 : COUPLING_FULL,
783 : COUPLING_CUSTOM
784 : };
785 :
786 : enum ConstraintSideType
787 : {
788 : SIDE_PRIMARY,
789 : SIDE_SECONDARY
790 : };
791 :
792 : enum DGResidualType
793 : {
794 : Element,
795 : Neighbor
796 : };
797 :
798 : enum DGJacobianType
799 : {
800 : ElementElement,
801 : ElementNeighbor,
802 : NeighborElement,
803 : NeighborNeighbor
804 : };
805 :
806 : enum ConstraintType
807 : {
808 : Secondary = Element,
809 : Primary = Neighbor
810 : };
811 :
812 : enum class ElementType : unsigned int
813 : {
814 : Element = DGResidualType::Element,
815 : Neighbor = DGResidualType::Neighbor,
816 : Lower = DGResidualType::Neighbor + 1
817 : };
818 :
819 : enum class MortarType : unsigned int
820 : {
821 : Secondary = static_cast<unsigned int>(Moose::ElementType::Element),
822 : Primary = static_cast<unsigned int>(Moose::ElementType::Neighbor),
823 : Lower = static_cast<unsigned int>(Moose::ElementType::Lower)
824 : };
825 :
826 : /**
827 : * The type of nonlinear computation being performed
828 : */
829 : enum class ComputeType
830 : {
831 : Residual,
832 : Jacobian,
833 : ResidualAndJacobian
834 : };
835 :
836 : /**
837 : * The filter type applied to a particular piece of "restartable" data. These filters
838 : * will be applied during deserialization to include or exclude data as appropriate.
839 : */
840 : enum class RESTARTABLE_FILTER : unsigned char
841 : {
842 : RECOVERABLE
843 : };
844 :
845 : enum ConstraintJacobianType
846 : {
847 : SecondarySecondary = ElementElement,
848 : SecondaryPrimary = ElementNeighbor,
849 : PrimarySecondary = NeighborElement,
850 : PrimaryPrimary = NeighborNeighbor,
851 : LowerLower,
852 : LowerSecondary,
853 : LowerPrimary,
854 : SecondaryLower,
855 : PrimaryLower
856 : };
857 :
858 : enum CoordinateSystemType : int
859 : {
860 : COORD_XYZ = 0,
861 : COORD_RZ,
862 : COORD_RSPHERICAL
863 : };
864 :
865 : /**
866 : * Preconditioning side
867 : */
868 : enum PCSideType
869 : {
870 : PCS_LEFT,
871 : PCS_RIGHT,
872 : PCS_SYMMETRIC,
873 : PCS_DEFAULT ///< Use whatever we have in PETSc
874 : };
875 :
876 : /**
877 : * Norm type for converge test
878 : */
879 : enum MooseKSPNormType
880 : {
881 : KSPN_NONE,
882 : KSPN_PRECONDITIONED,
883 : KSPN_UNPRECONDITIONED,
884 : KSPN_NATURAL,
885 : KSPN_DEFAULT ///< Use whatever we have in PETSc
886 : };
887 :
888 : /**
889 : * Type of the solve
890 : */
891 : enum SolveType
892 : {
893 : ST_PJFNK, ///< Preconditioned Jacobian-Free Newton Krylov
894 : ST_JFNK, ///< Jacobian-Free Newton Krylov
895 : ST_NEWTON, ///< Full Newton Solve
896 : ST_FD, ///< Use finite differences to compute Jacobian
897 : ST_LINEAR ///< Solving a linear problem
898 : };
899 :
900 : /**
901 : * Type of the eigen solve
902 : */
903 : enum EigenSolveType
904 : {
905 : EST_POWER, ///< Power / Inverse / RQI
906 : EST_ARNOLDI, ///< Arnoldi
907 : EST_KRYLOVSCHUR, ///< Krylov-Schur
908 : EST_JACOBI_DAVIDSON, ///< Jacobi-Davidson
909 : EST_NONLINEAR_POWER, ///< Nonlinear inverse power
910 : EST_NEWTON, ///< Newton-based eigensolver with an assembled Jacobian matrix (fully coupled by default)
911 : EST_PJFNK, ///< Preconditioned Jacobian-free Newton Krylov
912 : EST_PJFNKMO, ///< The same as PJFNK except that matrix-vector multiplication is employed to replace residual evaluation in linear solver
913 : EST_JFNK ///< Jacobian-free Newton Krylov
914 : };
915 :
916 : /**
917 : * Type of the eigen problem
918 : */
919 : enum EigenProblemType
920 : {
921 : EPT_HERMITIAN, ///< Hermitian
922 : EPT_NON_HERMITIAN, ///< Non-Hermitian
923 : EPT_GEN_HERMITIAN, ///< Generalized Hermitian
924 : EPT_GEN_INDEFINITE, ///< Generalized Hermitian indefinite
925 : EPT_GEN_NON_HERMITIAN, ///< Generalized Non-Hermitian
926 : EPT_POS_GEN_NON_HERMITIAN, ///< Generalized Non-Hermitian with positive (semi-)definite B
927 : EPT_SLEPC_DEFAULT ///< use whatever SLPEC has by default
928 : };
929 :
930 : /**
931 : * Which eigen pairs
932 : */
933 : enum WhichEigenPairs
934 : {
935 : WEP_LARGEST_MAGNITUDE, ///< largest magnitude
936 : WEP_SMALLEST_MAGNITUDE, ///< smallest magnitude
937 : WEP_LARGEST_REAL, ///< largest real
938 : WEP_SMALLEST_REAL, ///< smallest real
939 : WEP_LARGEST_IMAGINARY, ///< largest imaginary
940 : WEP_SMALLEST_IMAGINARY, ///< smallest imaginary
941 : WEP_TARGET_MAGNITUDE, ///< target magnitude
942 : WEP_TARGET_REAL, ///< target real
943 : WEP_TARGET_IMAGINARY, ///< target imaginary
944 : WEP_ALL_EIGENVALUES, ///< all eigenvalues
945 : WEP_SLEPC_DEFAULT ///< use whatever we have in SLEPC
946 : };
947 :
948 : /**
949 : * Time integrators
950 : */
951 : enum TimeIntegratorType
952 : {
953 : TI_IMPLICIT_EULER,
954 : TI_EXPLICIT_EULER,
955 : TI_CRANK_NICOLSON,
956 : TI_BDF2,
957 : TI_EXPLICIT_MIDPOINT,
958 : TI_LSTABLE_DIRK2,
959 : TI_EXPLICIT_TVD_RK_2,
960 : TI_NEWMARK_BETA
961 : };
962 :
963 : /**
964 : * Type of constraint formulation
965 : */
966 : enum ConstraintFormulationType
967 : {
968 : Penalty,
969 : Kinematic
970 : };
971 : /**
972 : * Type of the line search
973 : */
974 : enum LineSearchType
975 : {
976 : LS_INVALID, ///< means not set
977 : LS_DEFAULT,
978 : LS_NONE,
979 : LS_BASIC,
980 : LS_SHELL,
981 : LS_CONTACT,
982 : LS_PROJECT,
983 : LS_L2,
984 : LS_BT,
985 : LS_CP
986 : };
987 :
988 : /**
989 : * Type of the matrix-free finite-differencing parameter
990 : */
991 : enum MffdType
992 : {
993 : MFFD_INVALID, ///< means not set
994 : MFFD_WP,
995 : MFFD_DS
996 : };
997 :
998 : /**
999 : * Type of patch update strategy for modeling node-face constraints or contact
1000 : */
1001 : enum PatchUpdateType
1002 : {
1003 : Never,
1004 : Always,
1005 : Auto,
1006 : Iteration
1007 : };
1008 :
1009 : /**
1010 : * Main types of Relationship Managers
1011 : */
1012 : enum class RelationshipManagerType : unsigned char
1013 : {
1014 : DEFAULT = 0,
1015 : GEOMETRIC = 1 << 0,
1016 : ALGEBRAIC = 1 << 1,
1017 : COUPLING = 1 << 2
1018 : };
1019 :
1020 : enum RMSystemType
1021 : {
1022 : NONLINEAR,
1023 : AUXILIARY,
1024 : NONE
1025 : };
1026 :
1027 : enum VectorTagType
1028 : {
1029 : VECTOR_TAG_RESIDUAL = 0,
1030 : VECTOR_TAG_SOLUTION = 1,
1031 : VECTOR_TAG_ANY = 2
1032 : };
1033 :
1034 : /**
1035 : * The type for the callback to set RelationshipManager parameters
1036 : */
1037 : typedef std::function<void(const InputParameters &, InputParameters &)>
1038 : RelationshipManagerInputParameterCallback;
1039 :
1040 : std::string stringify(const Moose::RelationshipManagerType & t);
1041 : std::string stringify(const Moose::TimeIntegratorType & t);
1042 :
1043 : /**
1044 : * Struct that all MOOSE derivative strings derive from
1045 : */
1046 : struct DerivativeStringClass
1047 : {
1048 : };
1049 :
1050 : /**
1051 : * Replacement for std::span which we only get in c++20. This concept was generated in conversation
1052 : * with chatgpt-5. A few notes
1053 : * - Denoting all methods as const is apparently the standard idiom for span views
1054 : * - We mark all these methods as noexcept because they are trivial. E.g. we do no bounds checking
1055 : * or anything like that so there are no possibilities for throwing exceptions. By marking
1056 : * noexcept we are making this property known to the compiler so it can potentially perform
1057 : * optimizations
1058 : */
1059 : template <typename T>
1060 : class Span
1061 : {
1062 : public:
1063 : using element_type = T;
1064 : using size_type = std::size_t;
1065 : using pointer = T *;
1066 : using reference = T &;
1067 :
1068 222506 : constexpr Span(T * ptr, size_type n) noexcept : _ptr(ptr), _n(n) {}
1069 :
1070 : // observers (enough for std::data / std::size)
1071 : constexpr pointer data() const noexcept { return _ptr; }
1072 219818 : constexpr size_type size() const noexcept { return _n; }
1073 : constexpr bool empty() const noexcept { return _n == 0; }
1074 :
1075 : // optional element/iterator access
1076 230570 : constexpr reference operator[](size_type i) const noexcept { return _ptr[i]; }
1077 2688 : constexpr pointer begin() const noexcept { return _ptr; }
1078 2688 : constexpr pointer end() const noexcept { return _ptr + _n; }
1079 :
1080 : private:
1081 : T * _ptr;
1082 : size_type _n;
1083 : };
1084 :
1085 : /**
1086 : * Helper function for creating a span from a given \p container. This helper function will
1087 : * automatically deduce whether we're spanning over non-const or const elements */
1088 : template <class C>
1089 : auto
1090 15900 : makeSpan(C & container, std::size_t offset, std::size_t n)
1091 : {
1092 : using PointerType = decltype(std::data(container));
1093 : using ElementType = std::remove_pointer_t<PointerType>;
1094 15900 : return Moose::Span<ElementType>{std::data(container) + offset, n};
1095 : }
1096 : } // namespace Moose
1097 :
1098 : namespace libMesh
1099 : {
1100 : template <>
1101 : inline void
1102 0 : print_helper(std::ostream & os, const Moose::RelationshipManagerType * param)
1103 : {
1104 : // Specialization so that we don't print out unprintable characters
1105 0 : os << Moose::stringify(*param);
1106 0 : }
1107 : } // namespace libMesh
1108 :
1109 : template <>
1110 : struct enable_bitmask_operators<Moose::RelationshipManagerType>
1111 : {
1112 : static const bool enable = true;
1113 : };
1114 :
1115 : /**
1116 : * This Macro is used to generate std::string derived types useful for
1117 : * strong type checking and special handling in the GUI. It does not
1118 : * extend std::string in any way so it is generally "safe"
1119 : *
1120 : * Be sure to use the DerivativeStringToJSON macro for new types in
1121 : * MooseTypes.C to also define to_json for each
1122 : */
1123 : #define MooseDerivativeStringClass(TheName) \
1124 : class TheName : public std::string, public Moose::DerivativeStringClass \
1125 : { \
1126 : public: \
1127 : TheName() : std::string() {} \
1128 : TheName(const std::string & str) : std::string(str) {} \
1129 : TheName(const std::string & str, size_t pos, size_t n = npos) : std::string(str, pos, n) {} \
1130 : TheName(const char * s, size_t n) : std::string(s, n) {} \
1131 : TheName(const char * s) : std::string(s) {} \
1132 : TheName(size_t n, char c) : std::string(n, c) {} \
1133 : }; \
1134 : namespace nlohmann \
1135 : { \
1136 : template <> \
1137 : struct adl_serializer<TheName> \
1138 : { \
1139 : static void to_json(json & j, const TheName & v); \
1140 : }; \
1141 : } \
1142 : static_assert(true, "")
1143 :
1144 : // Instantiate new Types
1145 :
1146 : /// This type is for expected (i.e. input) file names or paths that your simulation needs.
1147 : /// If relative types are assigned to this type, they are replaced with an absolute path
1148 : /// that is relative to the context of the parameter (usually the input file).
1149 526267 : MooseDerivativeStringClass(FileName);
1150 :
1151 : /// Similar to FileName but without an extension
1152 1156339 : MooseDerivativeStringClass(FileNameNoExtension);
1153 :
1154 : /// This type is for expected filenames that should be relative and will not have their
1155 : /// values set to absolute paths like FileName
1156 0 : MooseDerivativeStringClass(RelativeFileName);
1157 :
1158 : /// This type is for files used in the DataFileInterface, which enables searching of files
1159 : /// within the registered data directory
1160 10367 : MooseDerivativeStringClass(DataFileName);
1161 :
1162 : /// This type is similar to "FileName", but is used to further filter file dialogs on known file mesh types
1163 338586 : MooseDerivativeStringClass(MeshFileName);
1164 :
1165 : /// This type is similar to "FileName", but is used to further filter file dialogs on known matrix file types
1166 37664 : MooseDerivativeStringClass(MatrixFileName);
1167 :
1168 : /// This type is for output file base
1169 163198 : MooseDerivativeStringClass(OutFileBase);
1170 :
1171 : /// This type is used for objects that expect nonlinear variable names (i.e. Kernels, BCs)
1172 2425759 : MooseDerivativeStringClass(NonlinearVariableName);
1173 :
1174 : /// This type is used for objects that expect linear variable names (i.e. LinearFVKernels, LinearFVBCs)
1175 56534 : MooseDerivativeStringClass(LinearVariableName);
1176 :
1177 : /// This type is used for objects that expect linear or nonlinear solver variable names
1178 4607746 : MooseDerivativeStringClass(SolverVariableName);
1179 :
1180 : /// This type is used for objects that expect Auxiliary variable names (i.e. AuxKernels, AuxBCs)
1181 896868 : MooseDerivativeStringClass(AuxVariableName);
1182 :
1183 : /// This type is used for objects that expect either Solver or Auxiliary Variables such as postprocessors
1184 1836674 : MooseDerivativeStringClass(VariableName);
1185 :
1186 : /// This type is used for objects that expect Boundary Names/Ids read from or generated on the current mesh
1187 2880605 : MooseDerivativeStringClass(BoundaryName);
1188 :
1189 : /// This type is similar to BoundaryName but is used for "blocks" or subdomains in the current mesh
1190 2606380 : MooseDerivativeStringClass(SubdomainName);
1191 :
1192 : /// This type is used for objects that expect Postprocessor objects
1193 2906859 : MooseDerivativeStringClass(PostprocessorName);
1194 :
1195 : /// This type is used for objects that expect VectorPostprocessor objects
1196 100602 : MooseDerivativeStringClass(VectorPostprocessorName);
1197 :
1198 : /// This type is used for objects that expect MeshDivision objects
1199 108524 : MooseDerivativeStringClass(MeshDivisionName);
1200 :
1201 : /// This type is used for objects that expect Moose Function objects
1202 2466126 : MooseDerivativeStringClass(FunctionName);
1203 :
1204 : /// This type is used for objects that expect Moose Distribution objects
1205 7856 : MooseDerivativeStringClass(DistributionName);
1206 :
1207 : /// This type is used for objects that expect Moose Sampler objects
1208 7588 : MooseDerivativeStringClass(SamplerName);
1209 :
1210 : /// This type is used for objects that expect "UserObject" names
1211 256383 : MooseDerivativeStringClass(UserObjectName);
1212 :
1213 : /// This type is used for referencing finite-volume interpolation methods
1214 13850 : MooseDerivativeStringClass(InterpolationMethodName);
1215 :
1216 : /// This type is used for objects that expect an Indicator object name
1217 9239 : MooseDerivativeStringClass(IndicatorName);
1218 :
1219 : /// This type is used for objects that expect an Marker object name
1220 23248 : MooseDerivativeStringClass(MarkerName);
1221 :
1222 : /// This type is used for objects that expect an MultiApp object name
1223 411429 : MooseDerivativeStringClass(MultiAppName);
1224 :
1225 : /// Used for objects the require Output object names
1226 5496815 : MooseDerivativeStringClass(OutputName);
1227 :
1228 : /// Used for objects that expect MaterialProperty names
1229 24607578 : MooseDerivativeStringClass(MaterialPropertyName);
1230 :
1231 : /// Used for objects that expect Moose::Functor names
1232 1998258 : MooseDerivativeStringClass(MooseFunctorName);
1233 :
1234 : /// User for accessing Material objects
1235 10885 : MooseDerivativeStringClass(MaterialName);
1236 :
1237 : /// Tag Name
1238 11202016 : MooseDerivativeStringClass(TagName);
1239 :
1240 : /// Name of MeshGenerators
1241 508345 : MooseDerivativeStringClass(MeshGeneratorName);
1242 :
1243 : /// Name of extra element IDs
1244 14327 : MooseDerivativeStringClass(ExtraElementIDName);
1245 :
1246 : /// Name of a Reporter Value, second argument to ReporterName (see Reporter.h)
1247 717351 : MooseDerivativeStringClass(ReporterValueName);
1248 :
1249 : /// Name of a Component object
1250 1143 : MooseDerivativeStringClass(ComponentName);
1251 :
1252 : /// Name of a Physics object
1253 132 : MooseDerivativeStringClass(PhysicsName);
1254 :
1255 : /// Name of a Positions object
1256 153783 : MooseDerivativeStringClass(PositionsName);
1257 :
1258 : /// Name of a Times object
1259 1243945 : MooseDerivativeStringClass(TimesName);
1260 :
1261 : /// Name of an Executor. Used for inputs to Executors
1262 6617 : MooseDerivativeStringClass(ExecutorName);
1263 :
1264 : /// ParsedFunction/ParsedMaterial etc. FParser expression
1265 51566 : MooseDerivativeStringClass(ParsedFunctionExpression);
1266 :
1267 : /// System name support of multiple nonlinear systems on the same mesh
1268 765454 : MooseDerivativeStringClass(NonlinearSystemName);
1269 :
1270 : /// Name of a Convergence object
1271 1234472 : MooseDerivativeStringClass(ConvergenceName);
1272 :
1273 : /// System name support of multiple linear systems on the same mesh
1274 80460 : MooseDerivativeStringClass(LinearSystemName);
1275 :
1276 : /// Name of a system which either be linear or nonlinear
1277 2183214 : MooseDerivativeStringClass(SolverSystemName);
1278 :
1279 : /// Command line argument, specialized to handle quotes in vector arguments
1280 3228 : MooseDerivativeStringClass(CLIArgString);
1281 :
1282 : #ifdef MOOSE_MFEM_ENABLED
1283 : /**
1284 : * Coefficients used in input for MFEM residual objects
1285 : */
1286 : ///@{
1287 352018 : MooseDerivativeStringClass(MFEMScalarCoefficientName);
1288 125604 : MooseDerivativeStringClass(MFEMVectorCoefficientName);
1289 0 : MooseDerivativeStringClass(MFEMMatrixCoefficientName);
1290 31520 : MooseDerivativeStringClass(MFEMFESpaceName);
1291 18239 : MooseDerivativeStringClass(MFEMSolverName);
1292 : ///@}
1293 : #endif
1294 : /**
1295 : * additional MOOSE typedefs
1296 : */
1297 : typedef std::vector<VariableName> CoupledName;
1298 :
1299 : namespace Moose
1300 : {
1301 : extern const TagName SOLUTION_TAG;
1302 : extern const TagName OLD_SOLUTION_TAG;
1303 : extern const TagName OLDER_SOLUTION_TAG;
1304 : extern const TagName PREVIOUS_NL_SOLUTION_TAG;
1305 : extern const TagName PREVIOUS_FP_SOLUTION_TAG;
1306 : extern const TagName SOLUTION_DOT_TAG;
1307 : extern const TagName SOLUTION_DOTDOT_TAG;
1308 :
1309 : enum class FEBackend
1310 : {
1311 : LibMesh
1312 : #ifdef MOOSE_MFEM_ENABLED
1313 : ,
1314 : MFEM
1315 : #endif
1316 : };
1317 :
1318 : #ifdef MOOSE_KOKKOS_ENABLED
1319 : namespace Kokkos
1320 : {
1321 : // Passkey for calling special constructors for functor copy
1322 : class FunctorCopy
1323 : {
1324 : friend class ResidualObject;
1325 : friend class KernelBase;
1326 : friend class NodalKernelBase;
1327 : friend class BoundaryCondition;
1328 : friend class IntegratedBCBase;
1329 : friend class NodalBCBase;
1330 : friend class MaterialBase;
1331 : friend class Material;
1332 : friend class AuxKernel;
1333 : friend class FunctionBase;
1334 : friend class UserObject;
1335 : friend class ElementUserObject;
1336 : friend class NodalUserObject;
1337 : friend class SideUserObject;
1338 : friend class GeneralUserObject;
1339 : friend class ElementReducer;
1340 : friend class NodalReducer;
1341 : friend class SideReducer;
1342 : friend class Postprocessor;
1343 : friend class VectorPostprocessor;
1344 : friend class Reporter;
1345 :
1346 1762787 : FunctorCopy() {}
1347 : FunctorCopy(const FunctorCopy &) {}
1348 : };
1349 : }
1350 : #endif
1351 : }
1352 :
1353 : /// macros for adding Tensor index enums locally
1354 : #define usingTensorIndices(...) \
1355 : enum \
1356 : { \
1357 : __VA_ARGS__ \
1358 : }
|