Go to the documentation of this file.
15 #include "libmesh/libmesh.h"
16 #include "libmesh/id_types.h"
17 #include "libmesh/stored_range.h"
18 #include "libmesh/petsc_macro.h"
19 #include "libmesh/boundary_info.h"
20 #include "libmesh/parameters.h"
23 #include "bitmask_operators.h"
25 #include "libmesh/ignore_warnings.h"
27 #include "libmesh/restore_warnings.h"
28 #include "libmesh/tensor_tools.h"
33 #include <type_traits>
37 #define MooseSharedPointer std::shared_ptr
38 #define MooseSharedNamespace std
49 #pragma clang diagnostic push
50 #pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
53 #define beginIndex_0() ERROR-- > "beginIndex() requires one or two arguments"
54 #define beginIndex_1(A) decltype(A.size())(0)
55 #define beginIndex_2(A, B) decltype(A.size())(B)
56 #define beginIndex_3(A, B, C) ERROR-- > "beginIndex() requires one or two arguments"
57 #define beginIndex_4(A, B, C, D) ERROR-- > "beginIndex() requires one or two arguments"
60 #define beginIndex_X(x, A, B, C, D, FUNC, ...) FUNC
63 #define beginIndex(...) \
66 beginIndex_4(__VA_ARGS__), \
67 beginIndex_3(__VA_ARGS__), \
68 beginIndex_2(__VA_ARGS__), \
69 beginIndex_1(__VA_ARGS__), \
70 beginIndex_0(__VA_ARGS__))
85 #define MooseIndex(type) decltype(_MooseIndex(type, 0))
88 template <typename T, typename std::enable_if<std::is_integral<T>::value>
::type * =
nullptr>
95 decltype(std::declval<T>().size())
100 template <
typename T>
101 decltype(
"NOTE: MooseIndex only works with integers and objects with size()!")
105 #pragma clang diagnostic pop
144 template <
unsigned int,
typename>
152 namespace TensorTools
155 struct IncrementRank<Eigen::Matrix<Real, Eigen::Dynamic, 1>>
157 typedef Eigen::Matrix<Real, Eigen::Dynamic, LIBMESH_DIM>
type;
161 struct IncrementRank<Eigen::Matrix<Real, Eigen::Dynamic, LIBMESH_DIM>>
163 typedef Eigen::Matrix<Real, Eigen::Dynamic, LIBMESH_DIM * LIBMESH_DIM>
type;
167 struct DecrementRank<Eigen::Matrix<Real, Eigen::Dynamic, LIBMESH_DIM>>
169 typedef Eigen::Matrix<Real, Eigen::Dynamic, 1>
type;
177 #define ADReal typename Moose::RealType<compute_stage>::type
178 #define ADRealVectorValue typename RealVectorValueType<compute_stage>::type
179 #define ADPoint typename PointType<compute_stage>::type
180 #define ADRealTensorValue typename RealTensorValueType<compute_stage>::type
181 #define ADRankTwoTensor typename RankTwoTensorType<compute_stage>::type
182 #define ADRankFourTensor typename RankFourTensorType<compute_stage>::type
183 #define ADDenseMatrix typename DenseMatrixType<compute_stage>::type
184 #define ADDenseVector typename DenseVectorType<compute_stage>::type
200 typedef StoredRange<std::vector<dof_id_type>::iterator, dof_id_type>
NodeIdRange;
211 template <ComputeStage compute_stage>
222 template <
typename T, ComputeStage compute_stage>
228 template <ComputeStage compute_stage>
234 template <ComputeStage compute_stage,
template <
typename>
class W>
240 template <
typename OutputType>
246 struct ShapeType<Eigen::Matrix<Real, Eigen::Dynamic, 1>>
251 template <
typename OutputType>
263 template <
typename OutputType>
342 template <
template <
class>
class W>
351 template <
typename T, ComputeStage compute_stage>
359 template <
typename T, ComputeStage compute_stage>
365 template <
typename T, ComputeStage compute_stage>
372 template <
typename T, ComputeStage compute_stage>
378 template <
typename T, ComputeStage compute_stage>
386 template <ComputeStage compute_stage>
396 template <ComputeStage compute_stage>
406 template <ComputeStage compute_stage>
416 template <ComputeStage compute_stage>
426 template <ComputeStage compute_stage>
429 typedef DenseMatrix<Real>
type;
434 typedef DenseMatrix<DualReal>
type;
436 template <ComputeStage compute_stage>
439 typedef DenseVector<Real>
type;
444 typedef DenseVector<DualReal>
type;
447 template <
typename mat_prop_type, ComputeStage compute_stage>
452 template <
typename mat_prop_type>
458 template <ComputeStage compute_stage>
469 #define ADVariableValue typename VariableValueType<Real, compute_stage>::type
470 #define ADVariableGradient typename VariableGradientType<Real, compute_stage>::type
471 #define ADVariableSecond typename VariableSecondType<Real, compute_stage>::type
473 #define ADVectorVariableValue typename VariableValueType<RealVectorValue, compute_stage>::type
474 #define ADVectorVariableGradient typename VariableGradientType<RealVectorValue, compute_stage>::type
475 #define ADVectorVariableSecond typename VariableSecondType<RealVectorValue, compute_stage>::type
477 #define ADTemplateVariableValue typename VariableValueType<T, compute_stage>::type
478 #define ADTemplateVariableGradient typename VariableGradientType<T, compute_stage>::type
479 #define ADTemplateVariableSecond typename VariableSecondType<T, compute_stage>::type
481 #define ADTemplateVariablePhiGradient typename VariablePhiGradientType<T, compute_stage>::type
482 #define ADVariablePhiGradient typename VariablePhiGradientType<Real, compute_stage>::type
484 #define ADMaterialProperty(Type) typename MaterialPropertyType<Type, compute_stage>::type
492 #define ADTemplateVariableTestValue typename OutputTools<T>::VariableTestValue
493 #define ADTemplateVariableTestSecond typename OutputTools<T>::VariableTestSecond
494 #define ADTemplateVariablePhiValue typename OutputTools<T>::VariablePhiValue
496 #define declareADValidParams(ADObjectType) \
498 InputParameters validParams<ADObjectType<RESIDUAL>>(); \
500 InputParameters validParams<ADObjectType<JACOBIAN>>()
502 #define defineADValidParams(ADObjectType, ADBaseObjectType, addedParamCode) \
504 InputParameters validParams<ADObjectType<RESIDUAL>>() \
506 InputParameters params = validParams<ADBaseObjectType<RESIDUAL>>(); \
511 InputParameters validParams<ADObjectType<JACOBIAN>>() \
513 return validParams<ADObjectType<RESIDUAL>>(); \
515 void mooseClangFormatFunction()
517 #define defineLegacyParams(ObjectType) \
519 InputParameters validParams<ObjectType>() \
521 return ObjectType::validParams(); \
523 void mooseClangFormatFunction()
525 #define defineADLegacyParams(ADObjectType) \
527 InputParameters validParams<ADObjectType<RESIDUAL>>() \
529 return ADObjectType<RESIDUAL>::validParams(); \
532 InputParameters validParams<ADObjectType<JACOBIAN>>() \
534 return ADObjectType<JACOBIAN>::validParams(); \
536 void mooseClangFormatFunction()
538 #define defineADBaseValidParams(ADObjectType, BaseObjectType, addedParamCode) \
540 InputParameters validParams<ADObjectType<RESIDUAL>>() \
542 InputParameters params = validParams<BaseObjectType>(); \
547 InputParameters validParams<ADObjectType<JACOBIAN>>() \
549 return validParams<ADObjectType<RESIDUAL>>(); \
551 void mooseClangFormatFunction()
553 #define defineADValidParamsFromEmpty(ADObjectType, addedParamCode) \
555 InputParameters validParams<ADObjectType<RESIDUAL>>() \
557 InputParameters params = emptyInputParameters(); \
562 InputParameters validParams<ADObjectType<JACOBIAN>>() \
564 return validParams<ADObjectType<RESIDUAL>>(); \
566 void mooseClangFormatFunction()
812 #ifdef LIBMESH_HAVE_PETSC
813 #if PETSC_VERSION_LESS_THAN(3, 3, 0)
892 static const bool enable =
true;
900 #define DerivativeStringClass(TheName) \
901 class TheName : public std::string \
904 TheName() : std::string() {} \
905 TheName(const std::string & str) : std::string(str) {} \
906 TheName(const std::string & str, size_t pos, size_t n = npos) : std::string(str, pos, n) {} \
907 TheName(const char * s, size_t n) : std::string(s, n) {} \
908 TheName(const char * s) : std::string(s) {} \
909 TheName(size_t n, char c) : std::string(n, c) {} \
OutputTools< RealEigenVector >::VariablePhiCurl ArrayVariablePhiCurl
PCSideType
Preconditioning side.
RESTARTABLE_FILTER
The filter type applied to a particular piece of "restartable" data.
Preconditioned Jacobian-Free Newton Krylov.
OutputTools< RealVectorValue >::VariableTestValue VectorVariableTestValue
OutputTools< typename Moose::ValueType< T, compute_stage >::type >::VariableGradient type
Solving a linear problem.
OutputTools< RealVectorValue >::VariableSecond VectorVariableSecond
use whatever we have in SLEPC
OutputTools< RealEigenVector >::VariableCurl ArrayVariableCurl
MooseArray< VectorValue< DualReal > > type
OutputTools< RealVectorValue >::VariablePhiCurl VectorVariablePhiCurl
OutputTools< RealEigenVector >::VariableTestCurl ArrayVariableTestCurl
VariableTestGradient ADVariableTestGradient
OutputTools< RealVectorValue >::VariableTestCurl VectorVariableTestCurl
OutputTools< typename Moose::ValueType< T, compute_stage >::type >::VariableSecond type
EigenSolveType
Type of the eigen solve.
OutputTools< typename Moose::ValueType< T, compute_stage >::type >::VariablePhiGradient type
OutputTools< Real >::VariableGradient VariableGradient
DenseVector< DualReal > type
Matrix-free nonlinear inverse power.
OutputTools< RealEigenVector >::VariablePhiValue ArrayVariablePhiValue
use whatever SLPEC has by default
OutputTools< RealVectorValue >::VariableCurl VectorVariableCurl
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
RankTwoTensorTempl< Real > RankTwoTensor
DualRealTensorValue ADRealTensor
DualRealVectorValue DualRealGradient
Use whatever we have in PETSc.
const processor_id_type INVALID_PROCESSOR_ID
RealType< compute_stage >::type type
const SubdomainID ANY_BLOCK_ID
Generalized Non-Hermitian with positive (semi-)definite B.
OutputTools< RealEigenVector >::VariableSecond ArrayVariableSecond
Newton-based eigen solver.
subdomain_id_type SubdomainID
std::function< void(const InputParameters &, InputParameters &)> RelationshipManagerInputParameterCallback
The type for the callback to set RelationshipManager parameters.
OutputTools< Real >::VariablePhiSecond VariablePhiSecond
DualNumber< Real, DNDerivativeType > DualReal
VectorValue< Real > RealVectorValue
OutputTools< RealVectorValue >::VariablePhiGradient VectorVariablePhiGradient
OutputTools< RealEigenVector >::VariablePhiSecond ArrayVariablePhiSecond
OutputTools< RealVectorValue >::VariableValue VectorVariableValue
PatchUpdateType
Type of patch update strategy for modeling node-face constraints or contact.
OutputTools< RealEigenVector >::VariableValue ArrayVariableValue
OutputTools< Real >::VariableCurl VariableCurl
MffdType
Type of the matrix-free finite-differencing parameter.
TemplateDN< TensorValue > DualRealTensorValue
StoredRange< std::vector< dof_id_type >::iterator, dof_id_type > NodeIdRange
std::string stringify(const T &t)
conversion to string
Use finite differences to compute Jacobian.
OutputTools< Real >::VariablePhiValue VariablePhiValue
Eigen::Matrix< Real, Eigen::Dynamic, LIBMESH_DIM *LIBMESH_DIM > RealTensorArrayValue
ADMaterialPropertyObject< mat_prop_type > type
TemplateDN< VectorValue > DualRealVectorValue
MooseKSPNormType
Norm type for converge test.
VectorVariableTestSecond ADVectorVariableTestSecond
const BoundaryID ANY_BOUNDARY_ID
LineSearchType
Type of the line search.
OutputTools< typename Moose::ValueType< T, compute_stage >::type >::VariableValue type
Real PostprocessorValue
MOOSE typedefs.
Real ScatterVectorPostprocessorValue
W< typename RealType< compute_stage >::type > type
OutputTools< RealVectorValue >::VariablePhiSecond VectorVariablePhiSecond
EigenProblemType
Type of the eigen problem.
StoredRange< std::vector< const Elem * >::iterator, const Elem * > ConstElemPointerRange
VectorVariableTestValue ADVectorVariableTestValue
SolveType
Type of the solve.
std::vector< std::vector< Eigen::Map< RealDIMValue > > > MappedArrayVariablePhiGradient
boundary_id_type BoundaryID
RelationshipManagerType
Main types of Relationship Managers.
AuxGroup
Flag for AuxKernel related execution type.
OutputTools< RealEigenVector >::VariablePhiGradient ArrayVariablePhiGradient
OutputTools< Real >::VariableTestValue VariableTestValue
const SubdomainID INVALID_BLOCK_ID
std::vector< Real > VectorPostprocessorValue
VariableTestSecond ADVariableTestSecond
Concrete definition of a parameter value for a specified type.
VariableValueType< Real, ComputeStage::JACOBIAN >::type DualVariableValue
OutputTools< RealEigenVector >::VariableTestSecond ArrayVariableTestSecond
subdomain_id_type SubdomainID
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealEigenMatrix
WhichEigenPairs
Which eigen pairs.
std::remove_const< T >::type _MooseIndex(T, int)
MaterialDataType
MaterialData types.
Use whatever we have in PETSc.
OutputTools< Real >::VariablePhiCurl VariablePhiCurl
DenseMatrix< DualReal > type
VariableTestValue ADVariableTestValue
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
const std::set< SubdomainID > EMPTY_BLOCK_IDS
Generalized Hermitian indefinite.
VarKindType
Framework-wide stuff.
MaterialProperty< mat_prop_type > type
OutputTools< RealVectorValue >::VariableTestGradient VectorVariableTestGradient
Generalized Non-Hermitian.
RankFourTensorTempl is designed to handle any N-dimensional fourth order tensor, C.
const std::set< BoundaryID > EMPTY_BOUNDARY_IDS
OutputTools< typename Moose::ValueType< T, compute_stage >::type >::VariableTestGradient type
Eigen::Matrix< Real, LIBMESH_DIM, 1 > RealDIMValue
OutputTools< RealVectorValue >::VariableTestSecond VectorVariableTestSecond
RealType< compute_stage >::type type
DerivativeStringClass(FileName)
This type is for expected (i.e.
VectorVariableTestGradient ADVectorVariableTestGradient
Jacobian-Free Newton Krylov.
OutputTools< Real >::VariableTestSecond VariableTestSecond
Eigen::Matrix< Real, Eigen::Dynamic, LIBMESH_DIM > RealVectorArrayValue
OutputTools< RealEigenVector >::VariableGradient ArrayVariableGradient
TimeIntegratorType
Time integrators.
unsigned int MooseObjectID
Matrix-free Newton-based eigen solver.
TensorValue< Real > RealTensorValue
RankTwoTensorTempl is designed to handle the Stress or Strain Tensor for a fully anisotropic material...
OutputTools< Real >::VariableTestGradient VariableTestGradient
RankFourTensorTempl< DualReal > DualRankFourTensor
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
OutputTools< Real >::VariableValue VariableValue
RankTwoTensorTempl< DualReal > DualRankTwoTensor
void print_helper(std::ostream &os, const Moose::RelationshipManagerType *param)
const BoundaryID INVALID_BOUNDARY_ID
RankFourTensorTempl< Real > RankFourTensor
OutputTools< RealVectorValue >::VariableGradient VectorVariableGradient
OutputTools< RealVectorValue >::VariablePhiValue VectorVariablePhiValue
OutputTools< Real >::VariableSecond VariableSecond
OutputTools< RealEigenVector >::VariableTestValue ArrayVariableTestValue
ConstraintFormulationType
Type of constraint formulation.
boundary_id_type BoundaryID
OutputTools< Real >::VariableTestCurl VariableTestCurl
OutputTools< RealEigenVector >::VariableTestGradient ArrayVariableTestGradient