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" 50 #include <type_traits> 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)) 112 template <typename T, typename std::enable_if<std::is_integral<T>::value>::type * =
nullptr>
113 typename std::remove_const<T>::type
118 template <
typename T>
119 decltype(std::declval<T>().size())
124 template <
typename T>
125 decltype(
"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;
215 template <
typename U>
220 template <
typename U>
283 template <
typename OutputType>
294 template <
typename OutputType>
306 template <
typename OutputType>
424 template <
typename T>
479 template <
template <
typename T>
class W,
typename T>
482 typedef W<typename ADType<T>::type>
type;
485 template <
typename T>
489 typedef std::vector<adT, std::allocator<adT>>
type;
492 template <
typename T>
496 typedef std::list<adT, std::allocator<adT>>
type;
499 template <
typename T>
500 struct ADType<
std::set<T, std::less<T>, std::allocator<T>>>
503 typedef std::set<adT, std::less<adT>, std::allocator<adT>>
type;
506 template <
typename T>
512 template <
typename T>
599 template <
typename T>
602 static constexpr
bool value =
false;
617 template <
template <
typename T,
typename... Args>
class W, typename T, typename... Args>
623 template <
typename T,
typename... Args>
634 template <
class... Ts>
646 template <
typename T>
649 template <
typename T>
652 template <
typename T>
655 template <
typename T>
667 template <
typename T>
669 template <
typename T>
674 template <
typename T>
677 template <
typename T>
680 template <
typename T>
688 template <
typename T,
bool is_ad>
689 using GenericType =
typename std::conditional<is_ad, typename ADType<T>::type, T>::type;
692 template <
bool is_ad>
694 template <
bool is_ad>
696 template <
bool is_ad>
698 template <
bool is_ad>
700 template <
bool is_ad>
702 template <
bool is_ad>
704 template <
bool is_ad>
706 template <
bool is_ad>
708 template <
bool is_ad>
710 template <
bool is_ad>
712 template <
bool is_ad>
714 template <
bool is_ad>
716 template <
bool is_ad>
718 template <
bool is_ad>
720 template <
bool is_ad>
1037 typedef std::function<void(const InputParameters &, InputParameters &)>
1059 template <
typename T>
1073 constexpr
bool empty() const noexcept {
return _n == 0; }
1090 makeSpan(C & container, std::size_t offset, std::size_t n)
1092 using PointerType = decltype(std::data(container));
1093 using ElementType = std::remove_pointer_t<PointerType>;
1112 static const bool enable =
true;
1123 #define MooseDerivativeStringClass(TheName) \ 1124 class TheName : public std::string, public Moose::DerivativeStringClass \ 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) {} \ 1134 namespace nlohmann \ 1137 struct adl_serializer<TheName> \ 1139 static void to_json(json & j, const TheName & v); \ 1142 static_assert(true, "") 1279 #ifdef MOOSE_MFEM_ENABLED 1307 #ifdef MOOSE_MFEM_ENABLED 1313 #ifdef MOOSE_KOKKOS_ENABLED 1339 #define usingTensorIndices(...) \
ConstraintFormulationType
Type of constraint formulation.
typename OutputTools< typename Moose::ADType< T >::type >::VariableSecond ADTemplateVariableSecond
OutputTools< Real >::VariableGradient VariableGradient
RankFourTensorTempl is designed to handle any N-dimensional fourth order tensor, C.
Generalized Non-Hermitian.
OutputTools< RealVectorValue >::VariableDivergence VectorVariableDivergence
RealVectorValue RealGradient
Moose::GenericType< Real, is_ad > GenericReal
typename OutputTools< typename Moose::ADType< T >::type >::VariableCurl ADTemplateVariableCurl
Moose::GenericType< VectorVariableValue, is_ad > GenericVectorVariableValue
Eigen::Matrix< ADReal, Eigen::Dynamic, 1 > ADRealEigenVector
Generalized Hermitian indefinite.
OutputTools< RealVectorValue >::VariableSecond VectorVariableSecond
Newton-based eigensolver with an assembled Jacobian matrix (fully coupled by default) ...
constexpr size_type size() const noexcept
OutputTools< RealEigenVector >::VariableDivergence ArrayVariableDivergence
typename OutputTools< typename Moose::ADType< T >::type >::VariablePhiGradient ADTemplateVariablePhiGradient
libMesh::DenseMatrix< ADReal > ADDenseMatrix
const TagTypeID INVALID_TAG_TYPE_ID
EigenSolveType
Type of the eigen solve.
OutputTools< ADRealEigenVector >::VariableGradient ADArrayVariableGradient
RelationshipManagerType
Main types of Relationship Managers.
void print_helper(std::ostream &os, const P *param)
OutputTools< Real >::VariableTestDivergence VariableTestDivergence
std::set< adT, std::less< adT >, std::allocator< adT > > type
constexpr pointer end() const noexcept
The base class for a user to derive their own Kokkos auxiliary kernels.
unsigned int InvalidSolutionID
VectorValue< Real > RealVectorValue
subdomain_id_type SubdomainID
typename OutputTools< typename Moose::ADType< T >::type >::VariableTestSecond ADTemplateVariableTestSecond
OutputTools< RealVectorValue >::VariableTestCurl VectorVariableTestCurl
const BoundaryID INVALID_BOUNDARY_ID
const TagName OLDER_SOLUTION_TAG
DenseVector< typename ADType< T >::type > type
OutputTools< RealEigenVector >::VariablePhiValue ArrayVariablePhiValue
constexpr std::size_t constMaxQpsPerElem
This is used for places where we initialize some qp-sized data structures that would end up being siz...
DualNumber< Real, Real > ChainedReal
typename OutputTools< T >::VariableTestValue ADTemplateVariableTestValue
The same as PJFNK except that matrix-vector multiplication is employed to replace residual evaluation...
VariableTestGradient ADVariableTestGradient
OutputTools< RealVectorValue >::VariableValue VectorVariableValue
libMesh::DenseVector< ADReal > ADDenseVector
MaterialDataType
MaterialData types.
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...
MooseArray< ADRealVectorValue > ADVariableGradient
typename OutputTools< T >::VariablePhiValue ADTemplateVariablePhiValue
DenseMatrix< typename ADType< T >::type > type
OutputTools< RealVectorValue >::VariableTestValue VectorVariableTestValue
libMesh::StoredRange< std::vector< dof_id_type >::iterator, dof_id_type > NodeIdRange
MooseArray< ADRealVectorValue > ADVectorVariableCurl
typename OutputTools< typename Moose::ADType< T >::type >::VariableValue ADTemplateVariableValue
OutputTools< RealEigenVector >::VariableCurl ArrayVariableCurl
The base class for Kokkos residual objects.
Eigen::Matrix< ADReal, Eigen::Dynamic, Eigen::Dynamic > ADRealEigenMatrix
ADTemplateVariablePhiGradient< Real > ADVariablePhiGradient
The base class for Kokkos integrated boundary conditions.
Solving a linear problem.
OutputTools< RealEigenVector >::VariableSecond ArrayVariableSecond
OutputTools< Real >::VariablePhiValue VariablePhiValue
OutputTools< RealVectorValue >::VariableCurl VectorVariableCurl
use whatever SLPEC has by default
OutputTools< RealVectorValue >::VariablePhiGradient VectorVariablePhiGradient
ADSymmetricRankTwoTensor type
MooseDerivativeStringClass(FileName)
This type is for expected (i.e.
OutputTools< RealEigenVector >::VariablePhiSecond ArrayVariablePhiSecond
The base class for a user to derive their own Kokkos functions.
Moose::GenericType< RealTensorValue, is_ad > GenericRealTensorValue
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
std::basic_ostream< charT, traits > * os
libMesh::TensorValue< ADReal > ADRealTensorValue
DualNumber< Real, DNDerivativeType, true > ADReal
Moose::GenericType< DenseVector< Real >, is_ad > GenericDenseVector
const TagName PREVIOUS_FP_SOLUTION_TAG
Generalized Non-Hermitian with positive (semi-)definite B.
MooseArray< libMesh::TypeNTensor< 3, ADReal > > ADVectorVariableSecond
MffdType
Type of the matrix-free finite-differencing parameter.
Moose::GenericType< RankFourTensor, is_ad > GenericRankFourTensor
VectorVariableTestSecond ADVectorVariableTestSecond
OutputTools< Real >::VariablePhiSecond VariablePhiSecond
typename std::conditional< is_ad, typename ADType< T >::type, T >::type GenericType
AuxGroup
Flag for AuxKernel related execution type.
RankThreeTensor is designed to handle any N-dimensional third order tensor, r.
MooseArray< ADReal > ADVariableValue
VariableTestSecond ADVariableTestSecond
MooseKSPNormType
Norm type for converge test.
const SubdomainID INVALID_BLOCK_ID
The base class for Kokkos nodal kernels.
OutputTools< RealVectorValue >::VariablePhiDivergence VectorVariablePhiDivergence
ADSymmetricRankFourTensor type
TensorValue< Real > RealTensorValue
uint8_t processor_id_type
The base class for Kokkos boundary conditions.
std::remove_const< T >::type _MooseIndex(T, int)
Use whatever we have in PETSc.
Preconditioned Jacobian-free Newton Krylov.
WhichEigenPairs
Which eigen pairs.
OutputTools< RealEigenVector >::VariableTestDivergence ArrayVariableTestDivergence
Replacement for std::span which we only get in c++20.
OutputTools< RealEigenVector >::VariableValue ArrayVariableValue
OutputTools< RealVectorValue >::VariableTestDivergence VectorVariableTestDivergence
MooseArray< ADRealTensorValue > ADVectorVariableGradient
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
OutputTools< Real >::VariableCurl VariableCurl
LineSearchType
Type of the line search.
RESTARTABLE_FILTER
The filter type applied to a particular piece of "restartable" data.
Moose::GenericType< VariableValue, is_ad > GenericVariableValue
const TagName OLD_SOLUTION_TAG
Use whatever we have in PETSc.
Moose::GenericType< VariableGradient, is_ad > GenericVariableGradient
std::function< void(const InputParameters &, InputParameters &)> RelationshipManagerInputParameterCallback
The type for the callback to set RelationshipManager parameters.
libMesh::VectorValue< ADReal > ADPoint
const TagName SOLUTION_DOTDOT_TAG
OutputTools< RealVectorValue >::VariablePhiSecond VectorVariablePhiSecond
OutputTools< Real >::VariableTestValue VariableTestValue
boundary_id_type BoundaryID
VarKindType
Framework-wide stuff.
Jacobian-Free Newton Krylov.
std::vector< std::vector< Eigen::Map< RealDIMValue > > > MappedArrayVariablePhiGradient
Real PostprocessorValue
various MOOSE typedefs
typename OutputTools< typename Moose::ADType< T >::type >::VariableTestGradient ADTemplateVariableTestGradient
ADSymmetricRankFourTensor type
OutputTools< Real >::VariableDivergence VariableDivergence
NumberVectorValue Gradient
typename OutputTools< typename Moose::ADType< T >::type >::VariableGradient ADTemplateVariableGradient
The base class for Kokkos kernels.
OutputTools< Real >::VariablePhiCurl VariablePhiCurl
constexpr reference operator[](size_type i) const noexcept
Use finite differences to compute Jacobian.
Moose::GenericType< RealVectorValue, is_ad > GenericRealVectorValue
Moose::GenericType< ChainedReal, is_ad > GenericChainedReal
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealEigenMatrix
OutputTools< ADRealEigenVector >::VariableValue ADArrayVariableValue
constexpr pointer data() const noexcept
Moose::GenericType< RealEigenMatrix, is_ad > GenericRealEigenMatrix
std::string stringify(const T &t)
conversion to string
The base class for Kokkos nodal boundary conditions.
OutputTools< Real >::VariablePhiDivergence VariablePhiDivergence
constexpr bool empty() const noexcept
ComputeType
The type of nonlinear computation being performed.
const processor_id_type INVALID_PROCESSOR_ID
Eigen::Matrix< Real, Eigen::Dynamic, Moose::dim > RealVectorArrayValue
OutputTools< Real >::VariableValue VariableValue
std::vector< Real > VectorPostprocessorValue
Real ScatterVectorPostprocessorValue
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
std::list< adT, std::allocator< adT > > type
constexpr Span(T *ptr, size_type n) noexcept
Struct that all MOOSE derivative strings derive from.
const SubdomainID ANY_BLOCK_ID
The base class for a user to derive their own Kokkos materials.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::set< SubdomainID > EMPTY_BLOCK_IDS
OutputTools< Real >::VariableTestSecond VariableTestSecond
OutputTools< RealVectorValue >::VariableTestGradient VectorVariableTestGradient
OutputTools< RealVectorValue >::VariablePhiValue VectorVariablePhiValue
OutputTools< RealEigenVector >::VariableTestSecond ArrayVariableTestSecond
std::string RestartableDataMapName
VectorVariableTestValue ADVectorVariableTestValue
const std::set< BoundaryID > EMPTY_BOUNDARY_IDS
const TagID INVALID_TAG_ID
std::vector< VariableName > CoupledName
additional MOOSE typedefs
OutputTools< RealVectorValue >::VariableTestSecond VectorVariableTestSecond
Jacobian-free Newton Krylov.
PatchUpdateType
Type of patch update strategy for modeling node-face constraints or contact.
OutputTools< RealEigenVector >::VariablePhiDivergence ArrayVariablePhiDivergence
SymmetricRankFourTensorTempl is designed to handle an N-dimensional fourth order tensor with minor sy...
OutputTools< RealEigenVector >::VariablePhiCurl ArrayVariablePhiCurl
OutputTools< RealEigenVector >::VariablePhiGradient ArrayVariablePhiGradient
TimeIntegratorType
Time integrators.
MooseArray< ADRealTensorValue > ADVariableSecond
PCSideType
Preconditioning side.
ADRealVectorValue ADRealGradient
VectorVariableTestGradient ADVectorVariableTestGradient
VariableTestValue ADVariableTestValue
Moose::GenericType< RankThreeTensor, is_ad > GenericRankThreeTensor
Moose::GenericType< VariableSecond, is_ad > GenericVariableSecond
const TagName SOLUTION_TAG
OutputTools< Real >::VariableSecond VariableSecond
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Preconditioned Jacobian-Free Newton Krylov.
Eigen::Matrix< Real, Moose::dim, 1 > RealDIMValue
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
OutputTools< RealVectorValue >::VariablePhiCurl VectorVariablePhiCurl
use whatever we have in SLEPC
OutputTools< RealVectorValue >::VariableGradient VectorVariableGradient
libMesh::StoredRange< std::vector< const Elem * >::iterator, const Elem * > ConstElemPointerRange
Eigen::Matrix< Real, Eigen::Dynamic, Moose::dim *Moose::dim > RealTensorArrayValue
std::vector< adT, std::allocator< adT > > type
OutputTools< Real >::VariableTestCurl VariableTestCurl
OutputTools< RealEigenVector >::VariableTestValue ArrayVariableTestValue
SolveType
Type of the solve.
constexpr pointer begin() const noexcept
OutputTools< Real >::VariableTestGradient VariableTestGradient
W< typename ADType< T >::type > type
OutputTools< RealEigenVector >::VariableGradient ArrayVariableGradient
const TagName PREVIOUS_NL_SOLUTION_TAG
auto makeSpan(C &container, std::size_t offset, std::size_t n)
Helper function for creating a span from a given container.
static constexpr bool value
unsigned int MooseObjectID
libMesh::VectorValue< ADReal > ADRealVectorValue
AD Array typedefs.
MooseArray< ADRealVectorValue > ADVectorVariableValue
The base class for Kokkos materials.
OutputTools< RealEigenVector >::VariableTestGradient ArrayVariableTestGradient
EigenProblemType
Type of the eigen problem.
ADSymmetricRankTwoTensor type
Moose::GenericType< DenseMatrix< Real >, is_ad > GenericDenseMatrix
void ErrorVector unsigned int
OutputTools< RealEigenVector >::VariableTestCurl ArrayVariableTestCurl
const BoundaryID ANY_BOUNDARY_ID
boundary_id_type BoundaryID
Moose::GenericType< RankTwoTensor, is_ad > GenericRankTwoTensor
DualNumber< ADReal, ADReal > ChainedADReal
Moose::GenericType< RealEigenVector, is_ad > GenericRealEigenVector
const TagName SOLUTION_DOT_TAG