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<Real, Eigen::Dynamic, Moose::dim> RealVectorArrayValue;
149 : typedef Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim * Moose::dim> RealTensorArrayValue;
150 : typedef Eigen::Matrix<Real, Eigen::Dynamic, Eigen::Dynamic> RealEigenMatrix;
151 : typedef TensorValue<Real> RealTensorValue;
152 :
153 : namespace TensorTools
154 : {
155 : template <>
156 : struct IncrementRank<Eigen::Matrix<Real, Eigen::Dynamic, 1>>
157 : {
158 : typedef Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim> type;
159 : };
160 :
161 : template <>
162 : struct IncrementRank<Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim>>
163 : {
164 : typedef Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim * Moose::dim> type;
165 : };
166 :
167 : template <>
168 : struct DecrementRank<Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim>>
169 : {
170 : typedef Eigen::Matrix<Real, Eigen::Dynamic, 1> type;
171 : };
172 : }
173 : }
174 :
175 : // Common types defined in libMesh
176 : using libMesh::Gradient;
177 : using libMesh::RealGradient;
178 :
179 : // Bring these common types added to the libMesh namespace in this header
180 : // to global namespace
181 : using libMesh::DenseMatrix;
182 : using libMesh::DenseVector;
183 : using libMesh::RealDIMValue;
184 : using libMesh::RealEigenMatrix;
185 : using libMesh::RealEigenVector;
186 : using libMesh::RealTensorArrayValue;
187 : using libMesh::RealTensorValue;
188 : using libMesh::RealVectorArrayValue;
189 : using libMesh::RealVectorValue;
190 :
191 : namespace MetaPhysicL
192 : {
193 : template <typename U>
194 : struct ReplaceAlgebraicType<libMesh::RealEigenVector, U>
195 : {
196 : typedef U type;
197 : };
198 : }
199 :
200 : /**
201 : * various MOOSE typedefs
202 : */
203 : typedef Real PostprocessorValue;
204 : typedef std::vector<Real> VectorPostprocessorValue;
205 : typedef Real ScatterVectorPostprocessorValue;
206 : typedef boundary_id_type BoundaryID;
207 : typedef unsigned int InterfaceID;
208 : typedef subdomain_id_type SubdomainID;
209 : typedef unsigned int MooseObjectID;
210 : typedef unsigned int THREAD_ID;
211 : typedef unsigned int TagID;
212 : typedef unsigned int TagTypeID;
213 : typedef unsigned int PerfID;
214 : typedef unsigned int InvalidSolutionID;
215 : using RestartableDataMapName = std::string; // see MooseApp.h
216 :
217 : typedef libMesh::StoredRange<std::vector<dof_id_type>::iterator, dof_id_type> NodeIdRange;
218 : typedef libMesh::StoredRange<std::vector<const Elem *>::iterator, const Elem *>
219 : ConstElemPointerRange;
220 :
221 : namespace Moose
222 : {
223 :
224 : /// This is used for places where we initialize some qp-sized data structures
225 : /// that would end up being sized too small after the quadrature order gets
226 : /// bumped (dynamically in-sim). So for these cases, we just use this constant
227 : /// to size those data structures overly large to accommodate rather than come
228 : /// up with some overkill complex mechanism for dynamically resizing them.
229 : /// Eventually, we may need or implement that more sophisticated mechanism and
230 : /// will no longer need this.
231 : constexpr std::size_t constMaxQpsPerElem = 1000;
232 :
233 : // These are used by MooseVariableData and MooseVariableDataFV
234 : enum SolutionState : int
235 : {
236 : Current = 0,
237 : Old = 1,
238 : Older = 2,
239 : PreviousNL = -1
240 : };
241 :
242 : enum class SolutionIterationType : unsigned short
243 : {
244 : Time = 0,
245 : Nonlinear = 1,
246 : FixedPoint = 2
247 : };
248 :
249 : // These are used by MooseVariableData and MooseVariableDataFV
250 : enum GeometryType
251 : {
252 : Volume,
253 : Face
254 : };
255 :
256 : template <typename OutputType>
257 : struct ShapeType
258 : {
259 : typedef OutputType type;
260 : };
261 : template <>
262 : struct ShapeType<Eigen::Matrix<Real, Eigen::Dynamic, 1>>
263 : {
264 : typedef Real type;
265 : };
266 :
267 : template <typename OutputType>
268 : struct DOFType
269 : {
270 : typedef OutputType type;
271 : };
272 : template <>
273 : struct DOFType<RealVectorValue>
274 : {
275 : typedef Real type;
276 : };
277 : } // namespace Moose
278 :
279 : template <typename OutputType>
280 : struct OutputTools
281 : {
282 : typedef typename libMesh::TensorTools::IncrementRank<OutputType>::type OutputGradient;
283 : typedef typename libMesh::TensorTools::IncrementRank<OutputGradient>::type OutputSecond;
284 : typedef typename libMesh::TensorTools::DecrementRank<OutputType>::type OutputDivergence;
285 :
286 : typedef MooseArray<OutputType> VariableValue;
287 : typedef MooseArray<OutputGradient> VariableGradient;
288 : typedef MooseArray<OutputSecond> VariableSecond;
289 : typedef MooseArray<OutputType> VariableCurl;
290 : typedef MooseArray<OutputDivergence> VariableDivergence;
291 :
292 : typedef typename Moose::ShapeType<OutputType>::type OutputShape;
293 : typedef typename libMesh::TensorTools::IncrementRank<OutputShape>::type OutputShapeGradient;
294 : typedef typename libMesh::TensorTools::IncrementRank<OutputShapeGradient>::type OutputShapeSecond;
295 : typedef typename libMesh::TensorTools::DecrementRank<OutputShape>::type OutputShapeDivergence;
296 :
297 : typedef MooseArray<std::vector<OutputShape>> VariablePhiValue;
298 : typedef MooseArray<std::vector<OutputShapeGradient>> VariablePhiGradient;
299 : typedef MooseArray<std::vector<OutputShapeSecond>> VariablePhiSecond;
300 : typedef MooseArray<std::vector<OutputShape>> VariablePhiCurl;
301 : typedef MooseArray<std::vector<OutputShapeDivergence>> VariablePhiDivergence;
302 :
303 : typedef MooseArray<std::vector<OutputShape>> VariableTestValue;
304 : typedef MooseArray<std::vector<OutputShapeGradient>> VariableTestGradient;
305 : typedef MooseArray<std::vector<OutputShapeSecond>> VariableTestSecond;
306 : typedef MooseArray<std::vector<OutputShape>> VariableTestCurl;
307 : typedef MooseArray<std::vector<OutputShapeDivergence>> VariableTestDivergence;
308 :
309 : // DoF value type for the template class OutputType
310 : typedef typename Moose::DOFType<OutputType>::type OutputData;
311 : typedef MooseArray<OutputData> DoFValue;
312 : typedef OutputType OutputValue;
313 : };
314 :
315 : // types for standard variable
316 : typedef typename OutputTools<Real>::VariableValue VariableValue;
317 : typedef typename OutputTools<Real>::VariableGradient VariableGradient;
318 : typedef typename OutputTools<Real>::VariableSecond VariableSecond;
319 : typedef typename OutputTools<Real>::VariableCurl VariableCurl;
320 : typedef typename OutputTools<Real>::VariableDivergence VariableDivergence;
321 : typedef typename OutputTools<Real>::VariablePhiValue VariablePhiValue;
322 : typedef typename OutputTools<Real>::VariablePhiGradient VariablePhiGradient;
323 : typedef typename OutputTools<Real>::VariablePhiSecond VariablePhiSecond;
324 : typedef typename OutputTools<Real>::VariablePhiCurl VariablePhiCurl;
325 : typedef typename OutputTools<Real>::VariablePhiDivergence VariablePhiDivergence;
326 : typedef typename OutputTools<Real>::VariableTestValue VariableTestValue;
327 : typedef typename OutputTools<Real>::VariableTestGradient VariableTestGradient;
328 : typedef typename OutputTools<Real>::VariableTestSecond VariableTestSecond;
329 : typedef typename OutputTools<Real>::VariableTestCurl VariableTestCurl;
330 : typedef typename OutputTools<Real>::VariableTestDivergence VariableTestDivergence;
331 :
332 : // types for vector variable
333 : typedef typename OutputTools<RealVectorValue>::VariableValue VectorVariableValue;
334 : typedef typename OutputTools<RealVectorValue>::VariableGradient VectorVariableGradient;
335 : typedef typename OutputTools<RealVectorValue>::VariableSecond VectorVariableSecond;
336 : typedef typename OutputTools<RealVectorValue>::VariableCurl VectorVariableCurl;
337 : typedef typename OutputTools<RealVectorValue>::VariableDivergence VectorVariableDivergence;
338 : typedef typename OutputTools<RealVectorValue>::VariablePhiValue VectorVariablePhiValue;
339 : typedef typename OutputTools<RealVectorValue>::VariablePhiGradient VectorVariablePhiGradient;
340 : typedef typename OutputTools<RealVectorValue>::VariablePhiSecond VectorVariablePhiSecond;
341 : typedef typename OutputTools<RealVectorValue>::VariablePhiCurl VectorVariablePhiCurl;
342 : typedef typename OutputTools<RealVectorValue>::VariablePhiDivergence VectorVariablePhiDivergence;
343 : typedef typename OutputTools<RealVectorValue>::VariableTestValue VectorVariableTestValue;
344 : typedef typename OutputTools<RealVectorValue>::VariableTestGradient VectorVariableTestGradient;
345 : typedef typename OutputTools<RealVectorValue>::VariableTestSecond VectorVariableTestSecond;
346 : typedef typename OutputTools<RealVectorValue>::VariableTestCurl VectorVariableTestCurl;
347 : typedef typename OutputTools<RealVectorValue>::VariableTestDivergence VectorVariableTestDivergence;
348 :
349 : // types for array variable
350 : typedef typename OutputTools<RealEigenVector>::VariableValue ArrayVariableValue;
351 : typedef typename OutputTools<RealEigenVector>::VariableGradient ArrayVariableGradient;
352 : typedef typename OutputTools<RealEigenVector>::VariableSecond ArrayVariableSecond;
353 : typedef typename OutputTools<RealEigenVector>::VariableCurl ArrayVariableCurl;
354 : typedef typename OutputTools<RealEigenVector>::VariableDivergence ArrayVariableDivergence;
355 : typedef typename OutputTools<RealEigenVector>::VariablePhiValue ArrayVariablePhiValue;
356 : typedef typename OutputTools<RealEigenVector>::VariablePhiGradient ArrayVariablePhiGradient;
357 : typedef std::vector<std::vector<Eigen::Map<RealDIMValue>>> MappedArrayVariablePhiGradient;
358 : typedef typename OutputTools<RealEigenVector>::VariablePhiSecond ArrayVariablePhiSecond;
359 : typedef typename OutputTools<RealEigenVector>::VariablePhiCurl ArrayVariablePhiCurl;
360 : typedef typename OutputTools<RealEigenVector>::VariablePhiDivergence ArrayVariablePhiDivergence;
361 : typedef typename OutputTools<RealEigenVector>::VariableTestValue ArrayVariableTestValue;
362 : typedef typename OutputTools<RealEigenVector>::VariableTestGradient ArrayVariableTestGradient;
363 : typedef typename OutputTools<RealEigenVector>::VariableTestSecond ArrayVariableTestSecond;
364 : typedef typename OutputTools<RealEigenVector>::VariableTestCurl ArrayVariableTestCurl;
365 : typedef typename OutputTools<RealEigenVector>::VariableTestDivergence ArrayVariableTestDivergence;
366 :
367 : /**
368 : * AD typedefs
369 : */
370 : typedef libMesh::VectorValue<ADReal> ADRealVectorValue;
371 : typedef ADRealVectorValue ADRealGradient;
372 : typedef libMesh::VectorValue<ADReal> ADPoint;
373 : typedef libMesh::TensorValue<ADReal> ADRealTensorValue;
374 : typedef libMesh::DenseMatrix<ADReal> ADDenseMatrix;
375 : typedef libMesh::DenseVector<ADReal> ADDenseVector;
376 : typedef MooseArray<ADReal> ADVariableValue;
377 : typedef MooseArray<ADRealVectorValue> ADVariableGradient;
378 : typedef MooseArray<ADRealTensorValue> ADVariableSecond;
379 : typedef MooseArray<ADRealVectorValue> ADVectorVariableValue;
380 : typedef MooseArray<ADRealTensorValue> ADVectorVariableGradient;
381 : typedef MooseArray<libMesh::TypeNTensor<3, ADReal>> ADVectorVariableSecond;
382 : typedef MooseArray<ADRealVectorValue> ADVectorVariableCurl;
383 :
384 : namespace Moose
385 : {
386 :
387 : // type conversion from regular to AD
388 : template <typename T>
389 : struct ADType
390 : {
391 : // unless a specialization exists we assume there is no specific AD type
392 : typedef T type;
393 : };
394 :
395 : template <>
396 : struct ADType<Real>
397 : {
398 : typedef ADReal type;
399 : };
400 : template <>
401 : struct ADType<ChainedReal>
402 : {
403 : typedef ChainedADReal type;
404 : };
405 : template <>
406 : struct ADType<Point>
407 : {
408 : typedef ADPoint type;
409 : };
410 :
411 : template <>
412 : struct ADType<RealVectorValue>
413 : {
414 : typedef ADRealVectorValue type;
415 : };
416 : template <>
417 : struct ADType<RankTwoTensor>
418 : {
419 : typedef ADRankTwoTensor type;
420 : };
421 : template <>
422 : struct ADType<RankThreeTensor>
423 : {
424 : typedef ADRankThreeTensor type;
425 : };
426 : template <>
427 : struct ADType<RankFourTensor>
428 : {
429 : typedef ADRankFourTensor type;
430 : };
431 :
432 : template <>
433 : struct ADType<SymmetricRankTwoTensor>
434 : {
435 : typedef ADSymmetricRankTwoTensor type;
436 : };
437 : template <>
438 : struct ADType<SymmetricRankFourTensor>
439 : {
440 : typedef ADSymmetricRankFourTensor type;
441 : };
442 :
443 : template <template <typename T> class W, typename T>
444 : struct ADType<W<T>>
445 : {
446 : typedef W<typename ADType<T>::type> type;
447 : };
448 :
449 : template <typename T>
450 : struct ADType<std::vector<T, std::allocator<T>>>
451 : {
452 : typedef typename ADType<T>::type adT;
453 : typedef std::vector<adT, std::allocator<adT>> type;
454 : };
455 :
456 : template <typename T>
457 : struct ADType<std::list<T, std::allocator<T>>>
458 : {
459 : typedef typename ADType<T>::type adT;
460 : typedef std::list<adT, std::allocator<adT>> type;
461 : };
462 :
463 : template <typename T>
464 : struct ADType<std::set<T, std::less<T>, std::allocator<T>>>
465 : {
466 : typedef typename ADType<T>::type adT;
467 : typedef std::set<adT, std::less<adT>, std::allocator<adT>> type;
468 : };
469 :
470 : template <typename T>
471 : struct ADType<DenseVector<T>>
472 : {
473 : typedef DenseVector<typename ADType<T>::type> type;
474 : };
475 :
476 : template <typename T>
477 : struct ADType<DenseMatrix<T>>
478 : {
479 : typedef DenseMatrix<typename ADType<T>::type> type;
480 : };
481 :
482 : template <>
483 : struct ADType<RealEigenVector>
484 : {
485 : typedef RealEigenVector type;
486 : };
487 : template <>
488 : struct ADType<VariableValue>
489 : {
490 : typedef ADVariableValue type;
491 : };
492 : template <>
493 : struct ADType<VariableGradient>
494 : {
495 : typedef ADVariableGradient type;
496 : };
497 : template <>
498 : struct ADType<VariableSecond>
499 : {
500 : typedef ADVariableSecond type;
501 : };
502 :
503 : template <>
504 : struct ADType<ADReal>
505 : {
506 : typedef ADReal type;
507 : };
508 : template <>
509 : struct ADType<ChainedADReal>
510 : {
511 : typedef ChainedADReal type;
512 : };
513 : template <>
514 : struct ADType<ADRankTwoTensor>
515 : {
516 : typedef ADRankTwoTensor type;
517 : };
518 : template <>
519 : struct ADType<ADRankThreeTensor>
520 : {
521 : typedef ADRankThreeTensor type;
522 : };
523 : template <>
524 : struct ADType<ADRankFourTensor>
525 : {
526 : typedef ADRankFourTensor type;
527 : };
528 :
529 : template <>
530 : struct ADType<ADSymmetricRankTwoTensor>
531 : {
532 : typedef ADSymmetricRankTwoTensor type;
533 : };
534 : template <>
535 : struct ADType<ADSymmetricRankFourTensor>
536 : {
537 : typedef ADSymmetricRankFourTensor type;
538 : };
539 :
540 : template <>
541 : struct ADType<ADVariableValue>
542 : {
543 : typedef ADVariableValue type;
544 : };
545 : template <>
546 : struct ADType<ADVariableGradient>
547 : {
548 : typedef ADVariableGradient type;
549 : };
550 : template <>
551 : struct ADType<ADVariableSecond>
552 : {
553 : typedef ADVariableSecond type;
554 : };
555 :
556 : template <typename T>
557 : struct IsADType
558 : {
559 : static constexpr bool value = false;
560 : };
561 :
562 : template <>
563 : struct IsADType<ADReal>
564 : {
565 : static constexpr bool value = true;
566 : };
567 :
568 : template <>
569 : struct IsADType<ADPoint>
570 : {
571 : static constexpr bool value = true;
572 : };
573 :
574 : template <template <typename T, typename... Args> class W, typename T, typename... Args>
575 : struct IsADType<W<T, Args...>>
576 : {
577 : static constexpr bool value = IsADType<T>::value;
578 : };
579 :
580 : template <typename T, typename... Args>
581 : struct IsADType<MetaPhysicL::DualNumber<T, Args...>>
582 : {
583 : static constexpr bool value = true;
584 : };
585 :
586 : /**
587 : * This is a helper variable template for cases when we want to use a default compile-time
588 : * error with constexpr-based if conditions. The templating delays the triggering
589 : * of the static assertion until the template is instantiated.
590 : */
591 : template <class... Ts>
592 : constexpr std::false_type always_false{};
593 :
594 : } // namespace Moose
595 :
596 : /**
597 : * some AD typedefs for backwards compatibility
598 : */
599 : typedef ADRealVectorValue ADRealVectorValue;
600 : typedef ADRealTensorValue ADRealTensorValue;
601 : typedef ADRealGradient ADRealGradient;
602 :
603 : template <typename T>
604 : using ADTemplateVariableValue =
605 : typename OutputTools<typename Moose::ADType<T>::type>::VariableValue;
606 : template <typename T>
607 : using ADTemplateVariableGradient =
608 : typename OutputTools<typename Moose::ADType<T>::type>::VariableGradient;
609 : template <typename T>
610 : using ADTemplateVariableSecond =
611 : typename OutputTools<typename Moose::ADType<T>::type>::VariableSecond;
612 : template <typename T>
613 : using ADTemplateVariableCurl = typename OutputTools<typename Moose::ADType<T>::type>::VariableCurl;
614 :
615 : typedef VariableTestValue ADVariableTestValue;
616 : typedef VariableTestGradient ADVariableTestGradient;
617 : typedef VariableTestSecond ADVariableTestSecond;
618 : typedef VectorVariableTestValue ADVectorVariableTestValue;
619 : typedef VectorVariableTestGradient ADVectorVariableTestGradient;
620 : typedef VectorVariableTestSecond ADVectorVariableTestSecond;
621 :
622 : // We can use the non-ad version for test values because these don't depend on the mesh
623 : // displacements (unless the location of the quadrature points depend on the mesh displacements...)
624 : template <typename T>
625 : using ADTemplateVariableTestValue = typename OutputTools<T>::VariableTestValue;
626 : template <typename T>
627 : using ADTemplateVariablePhiValue = typename OutputTools<T>::VariablePhiValue;
628 :
629 : // We need to use the AD version for test gradients and seconds because these *do* depend on the
630 : // mesh displacements
631 : template <typename T>
632 : using ADTemplateVariableTestGradient =
633 : typename OutputTools<typename Moose::ADType<T>::type>::VariableTestGradient;
634 : template <typename T>
635 : using ADTemplateVariableTestSecond =
636 : typename OutputTools<typename Moose::ADType<T>::type>::VariableTestSecond;
637 : template <typename T>
638 : using ADTemplateVariablePhiGradient =
639 : typename OutputTools<typename Moose::ADType<T>::type>::VariablePhiGradient;
640 : using ADVariablePhiGradient = ADTemplateVariablePhiGradient<Real>;
641 :
642 : // Templated typed to support is_ad templated classes
643 : namespace Moose
644 : {
645 : template <typename T, bool is_ad>
646 : using GenericType = typename std::conditional<is_ad, typename ADType<T>::type, T>::type;
647 : }
648 :
649 : template <bool is_ad>
650 : using GenericReal = Moose::GenericType<Real, is_ad>;
651 : template <bool is_ad>
652 : using GenericChainedReal = Moose::GenericType<ChainedReal, is_ad>;
653 : template <bool is_ad>
654 : using GenericRealVectorValue = Moose::GenericType<RealVectorValue, is_ad>;
655 : template <bool is_ad>
656 : using GenericRealTensorValue = Moose::GenericType<RealTensorValue, is_ad>;
657 : template <bool is_ad>
658 : using GenericRankTwoTensor = Moose::GenericType<RankTwoTensor, is_ad>;
659 : template <bool is_ad>
660 : using GenericRankThreeTensor = Moose::GenericType<RankThreeTensor, is_ad>;
661 : template <bool is_ad>
662 : using GenericRankFourTensor = Moose::GenericType<RankFourTensor, is_ad>;
663 : template <bool is_ad>
664 : using GenericVariableValue = Moose::GenericType<VariableValue, is_ad>;
665 : template <bool is_ad>
666 : using GenericVectorVariableValue = Moose::GenericType<VectorVariableValue, is_ad>;
667 : template <bool is_ad>
668 : using GenericVariableGradient = Moose::GenericType<VariableGradient, is_ad>;
669 : template <bool is_ad>
670 : using GenericVariableSecond = Moose::GenericType<VariableSecond, is_ad>;
671 : template <bool is_ad>
672 : using GenericDenseVector = Moose::GenericType<DenseVector<Real>, is_ad>;
673 : template <bool is_ad>
674 : using GenericDenseMatrix = Moose::GenericType<DenseMatrix<Real>, is_ad>;
675 :
676 : namespace Moose
677 : {
678 : extern const processor_id_type INVALID_PROCESSOR_ID;
679 : extern const SubdomainID ANY_BLOCK_ID;
680 : extern const SubdomainID INVALID_BLOCK_ID;
681 : extern const BoundaryID ANY_BOUNDARY_ID;
682 : extern const BoundaryID INVALID_BOUNDARY_ID;
683 : extern const TagID INVALID_TAG_ID;
684 : extern const TagTypeID INVALID_TAG_TYPE_ID;
685 : const std::set<SubdomainID> EMPTY_BLOCK_IDS = {};
686 : const std::set<BoundaryID> EMPTY_BOUNDARY_IDS = {};
687 :
688 : /**
689 : * MaterialData types
690 : *
691 : * @see FEProblemBase, MaterialPropertyInterface
692 : */
693 : enum MaterialDataType
694 : {
695 : BLOCK_MATERIAL_DATA,
696 : BOUNDARY_MATERIAL_DATA,
697 : FACE_MATERIAL_DATA,
698 : NEIGHBOR_MATERIAL_DATA,
699 : INTERFACE_MATERIAL_DATA
700 : };
701 :
702 : /**
703 : * Flag for AuxKernel related execution type.
704 : */
705 : enum AuxGroup
706 : {
707 : PRE_IC = 0,
708 : PRE_AUX = 1,
709 : POST_AUX = 2,
710 : ALL = 3
711 : };
712 :
713 : /**
714 : * Framework-wide stuff
715 : */
716 : enum VarKindType
717 : {
718 : VAR_SOLVER,
719 : VAR_AUXILIARY,
720 : VAR_ANY
721 : };
722 :
723 : enum VarFieldType
724 : {
725 : VAR_FIELD_STANDARD,
726 : VAR_FIELD_SCALAR,
727 : VAR_FIELD_VECTOR,
728 : VAR_FIELD_ARRAY,
729 : VAR_FIELD_ANY
730 : };
731 :
732 : enum CouplingType
733 : {
734 : COUPLING_DIAG,
735 : COUPLING_FULL,
736 : COUPLING_CUSTOM
737 : };
738 :
739 : enum ConstraintSideType
740 : {
741 : SIDE_PRIMARY,
742 : SIDE_SECONDARY
743 : };
744 :
745 : enum DGResidualType
746 : {
747 : Element,
748 : Neighbor
749 : };
750 :
751 : enum DGJacobianType
752 : {
753 : ElementElement,
754 : ElementNeighbor,
755 : NeighborElement,
756 : NeighborNeighbor
757 : };
758 :
759 : enum ConstraintType
760 : {
761 : Secondary = Element,
762 : Primary = Neighbor
763 : };
764 :
765 : enum class ElementType : unsigned int
766 : {
767 : Element = DGResidualType::Element,
768 : Neighbor = DGResidualType::Neighbor,
769 : Lower = DGResidualType::Neighbor + 1
770 : };
771 :
772 : enum class MortarType : unsigned int
773 : {
774 : Secondary = static_cast<unsigned int>(Moose::ElementType::Element),
775 : Primary = static_cast<unsigned int>(Moose::ElementType::Neighbor),
776 : Lower = static_cast<unsigned int>(Moose::ElementType::Lower)
777 : };
778 :
779 : /**
780 : * The type of nonlinear computation being performed
781 : */
782 : enum class ComputeType
783 : {
784 : Residual,
785 : Jacobian,
786 : ResidualAndJacobian
787 : };
788 :
789 : /**
790 : * The filter type applied to a particular piece of "restartable" data. These filters
791 : * will be applied during deserialization to include or exclude data as appropriate.
792 : */
793 : enum class RESTARTABLE_FILTER : unsigned char
794 : {
795 : RECOVERABLE
796 : };
797 :
798 : enum ConstraintJacobianType
799 : {
800 : SecondarySecondary = ElementElement,
801 : SecondaryPrimary = ElementNeighbor,
802 : PrimarySecondary = NeighborElement,
803 : PrimaryPrimary = NeighborNeighbor,
804 : LowerLower,
805 : LowerSecondary,
806 : LowerPrimary,
807 : SecondaryLower,
808 : PrimaryLower
809 : };
810 :
811 : enum CoordinateSystemType : int
812 : {
813 : COORD_XYZ = 0,
814 : COORD_RZ,
815 : COORD_RSPHERICAL
816 : };
817 :
818 : /**
819 : * Preconditioning side
820 : */
821 : enum PCSideType
822 : {
823 : PCS_LEFT,
824 : PCS_RIGHT,
825 : PCS_SYMMETRIC,
826 : PCS_DEFAULT ///< Use whatever we have in PETSc
827 : };
828 :
829 : /**
830 : * Norm type for converge test
831 : */
832 : enum MooseKSPNormType
833 : {
834 : KSPN_NONE,
835 : KSPN_PRECONDITIONED,
836 : KSPN_UNPRECONDITIONED,
837 : KSPN_NATURAL,
838 : KSPN_DEFAULT ///< Use whatever we have in PETSc
839 : };
840 :
841 : /**
842 : * Type of the solve
843 : */
844 : enum SolveType
845 : {
846 : ST_PJFNK, ///< Preconditioned Jacobian-Free Newton Krylov
847 : ST_JFNK, ///< Jacobian-Free Newton Krylov
848 : ST_NEWTON, ///< Full Newton Solve
849 : ST_FD, ///< Use finite differences to compute Jacobian
850 : ST_LINEAR ///< Solving a linear problem
851 : };
852 :
853 : /**
854 : * Type of the eigen solve
855 : */
856 : enum EigenSolveType
857 : {
858 : EST_POWER, ///< Power / Inverse / RQI
859 : EST_ARNOLDI, ///< Arnoldi
860 : EST_KRYLOVSCHUR, ///< Krylov-Schur
861 : EST_JACOBI_DAVIDSON, ///< Jacobi-Davidson
862 : EST_NONLINEAR_POWER, ///< Nonlinear inverse power
863 : EST_NEWTON, ///< Newton-based eigensolver with an assembled Jacobian matrix (fully coupled by default)
864 : EST_PJFNK, ///< Preconditioned Jacobian-free Newton Krylov
865 : EST_PJFNKMO, ///< The same as PJFNK except that matrix-vector multiplication is employed to replace residual evaluation in linear solver
866 : EST_JFNK ///< Jacobian-free Newton Krylov
867 : };
868 :
869 : /**
870 : * Type of the eigen problem
871 : */
872 : enum EigenProblemType
873 : {
874 : EPT_HERMITIAN, ///< Hermitian
875 : EPT_NON_HERMITIAN, ///< Non-Hermitian
876 : EPT_GEN_HERMITIAN, ///< Generalized Hermitian
877 : EPT_GEN_INDEFINITE, ///< Generalized Hermitian indefinite
878 : EPT_GEN_NON_HERMITIAN, ///< Generalized Non-Hermitian
879 : EPT_POS_GEN_NON_HERMITIAN, ///< Generalized Non-Hermitian with positive (semi-)definite B
880 : EPT_SLEPC_DEFAULT ///< use whatever SLPEC has by default
881 : };
882 :
883 : /**
884 : * Which eigen pairs
885 : */
886 : enum WhichEigenPairs
887 : {
888 : WEP_LARGEST_MAGNITUDE, ///< largest magnitude
889 : WEP_SMALLEST_MAGNITUDE, ///< smallest magnitude
890 : WEP_LARGEST_REAL, ///< largest real
891 : WEP_SMALLEST_REAL, ///< smallest real
892 : WEP_LARGEST_IMAGINARY, ///< largest imaginary
893 : WEP_SMALLEST_IMAGINARY, ///< smallest imaginary
894 : WEP_TARGET_MAGNITUDE, ///< target magnitude
895 : WEP_TARGET_REAL, ///< target real
896 : WEP_TARGET_IMAGINARY, ///< target imaginary
897 : WEP_ALL_EIGENVALUES, ///< all eigenvalues
898 : WEP_SLEPC_DEFAULT ///< use whatever we have in SLEPC
899 : };
900 :
901 : /**
902 : * Time integrators
903 : */
904 : enum TimeIntegratorType
905 : {
906 : TI_IMPLICIT_EULER,
907 : TI_EXPLICIT_EULER,
908 : TI_CRANK_NICOLSON,
909 : TI_BDF2,
910 : TI_EXPLICIT_MIDPOINT,
911 : TI_LSTABLE_DIRK2,
912 : TI_EXPLICIT_TVD_RK_2,
913 : TI_NEWMARK_BETA
914 : };
915 :
916 : /**
917 : * Type of constraint formulation
918 : */
919 : enum ConstraintFormulationType
920 : {
921 : Penalty,
922 : Kinematic
923 : };
924 : /**
925 : * Type of the line search
926 : */
927 : enum LineSearchType
928 : {
929 : LS_INVALID, ///< means not set
930 : LS_DEFAULT,
931 : LS_NONE,
932 : LS_BASIC,
933 : LS_SHELL,
934 : LS_CONTACT,
935 : LS_PROJECT,
936 : LS_L2,
937 : LS_BT,
938 : LS_CP
939 : };
940 :
941 : /**
942 : * Type of the matrix-free finite-differencing parameter
943 : */
944 : enum MffdType
945 : {
946 : MFFD_INVALID, ///< means not set
947 : MFFD_WP,
948 : MFFD_DS
949 : };
950 :
951 : /**
952 : * Type of patch update strategy for modeling node-face constraints or contact
953 : */
954 : enum PatchUpdateType
955 : {
956 : Never,
957 : Always,
958 : Auto,
959 : Iteration
960 : };
961 :
962 : /**
963 : * Main types of Relationship Managers
964 : */
965 : enum class RelationshipManagerType : unsigned char
966 : {
967 : DEFAULT = 0,
968 : GEOMETRIC = 1 << 0,
969 : ALGEBRAIC = 1 << 1,
970 : COUPLING = 1 << 2
971 : };
972 :
973 : enum RMSystemType
974 : {
975 : NONLINEAR,
976 : AUXILIARY,
977 : NONE
978 : };
979 :
980 : enum VectorTagType
981 : {
982 : VECTOR_TAG_RESIDUAL = 0,
983 : VECTOR_TAG_SOLUTION = 1,
984 : VECTOR_TAG_ANY = 2
985 : };
986 :
987 : /**
988 : * The type for the callback to set RelationshipManager parameters
989 : */
990 : typedef std::function<void(const InputParameters &, InputParameters &)>
991 : RelationshipManagerInputParameterCallback;
992 :
993 : std::string stringify(const Moose::RelationshipManagerType & t);
994 : std::string stringify(const Moose::TimeIntegratorType & t);
995 :
996 : /**
997 : * Struct that all MOOSE derivative strings derive from
998 : */
999 : struct DerivativeStringClass
1000 : {
1001 : };
1002 :
1003 : /**
1004 : * ContainerElement<R>:
1005 : * - We use std::declval<R&>() (note the '&') to model an *lvalue* of R.
1006 : * This forces std::data to pick the lvalue-qualified overload and yields
1007 : * the element type with correct constness (e.g., const double* for a
1008 : * const container). Using std::declval<R>() would model an rvalue and can
1009 : * select different overloads or constness, which is not what typical code
1010 : * sees when accessing a container's data().
1011 : * - Assumes R exposes contiguous storage (std::data) and a size().
1012 : * - Strips cv/ref qualifiers from the dereferenced pointer to get the element.
1013 : *
1014 : * Type trait created with assistance of ChatGPT 5
1015 : */
1016 : template <class Container>
1017 : using ContainerElement =
1018 : std::remove_cv_t<std::remove_reference_t<decltype(*std::data(std::declval<Container &>()))>>;
1019 :
1020 : } // namespace Moose
1021 :
1022 : namespace libMesh
1023 : {
1024 : template <>
1025 : inline void
1026 0 : print_helper(std::ostream & os, const Moose::RelationshipManagerType * param)
1027 : {
1028 : // Specialization so that we don't print out unprintable characters
1029 0 : os << Moose::stringify(*param);
1030 0 : }
1031 : } // namespace libMesh
1032 :
1033 : template <>
1034 : struct enable_bitmask_operators<Moose::RelationshipManagerType>
1035 : {
1036 : static const bool enable = true;
1037 : };
1038 :
1039 : /**
1040 : * This Macro is used to generate std::string derived types useful for
1041 : * strong type checking and special handling in the GUI. It does not
1042 : * extend std::string in any way so it is generally "safe"
1043 : *
1044 : * Be sure to use the DerivativeStringToJSON macro for new types in
1045 : * MooseTypes.C to also define to_json for each
1046 : */
1047 : #define MooseDerivativeStringClass(TheName) \
1048 : class TheName : public std::string, public Moose::DerivativeStringClass \
1049 : { \
1050 : public: \
1051 : TheName() : std::string() {} \
1052 : TheName(const std::string & str) : std::string(str) {} \
1053 : TheName(const std::string & str, size_t pos, size_t n = npos) : std::string(str, pos, n) {} \
1054 : TheName(const char * s, size_t n) : std::string(s, n) {} \
1055 : TheName(const char * s) : std::string(s) {} \
1056 : TheName(size_t n, char c) : std::string(n, c) {} \
1057 : }; \
1058 : namespace nlohmann \
1059 : { \
1060 : template <> \
1061 : struct adl_serializer<TheName> \
1062 : { \
1063 : static void to_json(json & j, const TheName & v); \
1064 : }; \
1065 : } \
1066 : static_assert(true, "")
1067 :
1068 : // Instantiate new Types
1069 :
1070 : /// This type is for expected (i.e. input) file names or paths that your simulation needs.
1071 : /// If relative types are assigned to this type, they are replaced with an absolute path
1072 : /// that is relative to the context of the parameter (usually the input file).
1073 1130723 : MooseDerivativeStringClass(FileName);
1074 :
1075 : /// Similar to FileName but without an extension
1076 2191880 : MooseDerivativeStringClass(FileNameNoExtension);
1077 :
1078 : /// This type is for expected filenames that should be relative and will not have their
1079 : /// values set to absolute paths like FileName
1080 0 : MooseDerivativeStringClass(RelativeFileName);
1081 :
1082 : /// This type is for files used in the DataFileInterface, which enables searching of files
1083 : /// within the registered data directory
1084 45986 : MooseDerivativeStringClass(DataFileName);
1085 :
1086 : /// This type is similar to "FileName", but is used to further filter file dialogs on known file mesh types
1087 496328 : MooseDerivativeStringClass(MeshFileName);
1088 :
1089 : /// This type is similar to "FileName", but is used to further filter file dialogs on known matrix file types
1090 85427 : MooseDerivativeStringClass(MatrixFileName);
1091 :
1092 : /// This type is for output file base
1093 169874 : MooseDerivativeStringClass(OutFileBase);
1094 :
1095 : /// This type is used for objects that expect nonlinear variable names (i.e. Kernels, BCs)
1096 7797284 : MooseDerivativeStringClass(NonlinearVariableName);
1097 :
1098 : /// This type is used for objects that expect linear variable names (i.e. LinearFVKernels, LinearFVBCs)
1099 187881 : MooseDerivativeStringClass(LinearVariableName);
1100 :
1101 : /// This type is used for objects that expect linear or nonlinear solver variable names
1102 5118583 : MooseDerivativeStringClass(SolverVariableName);
1103 :
1104 : /// This type is used for objects that expect Auxiliary variable names (i.e. AuxKernels, AuxBCs)
1105 2778004 : MooseDerivativeStringClass(AuxVariableName);
1106 :
1107 : /// This type is used for objects that expect either Solver or Auxiliary Variables such as postprocessors
1108 3217108 : MooseDerivativeStringClass(VariableName);
1109 :
1110 : /// This type is used for objects that expect Boundary Names/Ids read from or generated on the current mesh
1111 6055802 : MooseDerivativeStringClass(BoundaryName);
1112 :
1113 : /// This type is similar to BoundaryName but is used for "blocks" or subdomains in the current mesh
1114 4739382 : MooseDerivativeStringClass(SubdomainName);
1115 :
1116 : /// This type is used for objects that expect Postprocessor objects
1117 5086858 : MooseDerivativeStringClass(PostprocessorName);
1118 :
1119 : /// This type is used for objects that expect VectorPostprocessor objects
1120 335418 : MooseDerivativeStringClass(VectorPostprocessorName);
1121 :
1122 : /// This type is used for objects that expect MeshDivision objects
1123 230601 : MooseDerivativeStringClass(MeshDivisionName);
1124 :
1125 : /// This type is used for objects that expect Moose Function objects
1126 6092830 : MooseDerivativeStringClass(FunctionName);
1127 :
1128 : /// This type is used for objects that expect Moose Distribution objects
1129 16963 : MooseDerivativeStringClass(DistributionName);
1130 :
1131 : /// This type is used for objects that expect Moose Sampler objects
1132 16661 : MooseDerivativeStringClass(SamplerName);
1133 :
1134 : /// This type is used for objects that expect "UserObject" names
1135 977718 : MooseDerivativeStringClass(UserObjectName);
1136 :
1137 : /// This type is used for objects that expect an Indicator object name
1138 33040 : MooseDerivativeStringClass(IndicatorName);
1139 :
1140 : /// This type is used for objects that expect an Marker object name
1141 37024 : MooseDerivativeStringClass(MarkerName);
1142 :
1143 : /// This type is used for objects that expect an MultiApp object name
1144 1138989 : MooseDerivativeStringClass(MultiAppName);
1145 :
1146 : /// Used for objects the require Output object names
1147 11260021 : MooseDerivativeStringClass(OutputName);
1148 :
1149 : /// Used for objects that expect MaterialProperty names
1150 102851486 : MooseDerivativeStringClass(MaterialPropertyName);
1151 :
1152 : /// Used for objects that expect Moose::Functor names
1153 4533050 : MooseDerivativeStringClass(MooseFunctorName);
1154 :
1155 : /// User for accessing Material objects
1156 46463 : MooseDerivativeStringClass(MaterialName);
1157 :
1158 : /// Tag Name
1159 12212788 : MooseDerivativeStringClass(TagName);
1160 :
1161 : /// Name of MeshGenerators
1162 1388195 : MooseDerivativeStringClass(MeshGeneratorName);
1163 :
1164 : /// Name of extra element IDs
1165 61397 : MooseDerivativeStringClass(ExtraElementIDName);
1166 :
1167 : /// Name of a Reporter Value, second argument to ReporterName (see Reporter.h)
1168 181828 : MooseDerivativeStringClass(ReporterValueName);
1169 :
1170 : /// Name of a Component object
1171 386 : MooseDerivativeStringClass(ComponentName);
1172 :
1173 : /// Name of a Physics object
1174 152 : MooseDerivativeStringClass(PhysicsName);
1175 :
1176 : /// Name of a Positions object
1177 563354 : MooseDerivativeStringClass(PositionsName);
1178 :
1179 : /// Name of a Times object
1180 1645331 : MooseDerivativeStringClass(TimesName);
1181 :
1182 : /// Name of an Executor. Used for inputs to Executors
1183 30320 : MooseDerivativeStringClass(ExecutorName);
1184 :
1185 : /// ParsedFunction/ParsedMaterial etc. FParser expression
1186 203630 : MooseDerivativeStringClass(ParsedFunctionExpression);
1187 :
1188 : /// System name support of multiple nonlinear systems on the same mesh
1189 1742951 : MooseDerivativeStringClass(NonlinearSystemName);
1190 :
1191 : /// Name of a Convergence object
1192 1989879 : MooseDerivativeStringClass(ConvergenceName);
1193 :
1194 : /// System name support of multiple linear systems on the same mesh
1195 42564 : MooseDerivativeStringClass(LinearSystemName);
1196 :
1197 : /// Name of a system which either be linear or nonlinear
1198 2656248 : MooseDerivativeStringClass(SolverSystemName);
1199 :
1200 : /// Command line argument, specialized to handle quotes in vector arguments
1201 3341 : MooseDerivativeStringClass(CLIArgString);
1202 :
1203 : #ifdef MOOSE_MFEM_ENABLED
1204 : /**
1205 : * Coefficients used in input for MFEM residual objects
1206 : */
1207 : ///@{
1208 860615 : MooseDerivativeStringClass(MFEMScalarCoefficientName);
1209 288317 : MooseDerivativeStringClass(MFEMVectorCoefficientName);
1210 0 : MooseDerivativeStringClass(MFEMMatrixCoefficientName);
1211 : ///@}
1212 : #endif
1213 : /**
1214 : * additional MOOSE typedefs
1215 : */
1216 : typedef std::vector<VariableName> CoupledName;
1217 :
1218 : namespace Moose
1219 : {
1220 : extern const TagName SOLUTION_TAG;
1221 : extern const TagName OLD_SOLUTION_TAG;
1222 : extern const TagName OLDER_SOLUTION_TAG;
1223 : extern const TagName PREVIOUS_NL_SOLUTION_TAG;
1224 : extern const TagName PREVIOUS_FP_SOLUTION_TAG;
1225 : extern const TagName SOLUTION_DOT_TAG;
1226 : extern const TagName SOLUTION_DOTDOT_TAG;
1227 :
1228 : enum class FEBackend
1229 : {
1230 : LibMesh
1231 : #ifdef MOOSE_MFEM_ENABLED
1232 : ,
1233 : MFEM
1234 : #endif
1235 : };
1236 :
1237 : #ifdef MOOSE_KOKKOS_ENABLED
1238 : namespace Kokkos
1239 : {
1240 : // Passkey for calling special constructors for functor copy
1241 : class FunctorCopy
1242 : {
1243 : friend class ResidualObject;
1244 : friend class KernelBase;
1245 : friend class NodalKernelBase;
1246 : friend class BoundaryCondition;
1247 : friend class IntegratedBCBase;
1248 : friend class NodalBCBase;
1249 : friend class MaterialBase;
1250 : friend class Material;
1251 : friend class AuxKernel;
1252 :
1253 : FunctorCopy() = default;
1254 : FunctorCopy(const FunctorCopy &) = delete;
1255 : FunctorCopy(FunctorCopy &&) = delete;
1256 : };
1257 : }
1258 : #endif
1259 : }
1260 :
1261 : /// macros for adding Tensor index enums locally
1262 : #define usingTensorIndices(...) \
1263 : enum \
1264 : { \
1265 : __VA_ARGS__ \
1266 : }
|