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"
38#include "boost/bitmask_operators.h"
40#include "libmesh/ignore_warnings.h"
42#include "libmesh/restore_warnings.h"
43#include "libmesh/tensor_tools.h"
45#include "metaphysicl/ct_types.h"
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
61#define MooseSharedPointer std::shared_ptr
62#define MooseSharedNamespace std
73#pragma clang diagnostic push
74#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
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"
84#define beginIndex_X(x, A, B, C, D, FUNC, ...) FUNC
87#define beginIndex(...) \
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__))
109#define MooseIndex(type) decltype(_MooseIndex(type, 0))
112template <typename T, typename std::enable_if<std::is_integral<T>::value>::type * =
nullptr>
113typename std::remove_const<T>::type
119decltype(std::declval<T>().size())
125decltype(
"NOTE: MooseIndex only works with integers and objects with size()!")
129#pragma clang diagnostic pop
160 typedef Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim>
type;
166 typedef Eigen::Matrix<Real, Eigen::Dynamic, Moose::dim * Moose::dim>
type;
172 typedef Eigen::Matrix<Real, Eigen::Dynamic, 1>
type;
178 typedef Eigen::Matrix<ADReal, Eigen::Dynamic, Moose::dim>
type;
184 typedef Eigen::Matrix<ADReal, Eigen::Dynamic, Moose::dim * Moose::dim>
type;
190 typedef Eigen::Matrix<ADReal, Eigen::Dynamic, 1>
type;
216struct ReplaceAlgebraicType<
libMesh::RealEigenVector, U>
221struct ReplaceAlgebraicType<
libMesh::ADRealEigenVector, U>
288template <
typename OutputType>
299template <
typename OutputType>
311template <
typename OutputType>
484template <
template <
typename T>
class W,
typename T>
487 typedef W<typename ADType<T>::type>
type;
494 typedef std::vector<adT, std::allocator<adT>>
type;
501 typedef std::list<adT, std::allocator<adT>>
type;
505struct ADType<
std::set<T, std::less<T>, std::allocator<T>>>
508 typedef std::set<adT, std::less<adT>, std::allocator<adT>>
type;
526 typedef ADRealEigenVector
type;
532 typedef ADRealEigenMatrix
type;
607 static constexpr bool value =
false;
622template <
template <
typename T,
typename... Args>
class W, typename T, typename... Args>
628template <
typename T,
typename... Args>
639template <
class... Ts>
693template <
typename T,
bool is_ad>
694using GenericType =
typename std::conditional<is_ad, typename ADType<T>::type, T>::type;
1064template <
typename T>
1078 constexpr bool empty() const noexcept {
return _n == 0; }
1095makeSpan(C & container, std::size_t offset, std::size_t n)
1097 using PointerType =
decltype(std::data(container));
1098 using ElementType = std::remove_pointer_t<PointerType>;
1115struct enable_bitmask_operators<
Moose::RelationshipManagerType>
1117 static const bool enable =
true;
1128#define MooseDerivativeStringClass(TheName) \
1129 class TheName : public std::string, public Moose::DerivativeStringClass \
1132 TheName() : std::string() {} \
1133 TheName(const std::string & str) : std::string(str) {} \
1134 TheName(const std::string & str, size_t pos, size_t n = npos) : std::string(str, pos, n) {} \
1135 TheName(const char * s, size_t n) : std::string(s, n) {} \
1136 TheName(const char * s) : std::string(s) {} \
1137 TheName(size_t n, char c) : std::string(n, c) {} \
1139 namespace nlohmann \
1142 struct adl_serializer<TheName> \
1144 static void to_json(json & j, const TheName & v); \
1147 static_assert(true, "")
1287#ifdef MOOSE_MFEM_ENABLED
1318#ifdef MOOSE_MFEM_ENABLED
1324#ifdef MOOSE_KOKKOS_ENABLED
1363#define usingTensorIndices(...) \
DualNumber< Real, DNDerivativeType, true > ADReal
boundary_id_type BoundaryID
DualNumber< ADReal, ADReal > ChainedADReal
DualNumber< Real, Real > ChainedReal
OutputTools< RealVectorValue >::VariablePhiValue VectorVariablePhiValue
OutputTools< Real >::VariablePhiValue VariablePhiValue
typename OutputTools< T >::VariablePhiValue ADTemplateVariablePhiValue
libMesh::VectorValue< ADReal > ADRealVectorValue
AD Array typedefs.
VectorVariableTestSecond ADVectorVariableTestSecond
OutputTools< RealEigenVector >::VariableCurl ArrayVariableCurl
OutputTools< RealVectorValue >::VariableCurl VectorVariableCurl
OutputTools< RealEigenVector >::VariableDivergence ArrayVariableDivergence
OutputTools< ADRealEigenVector >::VariableGradient ADArrayVariableGradient
MooseArray< ADReal > ADVariableValue
VariableTestValue ADVariableTestValue
VariableTestGradient ADVariableTestGradient
OutputTools< RealVectorValue >::VariablePhiCurl VectorVariablePhiCurl
OutputTools< Real >::VariableTestCurl VariableTestCurl
unsigned int MooseObjectID
OutputTools< Real >::VariablePhiCurl VariablePhiCurl
OutputTools< Real >::VariableTestValue VariableTestValue
OutputTools< Real >::VariableGradient VariableGradient
VectorVariableTestValue ADVectorVariableTestValue
OutputTools< RealVectorValue >::VariableTestValue VectorVariableTestValue
OutputTools< RealEigenVector >::VariablePhiGradient ArrayVariablePhiGradient
libMesh::TensorValue< ADReal > ADRealTensorValue
MooseDerivativeStringClass(FileName)
This type is for expected (i.e.
OutputTools< RealEigenVector >::VariableValue ArrayVariableValue
Moose::GenericType< VariableValue, is_ad > GenericVariableValue
Moose::GenericType< VectorVariableValue, is_ad > GenericVectorVariableValue
OutputTools< Real >::VariableTestGradient VariableTestGradient
Real ScatterVectorPostprocessorValue
Moose::GenericType< VariableSecond, is_ad > GenericVariableSecond
std::string RestartableDataMapName
std::vector< VariableName > CoupledName
additional MOOSE typedefs
OutputTools< RealEigenVector >::VariablePhiCurl ArrayVariablePhiCurl
unsigned int InvalidSolutionID
OutputTools< RealEigenVector >::VariablePhiValue ArrayVariablePhiValue
OutputTools< Real >::VariableValue VariableValue
Moose::GenericType< RankFourTensor, is_ad > GenericRankFourTensor
OutputTools< RealVectorValue >::VariableDivergence VectorVariableDivergence
Moose::GenericType< RealEigenVector, is_ad > GenericRealEigenVector
libMesh::DenseVector< ADReal > ADDenseVector
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
MooseArray< libMesh::TypeNTensor< 3, ADReal > > ADVectorVariableSecond
OutputTools< RealVectorValue >::VariableTestCurl VectorVariableTestCurl
libMesh::StoredRange< std::vector< const Elem * >::iterator, const Elem * > ConstElemPointerRange
OutputTools< ADRealEigenVector >::VariableValue ADArrayVariableValue
Moose::GenericType< DenseVector< Real >, is_ad > GenericDenseVector
OutputTools< RealVectorValue >::VariableTestDivergence VectorVariableTestDivergence
OutputTools< RealEigenVector >::VariableTestGradient ArrayVariableTestGradient
typename OutputTools< typename Moose::ADType< T >::type >::VariableSecond ADTemplateVariableSecond
Real PostprocessorValue
various MOOSE typedefs
OutputTools< RealEigenVector >::VariableTestSecond ArrayVariableTestSecond
OutputTools< Real >::VariableDivergence VariableDivergence
libMesh::VectorValue< ADReal > ADPoint
typename OutputTools< typename Moose::ADType< T >::type >::VariableValue ADTemplateVariableValue
VectorVariableTestGradient ADVectorVariableTestGradient
MooseArray< ADRealTensorValue > ADVariableSecond
std::vector< std::vector< Eigen::Map< RealDIMValue > > > MappedArrayVariablePhiGradient
Moose::GenericType< VariableGradient, is_ad > GenericVariableGradient
typename OutputTools< typename Moose::ADType< T >::type >::VariablePhiGradient ADTemplateVariablePhiGradient
OutputTools< RealEigenVector >::VariableTestDivergence ArrayVariableTestDivergence
OutputTools< RealVectorValue >::VariableTestGradient VectorVariableTestGradient
typename OutputTools< T >::VariableTestValue ADTemplateVariableTestValue
Moose::GenericType< Real, is_ad > GenericReal
Moose::GenericType< RealTensorValue, is_ad > GenericRealTensorValue
libMesh::DenseMatrix< ADReal > ADDenseMatrix
Moose::GenericType< RankThreeTensor, is_ad > GenericRankThreeTensor
Moose::GenericType< ChainedReal, is_ad > GenericChainedReal
OutputTools< RealEigenVector >::VariableGradient ArrayVariableGradient
MooseArray< ADRealVectorValue > ADVectorVariableValue
OutputTools< Real >::VariableSecond VariableSecond
Moose::GenericType< RealEigenMatrix, is_ad > GenericRealEigenMatrix
typename OutputTools< typename Moose::ADType< T >::type >::VariableTestGradient ADTemplateVariableTestGradient
Moose::GenericType< RealVectorValue, is_ad > GenericRealVectorValue
typename OutputTools< typename Moose::ADType< T >::type >::VariableCurl ADTemplateVariableCurl
OutputTools< RealVectorValue >::VariableSecond VectorVariableSecond
OutputTools< RealEigenVector >::VariableTestValue ArrayVariableTestValue
OutputTools< RealEigenVector >::VariablePhiSecond ArrayVariablePhiSecond
OutputTools< RealEigenVector >::VariableTestCurl ArrayVariableTestCurl
typename OutputTools< typename Moose::ADType< T >::type >::VariableTestSecond ADTemplateVariableTestSecond
ADTemplateVariablePhiGradient< Real > ADVariablePhiGradient
VariableTestSecond ADVariableTestSecond
OutputTools< RealVectorValue >::VariableGradient VectorVariableGradient
MooseArray< ADRealTensorValue > ADVectorVariableGradient
OutputTools< RealVectorValue >::VariableTestSecond VectorVariableTestSecond
OutputTools< RealVectorValue >::VariablePhiSecond VectorVariablePhiSecond
boundary_id_type BoundaryID
OutputTools< Real >::VariableTestSecond VariableTestSecond
Moose::GenericType< RankTwoTensor, is_ad > GenericRankTwoTensor
std::vector< Real > VectorPostprocessorValue
ADRealVectorValue ADRealGradient
typename OutputTools< typename Moose::ADType< T >::type >::VariableGradient ADTemplateVariableGradient
OutputTools< RealVectorValue >::VariablePhiDivergence VectorVariablePhiDivergence
Moose::GenericType< DenseMatrix< Real >, is_ad > GenericDenseMatrix
libMesh::StoredRange< std::vector< dof_id_type >::iterator, dof_id_type > NodeIdRange
MooseArray< ADRealVectorValue > ADVectorVariableCurl
OutputTools< Real >::VariablePhiSecond VariablePhiSecond
std::remove_const< T >::type _MooseIndex(T, int)
OutputTools< RealVectorValue >::VariableValue VectorVariableValue
OutputTools< Real >::VariableTestDivergence VariableTestDivergence
OutputTools< RealEigenVector >::VariableSecond ArrayVariableSecond
MooseArray< ADRealVectorValue > ADVariableGradient
OutputTools< Real >::VariableCurl VariableCurl
OutputTools< Real >::VariablePhiDivergence VariablePhiDivergence
subdomain_id_type SubdomainID
OutputTools< RealEigenVector >::VariablePhiDivergence ArrayVariablePhiDivergence
OutputTools< RealVectorValue >::VariablePhiGradient VectorVariablePhiGradient
The base class for a user to derive their own Kokkos auxiliary kernels.
The base class for Kokkos boundary conditions.
The base class for a user to derive their own Kokkos functions.
FunctorCopy(const FunctorCopy &)
The base class for Kokkos integrated boundary conditions.
The base class for Kokkos kernels.
Base class for Kokkos linear finite volume boundary conditions.
Base class for Kokkos linear finite volume kernels that contribute to the linear system.
Base class for Kokkos objects that contribute to a linear system, i.e.
The base class for Kokkos materials.
The base class for a user to derive their own Kokkos materials.
The base class for Kokkos nodal boundary conditions.
The base class for Kokkos nodal kernels.
The base class for Kokkos residual objects.
Replacement for std::span which we only get in c++20.
constexpr reference operator[](size_type i) const noexcept
constexpr bool empty() const noexcept
constexpr pointer begin() const noexcept
constexpr Span(T *ptr, size_type n) noexcept
constexpr pointer data() const noexcept
constexpr pointer end() const noexcept
constexpr size_type size() const noexcept
RankFourTensorTempl is designed to handle any N-dimensional fourth order tensor, C.
RankThreeTensor is designed to handle any N-dimensional third order tensor, r.
SymmetricRankFourTensorTempl is designed to handle an N-dimensional fourth order tensor with minor sy...
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
constexpr std::false_type always_false
This is a helper variable template for cases when we want to use a default compile-time error with co...
const TagName SOLUTION_DOTDOT_TAG
ComputeType
The type of nonlinear computation being performed.
PCSideType
Preconditioning side.
@ PCS_DEFAULT
Use whatever we have in PETSc.
SolveType
Type of the solve.
@ ST_FD
Use finite differences to compute Jacobian.
@ ST_LINEAR
Solving a linear problem.
@ ST_NEWTON
Full Newton Solve.
@ ST_JFNK
Jacobian-Free Newton Krylov.
@ ST_PJFNK
Preconditioned Jacobian-Free Newton Krylov.
ConstraintFormulationType
Type of constraint formulation.
AuxGroup
Flag for AuxKernel related execution type.
constexpr std::size_t constMaxQpsPerElem
This is used for places where we initialize some qp-sized data structures that would end up being siz...
const TagID INVALID_TAG_ID
MooseKSPNormType
Norm type for converge test.
@ KSPN_DEFAULT
Use whatever we have in PETSc.
const TagName PREVIOUS_MULTISYSTEM_FP_SOLUTION_TAG
const TagName OLDER_SOLUTION_TAG
const TagName SOLUTION_DOT_TAG
TimeIntegratorType
Time integrators.
const SubdomainID ANY_BLOCK_ID
const std::set< SubdomainID > EMPTY_BLOCK_IDS
auto makeSpan(C &container, std::size_t offset, std::size_t n)
Helper function for creating a span from a given container.
LineSearchType
Type of the line search.
@ LS_INVALID
means not set
std::function< void(const InputParameters &, InputParameters &)> RelationshipManagerInputParameterCallback
The type for the callback to set RelationshipManager parameters.
PatchUpdateType
Type of patch update strategy for modeling node-face constraints or contact.
const TagName PREVIOUS_NL_SOLUTION_TAG
const TagName PREVIOUS_MULTIAPP_FP_SOLUTION_TAG
const TagTypeID INVALID_TAG_TYPE_ID
std::string stringify(const T &t)
conversion to string
RelationshipManagerType
Main types of Relationship Managers.
MaterialDataType
MaterialData types.
@ INTERFACE_MATERIAL_DATA
const TagName OLD_SOLUTION_TAG
const std::set< BoundaryID > EMPTY_BOUNDARY_IDS
const processor_id_type INVALID_PROCESSOR_ID
const BoundaryID INVALID_BOUNDARY_ID
VarKindType
Framework-wide stuff.
WhichEigenPairs
Which eigen pairs.
@ WEP_TARGET_MAGNITUDE
target magnitude
@ WEP_LARGEST_IMAGINARY
largest imaginary
@ WEP_TARGET_IMAGINARY
target imaginary
@ WEP_SMALLEST_REAL
smallest real
@ WEP_SLEPC_DEFAULT
use whatever we have in SLEPC
@ WEP_LARGEST_MAGNITUDE
largest magnitude
@ WEP_SMALLEST_MAGNITUDE
smallest magnitude
@ WEP_ALL_EIGENVALUES
all eigenvalues
@ WEP_SMALLEST_IMAGINARY
smallest imaginary
@ WEP_TARGET_REAL
target real
@ WEP_LARGEST_REAL
largest real
typename std::conditional< is_ad, typename ADType< T >::type, T >::type GenericType
RESTARTABLE_FILTER
The filter type applied to a particular piece of "restartable" data.
const SubdomainID INVALID_BLOCK_ID
const TagName SOLUTION_TAG
const BoundaryID ANY_BOUNDARY_ID
EigenSolveType
Type of the eigen solve.
@ EST_PJFNKMO
The same as PJFNK except that matrix-vector multiplication is employed to replace residual evaluation...
@ EST_JACOBI_DAVIDSON
Jacobi-Davidson.
@ EST_KRYLOVSCHUR
Krylov-Schur.
@ EST_JFNK
Jacobian-free Newton Krylov.
@ EST_NEWTON
Newton-based eigensolver with an assembled Jacobian matrix (fully coupled by default)
@ EST_POWER
Power / Inverse / RQI.
@ EST_NONLINEAR_POWER
Nonlinear inverse power.
@ EST_PJFNK
Preconditioned Jacobian-free Newton Krylov.
EigenProblemType
Type of the eigen problem.
@ EPT_GEN_INDEFINITE
Generalized Hermitian indefinite.
@ EPT_NON_HERMITIAN
Non-Hermitian.
@ EPT_GEN_HERMITIAN
Generalized Hermitian.
@ EPT_HERMITIAN
Hermitian.
@ EPT_GEN_NON_HERMITIAN
Generalized Non-Hermitian.
@ EPT_POS_GEN_NON_HERMITIAN
Generalized Non-Hermitian with positive (semi-)definite B.
@ EPT_SLEPC_DEFAULT
use whatever SLPEC has by default
MffdType
Type of the matrix-free finite-differencing parameter.
@ MFFD_INVALID
means not set
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
Eigen::Matrix< ADReal, Eigen::Dynamic, 1 > ADRealEigenVector
Eigen::Matrix< Real, Moose::dim, 1 > RealDIMValue
Eigen::Matrix< Real, Eigen::Dynamic, Moose::dim > RealVectorArrayValue
TensorValue< Real > RealTensorValue
void print_helper(std::ostream &os, const P *param)
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealEigenMatrix
VectorValue< Real > RealVectorValue
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Eigen::Matrix< Real, Eigen::Dynamic, Moose::dim *Moose::dim > RealTensorArrayValue
Eigen::Matrix< ADReal, Eigen::Dynamic, Eigen::Dynamic > ADRealEigenMatrix
ADSymmetricRankFourTensor type
ADSymmetricRankTwoTensor type
DenseMatrix< typename ADType< T >::type > type
DenseVector< typename ADType< T >::type > type
ADSymmetricRankFourTensor type
ADSymmetricRankTwoTensor type
W< typename ADType< T >::type > type
std::list< adT, std::allocator< adT > > type
std::set< adT, std::less< adT >, std::allocator< adT > > type
std::vector< adT, std::allocator< adT > > type
Struct that all MOOSE derivative strings derive from.
static constexpr bool value