https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
Moose Namespace Reference

MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to address this in their environment if C++17 compatibility isn't found. More...

Namespaces

namespace  DataFileUtils
 
namespace  FV
 
namespace  internal
 
namespace  Kokkos
 
namespace  MFEM
 Utilities for converting between vector(s) of libMesh Points and MFEM Vector(s).
 
namespace  Mortar
 
namespace  ParameterRegistration
 
namespace  PetscSupport
 
namespace  SlepcSupport
 
namespace  UnitUtils
 
namespace  WebServerControlTypeRegistration
 Defines classes for registering values that can be parsed, communicated, and stored in the WebServerControl.
 

Classes

struct  _enumerate_iterator
 
struct  _enumerate_range
 
struct  _enumerate_struct
 
struct  ADType
 
struct  ADType< ADRankFourTensor >
 
struct  ADType< ADRankThreeTensor >
 
struct  ADType< ADRankTwoTensor >
 
struct  ADType< ADReal >
 
struct  ADType< ADSymmetricRankFourTensor >
 
struct  ADType< ADSymmetricRankTwoTensor >
 
struct  ADType< ADVariableGradient >
 
struct  ADType< ADVariableSecond >
 
struct  ADType< ADVariableValue >
 
struct  ADType< ChainedADReal >
 
struct  ADType< ChainedReal >
 
struct  ADType< DenseMatrix< T > >
 
struct  ADType< DenseVector< T > >
 
struct  ADType< Eigen::Matrix< T, M, N, O, M2, N2 > >
 
struct  ADType< Point >
 
struct  ADType< RankFourTensor >
 
struct  ADType< RankThreeTensor >
 
struct  ADType< RankTwoTensor >
 
struct  ADType< Real >
 
struct  ADType< RealEigenMatrix >
 
struct  ADType< RealEigenVector >
 
struct  ADType< RealVectorValue >
 
struct  ADType< std::list< T, std::allocator< T > > >
 
struct  ADType< std::set< T, std::less< T >, std::allocator< T > > >
 
struct  ADType< std::vector< T, std::allocator< T > > >
 
struct  ADType< SymmetricRankFourTensor >
 
struct  ADType< SymmetricRankTwoTensor >
 
struct  ADType< VariableGradient >
 
struct  ADType< VariableSecond >
 
struct  ADType< VariableValue >
 
struct  ADType< W< T > >
 
class  ADWrapperFunctor
 Wraps non-AD functors such that they can be used in objects that have requested the functor as AD. More...
 
class  ArrayComponentFunctor
 This is essentially a forwarding functor that forwards the spatial and temporal evaluation arguments to the parent array functor and then returns the result indexed at a given component. More...
 
class  BSpline
 Class implementing a uniform clamped B-Spline curve. More...
 
class  Builder
 Parses MOOSE input using HIT/WASP. More...
 
class  Capability
 An entry for a single capability. More...
 
class  CapabilityException
 Common execption to be thrown when interacting with capabilities. More...
 
class  ConstantFunctor
 Class template for creating constant functors. More...
 
struct  DerivativeStringClass
 Struct that all MOOSE derivative strings derive from. More...
 
struct  DOFType
 
struct  DOFType< RealVectorValue >
 
struct  ElemArg
 A structure that is used to evaluate Moose functors logically at an element/cell center. More...
 
struct  ElemPointArg
 A structure that is used to evaluate Moose functors at an arbitrary physical point contained within an element. More...
 
struct  ElemQpArg
 Argument for requesting functor evaluation at a quadrature point location in an element. More...
 
struct  ElemSideQpArg
 Argument for requesting functor evaluation at quadrature point locations on an element side. More...
 
struct  FaceArg
 A structure defining a "face" evaluation calling argument for Moose functors. More...
 
class  FunctionBase
 
class  FunctorAbstract
 Abstract base class that can be used to hold collections of functors. More...
 
class  FunctorBase
 Base class template for functor objects. More...
 
class  FunctorEnvelope
 This is a wrapper that forwards calls to the implementation, which can be switched out at any time without disturbing references to FunctorBase. More...
 
class  FunctorEnvelopeBase
 A non-templated base class for functors that allow an owner object to hold different class template instantiations of Functor in a single container. More...
 
struct  FunctorGradientEvaluationKind
 This structure takes an evaluation kind as a template argument and defines a constant expression indicating the associated gradient kind. More...
 
struct  FunctorGradientEvaluationKind< FunctorEvaluationKind::Dot >
 The gradient kind associated with a time derivative is the gradient of the time derivative. More...
 
struct  FunctorGradientEvaluationKind< FunctorEvaluationKind::Value >
 The gradient kind associated with a value is simply the gradient. More...
 
struct  FunctorReturnType
 A structure that defines the return type of a functor based on the type of the functor and the requested evaluation kind, e.g. More...
 
struct  FunctorReturnType< T, FunctorEvaluationKind::Dot >
 The return type of a time derivative evaluation is the same as the value type. More...
 
struct  FunctorReturnType< T, FunctorEvaluationKind::GradDot >
 The return type of a gradient of time derivative evaluation is the same as the gradient type. More...
 
struct  FunctorReturnType< T, FunctorEvaluationKind::Gradient >
 The return type of a gradient evaluation is the rank increment of a value return type. More...
 
struct  FunctorReturnType< T, FunctorEvaluationKind::Value >
 The return type for a value evaluation is just the type of the functor. More...
 
struct  indirect_comparator
 
struct  IsADType
 
struct  IsADType< ADPoint >
 
struct  IsADType< ADReal >
 
struct  IsADType< MetaPhysicL::DualNumber< T, Args... > >
 
struct  IsADType< W< T, Args... > >
 
class  LibtorchArtificialNeuralNet
 
class  LibtorchArtificialNeuralNetTrainer
 Templated class which is responsible for training LibtorchArtificialNeuralNets. More...
 
class  LibtorchDataset
 This class is a wrapper around a libtorch dataset which can be used by the data loaders in the neural net training process. More...
 
class  LibtorchNeuralNetBase
 This base class is meant to gather the functions and members common in every neural network based on Libtorch. More...
 
struct  LibtorchTrainingOptions
 A struct containing necessary information for training neural networks. More...
 
struct  NodeArg
 
class  NullFunctor
 A functor that serves as a placeholder during the simulation setup phase if a functor consumer requests a functor that has not yet been constructed. More...
 
class  ParameterRegistry
 Registry that allows for the typeless setting of a parameter value from a hit field. More...
 
class  PassKey
 
class  PeriodicBCHelper
 Helper class for setting up periodic boundary conditions via an Action. More...
 
class  RawValueFunctor
 
class  ScopedCommSwapper
 
class  ScopedDeprecatedIsError
 Scoped helper for setting Moose::_deprecated_is_error during this scope. More...
 
class  ScopedThrowOnError
 Scoped helper for setting Moose::_throw_on_error during this scope. More...
 
struct  SerialAccess
 Serial access requires object data to be stored contiguously. More...
 
class  SerialAccessRange
 
struct  SerialAccessValueTypeHelper
 Value type helper (necessary for any type that does not have a value_type member or where value_type doesn't have a suitable meaning (ADReal)). More...
 
struct  SerialAccessValueTypeHelper< ADReal >
 
struct  SerialAccessValueTypeHelper< Real >
 
struct  ShapeType
 
struct  ShapeType< Eigen::Matrix< Real, Eigen::Dynamic, 1 > >
 
class  Span
 Replacement for std::span which we only get in c++20. More...
 
struct  StateArg
 State argument for evaluating functors. More...
 
class  TorchScriptModule
 
struct  TypeList
 Helper structure to hold a list of types. More...
 
class  UnknownCapabilitiesException
 Exception thrown when capabilities are unknown. More...
 
class  UnusedWalker
 
class  VectorComponentFunctor
 This is essentially a forwarding functor that forwards the spatial and temporal evaluation arguments to the parent vector functor and then returns the result indexed at a given component. More...
 
class  VectorCompositeFunctor
 A functor that returns a vector composed of its component functor evaluations. More...
 
class  WebServerControlTypeRegistry
 A static registry used to register and build values of different types for the WebServerControl. More...
 

Typedefs

template<typename T >
using Functor = FunctorEnvelope< T >
 
template<typename T , bool is_ad>
using GenericType = typename std::conditional< is_ad, typename ADType< T >::type, T >::type
 
typedef std::function< void(const InputParameters &, InputParameters &)> RelationshipManagerInputParameterCallback
 The type for the callback to set RelationshipManager parameters.
 

Enumerations

enum class  FunctorEvaluationKind { Value , Gradient , Dot , GradDot }
 An enumeration of possible functor evaluation kinds. More...
 
enum  SolutionState : int { Current = 0 , Old = 1 , Older = 2 , PreviousNL = -1 }
 
enum class  SolutionIterationType : unsigned short {
  Time = 0 , Nonlinear , MultiAppFixedPoint , MultiSystemFixedPoint ,
  Count
}
 
enum  GeometryType { Volume , Face }
 
enum  MaterialDataType {
  BLOCK_MATERIAL_DATA , BOUNDARY_MATERIAL_DATA , FACE_MATERIAL_DATA , NEIGHBOR_MATERIAL_DATA ,
  INTERFACE_MATERIAL_DATA
}
 MaterialData types. More...
 
enum  AuxGroup { PRE_IC = 0 , PRE_AUX = 1 , POST_AUX = 2 , ALL = 3 }
 Flag for AuxKernel related execution type. More...
 
enum  VarKindType { VAR_SOLVER , VAR_AUXILIARY , VAR_ANY }
 Framework-wide stuff. More...
 
enum  VarFieldType {
  VAR_FIELD_STANDARD , VAR_FIELD_SCALAR , VAR_FIELD_VECTOR , VAR_FIELD_ARRAY ,
  VAR_FIELD_ANY
}
 
enum  CouplingType { COUPLING_DIAG , COUPLING_FULL , COUPLING_CUSTOM }
 
enum  ConstraintSideType { SIDE_PRIMARY , SIDE_SECONDARY }
 
enum  DGResidualType { Element , Neighbor }
 
enum  DGJacobianType { ElementElement , ElementNeighbor , NeighborElement , NeighborNeighbor }
 
enum  ConstraintType { Secondary = Element , Primary = Neighbor }
 
enum class  ElementType : unsigned int { Element = DGResidualType::Element , Neighbor = DGResidualType::Neighbor , Lower = DGResidualType::Neighbor + 1 }
 
enum class  MortarType : unsigned int { Secondary = static_cast<unsigned int>(Moose::ElementType::Element) , Primary = static_cast<unsigned int>(Moose::ElementType::Neighbor) , Lower = static_cast<unsigned int>(Moose::ElementType::Lower) }
 
enum class  ComputeType { Residual , Jacobian , ResidualAndJacobian }
 The type of nonlinear computation being performed. More...
 
enum class  RESTARTABLE_FILTER : unsigned char { RECOVERABLE }
 The filter type applied to a particular piece of "restartable" data. More...
 
enum  ConstraintJacobianType {
  SecondarySecondary = ElementElement , SecondaryPrimary = ElementNeighbor , PrimarySecondary = NeighborElement , PrimaryPrimary = NeighborNeighbor ,
  LowerLower , LowerSecondary , LowerPrimary , SecondaryLower ,
  PrimaryLower
}
 
enum  CoordinateSystemType : int { COORD_XYZ = 0 , COORD_RZ , COORD_RSPHERICAL }
 
enum  PCSideType { PCS_LEFT , PCS_RIGHT , PCS_SYMMETRIC , PCS_DEFAULT }
 Preconditioning side. More...
 
enum  MooseKSPNormType {
  KSPN_NONE , KSPN_PRECONDITIONED , KSPN_UNPRECONDITIONED , KSPN_NATURAL ,
  KSPN_DEFAULT
}
 Norm type for converge test. More...
 
enum  SolveType {
  ST_PJFNK , ST_JFNK , ST_NEWTON , ST_FD ,
  ST_LINEAR
}
 Type of the solve. More...
 
enum  EigenSolveType {
  EST_POWER , EST_ARNOLDI , EST_KRYLOVSCHUR , EST_JACOBI_DAVIDSON ,
  EST_NONLINEAR_POWER , EST_NEWTON , EST_PJFNK , EST_PJFNKMO ,
  EST_JFNK
}
 Type of the eigen solve. More...
 
enum  EigenProblemType {
  EPT_HERMITIAN , EPT_NON_HERMITIAN , EPT_GEN_HERMITIAN , EPT_GEN_INDEFINITE ,
  EPT_GEN_NON_HERMITIAN , EPT_POS_GEN_NON_HERMITIAN , EPT_SLEPC_DEFAULT
}
 Type of the eigen problem. More...
 
enum  WhichEigenPairs {
  WEP_LARGEST_MAGNITUDE , WEP_SMALLEST_MAGNITUDE , WEP_LARGEST_REAL , WEP_SMALLEST_REAL ,
  WEP_LARGEST_IMAGINARY , WEP_SMALLEST_IMAGINARY , WEP_TARGET_MAGNITUDE , WEP_TARGET_REAL ,
  WEP_TARGET_IMAGINARY , WEP_ALL_EIGENVALUES , WEP_SLEPC_DEFAULT
}
 Which eigen pairs. More...
 
enum  TimeIntegratorType {
  TI_IMPLICIT_EULER , TI_EXPLICIT_EULER , TI_CRANK_NICOLSON , TI_BDF2 ,
  TI_EXPLICIT_MIDPOINT , TI_LSTABLE_DIRK2 , TI_EXPLICIT_TVD_RK_2 , TI_NEWMARK_BETA
}
 Time integrators. More...
 
enum  ConstraintFormulationType { Penalty , Kinematic }
 Type of constraint formulation. More...
 
enum  LineSearchType {
  LS_INVALID , LS_DEFAULT , LS_NONE , LS_BASIC ,
  LS_SHELL , LS_CONTACT , LS_PROJECT , LS_L2 ,
  LS_BT , LS_CP
}
 Type of the line search. More...
 
enum  MffdType { MFFD_INVALID , MFFD_WP , MFFD_DS }
 Type of the matrix-free finite-differencing parameter. More...
 
enum  PatchUpdateType { Never , Always , Auto , Iteration }
 Type of patch update strategy for modeling node-face constraints or contact. More...
 
enum class  RelationshipManagerType : unsigned char { DEFAULT = 0 , GEOMETRIC = 1 << 0 , ALGEBRAIC = 1 << 1 , COUPLING = 1 << 2 }
 Main types of Relationship Managers. More...
 
enum  RMSystemType { NONLINEAR , AUXILIARY , NONE }
 
enum  VectorTagType { VECTOR_TAG_RESIDUAL = 0 , VECTOR_TAG_SOLUTION = 1 , VECTOR_TAG_ANY = 2 }
 
enum class  FEBackend { LibMesh , MFEM }
 

Functions

InputParameters commonAdaptivityParams ()
 
bool isSolverExecFlag (const ExecFlagType &exec_flag)
 
bool colorConsole ()
 Returns whether Console coloring is turned on (default: true).
 
bool setColorConsole (bool use_color, bool force=false)
 Turns color escape sequences on/off for info written to stdout.
 
void registerAll (Factory &f, ActionFactory &af, Syntax &s)
 Register objects that are in MOOSE.
 
void registerObjects (Factory &factory, const std::set< std::string > &obj_labels)
 
void addActionTypes (Syntax &syntax)
 
void registerActions (Syntax &syntax, ActionFactory &action_factory)
 Multiple Action class can be associated with a single input file section, in which case all associated Actions will be created and "acted" on when the associated input file section is seen.
 
void registerActions (Syntax &syntax, ActionFactory &action_factory, const std::set< std::string > &obj_labels)
 
void associateSyntax (Syntax &syntax, ActionFactory &action_factory)
 
void setSolverDefaults (FEProblemBase &problem)
 
MPI_Comm swapLibMeshComm (MPI_Comm new_comm)
 Swap the libMesh MPI communicator out for ours.
 
std::string hitMessagePrefix (const hit::Node &node)
 Get the prefix to be associated with a hit node for a message.
 
StateArg currentState ()
 
StateArg oldState ()
 
StateArg previousNonlinearState ()
 
StateArg previousMultiAppFixedPointState ()
 
StateArg previousMultiSystemFixedPointState ()
 
std::unique_ptr< MooseAppcreateMooseApp (const std::string &default_app_type, int argc, char *argv[])
 Create a MooseApp from command-line arguments.
 
template<typename DefaultAppType >
int main (int argc, char *argv[])
 Initialize, create and run a MooseApp.
 
void findContactPoint (PenetrationInfo &p_info, libMesh::FEBase *fe_elem, libMesh::FEBase *fe_side, libMesh::FEType &fe_side_type, const libMesh::Point &secondary_point, bool start_with_centroid, const Real tangential_tolerance, bool &contact_point_on_side, bool &search_succeeded)
 
void restrictPointToFace (libMesh::Point &p, const libMesh::Elem *side, std::vector< const libMesh::Node * > &off_edge_nodes)
 
void to_json (nlohmann::json &json, const Moose::LibtorchArtificialNeuralNet *const &network)
 
void initial_condition (libMesh::EquationSystems &es, const std::string &system_name)
 
void assemble_matrix (EquationSystems &es, const std::string &system_name)
 
template<std::size_t N>
void derivInsert (SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N > > &derivs, libMesh::dof_id_type index, Real value)
 
bool globalADIndexing ()
 Whether we are using global AD indexing.
 
std::size_t adOffset (unsigned int var_num, std::size_t max_dofs_per_elem, ElementType element_type=ElementType::Element, unsigned int num_vars_in_system=0)
 Helper function for computing automatic differentiation offset.
 
std::size_t adOffset (unsigned int var_num, std::size_t max_dofs_per_elem, DGJacobianType dg_jacobian_type, unsigned int num_vars_in_system=0)
 
std::unordered_map< dof_id_type, Real > globalDofIndexToDerivative (const ADReal &ad_real, const SystemBase &sys, ElementType elem_type=ElementType::Element, THREAD_ID tid=0)
 Generate a map from global dof index to derivative value.
 
template<typename T >
auto globalDofIndexToDerivative (const T &ad_real_container, const SystemBase &sys, ElementType elem_type=ElementType::Element, THREAD_ID tid=0) -> std::vector< std::unordered_map< dof_id_type, typename std::enable_if< std::is_same< ADReal, typename T::value_type >::value, Real >::type > >
 Generate a map from global dof index to derivative value for a (probably quadrature-point-based) container like a material property or a variable value.
 
bool doDerivatives (const SubProblem &subproblem, const SystemBase &sys)
 
template<bool is_ad>
GenericReal< is_ad > ADRealToGenericReal (const ADReal &u_ad)
 Converts an ADReal to a GenericReal<is_ad>
 
template<typename T >
stringToEnum (const std::string &s)
 
template<>
libMesh::QuadratureType stringToEnum< libMesh::QuadratureType > (const std::string &s)
 
template<>
libMesh::Order stringToEnum< libMesh::Order > (const std::string &s)
 
template<>
CoordinateSystemType stringToEnum< CoordinateSystemType > (const std::string &s)
 
template<>
SolveType stringToEnum< SolveType > (const std::string &s)
 
template<>
LineSearchType stringToEnum< LineSearchType > (const std::string &s)
 
template<>
TimeIntegratorType stringToEnum< TimeIntegratorType > (const std::string &s)
 
template<>
RelationshipManagerType stringToEnum< RelationshipManagerType > (const std::string &s)
 
template<typename T >
std::vector< T > vectorStringsToEnum (const MultiMooseEnum &v)
 
template<typename T >
std::string stringify (const T &t)
 conversion to string
 
std::string stringify (bool v)
 
std::string stringify (int v)
 
std::string stringify (long v)
 
std::string stringify (long long v)
 
std::string stringify (unsigned int v)
 
std::string stringify (unsigned long v)
 
std::string stringify (unsigned long long v)
 
template<typename... T>
std::string stringify (std::variant< T... > v)
 
std::string stringify (const SolveType &t)
 Convert solve type into human readable string.
 
std::string stringify (const EigenSolveType &t)
 Convert eigen solve type into human readable string.
 
std::string stringify (const VarFieldType &t)
 Convert variable field type into human readable string.
 
std::string stringify (const std::string &s)
 Add no-op stringify if the argument already is a string (must use overloading)
 
std::string stringify (libMesh::FEFamily f)
 Convert FEType from libMesh into string.
 
std::string stringify (SolutionIterationType t)
 Convert SolutionIterationType into string.
 
std::string stringify (ElementType t)
 Convert ElementType into string.
 
std::string stringify (libMesh::ElemType t)
 Convert the libmesh ElemType into string.
 
template<typename T , typename U >
std::string stringify (const std::pair< T, U > &p, const std::string &delim=":")
 Add pair stringify to support maps.
 
template<typename... Args>
std::string stringify (const std::tuple< Args... > &t, const std::string &delim=":")
 Add tuple stringify.
 
template<template< typename... > class T, typename... U>
std::string stringify (const T< U... > &c, const std::string &delim=", ", const std::string &elem_encl="", bool enclose_list_in_curly_braces=false)
 Convert a container to a string with elements separated by delimiter of user's choice.
 
std::string stringifyExact (Real)
 Stringify Reals with enough precision to guarantee lossless Real -> string -> Real roundtrips.
 
void elementsIntersectedByPlane (const libMesh::Point &p0, const libMesh::Point &normal, const libMesh::MeshBase &mesh, std::vector< const libMesh::Elem * > &intersected_elems)
 Find all of the elements intersected by a plane.
 
void elementsIntersectedByPlane (const libMesh::Point &p0, const libMesh::Point &p1, const libMesh::Point &p2, const libMesh::MeshBase &mesh, std::vector< const libMesh::Elem * > &intersected_elems)
 Find all of the elements intersected by a plane.
 
template<class Iterator >
_enumerate_range< Iterator > enumerate (Iterator first, Iterator last, typename std::iterator_traits< Iterator >::difference_type initial)
 Enumerate function for iterating over a range and obtaining both a reference to the underlying type and an index simultaneously.
 
template<class Container >
_enumerate_range< typename Container::iterator > enumerate (Container &content)
 
template<class Container >
_enumerate_range< typename Container::const_iterator > enumerate (const Container &content)
 
std::string getExec ()
 Gets the full path to the running executable on Mac OS X and linux.
 
std::string getExecutablePath ()
 Gets the directory the running executable is on Mac OS X and linux.
 
std::string getExecutableName ()
 Gets the name of the running executable on Mac OS X and linux.
 
template<class RandomAccessIterator >
void initialize_indirect_sort (RandomAccessIterator beg, RandomAccessIterator end, std::vector< size_t > &b)
 
template<class RandomAccessIterator >
void indirectSort (RandomAccessIterator beg, RandomAccessIterator end, std::vector< size_t > &b)
 
template<class RandomAccessIterator , class UserComparisonFunctor >
void indirectSort (RandomAccessIterator beg, RandomAccessIterator end, std::vector< size_t > &b, UserComparisonFunctor user_comp)
 
template<typename T >
void applyIndices (T &container, const std::vector< size_t > &indices)
 Uses indices created by the indirectSort function to sort the given container (which must support random access, resizing, and std::swap.
 
template<typename T , typename C >
std::map< T, C > createMapFromVectors (const std::vector< T > &keys, const std::vector< C > &values)
 Create a map from two vectors.
 
template<typename T >
std::map< T, MooseEnumcreateMapFromVectorAndMultiMooseEnum (const std::vector< T > &keys, const MultiMooseEnum &values)
 Create a map from a vector of keys and MultiMooseEnum acting as a vector.
 
void hash_combine (std::size_t &)
 Used for hash function specialization for Attribute objects.
 
template<typename T , typename... Rest>
void hash_combine (std::size_t &seed, const T &v, Rest &&... rest)
 Used to combine an existing hash value with the hash of one or more other values (v and rest).
 
template<typename T , typename... Rest>
void hash_combine (std::size_t &seed, const std::vector< T > &v, Rest &&... rest)
 Used for hash function specialization for Attribute objects.
 
template<typename T , typename... Rest>
void hash_combine (std::size_t &seed, const std::set< T > &v, Rest &&... rest)
 Used for hash function specialization for Attribute objects.
 
template<typename T >
fe_lagrange_1D_shape (const Order order, const unsigned int i, const T &xi)
 
template<typename T >
fe_lagrange_1D_shape_deriv (const Order order, const unsigned int i, const T &xi)
 
template<typename T , template< typename > class VectorType>
fe_lagrange_2D_shape (const libMesh::ElemType type, const Order order, const unsigned int i, const VectorType< T > &p)
 
template<typename T , template< typename > class VectorType>
fe_lagrange_2D_shape_deriv (const libMesh::ElemType type, const Order order, const unsigned int i, const unsigned int j, const VectorType< T > &p)
 
std::string stringify (const Moose::RelationshipManagerType &t)
 
std::string stringify (const Moose::TimeIntegratorType &t)
 
template<class C >
auto makeSpan (C &container, std::size_t offset, std::size_t n)
 Helper function for creating a span from a given container.
 
template<std::size_t N>
void derivInsert (NumberArray< N, Real > &derivs, dof_id_type index, Real value)
 
void elementsIntersectedByLine (const Point &p0, const Point &p1, const MeshBase &mesh, const libMesh::PointLocatorBase &point_locator, std::vector< Elem * > &intersected_elems, std::vector< LineSegment > &segments)
 Find all of the elements intersected by a line.
 
 SERIAL_ACCESS_SCALAR (Real)
 
 SERIAL_ACCESS_SCALAR (ADReal)
 
 SERIAL_ACCESS_CONST_SIZE (libMesh::VectorValue, &obj(0u), Moose::dim)
 
 SERIAL_ACCESS_CONST_SIZE (RankTwoTensorTempl, &obj(0u, 0u), RankTwoTensorTempl< T >::N2)
 
 SERIAL_ACCESS_CONST_SIZE (RankFourTensorTempl, &obj(0u, 0u, 0u, 0u), RankFourTensorTempl< T >::N4)
 
 SERIAL_ACCESS_DYNAMIC_SIZE (DenseVector, &obj(0u), obj.size())
 
template<typename T >
SerialAccessRange< T > serialAccess (T &obj)
 
template<template< typename, int > class L, int I, typename T , typename... Ts, typename... As>
void typeLoopInternal (TypeList< T, Ts... >, As... args)
 Type loop.
 
template<template< typename, int > class L, typename... Ts, typename... As>
void typeLoop (TypeList< Ts... >, As... args)
 Type loop.
 
template<typename T >
void initDofIndices (T &data, const Elem &elem)
 
void associateSyntaxInner (Syntax &syntax, ActionFactory &action_factory)
 
void findContactPoint (PenetrationInfo &p_info, FEBase *fe_elem, FEBase *fe_side, FEType &, const libMesh::Point &secondary_point, bool start_with_centroid, const Real tangential_tolerance, bool &contact_point_on_side, bool &search_succeeded)
 Finds the closest point (called the contact point) on the primary_elem on side "side" to the secondary_point.
 
void restrictPointToFace (libMesh::Point &p, const Elem *side, std::vector< const Node * > &off_edge_nodes)
 
bool isSectionActive (const hit::Node &node)
 
std::vector< std::string > findSimilar (const std::string &param, const std::vector< std::string > &options)
 
void compute_linear_system (libMesh::EquationSystems &es, const std::string &system_name)
 
void compute_jacobian (const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian, NonlinearImplicitSystem &sys)
 
void compute_bounds (NumericVector< Number > &lower, NumericVector< Number > &upper, NonlinearImplicitSystem &sys)
 
void compute_nullspace (std::vector< NumericVector< Number > * > &sp, NonlinearImplicitSystem &sys)
 
void compute_transpose_nullspace (std::vector< NumericVector< Number > * > &sp, NonlinearImplicitSystem &sys)
 
void compute_nearnullspace (std::vector< NumericVector< Number > * > &sp, NonlinearImplicitSystem &sys)
 
void compute_postcheck (const NumericVector< Number > &old_soln, NumericVector< Number > &search_direction, NumericVector< Number > &new_soln, bool &changed_search_direction, bool &changed_new_soln, NonlinearImplicitSystem &sys)
 
void initCoordinateSystemType ()
 
void initSolveType ()
 
void initEigenSolveType ()
 
void initEigenProlemType ()
 
void initWhichEigenPairs ()
 
void initLineSearchType ()
 
void initTimeIntegratorsType ()
 
void initMffdType ()
 
void initRMType ()
 
template<>
QuadratureType stringToEnum< QuadratureType > (const std::string &s)
 
template<>
Order stringToEnum< Order > (const std::string &s)
 
template<>
CoordinateSystemType stringToEnum< CoordinateSystemType > (const std::string &s)
 
template<>
SolveType stringToEnum< SolveType > (const std::string &s)
 
template<>
EigenSolveType stringToEnum< EigenSolveType > (const std::string &s)
 
template<>
EigenProblemType stringToEnum< EigenProblemType > (const std::string &s)
 
template<>
WhichEigenPairs stringToEnum< WhichEigenPairs > (const std::string &s)
 
template<>
LineSearchType stringToEnum< LineSearchType > (const std::string &s)
 
template<>
TimeIntegratorType stringToEnum< TimeIntegratorType > (const std::string &s)
 
template<>
MffdType stringToEnum< MffdType > (const std::string &s)
 
template<>
RelationshipManagerType stringToEnum< RelationshipManagerType > (const std::string &s)
 
Point toPoint (const std::vector< Real > &pos)
 
void findElementsIntersectedByPlane (const libMesh::Plane &plane, const MeshBase &mesh, std::vector< const Elem * > &intersected_elems)
 
void elementsIntersectedByPlane (const Point &p0, const Point &normal, const MeshBase &mesh, std::vector< const Elem * > &intersected_elems)
 
void elementsIntersectedByPlane (const Point &p0, const Point &p1, const Point &p2, const MeshBase &mesh, std::vector< const Elem * > &intersected_elems)
 
int sideIntersectedByLine (const Elem *elem, std::vector< int > &not_side, const LineSegment &line_segment, Point &intersection_point)
 Figure out which (if any) side of an Elem is intersected by a line.
 
int sideNeighborIsOn (const Elem *elem, const Elem *neighbor)
 Returns the side number for elem that neighbor is on.
 
void recursivelyFindElementsIntersectedByLine (const LineSegment &line_segment, const Elem *current_elem, int incoming_side, const Point &incoming_point, std::vector< Elem * > &intersected_elems, std::vector< LineSegment > &segments)
 Recursively find all elements intersected by a line segment.
 
void elementsIntersectedByLine (const Point &p0, const Point &p1, const MeshBase &, const PointLocatorBase &point_locator, std::vector< Elem * > &intersected_elems, std::vector< LineSegment > &segments)
 

Variables

static constexpr std::size_t dim = LIBMESH_DIM
 This is the dimension of all vector and tensor datastructures used in MOOSE.
 
constexpr std::size_t invalid_size_t = std::numeric_limits<std::size_t>::max()
 Value for invalid size_t indices.
 
volatile std::sig_atomic_t interrupt_signal_number = 0
 Used by the signal handler to determine if we should write a checkpoint file out at any point during operation.
 
bool show_multiple = false
 Set to false (the default) to display an error message only once for each error call code location (as opposed to every time the code is executed).
 
libMesh::PerfLog perf_log
 Perflog to be used by applications.
 
bool _trap_fpe
 Variable indicating whether we will enable FPE trapping for this run.
 
bool _warnings_are_errors = false
 Variable to toggle any warning into an error (includes deprecated code warnings)
 
bool _deprecated_is_error = false
 Variable to toggle only deprecated warnings as errors.
 
bool _throw_on_error = false
 Variable to turn on exceptions during mooseError(), should only be used within MOOSE unit tests or when about to perform threaded operations because exception throwing in threaded regions is safe while aborting is inherently not when singletons are involved (e.g.
 
bool _throw_on_warning = false
 Variable to turn on exceptions during mooseWarning(), should only be used in MOOSE unit tests.
 
ExecFlagEnum execute_flags
 Storage for the registered execute flags.
 
constexpr std::size_t constMaxQpsPerElem = 1000
 This is used for places where we initialize some qp-sized data structures that would end up being sized too small after the quadrature order gets bumped (dynamically in-sim).
 
template<class... Ts>
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 constexpr-based if conditions.
 
const processor_id_type INVALID_PROCESSOR_ID = libMesh::DofObject::invalid_processor_id
 
const SubdomainID ANY_BLOCK_ID = libMesh::Elem::invalid_subdomain_id - 1
 
const SubdomainID INVALID_BLOCK_ID = libMesh::Elem::invalid_subdomain_id
 
const BoundaryID ANY_BOUNDARY_ID = static_cast<BoundaryID>(-1)
 
const BoundaryID INVALID_BOUNDARY_ID = libMesh::BoundaryInfo::invalid_id
 
const TagID INVALID_TAG_ID = static_cast<TagID>(-1)
 
const TagTypeID INVALID_TAG_TYPE_ID = static_cast<TagTypeID>(-1)
 
const std::set< SubdomainIDEMPTY_BLOCK_IDS = {}
 
const std::set< BoundaryIDEMPTY_BOUNDARY_IDS = {}
 
const TagName SOLUTION_TAG = "SOLUTION"
 
const TagName OLD_SOLUTION_TAG = "SOLUTION_STATE_1"
 
const TagName OLDER_SOLUTION_TAG = "SOLUTION_STATE_2"
 
const TagName PREVIOUS_NL_SOLUTION_TAG = "U_PREVIOUS_NL_NEWTON"
 
const TagName PREVIOUS_MULTIAPP_FP_SOLUTION_TAG = "U_PREVIOUS_MULTIAPP_FP"
 
const TagName PREVIOUS_MULTISYSTEM_FP_SOLUTION_TAG = "U_PREVIOUS_MULTISYSTEM_FP"
 
const TagName SOLUTION_DOT_TAG = "u_dot_factor"
 
const TagName SOLUTION_DOTDOT_TAG = "u_dotdot_factor"
 
static bool _color_console = isatty(fileno(stdout))
 
std::map< std::string, CoordinateSystemTypecoordinate_system_type_to_enum
 
std::map< std::string, SolveTypesolve_type_to_enum
 
std::map< std::string, EigenSolveTypeeigen_solve_type_to_enum
 
std::map< std::string, EigenProblemTypeeigen_problem_type_to_enum
 
std::map< std::string, WhichEigenPairswhich_eigen_pairs_to_enum
 
std::map< std::string, LineSearchTypeline_search_type_to_enum
 
std::map< std::string, TimeIntegratorTypetime_integrator_to_enum
 
std::map< std::string, MffdTypemffd_type_to_enum
 
std::map< std::string, RelationshipManagerTyperm_type_to_enum
 

Detailed Description

MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to address this in their environment if C++17 compatibility isn't found.

Typedef Documentation

◆ Functor

template<typename T >
using Moose::Functor = typedef FunctorEnvelope<T>

Definition at line 33 of file MooseFunctorForward.h.

◆ GenericType

template<typename T , bool is_ad>
using Moose::GenericType = typedef typename std::conditional<is_ad, typename ADType<T>::type, T>::type

Definition at line 694 of file MooseTypes.h.

◆ RelationshipManagerInputParameterCallback

The type for the callback to set RelationshipManager parameters.

Definition at line 1043 of file MooseTypes.h.

Enumeration Type Documentation

◆ AuxGroup

Flag for AuxKernel related execution type.

Enumerator
PRE_IC 
PRE_AUX 
POST_AUX 
ALL 

Definition at line 757 of file MooseTypes.h.

758{
759 PRE_IC = 0,
760 PRE_AUX = 1,
761 POST_AUX = 2,
762 ALL = 3
763};
@ POST_AUX
Definition MooseTypes.h:761
@ PRE_AUX
Definition MooseTypes.h:760

◆ ComputeType

enum class Moose::ComputeType
strong

The type of nonlinear computation being performed.

Enumerator
Residual 
Jacobian 
ResidualAndJacobian 

Definition at line 834 of file MooseTypes.h.

◆ ConstraintFormulationType

Type of constraint formulation.

Enumerator
Penalty 
Kinematic 

Definition at line 971 of file MooseTypes.h.

972{
973 Penalty,
975};
@ Penalty
Definition MooseTypes.h:973
@ Kinematic
Definition MooseTypes.h:974

◆ ConstraintJacobianType

Enumerator
SecondarySecondary 
SecondaryPrimary 
PrimarySecondary 
PrimaryPrimary 
LowerLower 
LowerSecondary 
LowerPrimary 
SecondaryLower 
PrimaryLower 

Definition at line 850 of file MooseTypes.h.

◆ ConstraintSideType

Enumerator
SIDE_PRIMARY 
SIDE_SECONDARY 

Definition at line 791 of file MooseTypes.h.

792{
795};
@ SIDE_SECONDARY
Definition MooseTypes.h:794
@ SIDE_PRIMARY
Definition MooseTypes.h:793

◆ ConstraintType

Enumerator
Secondary 
Primary 

Definition at line 811 of file MooseTypes.h.

812{
815};
@ Neighbor
Definition MooseTypes.h:800
@ Primary
Definition MooseTypes.h:814
@ Secondary
Definition MooseTypes.h:813

◆ CoordinateSystemType

Enumerator
COORD_XYZ 
COORD_RZ 
COORD_RSPHERICAL 

Definition at line 863 of file MooseTypes.h.

864{
865 COORD_XYZ = 0,
866 COORD_RZ,
868};
@ COORD_RZ
Definition MooseTypes.h:866
@ COORD_RSPHERICAL
Definition MooseTypes.h:867
@ COORD_XYZ
Definition MooseTypes.h:865

◆ CouplingType

Enumerator
COUPLING_DIAG 
COUPLING_FULL 
COUPLING_CUSTOM 

Definition at line 784 of file MooseTypes.h.

785{
789};
@ COUPLING_FULL
Definition MooseTypes.h:787
@ COUPLING_DIAG
Definition MooseTypes.h:786
@ COUPLING_CUSTOM
Definition MooseTypes.h:788

◆ DGJacobianType

Enumerator
ElementElement 
ElementNeighbor 
NeighborElement 
NeighborNeighbor 

Definition at line 803 of file MooseTypes.h.

◆ DGResidualType

Enumerator
Element 
Neighbor 

Definition at line 797 of file MooseTypes.h.

798{
799 Element,
801};

◆ EigenProblemType

Type of the eigen problem.

Enumerator
EPT_HERMITIAN 

Hermitian.

EPT_NON_HERMITIAN 

Non-Hermitian.

EPT_GEN_HERMITIAN 

Generalized Hermitian.

EPT_GEN_INDEFINITE 

Generalized Hermitian indefinite.

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

Definition at line 924 of file MooseTypes.h.

925{
933};
@ EPT_GEN_INDEFINITE
Generalized Hermitian indefinite.
Definition MooseTypes.h:929
@ EPT_NON_HERMITIAN
Non-Hermitian.
Definition MooseTypes.h:927
@ EPT_GEN_HERMITIAN
Generalized Hermitian.
Definition MooseTypes.h:928
@ EPT_HERMITIAN
Hermitian.
Definition MooseTypes.h:926
@ EPT_GEN_NON_HERMITIAN
Generalized Non-Hermitian.
Definition MooseTypes.h:930
@ EPT_POS_GEN_NON_HERMITIAN
Generalized Non-Hermitian with positive (semi-)definite B.
Definition MooseTypes.h:931
@ EPT_SLEPC_DEFAULT
use whatever SLPEC has by default
Definition MooseTypes.h:932

◆ EigenSolveType

Type of the eigen solve.

Enumerator
EST_POWER 

Power / Inverse / RQI.

EST_ARNOLDI 

Arnoldi.

EST_KRYLOVSCHUR 

Krylov-Schur.

EST_JACOBI_DAVIDSON 

Jacobi-Davidson.

EST_NONLINEAR_POWER 

Nonlinear inverse power.

EST_NEWTON 

Newton-based eigensolver with an assembled Jacobian matrix (fully coupled by default)

EST_PJFNK 

Preconditioned Jacobian-free Newton Krylov.

EST_PJFNKMO 

The same as PJFNK except that matrix-vector multiplication is employed to replace residual evaluation in linear solver.

EST_JFNK 

Jacobian-free Newton Krylov.

Definition at line 908 of file MooseTypes.h.

909{
910 EST_POWER,
915 EST_NEWTON,
916 EST_PJFNK,
918 EST_JFNK
919};
@ EST_PJFNKMO
The same as PJFNK except that matrix-vector multiplication is employed to replace residual evaluation...
Definition MooseTypes.h:917
@ EST_JACOBI_DAVIDSON
Jacobi-Davidson.
Definition MooseTypes.h:913
@ EST_KRYLOVSCHUR
Krylov-Schur.
Definition MooseTypes.h:912
@ EST_JFNK
Jacobian-free Newton Krylov.
Definition MooseTypes.h:918
@ EST_NEWTON
Newton-based eigensolver with an assembled Jacobian matrix (fully coupled by default)
Definition MooseTypes.h:915
@ EST_POWER
Power / Inverse / RQI.
Definition MooseTypes.h:910
@ EST_NONLINEAR_POWER
Nonlinear inverse power.
Definition MooseTypes.h:914
@ EST_ARNOLDI
Arnoldi.
Definition MooseTypes.h:911
@ EST_PJFNK
Preconditioned Jacobian-free Newton Krylov.
Definition MooseTypes.h:916

◆ ElementType

enum class Moose::ElementType : unsigned int
strong
Enumerator
Element 
Neighbor 
Lower 

Definition at line 817 of file MooseTypes.h.

818{
819 Element = DGResidualType::Element,
820 Neighbor = DGResidualType::Neighbor,
821 Lower = DGResidualType::Neighbor + 1
822};

◆ FEBackend

enum class Moose::FEBackend
strong
Enumerator
LibMesh 
MFEM 

Definition at line 1318 of file MooseTypes.h.

1319{
1320 LibMesh
1321#ifdef MOOSE_MFEM_ENABLED
1322 ,
1323 MFEM
1324#endif
1325};

◆ FunctorEvaluationKind

enum class Moose::FunctorEvaluationKind
strong

An enumeration of possible functor evaluation kinds.

The available options are value, gradient, time derivative (dot), and gradient of time derivative (gradDot)

Enumerator
Value 
Gradient 
Dot 
GradDot 

Definition at line 36 of file MooseFunctor.h.

◆ GeometryType

Enumerator
Volume 
Face 

Definition at line 282 of file MooseTypes.h.

283{
284 Volume,
285 Face
286};

◆ LineSearchType

Type of the line search.

Enumerator
LS_INVALID 

means not set

LS_DEFAULT 
LS_NONE 
LS_BASIC 
LS_SHELL 
LS_CONTACT 
LS_PROJECT 
LS_L2 
LS_BT 
LS_CP 

Definition at line 979 of file MooseTypes.h.

980{
981 LS_INVALID,
983 LS_NONE,
984 LS_BASIC,
985 LS_SHELL,
988 LS_L2,
989 LS_BT,
990 LS_CP
991};
@ LS_DEFAULT
Definition MooseTypes.h:982
@ LS_NONE
Definition MooseTypes.h:983
@ LS_PROJECT
Definition MooseTypes.h:987
@ LS_CONTACT
Definition MooseTypes.h:986
@ LS_SHELL
Definition MooseTypes.h:985
@ LS_BASIC
Definition MooseTypes.h:984
@ LS_INVALID
means not set
Definition MooseTypes.h:981

◆ MaterialDataType

MaterialData types.

See also
FEProblemBase, MaterialPropertyInterface
Enumerator
BLOCK_MATERIAL_DATA 
BOUNDARY_MATERIAL_DATA 
FACE_MATERIAL_DATA 
NEIGHBOR_MATERIAL_DATA 
INTERFACE_MATERIAL_DATA 

Definition at line 745 of file MooseTypes.h.

◆ MffdType

Type of the matrix-free finite-differencing parameter.

Enumerator
MFFD_INVALID 

means not set

MFFD_WP 
MFFD_DS 

Definition at line 996 of file MooseTypes.h.

997{
999 MFFD_WP,
1000 MFFD_DS
1001};
@ MFFD_WP
Definition MooseTypes.h:999
@ MFFD_INVALID
means not set
Definition MooseTypes.h:998

◆ MooseKSPNormType

Norm type for converge test.

Enumerator
KSPN_NONE 
KSPN_PRECONDITIONED 
KSPN_UNPRECONDITIONED 
KSPN_NATURAL 
KSPN_DEFAULT 

Use whatever we have in PETSc.

Definition at line 884 of file MooseTypes.h.

885{
886 KSPN_NONE,
891};
@ KSPN_NONE
Definition MooseTypes.h:886
@ KSPN_PRECONDITIONED
Definition MooseTypes.h:887
@ KSPN_UNPRECONDITIONED
Definition MooseTypes.h:888
@ KSPN_DEFAULT
Use whatever we have in PETSc.
Definition MooseTypes.h:890
@ KSPN_NATURAL
Definition MooseTypes.h:889

◆ MortarType

enum class Moose::MortarType : unsigned int
strong
Enumerator
Secondary 
Primary 
Lower 

Definition at line 824 of file MooseTypes.h.

825{
826 Secondary = static_cast<unsigned int>(Moose::ElementType::Element),
827 Primary = static_cast<unsigned int>(Moose::ElementType::Neighbor),
828 Lower = static_cast<unsigned int>(Moose::ElementType::Lower)
829};

◆ PatchUpdateType

Type of patch update strategy for modeling node-face constraints or contact.

Enumerator
Never 
Always 
Auto 
Iteration 

Definition at line 1006 of file MooseTypes.h.

1007{
1008 Never,
1009 Always,
1010 Auto,
1011 Iteration
1012};
@ Iteration

◆ PCSideType

Preconditioning side.

Enumerator
PCS_LEFT 
PCS_RIGHT 
PCS_SYMMETRIC 
PCS_DEFAULT 

Use whatever we have in PETSc.

Definition at line 873 of file MooseTypes.h.

874{
875 PCS_LEFT,
876 PCS_RIGHT,
879};
@ PCS_LEFT
Definition MooseTypes.h:875
@ PCS_DEFAULT
Use whatever we have in PETSc.
Definition MooseTypes.h:878
@ PCS_SYMMETRIC
Definition MooseTypes.h:877
@ PCS_RIGHT
Definition MooseTypes.h:876

◆ RelationshipManagerType

enum class Moose::RelationshipManagerType : unsigned char
strong

Main types of Relationship Managers.

Enumerator
DEFAULT 
GEOMETRIC 
ALGEBRAIC 
COUPLING 

Definition at line 1017 of file MooseTypes.h.

◆ RESTARTABLE_FILTER

enum class Moose::RESTARTABLE_FILTER : unsigned char
strong

The filter type applied to a particular piece of "restartable" data.

These filters will be applied during deserialization to include or exclude data as appropriate.

Enumerator
RECOVERABLE 

Definition at line 845 of file MooseTypes.h.

◆ RMSystemType

Enumerator
NONLINEAR 
AUXILIARY 
NONE 

Definition at line 1025 of file MooseTypes.h.

1026{
1027 NONLINEAR,
1028 AUXILIARY,
1029 NONE
1030};
@ AUXILIARY

◆ SolutionIterationType

enum class Moose::SolutionIterationType : unsigned short
strong
Enumerator
Time 
Nonlinear 
MultiAppFixedPoint 
MultiSystemFixedPoint 
Count 

Definition at line 269 of file MooseTypes.h.

270{
271 Time = 0,
272 Nonlinear,
275 // Special name for determing the total size of
276 // iteration types. If adding a new type, it should
277 // always be above this entry.
278 Count
279};

◆ SolutionState

Enumerator
Current 
Old 
Older 
PreviousNL 

Definition at line 261 of file MooseTypes.h.

262{
263 Current = 0,
264 Old = 1,
265 Older = 2,
266 PreviousNL = -1
267};
@ Current
Definition MooseTypes.h:263
@ PreviousNL
Definition MooseTypes.h:266

◆ SolveType

Type of the solve.

Enumerator
ST_PJFNK 

Preconditioned Jacobian-Free Newton Krylov.

ST_JFNK 

Jacobian-Free Newton Krylov.

ST_NEWTON 

Full Newton Solve.

ST_FD 

Use finite differences to compute Jacobian.

ST_LINEAR 

Solving a linear problem.

Definition at line 896 of file MooseTypes.h.

897{
898 ST_PJFNK,
899 ST_JFNK,
900 ST_NEWTON,
901 ST_FD,
902 ST_LINEAR
903};
@ ST_FD
Use finite differences to compute Jacobian.
Definition MooseTypes.h:901
@ ST_LINEAR
Solving a linear problem.
Definition MooseTypes.h:902
@ ST_NEWTON
Full Newton Solve.
Definition MooseTypes.h:900
@ ST_JFNK
Jacobian-Free Newton Krylov.
Definition MooseTypes.h:899
@ ST_PJFNK
Preconditioned Jacobian-Free Newton Krylov.
Definition MooseTypes.h:898

◆ TimeIntegratorType

Time integrators.

Enumerator
TI_IMPLICIT_EULER 
TI_EXPLICIT_EULER 
TI_CRANK_NICOLSON 
TI_BDF2 
TI_EXPLICIT_MIDPOINT 
TI_LSTABLE_DIRK2 
TI_EXPLICIT_TVD_RK_2 
TI_NEWMARK_BETA 

Definition at line 956 of file MooseTypes.h.

957{
961 TI_BDF2,
966};
@ TI_EXPLICIT_EULER
Definition MooseTypes.h:959
@ TI_EXPLICIT_TVD_RK_2
Definition MooseTypes.h:964
@ TI_EXPLICIT_MIDPOINT
Definition MooseTypes.h:962
@ TI_NEWMARK_BETA
Definition MooseTypes.h:965
@ TI_IMPLICIT_EULER
Definition MooseTypes.h:958
@ TI_CRANK_NICOLSON
Definition MooseTypes.h:960
@ TI_BDF2
Definition MooseTypes.h:961
@ TI_LSTABLE_DIRK2
Definition MooseTypes.h:963

◆ VarFieldType

Enumerator
VAR_FIELD_STANDARD 
VAR_FIELD_SCALAR 
VAR_FIELD_VECTOR 
VAR_FIELD_ARRAY 
VAR_FIELD_ANY 

Definition at line 775 of file MooseTypes.h.

776{
782};
@ VAR_FIELD_SCALAR
Definition MooseTypes.h:778
@ VAR_FIELD_STANDARD
Definition MooseTypes.h:777
@ VAR_FIELD_ARRAY
Definition MooseTypes.h:780
@ VAR_FIELD_ANY
Definition MooseTypes.h:781
@ VAR_FIELD_VECTOR
Definition MooseTypes.h:779

◆ VarKindType

Framework-wide stuff.

Enumerator
VAR_SOLVER 
VAR_AUXILIARY 
VAR_ANY 

Definition at line 768 of file MooseTypes.h.

769{
772 VAR_ANY
773};
@ VAR_ANY
Definition MooseTypes.h:772
@ VAR_AUXILIARY
Definition MooseTypes.h:771
@ VAR_SOLVER
Definition MooseTypes.h:770

◆ VectorTagType

Enumerator
VECTOR_TAG_RESIDUAL 
VECTOR_TAG_SOLUTION 
VECTOR_TAG_ANY 

Definition at line 1032 of file MooseTypes.h.

1033{
1036 VECTOR_TAG_ANY = 2
1037};
@ VECTOR_TAG_SOLUTION
@ VECTOR_TAG_ANY
@ VECTOR_TAG_RESIDUAL

◆ WhichEigenPairs

Which eigen pairs.

Enumerator
WEP_LARGEST_MAGNITUDE 

largest magnitude

WEP_SMALLEST_MAGNITUDE 

smallest magnitude

WEP_LARGEST_REAL 

largest real

WEP_SMALLEST_REAL 

smallest real

WEP_LARGEST_IMAGINARY 

largest imaginary

WEP_SMALLEST_IMAGINARY 

smallest imaginary

WEP_TARGET_MAGNITUDE 

target magnitude

WEP_TARGET_REAL 

target real

WEP_TARGET_IMAGINARY 

target imaginary

WEP_ALL_EIGENVALUES 

all eigenvalues

WEP_SLEPC_DEFAULT 

use whatever we have in SLEPC

Definition at line 938 of file MooseTypes.h.

939{
951};
@ WEP_TARGET_MAGNITUDE
target magnitude
Definition MooseTypes.h:946
@ WEP_LARGEST_IMAGINARY
largest imaginary
Definition MooseTypes.h:944
@ WEP_TARGET_IMAGINARY
target imaginary
Definition MooseTypes.h:948
@ WEP_SMALLEST_REAL
smallest real
Definition MooseTypes.h:943
@ WEP_SLEPC_DEFAULT
use whatever we have in SLEPC
Definition MooseTypes.h:950
@ WEP_LARGEST_MAGNITUDE
largest magnitude
Definition MooseTypes.h:940
@ WEP_SMALLEST_MAGNITUDE
smallest magnitude
Definition MooseTypes.h:941
@ WEP_ALL_EIGENVALUES
all eigenvalues
Definition MooseTypes.h:949
@ WEP_SMALLEST_IMAGINARY
smallest imaginary
Definition MooseTypes.h:945
@ WEP_TARGET_REAL
target real
Definition MooseTypes.h:947
@ WEP_LARGEST_REAL
largest real
Definition MooseTypes.h:942

Function Documentation

◆ addActionTypes()

void Moose::addActionTypes ( Syntax syntax)

The (optional) last param here indicates whether the task should trigger an Action auto-build. If a task is marked as "true". Then MOOSE will attempt to build the associated Action if one is not supplied by some other means (usually through the input file or custom Action). Only Actions that do not have required parameters and have defaults for all optional parameters can be built automatically (See ActionWarehouse.C).

Note: Many of the actions in the "Minimal Problem" section are marked as false. However, we can generally force creation of these "Action"s as needed by registering them to syntax that we expect to see even if those "Action"s don't normally pick up parameters from the input file.

Additional Actions

The following is the default set of action dependencies for a basic MOOSE problem. The formatting of this string is important. Each line represents a set of dependencies that depend on the previous line. Items on the same line have equal weight and can be executed in any order.

Additional dependencies can be inserted later inside of user applications with calls to ActionWarehouse::addDependency("task", "pre_req")

The (optional) last param here indicates whether the task should trigger an Action auto-build. If a task is marked as "true". Then MOOSE will attempt to build the associated Action if one is not supplied by some other means (usually through the input file or custom Action). Only Actions that do not have required parameters and have defaults for all optional parameters can be built automatically (See ActionWarehouse.C).

Note: Many of the actions in the "Minimal Problem" section are marked as false. However, we can generally force creation of these "Action"s as needed by registering them to syntax that we expect to see even if those "Action"s don't normally pick up parameters from the input file.

Additional Actions

The following is the default set of action dependencies for a basic MOOSE problem. The formatting of this string is important. Each line represents a set of dependencies that depend on the previous line. Items on the same line have equal weight and can be executed in any order.

Additional dependencies can be inserted later inside of user applications with calls to ActionWarehouse::addDependency("task", "pre_req")

Definition at line 116 of file Moose.C.

116 {2006},
117 url={http://dx.doi.org/10.1007/s00366-006-0049-3}
118})");
119
120#ifdef MOOSE_MFEM_ENABLED
121 // Like libMesh, the MFEM citation is emitted by MooseApp::requestCitations() only when the run
122 // actually uses the MFEM backend.
123 Registry::addAppCitation("MFEM",
124 "mfem-2024",
125 R"(@article{mfem-2024,
126 title = {High-Performance Finite Elements with {MFEM}},
127 author = {J. Andrej and N. Atallah and J.-P. B{\"a}cker and J.-S. Camier and D. Copeland and V. Dobrev and Y. Dudouit and T. Duswald and B. Keith and D. Kim and T. Kolev and B. Lazarov and K. Mittal and W. Pazner and S. Petrides and S. Shiraiwa and M. Stowell and V. Tomov},
128 journal = {The International Journal of High Performance Computing Applications},
129 volume = {38},
130 number = {5},
131 pages = {447--467},
132 year = {2024},
133 publisher = {SAGE Publications Sage UK: London, England},
134})");
135#endif
136}
137
138void
139registerObjects(Factory & factory, const std::set<std::string> & obj_labels)
140{
141 Registry::registerObjectsTo(factory, obj_labels);
142}
143
144void
145addActionTypes(Syntax & syntax)
146{
159 // clang-format off
160 /**************************/
161 /**** Register Actions ****/
162 /**************************/
163 registerMooseObjectTask("create_problem", Problem, false);
164 registerMooseObjectTask("setup_executioner", Executioner, false);
165 registerMooseObjectTask("read_executor", Executor, false);
166 registerTask("add_executor", true);
167
168 // TODO Organize these somewhere
169 registerTask("init_physics", false);
170 registerTask("init_component_physics", false);
171 registerTask("meta_action_component", false);
172 registerTask("setup_component", false);
173 // 'list_component' is used to retrieve ActionComponents for the syntax JSON
174 registerTask("list_component", false);
175
176 // This task does not construct an object, but it needs all of the parameters that
177 // would normally be used to construct an object.
178 registerMooseObjectTask("determine_system_type", Executioner, true);
179
180 registerMooseObjectTask("setup_mesh", MooseMesh, false);
181 registerMooseObjectTask("set_mesh_base", MooseMesh, false);
182 registerMooseObjectTask("init_mesh", MooseMesh, false);
183 registerMooseObjectTask("add_mesh_generator", MeshGenerator, false);
184 registerTask("create_added_mesh_generators", true);
185 registerMooseObjectTask("append_mesh_generator", MeshGenerator, false);
186
187 registerMooseObjectTask("add_kernel", Kernel, false);
188 appendMooseObjectTask ("add_kernel", EigenKernel);
189 appendMooseObjectTask ("add_kernel", VectorKernel);
190 appendMooseObjectTask ("add_kernel", ArrayKernel);
191 appendMooseObjectTask ("add_kernel", ADArrayKernel);
192
193 registerMooseObjectTask("add_variable", MooseVariableBase, false);
194 registerMooseObjectTask("add_aux_variable", MooseVariableBase, false);
195 registerMooseObjectTask("add_elemental_field_variable", MooseVariableBase, false);
196 registerMooseObjectTask("add_variables_physics", MooseVariableBase, false);
197
198 registerMooseObjectTask("add_nodal_kernel", NodalKernel, false);
199
200 registerMooseObjectTask("add_functor_material", FunctorMaterial, false);
201 registerMooseObjectTask("add_material", MaterialBase, false);
202 appendDeprecatedMooseObjectTask("add_material", FunctorMaterial);
203 registerMooseObjectTask("add_materials_physics", FunctorMaterial, false);
204 appendMooseObjectTask ("add_materials_physics", MaterialBase);
205
206 registerMooseObjectTask("add_bc", BoundaryCondition, false);
207
208 registerMooseObjectTask("add_function", Function, false);
209
210 registerMooseObjectTask("add_distribution", Distribution, false);
211 registerMooseObjectTask("add_sampler", Sampler, false);
212
213 registerMooseObjectTask("add_aux_kernel", AuxKernel, false);
214 appendMooseObjectTask ("add_aux_kernel", VectorAuxKernel);
215 appendMooseObjectTask ("add_aux_kernel", ArrayAuxKernel);
216
217 registerMooseObjectTask("add_bound", Bounds, false);
218
219 registerMooseObjectTask("add_scalar_kernel", ScalarKernel, false);
220 registerMooseObjectTask("add_aux_scalar_kernel", AuxScalarKernel, false);
221 registerMooseObjectTask("add_dirac_kernel", DiracKernel, false);
222 appendMooseObjectTask ("add_dirac_kernel", VectorDiracKernel);
223 registerMooseObjectTask("add_dg_kernel", DGKernel, false);
224 registerMooseObjectTask("add_fv_kernel", FVKernel, false);
225 registerMooseObjectTask("add_gradient_method", FVGradientMethod, false);
226 registerMooseObjectTask("add_interpolation_method", FVInterpolationMethod, false);
227 registerMooseObjectTask("add_interpolation_method_physics", FVInterpolationMethod, false);
228 registerMooseObjectTask("add_linear_fv_kernel", LinearFVKernel, false);
229 registerMooseObjectTask("add_fv_bc", FVBoundaryCondition, false);
230 registerMooseObjectTask("add_linear_fv_bc", LinearFVBoundaryCondition, false);
231 registerMooseObjectTask("add_fv_ik", FVInterfaceKernel, false);
232 registerMooseObjectTask("add_interface_kernel", InterfaceKernel, false);
233 appendMooseObjectTask ("add_interface_kernel", VectorInterfaceKernel);
234 registerMooseObjectTask("add_constraint", Constraint, false);
235 registerMooseObjectTask("add_hybridized_kernel", HDGKernel, false);
236 registerMooseObjectTask("add_hybridized_integrated_bc", HDGIntegratedBC, false);
237
238 registerMooseObjectTask("add_ic", InitialCondition, false);
239 appendMooseObjectTask ("add_ic", ScalarInitialCondition);
240 registerMooseObjectTask("add_fv_ic", FVInitialCondition, false);
241 registerMooseObjectTask("add_ics_physics", InitialCondition, false);
242 appendMooseObjectTask ("add_ics_physics", FVInitialCondition);
243 appendMooseObjectTask ("add_ics_physics", ScalarInitialCondition);
244
245 registerMooseObjectTask("add_damper", Damper, false);
246 registerMooseObjectTask("setup_predictor", Predictor, false);
247 registerMooseObjectTask("add_time_steppers", TimeStepper, false);
248 registerMooseObjectTask("add_time_stepper", TimeStepper, false);
249 registerTask ("compose_time_stepper", true);
250 registerMooseObjectTask("setup_time_integrators", TimeIntegrator, false);
251 registerMooseObjectTask("setup_time_integrator", TimeIntegrator, false);
252 registerMooseObjectTask("add_convergence", Convergence, false);
253
254 registerMooseObjectTask("add_preconditioning", MoosePreconditioner, false);
255 registerMooseObjectTask("add_field_split", Split, false);
256
257 registerMooseObjectTask("add_mesh_division", MeshDivision, false);
258 registerMooseObjectTask("add_user_object", UserObject, false);
259 appendMooseObjectTask ("add_user_object", Postprocessor);
260
261 appendDeprecatedMooseObjectTask("add_user_object", Corrector);
262 registerMooseObjectTask("add_corrector", Corrector, false);
263 appendDeprecatedMooseObjectTask("add_user_object", MeshModifier);
264 registerMooseObjectTask("add_mesh_modifier", MeshModifier, false);
265
266 registerMooseObjectTask("add_postprocessor", Postprocessor, false);
267 registerMooseObjectTask("add_vector_postprocessor", VectorPostprocessor, false);
268 registerMooseObjectTask("add_reporter", Reporter, false);
269
270 registerMooseObjectTask("add_positions", Positions, false);
271 registerMooseObjectTask("add_times", Times, false);
272
273 registerMooseObjectTask("add_indicator", Indicator, false);
274 registerMooseObjectTask("add_marker", Marker, false);
275
276 registerMooseObjectTask("add_multi_app", MultiApp, false);
277 registerMooseObjectTask("add_transfer", Transfer, false);
278
279 registerMooseObjectTask("add_output", Output, false);
280
281 registerMooseObjectTask("add_control", Control, false);
282 registerMooseObjectTask("add_chain_control", ChainControl, false);
283 registerMooseObjectTask("add_partitioner", MoosePartitioner, false);
284
285 // clang-format on
286
287 registerTask("dynamic_object_registration", false);
288 registerTask("common_output", true);
289 registerTask("setup_recover_file_base", true);
290 registerTask("recover_meta_data", true);
291
292 registerTask("add_bounds_vectors", false);
293 registerTask("add_periodic_bc", false);
294 registerTask("add_aux_variable", false);
295 registerTask("add_external_aux_variables", true);
296 registerTask("add_variable", false);
297 registerTask("add_mortar_variable", false);
298
299 registerTask("execute_mesh_generators", true);
300 registerTask("uniform_refine_mesh", false);
301 registerTask("prepare_mesh", false);
302 registerTask("delete_remote_elements_after_late_geometric_ghosting", false);
303 registerTask("setup_mesh_complete", true); // calls prepare
304 registerTask("post_mesh_prepared", false);
305 registerTask("add_geometric_rm", false);
306 registerTask("attach_geometric_rm", true);
307 registerTask("attach_geometric_rm_final", true);
308
309 registerTask("init_displaced_problem", false);
310
311 registerTask("add_algebraic_rm", false);
312 registerTask("attach_algebraic_rm", true);
313 registerTask("add_coupling_rm", false);
314 registerTask("attach_coupling_rm", true);
315 registerTask("init_problem", true);
316 registerTask("check_copy_nodal_vars", true);
317 registerTask("copy_nodal_vars", true);
318 registerTask("copy_nodal_aux_vars", true);
319 registerTask("copy_vars_physics", false);
320 registerTask("setup_postprocessor_data", false);
321 registerTask("setup_time_steppers", true);
322
323 registerTask("setup_dampers", true);
324 registerTask("check_integrity", true);
325 registerTask("resolve_optional_materials", true);
326 registerTask("check_integrity_early", true);
327 registerTask("check_integrity_early_physics", false);
328 registerTask("setup_quadrature", true);
329 registerTask("create_tagged_matrices", true);
330
331 registerTask("mesh_modifiers", false);
332
334 registerTask("no_action", false); // Used for Empty Action placeholders
335 registerTask("set_global_params", false);
336 registerTask("setup_adaptivity", false);
337 registerTask("meta_action", false);
338 registerTask("setup_residual_debug", false);
339 registerTask("setup_oversampling", false);
340 registerTask("deprecated_block", false);
341 registerTask("set_adaptivity_options", false);
342 registerTask("add_mortar_interface", false);
343 registerTask("coupling_functor_check", true);
344 registerTask("add_master_action_material", false);
345 registerTask("setup_projected_properties", false);
346 registerTask("create_application_block", false);
347
348 // Dummy Actions (useful for sync points in the dependencies)
349 registerTask("setup_function_complete", false);
350 registerTask("setup_variable_complete", false);
351 registerTask("setup_executioner_complete", false);
352 registerTask("ready_to_init", true);
353
354 // Output related actions
355 registerTask("add_output_aux_variables", true);
356 registerTask("check_output", true);
357 registerTask("declare_late_reporters", true);
358
359 registerTask("create_problem_default", true);
360 registerTask("create_problem_custom", false);
361 registerTask("create_problem_complete", false);
362
363 registerTask("add_default_nonlinear_convergence", true);
364 registerTask("add_default_multiapp_fixed_point_convergence", true);
365 registerTask("add_default_steady_state_convergence", true);
366
367 registerTask("chain_control_setup", true);
368 registerTask("start_webservercontrol", true);
369
370 // Action for setting up the signal-based checkpoint
371 registerTask("auto_checkpoint_action", true);
372 /**************************/
373 /****** Dependencies ******/
374 /**************************/
385 // clang-format off
386 syntax.addDependencySets("(meta_action)"
387 "(meta_action_component)"
388 "(dynamic_object_registration)"
389 "(common_output)"
390 "(set_global_params)"
391 "(setup_recover_file_base)"
392 "(check_copy_nodal_vars)"
393 "(setup_mesh)"
394 "(add_geometric_rm)"
395 "(add_partitioner)"
396 "(add_mesh_generator)"
397 "(create_added_mesh_generators)"
398 "(append_mesh_generator)"
399 "(execute_mesh_generators)"
400 "(recover_meta_data)"
401 "(set_mesh_base)"
402 "(attach_geometric_rm)"
403 "(init_mesh)"
404 "(prepare_mesh)"
405 "(add_mortar_interface)"
406 "(uniform_refine_mesh)"
407 "(setup_mesh_complete)"
408 "(post_mesh_prepared)"
409 "(determine_system_type)"
410 "(create_problem)"
411 "(create_problem_custom)"
412 "(create_problem_default)"
413 "(create_problem_complete)"
414 "(init_displaced_problem)" // Problem must be init-ed before we start adding functors
415 "(add_function)" // Functions can depend on scalar variables & PPs, but this dependence can be
416 // added on initialSetup() rather than construction
417 "(init_component_physics)" // components must add their blocks to physics before init_physics
418 "(init_physics)"
419 "(setup_postprocessor_data)"
420 "(setup_time_integrator, setup_time_integrators)"
421 "(setup_executioner)"
422 "(setup_executioner_complete)"
423 "(setup_component)" // no particular reason for that placement
424 "(read_executor)"
425 "(add_executor)"
426 "(check_integrity_early)"
427 "(setup_predictor)"
428 "(add_aux_variable, add_variable, add_elemental_field_variable,"
429 " add_external_aux_variables)"
430 "(add_variables_physics)" // physics can skip adding variables if they already exist
431 "(add_mortar_variable)"
432 "(setup_variable_complete)"
433 "(check_integrity_early_physics)" // checks that systems and variables are consistent
434 "(setup_quadrature)"
435 "(add_convergence)"
436 "(add_default_nonlinear_convergence,"
437 " add_default_multiapp_fixed_point_convergence,"
438 " add_default_steady_state_convergence)"
439 "(add_positions)"
440 "(add_periodic_bc)"
441 "(add_gradient_method)"
442 "(add_user_object, add_corrector, add_mesh_modifier)"
443 "(add_field_split)" // split objects required before field split preconditioner itself
444 "(add_preconditioning)" // preconditioner may introduce objects such as static condensation which influence the underlying types of tagged matrices
445 "(create_tagged_matrices)"
446 "(add_distribution)"
447 "(add_sampler)"
448 "(setup_function_complete)"
449 "(setup_adaptivity)"
450 "(set_adaptivity_options)"
451 "(add_ic, add_fv_ic)"
452 "(add_ics_physics)" // physics can skip adding initial conditions if they already exist
453 "(add_constraint)"
454 "(add_times)"
455 "(add_time_stepper, add_time_steppers)"
456 "(compose_time_stepper)"
457 "(setup_time_steppers)"
458 "(ready_to_init)"
459 "(setup_dampers)"
460 "(setup_residual_debug)"
461 "(add_bounds_vectors)"
462 "(add_mesh_division)" // NearestPositionsDivision uses a Positions
463 "(add_multi_app)"
464 "(add_transfer)"
465 "(copy_nodal_vars, copy_nodal_aux_vars, copy_vars_physics)"
466 "(add_material)"
467 "(add_master_action_material)"
468 "(add_functor_material)"
469 "(add_materials_physics)"
470 "(setup_projected_properties)"
471 "(add_output_aux_variables)"
472 "(add_output)"
473 "(auto_checkpoint_action)"
474 "(add_postprocessor)"
475 "(add_vector_postprocessor)" // MaterialVectorPostprocessor requires this
476 // to be after material objects are created.
477 "(add_reporter)"
478 "(declare_late_reporters)"
479 "(add_aux_kernel, add_bc, add_damper, add_dirac_kernel, add_kernel,"
480 " add_nodal_kernel, add_dg_kernel, add_fv_kernel, add_interpolation_method,"
481 " add_interpolation_method_physics, add_linear_fv_kernel,"
482 " add_fv_bc, add_linear_fv_bc, add_fv_ik, add_interface_kernel,"
483 " add_scalar_kernel, add_aux_scalar_kernel, add_indicator, add_marker,"
484 " add_bound, add_hybridized_kernel, add_hybridized_integrated_bc)"
485 "(resolve_optional_materials)"
486 "(add_algebraic_rm)"
487 "(add_coupling_rm)"
488 "(attach_geometric_rm_final)"
489 "(attach_algebraic_rm)"
490 "(attach_coupling_rm)"
491 "(coupling_functor_check)"
492 "(delete_remote_elements_after_late_geometric_ghosting)"
493 "(init_problem)"
494 "(add_control, add_chain_control)"
495 "(chain_control_setup)"
496 "(start_webservercontrol)"
497 "(check_output)"
498 "(check_integrity)"
499 "(create_application_block)");
500 // clang-format on
501
502#ifdef MOOSE_MFEM_ENABLED
503 registerTask("add_mfem_problem_operator", true);
504 addTaskDependency("add_variable", "add_mfem_problem_operator");
505 addTaskDependency("add_aux_variable", "add_mfem_problem_operator");
506 addTaskDependency("add_elemental_field_variable", "add_mfem_problem_operator");
507 addTaskDependency("add_bc", "add_mfem_problem_operator");
508 addTaskDependency("add_kernel", "add_mfem_problem_operator");
509
510 // add problem composers (and operators)
511 registerMooseObjectTask("add_mfem_problem_composer", MFEMProblemComposer, false);
512 addTaskDependency("add_mfem_problem_operator", "add_mfem_problem_composer");
513 addTaskDependency("setup_executioner", "add_mfem_problem_composer");
514
515 // add SubMeshes
516 registerMooseObjectTask("add_mfem_submeshes", MFEMSubMesh, false);
517 addTaskDependency("add_mfem_submeshes", "create_problem_complete");
518
519 // add SubMesh transfers
520 appendMooseObjectTask("add_transfer", MFEMSubMeshTransfer);
521
522 // add FESpaces
523 registerMooseObjectTask("add_mfem_fespaces", MFEMFESpace, false);
524 appendMooseObjectTask("add_mfem_fespaces", MFEMFECollection);
525 addTaskDependency("add_mfem_fespaces", "add_mfem_submeshes");
526
527 // add FESpace hierarchies (must come after fespaces so the base fespace is available)
528 registerMooseObjectTask("add_mfem_fespace_hierarchies", MFEMFESpaceHierarchy, false);
529 addTaskDependency("add_mfem_fespace_hierarchies", "add_mfem_fespaces");
530
531 // variables must wait for hierarchies since a variable may reference a hierarchy's
532 // finest level via fespace_hierarchy = ...
533 addTaskDependency("add_variable", "add_mfem_fespace_hierarchies");
534 addTaskDependency("add_aux_variable", "add_mfem_fespace_hierarchies");
535 addTaskDependency("add_elemental_field_variable", "add_mfem_fespace_hierarchies");
536 // kernels only need fespaces, not hierarchies
537 addTaskDependency("add_kernel", "add_mfem_fespaces");
538
539 // add QuadratureFunctions
540 registerMooseObjectTask("add_mfem_quadrature_functions", MFEMQuadratureFunction, false);
541 // after the last task declaring coefficients the quadrature functions may project
542 addTaskDependency("add_mfem_quadrature_functions", "add_functor_material");
543 // before the tasks constructing objects that may consume the declared coefficients
544 addTaskDependency("add_kernel", "add_mfem_quadrature_functions");
545 addTaskDependency("add_bc", "add_mfem_quadrature_functions");
546 addTaskDependency("add_aux_kernel", "add_mfem_quadrature_functions");
547
548 // add complex kernels
549 registerMooseObjectTask("add_mfem_complex_kernel_components", Kernel, false);
550 registerMooseObjectTask("add_mfem_complex_bc_components", BoundaryCondition, false);
551 addTaskDependency("add_mfem_complex_kernel_components", "add_mfem_fespaces");
552 addTaskDependency("add_mfem_complex_bc_components", "add_mfem_fespaces");
553 addTaskDependency("add_mfem_complex_kernel_components", "add_kernel");
554 addTaskDependency("add_mfem_complex_bc_components", "add_bc");
555
556 // set mesh FE space
557 registerTask("set_mesh_fe_space", true);
558 addTaskDependency("set_mesh_fe_space", "add_variable");
559 addTaskDependency("set_mesh_fe_space", "init_mesh");
560
Base class for array variable (equation) kernels using automatic differentiation.
Base class for making kernels that work on auxiliary scalar variables.
Base class for creating new types of boundary conditions.
Control that additionally provides the capability to produce/consume data values, to allow control op...
Base class for all Constraint types.
Definition Constraint.h:20
Base class for Control objects.
Definition Control.h:44
Base class for convergence criteria.
Definition Convergence.h:26
The DGKernel class is responsible for calculating the residuals for various physics on internal sides...
Definition DGKernel.h:19
Base class for deriving dampers.
Definition Damper.h:28
A DiracKernel is used when you need to add contributions to the residual by means of multiplying some...
Definition DiracKernel.h:33
All Distributions should inherit from this class.
The behavior of this kernel is controlled by one problem-wise global parameter eigen_on_current - boo...
Definition EigenKernel.h:24
Executioners are objects that do the actual work of solving your problem.
Definition Executioner.h:37
The Executor class directs the execution flow of simulations.
Definition Executor.h:27
Base class for creating new types of boundary conditions.
Base class for linear finite-volume cell-gradient methods.
This is a template class that implements the workhorse compute and computeNodal methods.
Base class for creating kernels that interface physics between subdomains.
Registered base class for linear FV interpolation objects.
FVKernel is a base class for all finite volume method kernels.
Definition FVKernel.h:36
Generic factory class for build all sorts of objects.
Definition Factory.h:29
Base class for function objects.
Definition Function.h:30
FunctorMaterials compute functor material properties.
Base kernel for hybridized finite element formulations.
Definition HDGKernel.h:18
This is a template class that implements the workhorse compute and computeNodal methods.
InterfaceKernel and VectorInterfaceKernel is responsible for interfacing physics across subdomains.
Base class for boundary conditions for linear FV systems.
Base class for finite volume kernels that contribute to a linear systems.
Builds and owns a mfem::ParFiniteElementSpaceHierarchy from a base FESpace by applying a sequence of ...
Constructs and stores an mfem::ParFiniteElementSpace object.
Definition MFEMFESpace.h:21
Interface required for all MFEMProblemComposers.
Class to transfer MFEM variable data to or from a restricted copy of the variable defined on an a sub...
Base class for construction of a mfem::ParSubMesh object.
Definition MFEMSubMesh.h:21
MaterialBases compute MaterialProperties.
Base class for MeshDivision objects.
MeshGenerators are objects that can modify or add to an existing mesh.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition MooseMesh.h:95
Base class for MOOSE partitioner.
Base class for MOOSE preconditioners.
Base variable class.
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition MultiApp.h:116
Base class for creating nodal kernels with hand-coded Jacobians.
Definition NodalKernel.h:19
Based class for output objects.
Definition Output.h:52
Positions objects are under the hood Reporters.
Definition Positions.h:21
Base class for all Postprocessors.
Base class for predictors.
Definition Predictor.h:29
Class that hold the whole problem being solved.
Definition Problem.h:20
static void registerObjectsTo(Factory &f, const std::set< std::string > &labels)
This registers all MooseObjects known to the registry that have the given label(s) with the factory f...
Definition Registry.C:35
Reporter objects allow for the declaration of arbitrary data types that are aggregate values for a si...
Definition Reporter.h:48
This is the base class for Samplers as used within the Stochastic Tools module.
Definition Sampler.h:52
InitialConditions are objects that set the initial value of variables.
Base class for split-based preconditioners.
Definition Split.h:26
Holding syntax for parsing input files.
Definition Syntax.h:22
void addDependencySets(const std::string &action_sets)
Adds all dependencies in a single call.
Definition Syntax.C:69
Base class for time integrators.
Base class for time stepping.
Definition TimeStepper.h:23
Times objects are under the hood Reporters, but limited to a vector of Real.
Definition Times.h:19
Base class for all Transfer objects.
Definition Transfer.h:40
Base class for user-specific data.
Definition UserObject.h:20
Base class for Postprocessors that produce a vector of values.
void registerObjects(Factory &factory, const std::set< std::string > &obj_labels)
Definition Moose.C:110
void addActionTypes(Syntax &syntax)
Definition Moose.C:116

◆ adOffset() [1/2]

std::size_t Moose::adOffset ( unsigned int  var_num,
std::size_t  max_dofs_per_elem,
DGJacobianType  dg_jacobian_type,
unsigned int  num_vars_in_system = 0 
)
inline

Definition at line 108 of file ADUtils.h.

112{
113 if (dg_jacobian_type == DGJacobianType::ElementElement ||
114 dg_jacobian_type == DGJacobianType::NeighborElement)
115 return adOffset(var_num, max_dofs_per_elem, ElementType::Element);
116 else
117 return adOffset(var_num, max_dofs_per_elem, ElementType::Neighbor, num_vars_in_system);
118}
std::size_t adOffset(unsigned int var_num, std::size_t max_dofs_per_elem, ElementType element_type=ElementType::Element, unsigned int num_vars_in_system=0)
Helper function for computing automatic differentiation offset.
Definition ADUtils.h:78

◆ adOffset() [2/2]

std::size_t Moose::adOffset ( unsigned int  var_num,
std::size_t  max_dofs_per_elem,
ElementType  element_type = ElementType::Element,
unsigned int  num_vars_in_system = 0 
)
inline

Helper function for computing automatic differentiation offset.

Let's explain how our derivative index numbering scheme works:

Let's just think about continuous finite elements for a second. We use a variable major numbering scheme, such that each variables indices are in a contiguous block. Let's imagine we have two variables, u and v, and we're on a QUAD4. The AD indices will be ordered like this:

u0, u1, u2, u3, v0, v1, v2, v3

max_dofs_per_elem should be for a QUAD4: 4. For a QUAD9, 9. HEX27, 27. Etc. For CFEM the offset will be simply be the max_dofs_per_elem number times the var_num. So for u on a QUAD4: 4 * 0 = 0. For v: 4 * 1. So u indices start at index 0, v indices start at index 4.

With DFEM or interface kernels it's a little more complicated. We essentially already have an indices block that is num_vars_in_system * max_dofs_per_elem long, so in our two var, QUAD4 example: 4 * 2 = 8. So what we do is that if we are on a neighbor element, we do an additional offset by num_vars_in_system * max_dofs_per_elem. So now our derivative indices are ordered like this:

u0, u1, u2, u3, v0, v1, v2, v3, u0_neighbor, u1_neighbor, u2_neighbor, u3_neighbor, v0_neighbor, v1_neighbor, v2_neighbor, v3_neighbor

Finally if a lower-dimensional element is involved, then we another offset of num_vars_in_system * max_dofs_per_elem:

u0, u1, u2, u3, v0, v1, v2, v3, u0_neighbor, u1_neighbor, u2_neighbor, u3_neighbor, v0_neighbor, v1_neighbor, v2_neighbor, v3_neighbor, u0_lower, u1_lower, u2_lower, u3_lower, v0_lower, v1_lower, v2_lower, v3_lower

Note that a lower dimensional block will have less indices than a higher dimensional one, but we do not optimize for that consideration at this time

Parameters
var_numThe variable number we are calculating the offset for
max_dofs_per_elemThe maximum number of degrees of freedom for any one variable on an element
element_typeThe "type" of element that we are on. Current options are ElementType::Element, ElementType::Neighbor, and ElementType::Lower
num_vars_in_systemThe number of vars in the system. This is used in offset calculation unless element_type is ElementType::Element
Returns
The automatic differentiation indexing offset

Definition at line 78 of file ADUtils.h.

82{
83 // If our element type is anything other than ElementType::Element, then the user must
84 // supply num_vars_in_system in order to calculate the offset
85 mooseAssert(element_type == ElementType::Element || num_vars_in_system,
86 "If our element type is anything other than ElementType::Element, then you "
87 "must supply num_vars_in_system in order to calculate the offset");
88
89 switch (element_type)
90 {
91 case ElementType::Element:
92 return var_num * max_dofs_per_elem;
93
94 case ElementType::Neighbor:
95 return num_vars_in_system * max_dofs_per_elem + var_num * max_dofs_per_elem;
96
97 case ElementType::Lower:
98 return 2 * num_vars_in_system * max_dofs_per_elem + var_num * max_dofs_per_elem;
99
100 default:
102 "Unsupported element type ",
103 static_cast<typename std::underlying_type<decltype(element_type)>::type>(element_type));
104 }
105}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311

Referenced by adOffset(), and globalDofIndexToDerivative().

◆ ADRealToGenericReal()

template<bool is_ad>
GenericReal< is_ad > Moose::ADRealToGenericReal ( const ADReal u_ad)

Converts an ADReal to a GenericReal<is_ad>

Definition at line 161 of file ADUtils.h.

162{
163 if constexpr (is_ad)
164 return u_ad;
165 else
166 return u_ad.value();
167}

◆ applyIndices()

template<typename T >
void Moose::applyIndices ( T &  container,
const std::vector< size_t > &  indices 
)

Uses indices created by the indirectSort function to sort the given container (which must support random access, resizing, and std::swap.

Definition at line 116 of file IndirectSort.h.

117{
118 T tmp;
119 tmp.resize(container.size());
120 for (size_t i = 0; i < indices.size(); i++)
121 tmp[i] = container[indices[i]];
122 std::swap(tmp, container);
123}

◆ assemble_matrix()

void Moose::assemble_matrix ( EquationSystems &  es,
const std::string &  system_name 
)

Definition at line 42 of file NonlinearEigenSystem.C.

43{
44 EigenProblem * p = es.parameters.get<EigenProblem *>("_eigen_problem");
45 auto & eigen_system = es.get_system<libMesh::CondensedEigenSystem>(system_name);
46 NonlinearEigenSystem & eigen_nl =
47 p->getNonlinearEigenSystem(/*nl_sys_num=*/eigen_system.number());
48
49 // If this is a nonlinear eigenvalue problem,
50 // we do not need to assemble anything
51 if (p->isNonlinearEigenvalueSolver(eigen_nl.number()))
52 {
53 // If you want an efficient eigensolver,
54 // please use PETSc 3.13 or newer.
55 // We need to do an unnecessary assembly,
56 // if you use PETSc that is older than 3.13.
57#if PETSC_RELEASE_LESS_THAN(3, 13, 0)
58 if (eigen_system.has_matrix_B())
59 p->computeJacobianTag(*eigen_system.current_local_solution,
60 eigen_system.get_matrix_B(),
61 eigen_nl.eigenMatrixTag());
62#endif
63 return;
64 }
65
66#if !PETSC_RELEASE_LESS_THAN(3, 13, 0)
67 // If we use shell matrices and do not use a shell preconditioning matrix,
68 // we only need to form a preconditioning matrix
69 if (eigen_system.use_shell_matrices() && !eigen_system.use_shell_precond_matrix())
70 {
71 p->computeJacobianTag(*eigen_system.current_local_solution,
72 eigen_system.get_precond_matrix(),
73 eigen_nl.precondMatrixTag());
74 return;
75 }
76#endif
77 // If it is a linear generalized eigenvalue problem,
78 // we assemble A and B together
79 if (eigen_system.generalized())
80 {
81 p->computeJacobianAB(*eigen_system.current_local_solution,
82 eigen_system.get_matrix_A(),
83 eigen_system.get_matrix_B(),
84 eigen_nl.nonEigenMatrixTag(),
85 eigen_nl.eigenMatrixTag());
86#if LIBMESH_HAVE_SLEPC
88 LibmeshPetscCallA(
89 p->comm().get(),
90 MatScale(cast_ref<PetscMatrix<Number> &>(eigen_system.get_matrix_B()).mat(), -1.0));
91#endif
92 return;
93 }
94
95 // If it is a linear eigenvalue problem, we assemble matrix A
96 {
97 p->computeJacobianTag(*eigen_system.current_local_solution,
98 eigen_system.get_matrix_A(),
99 eigen_nl.nonEigenMatrixTag());
100
101 return;
102 }
103}
Problem for solving eigenvalue problems.
bool negativeSignEigenKernel() const
A flag indicates if a negative sign is used in eigen kernels.
NonlinearEigenSystem & getNonlinearEigenSystem(const unsigned int nl_sys_num)
virtual void computeJacobianTag(const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian, TagID tag) override
Form a Jacobian matrix for all kernels and BCs with a given tag.
bool isNonlinearEigenvalueSolver(unsigned int eigen_sys_num) const
void computeJacobianAB(const NumericVector< Number > &soln, SparseMatrix< Number > &jacobianA, SparseMatrix< Number > &jacobianB, TagID tagA, TagID tagB)
Form two Jacobian matrices, where each is associated with one tag, through one element-loop.
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Nonlinear eigenvalue system to be solved.
const Parallel::Communicator & comm() const

Referenced by EigenProblem::init().

◆ associateSyntax()

void Moose::associateSyntax ( Syntax syntax,
ActionFactory action_factory 
)

Definition at line 847 of file Moose.C.

◆ associateSyntaxInner()

void Moose::associateSyntaxInner ( Syntax syntax,
ActionFactory action_factory 
)

Note: the optional third parameter is used to differentiate which task is satisfied based on the syntax encountered for classes which are registered to satisfy more than one task

Variable/AuxVariable Actions

Note: the optional third parameter is used to differentiate which task is satisfied based on the syntax encountered for classes which are registered to satisfy more than one task

Variable/AuxVariable Actions

Definition at line 610 of file Moose.C.

615 : Placeholder "no_action" actions must be put in places where it is possible to match an
616 * object with a star or a more specific parent later on. (i.e. where one needs to negate the
617 * '*' matching prematurely).
618 */
619void
620registerActions(Syntax & syntax, ActionFactory & action_factory)
621{
622 mooseDeprecated("use registerAll instead of registerActions");
623 registerActions(syntax, action_factory, {"MooseApp"});
624}
625
626void
627registerActions(Syntax & syntax,
628 ActionFactory & action_factory,
629 const std::set<std::string> & obj_labels)
630{
631 Registry::registerActionsTo(action_factory, obj_labels);
632
633 // Add these actions here so they are always executed last, without setting any dependency
634 registerTask("dump_objects", false);
635 registerTask("finish_input_file_output", false);
636}
637
638void
639associateSyntaxInner(Syntax & syntax, ActionFactory & /*action_factory*/)
640{
646 registerSyntax("DiffusionCG", "Physics/Diffusion/ContinuousGalerkin/*");
647 registerSyntax("DiffusionFV", "Physics/Diffusion/FiniteVolume/*");
648
649 registerSyntax("AddActionComponentAction", "ActionComponents/*");
650 registerSyntax("CombineComponentsMeshes", "ActionComponents");
651
652 registerSyntaxTask("CopyNodalVarsAction", "Variables/*", "check_copy_nodal_vars");
653 registerSyntaxTask("CopyNodalVarsAction", "Variables/*", "copy_nodal_vars");
654 registerSyntaxTask("CopyNodalVarsAction", "AuxVariables/*", "check_copy_nodal_vars");
655 registerSyntaxTask("CopyNodalVarsAction", "AuxVariables/*", "copy_nodal_aux_vars");
656
657 registerSyntaxTask("AddKernelAction", "Kernels/*", "add_kernel");
658 registerSyntaxTask("AddNodalKernelAction", "NodalKernels/*", "add_nodal_kernel");
659 registerSyntaxTask("AddKernelAction", "AuxKernels/*", "add_aux_kernel");
660
661 registerSyntaxTask("AddHDGKernelAction", "HDGKernels/*", "add_hybridized_kernel");
662
663 registerSyntax("AddAuxKernelAction", "AuxVariables/*/AuxKernel");
664
665 registerSyntaxTask("AddScalarKernelAction", "ScalarKernels/*", "add_scalar_kernel");
666 registerSyntaxTask("AddScalarKernelAction", "AuxScalarKernels/*", "add_aux_scalar_kernel");
667
668 registerSyntaxTask("AddBCAction", "BCs/*", "add_bc");
669
670 registerSyntax("CreateProblemAction", "Problem");
671 registerSyntax("DynamicObjectRegistrationAction", "Problem");
672
673 registerSyntax("SetupMeshAction", "Mesh");
674 registerSyntax("SetupMeshCompleteAction", "Mesh");
675 // Components should be able create a Mesh without a Mesh block
676 registerSyntax("CreateMeshSetupActionsForComponents", "ActionComponents");
677 registerSyntax("CreateDisplacedProblemAction", "Mesh");
678 registerSyntax("DisplayGhostingAction", "Mesh");
679 registerSyntax("AddMeshGeneratorAction", "Mesh/*");
680 registerSyntaxTask("EmptyAction", "Mesh/BatchMeshGeneratorAction", "no_action");
681 registerSyntax("BatchMeshGeneratorAction", "Mesh/BatchMeshGeneratorAction/*");
682 registerSyntax("ElementIDOutputAction", "Mesh");
683 syntax.registerSyntaxType("Mesh/*", "MeshGeneratorName");
684
685 registerSyntax("AddFunctionAction", "Functions/*");
686 syntax.registerSyntaxType("Functions/*", "FunctionName");
687
688 registerSyntax("AddMeshDivisionAction", "MeshDivisions/*");
689 syntax.registerSyntaxType("MeshDivisions/*", "MeshDivisionName");
690 registerSyntax("AddConvergenceAction", "Convergence/*");
691 syntax.registerSyntaxType("Convergence/*", "ConvergenceName");
692
693 registerSyntax("GlobalParamsAction", "GlobalParams");
694
695 registerSyntax("AddDistributionAction", "Distributions/*");
696 syntax.registerSyntaxType("Distributions/*", "DistributionName");
697
698 registerSyntax("AddSamplerAction", "Samplers/*");
699 syntax.registerSyntaxType("Samplers/*", "SamplerName");
700
701 registerSyntax("SetupDebugAction", "Debug");
702 registerSyntax("SetupResidualDebugAction", "Debug");
703
705 registerSyntax("AddVariableAction", "Variables/*");
706 syntax.registerSyntaxType("Variables/*", "VariableName");
707 syntax.registerSyntaxType("Variables/*", "NonlinearVariableName");
708
709 registerSyntax("AddICAction", "Variables/*/InitialCondition");
710 registerSyntax("AddFVICAction", "Variables/*/FVInitialCondition");
711
712 registerSyntax("AddAuxVariableAction", "AuxVariables/*");
713 syntax.registerSyntaxType("AuxVariables/*", "VariableName");
714 syntax.registerSyntaxType("AuxVariables/*", "AuxVariableName");
715
716 registerSyntax("AddICAction", "AuxVariables/*/InitialCondition");
717 registerSyntax("AddFVICAction", "AuxVariables/*/FVInitialCondition");
718
719 registerSyntaxTask("EmptyAction", "BCs/Periodic", "no_action"); // placeholder
720 registerSyntax("AddPeriodicBCAction", "BCs/Periodic/*");
721
722 registerSyntaxTask("AddInitialConditionAction", "ICs/*", "add_ic");
723 registerSyntaxTask("AddFVInitialConditionAction", "FVICs/*", "add_fv_ic");
724
725 registerSyntax("AddMaterialAction", "Materials/*");
726 syntax.registerSyntaxType("Materials/*", "MaterialName");
727
728 registerSyntax("AddFunctorMaterialAction", "FunctorMaterials/*");
729 syntax.registerSyntaxType("FunctorMaterials/*", "MaterialName");
730
731 registerSyntax("AddPostprocessorAction", "Postprocessors/*");
732 syntax.registerSyntaxType("Postprocessors/*", "PostprocessorName");
733 syntax.registerSyntaxType("Postprocessors/*", "UserObjectName");
734
735 registerSyntax("AddVectorPostprocessorAction", "VectorPostprocessors/*");
736 syntax.registerSyntaxType("VectorPostprocessors/*", "VectorPostprocessorName");
737
738 registerSyntax("AddReporterAction", "Reporters/*");
739 syntax.registerSyntaxType("Reporters/*", "ReporterName");
740
741 registerSyntax("AddPositionsAction", "Positions/*");
742 syntax.registerSyntaxType("Positions/*", "PositionsName");
743
744 registerSyntax("AddTimesAction", "Times/*");
745 syntax.registerSyntaxType("Times/*", "TimesName");
746
747 registerSyntax("AddDamperAction", "Dampers/*");
748
749 registerSyntax("AddOutputAction", "Outputs/*");
750 registerSyntax("CommonOutputAction", "Outputs");
751 registerSyntax("MaterialOutputAction", "Outputs");
752 registerSyntax("AutoCheckpointAction", "Outputs");
753 syntax.registerSyntaxType("Outputs/*", "OutputName");
754
755 // Note: Preconditioner Actions will be built by this setup action
756 registerSyntax("SetupPreconditionerAction", "Preconditioning/*");
757 registerSyntax("AddFieldSplitAction", "Preconditioning/*/*");
758
759 registerSyntax("CreateExecutionerAction", "Executioner");
760 registerSyntax("ReadExecutorParamsAction", "Executors/*");
761
762 registerSyntaxTask("AddTimeStepperAction", "Executioner/TimeSteppers/*", "add_time_steppers");
763 registerSyntaxTask("AddTimeStepperAction", "Executioner/TimeStepper", "add_time_stepper");
764 registerSyntaxTask(
765 "ComposeTimeStepperAction", "Executioner/TimeSteppers", "compose_time_stepper");
766 registerSyntaxTask(
767 "SetupTimeIntegratorAction", "Executioner/TimeIntegrators/*", "setup_time_integrators");
768 registerSyntaxTask(
769 "SetupTimeIntegratorAction", "Executioner/TimeIntegrator", "setup_time_integrator");
770 syntax.registerSyntaxType("Executors/*", "ExecutorName");
771
772 registerSyntax("SetupQuadratureAction", "Executioner/Quadrature");
773 registerSyntax("SetupPredictorAction", "Executioner/Predictor");
774#ifdef LIBMESH_ENABLE_AMR
775 registerSyntax("AdaptivityAction", "Executioner/Adaptivity");
776#endif
777
778 registerSyntax("PartitionerAction", "Mesh/Partitioner");
779
780 registerSyntax("AddDiracKernelAction", "DiracKernels/*");
781
782 registerSyntax("AddDGKernelAction", "DGKernels/*");
783 registerSyntax("AddFVKernelAction", "FVKernels/*");
784 registerSyntax("AddFVBCAction", "FVBCs/*");
785 registerSyntax("AddLinearFVBCAction", "LinearFVBCs/*");
786 registerSyntax("AddFVInterfaceKernelAction", "FVInterfaceKernels/*");
787 registerSyntax("CheckFVBCAction", "FVBCs");
788
789 registerSyntax("AddLinearFVKernelAction", "LinearFVKernels/*");
790
791 registerSyntax("AddInterfaceKernelAction", "InterfaceKernels/*");
792
793 registerSyntax("AddConstraintAction", "Constraints/*");
794
795 registerSyntax("AddControlAction", "Controls/*");
796 registerSyntax("AddChainControlAction", "ChainControls/*");
797 registerSyntax("AddBoundAction", "Bounds/*");
798 registerSyntax("AddBoundsVectorsAction", "Bounds");
799
800 // UserObject and some derived classes
801 registerSyntax("AddUserObjectAction", "UserObjects/*");
802 syntax.registerSyntaxType("UserObjects/*", "UserObjectName");
803
804 registerSyntax("AddCorrectorAction", "Correctors/*");
805 syntax.registerSyntaxType("Correctors/*", "UserObjectName");
806
807 registerSyntax("AddMeshModifiersAction", "MeshModifiers/*");
808 syntax.registerSyntaxType("MeshModifiers/*", "UserObjectName");
809
810 registerSyntax("AddNodalNormalsAction", "NodalNormals");
811
812 // FVInterpolationMethods
813 registerSyntax("AddFVInterpolationMethodAction", "FVInterpolationMethods/*");
814 syntax.registerSyntaxType("FVInterpolationMethods/*", "InterpolationMethodName");
815
816 // FVGradientMethods
817 registerSyntax("AddFVGradientMethodAction", "FVGradientMethods/*");
818 syntax.registerSyntaxType("FVGradientMethods/*", "GradientMethodName");
819
820 // Indicator
821 registerSyntax("AddElementalFieldAction", "Adaptivity/Indicators/*");
822 registerSyntax("AddIndicatorAction", "Adaptivity/Indicators/*");
823 syntax.registerSyntaxType("Adaptivity/Indicators/*", "IndicatorName");
824
825 // Marker
826 registerSyntax("AddElementalFieldAction", "Adaptivity/Markers/*");
827 registerSyntax("AddMarkerAction", "Adaptivity/Markers/*");
828 syntax.registerSyntaxType("Adaptivity/Markers/*", "MarkerName");
829
830 // New Adaptivity System
831 registerSyntax("SetAdaptivityOptionsAction", "Adaptivity");
832
833 // Deprecated Block
834 registerSyntax("DeprecatedBlockAction", "DeprecatedBlock");
835
836 // Multi Apps
837 registerSyntax("AddMultiAppAction", "MultiApps/*");
838 syntax.registerSyntaxType("MultiApps/*", "MultiAppName");
839
840 // Transfers
841 registerSyntax("AddTransferAction", "Transfers/*");
842
843 // Material derivative test
844 registerSyntaxTask("EmptyAction", "Debug/MaterialDerivativeTest", "no_action"); // placeholder
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition MooseError.h:363
Specialized factory for generic Action System objects.
static void registerActionsTo(ActionFactory &f, const std::set< std::string > &labels)
This registers all Actions known to the registry that have the given label(s) with the factory f.
Definition Registry.C:69
void registerSyntaxType(const std::string &syntax, const std::string &type)
Register a type with a block.
Definition Syntax.C:363
void registerActions(Syntax &syntax, ActionFactory &action_factory)
Multiple Action class can be associated with a single input file section, in which case all associate...
Definition Moose.C:591
void associateSyntaxInner(Syntax &syntax, ActionFactory &action_factory)
Definition Moose.C:610

Referenced by registerAll(), and setColorConsole().

◆ colorConsole()

bool Moose::colorConsole ( )

Returns whether Console coloring is turned on (default: true).

Definition at line 871 of file Moose.C.

◆ commonAdaptivityParams()

InputParameters Moose::commonAdaptivityParams ( )

Definition at line 23 of file SetAdaptivityOptionsAction.C.

24{
26 params.addParam<unsigned int>(
27 "steps", 0, "The number of adaptive steps to use when doing a Steady simulation.");
28 params.addRangeCheckedParam<unsigned int>(
29 "interval", 1, "interval>0", "The number of time steps betweeen each adaptivity phase");
30 params.addParam<unsigned int>(
31 "max_h_level",
32 0,
33 "Maximum number of times a single element can be refined. If 0 then infinite.");
34 params.addDeprecatedParam<Real>(
35 "start_time",
36 -std::numeric_limits<Real>::max(),
37 "The time that adaptivity will be active after.",
38 "'start_time' will be deprecated in the future. You can get identical behavior by using the "
39 "Controls system to set 'enable'.");
40 params.addDeprecatedParam<Real>(
41 "stop_time",
42 std::numeric_limits<Real>::max(),
43 "The time after which adaptivity will no longer be active.",
44 "'stop_time' will be deprecated in the future. You can get identical behavior by using the "
45 "Controls system to set 'enable'.");
46 params.addParam<bool>("enable", true, "Whether adaptivity should be enabled.");
47 params.declareControllable("enable");
48 params.addParam<unsigned int>(
49 "cycles_per_step",
50 1,
51 "The number of adaptive steps to use when on each timestep during a Transient simulation.");
52 params.addParam<bool>(
53 "recompute_markers_during_cycles", false, "Recompute markers during adaptivity cycles");
54 MooseEnum adaptivity("h=0 p=1 hp=2", "h");
55 params.addParam<MooseEnum>(
56 "adaptivity_type", adaptivity, "Select between h, p or hp mesh adaptivity");
57 return params;
58}
static InputParameters validParams()
Definition Action.C:26
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
void addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition MooseEnum.h:55

Referenced by AdaptivityAction::validParams(), and SetAdaptivityOptionsAction::validParams().

◆ compute_bounds()

void Moose::compute_bounds ( NumericVector< Number > &  lower,
NumericVector< Number > &  upper,
NonlinearImplicitSystem &  sys 
)

Definition at line 45 of file NonlinearSystem.C.

48{
49 FEProblemBase * p =
50 sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
51 p->computeBounds(sys, lower, upper);
52}
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void computeBounds(libMesh::NonlinearImplicitSystem &sys, NumericVector< libMesh::Number > &lower, NumericVector< libMesh::Number > &upper)

Referenced by NonlinearSystem::NonlinearSystem().

◆ compute_jacobian()

void Moose::compute_jacobian ( const NumericVector< Number > &  soln,
SparseMatrix< Number > &  jacobian,
NonlinearImplicitSystem &  sys 
)

Definition at line 35 of file NonlinearSystem.C.

38{
39 FEProblemBase * p =
40 sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
41 p->computeJacobianSys(sys, soln, jacobian);
42}
virtual void computeJacobianSys(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian)
Form a Jacobian matrix.

Referenced by NonlinearSystem::NonlinearSystem(), and NonlinearSystem::setupColoringFiniteDifferencedPreconditioner().

◆ compute_linear_system()

void Moose::compute_linear_system ( libMesh::EquationSystems es,
const std::string &  system_name 
)

Definition at line 64 of file LinearSystem.C.

65{
66 FEProblemBase * p = es.parameters.get<FEProblemBase *>("_fe_problem_base");
67 auto & sys = p->getLinearSystem(p->linearSysNum(system_name));
68 auto & lin_sys = sys.linearImplicitSystem();
69 auto & matrix = *(sys.linearImplicitSystem().matrix);
70 auto & rhs = *(sys.linearImplicitSystem().rhs);
71 p->computeLinearSystemSys(lin_sys, matrix, rhs);
72}
virtual void computeLinearSystemSys(libMesh::LinearImplicitSystem &sys, libMesh::SparseMatrix< libMesh::Number > &system_matrix, NumericVector< libMesh::Number > &rhs, const bool compute_gradients=true)
Assemble both the right hand side and the system matrix of a given linear system.
LinearSystem & getLinearSystem(unsigned int sys_num)
Get non-constant reference to a linear system.
unsigned int linearSysNum(const LinearSystemName &linear_sys_name) const override
const T & get(std::string_view) const

Referenced by LinearSystem::LinearSystem().

◆ compute_nearnullspace()

void Moose::compute_nearnullspace ( std::vector< NumericVector< Number > * > &  sp,
NonlinearImplicitSystem &  sys 
)

Definition at line 72 of file NonlinearSystem.C.

73{
74 FEProblemBase * p =
75 sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
76 p->computeNearNullSpace(sys, sp);
77}
virtual void computeNearNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > * > &sp)

Referenced by NonlinearSystem::NonlinearSystem().

◆ compute_nullspace()

void Moose::compute_nullspace ( std::vector< NumericVector< Number > * > &  sp,
NonlinearImplicitSystem &  sys 
)

Definition at line 55 of file NonlinearSystem.C.

56{
57 FEProblemBase * p =
58 sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
59 p->computeNullSpace(sys, sp);
60}
virtual void computeNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > * > &sp)

Referenced by NonlinearSystem::NonlinearSystem().

◆ compute_postcheck()

void Moose::compute_postcheck ( const NumericVector< Number > &  old_soln,
NumericVector< Number > &  search_direction,
NumericVector< Number > &  new_soln,
bool &  changed_search_direction,
bool &  changed_new_soln,
NonlinearImplicitSystem &  sys 
)

Definition at line 80 of file NonlinearSystem.C.

86{
87 FEProblemBase * p =
88 sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
90 sys, old_soln, search_direction, new_soln, changed_search_direction, changed_new_soln);
91}
virtual void computePostCheck(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &old_soln, NumericVector< libMesh::Number > &search_direction, NumericVector< libMesh::Number > &new_soln, bool &changed_search_direction, bool &changed_new_soln)

Referenced by NonlinearSystem::solve().

◆ compute_transpose_nullspace()

void Moose::compute_transpose_nullspace ( std::vector< NumericVector< Number > * > &  sp,
NonlinearImplicitSystem &  sys 
)

Definition at line 63 of file NonlinearSystem.C.

65{
66 FEProblemBase * p =
67 sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
68 p->computeTransposeNullSpace(sys, sp);
69}
virtual void computeTransposeNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > * > &sp)

Referenced by NonlinearSystem::NonlinearSystem().

◆ createMapFromVectorAndMultiMooseEnum()

template<typename T >
std::map< T, MooseEnum > Moose::createMapFromVectorAndMultiMooseEnum ( const std::vector< T > &  keys,
const MultiMooseEnum values 
)

Create a map from a vector of keys and MultiMooseEnum acting as a vector.

Parameters
keysthe vector of the keys
valuesthe MultiMooseEnum acting as a vector of the values
Template Parameters
Tthe type of the keys

Definition at line 58 of file MapConversionUtils.h.

59{
60 std::map<T, MooseEnum> map;
61 mooseAssert(keys.size() == values.size(),
62 "Map should be made from keys and values of the same size");
63 // No values have been specified. We cant form a map of empty MooseEnum
64 if (!values.size())
65 return map;
66 std::transform(keys.begin(),
67 keys.end(),
68 values.begin(),
69 std::inserter(map, map.end()),
70 [values](const T & a, const MooseEnumItem & b)
71 {
72 // Create a MooseEnum from the available values in the MultiMooseEnum and an
73 // actual current active item from that same MultiMooseEnum
74 MooseEnum single_value(values.getRawNames(), b.name());
75 return std::make_pair(a, single_value);
76 });
77 return map;
78}
std::array< Real, 2 > values
Definition MortarUtils.C:52
Class for containing MooseEnum item information.

◆ createMapFromVectors()

template<typename T , typename C >
std::map< T, C > Moose::createMapFromVectors ( const std::vector< T > &  keys,
const std::vector< C > &  values 
)

Create a map from two vectors.

Parameters
keysthe vector of the keys
valuesthe vector of the values
Template Parameters
Tthe type of the keys
Cthe type of the values

Definition at line 36 of file MapConversionUtils.h.

37{
38 std::map<T, C> map;
39 mooseAssert(keys.size() == values.size(),
40 "Map should be made from keys (" + std::to_string(keys.size()) + ") and values (" +
41 std::to_string(values.size()) + ") of the same size");
42
43 // No values have been specified.
44 if (!values.size())
45 {
46 return map;
47 }
48 std::transform(keys.begin(),
49 keys.end(),
50 values.begin(),
51 std::inserter(map, map.end()),
52 [](const T & a, const C & b) { return std::make_pair(a, b); });
53 return map;
54}

◆ createMooseApp()

std::unique_ptr< MooseApp > Moose::createMooseApp ( const std::string &  default_app_type,
int  argc,
char *  argv[] 
)

Create a MooseApp from command-line arguments.

Definition at line 27 of file MooseMain.C.

28{
29 // Parse the command line early in order to determine the application type, from:
30 // - the input file, to load and search for Application/type
31 // - the --app command line argument
32 // - The Application/type= hit command line argument
33 auto command_line_params = emptyInputParameters();
34 {
35 CommandLine cl(argc, argv);
36 cl.parse();
37 MooseApp::addInputParam(command_line_params);
38 MooseApp::addAppParam(command_line_params);
39 cl.populateCommandLineParams(command_line_params);
40
41 // Do not allow overriding Application/type= for subapps
42 for (const auto & arg : cl.getArguments())
43 if (std::regex_match(arg, std::regex("[A-Za-z0-9]*:Application/.*")))
45 "For command line argument '",
46 arg,
47 "': overriding the application type for MultiApps via command line is not allowed.");
48 }
49 const auto & input_filenames = command_line_params.get<std::vector<std::string>>("input_file");
50
51 // Parse command line arguments so that we can get the "--app" entry (if any) and the HIT
52 // command line arguments for the Parser
53 auto command_line = std::make_unique<CommandLine>(argc, argv);
54 command_line->parse();
55
56 // Setup the parser with the input and the HIT parameters from the command line. The parse
57 // will also look for "Application/type=" in input to specify the application type
58 auto parser = std::make_unique<Parser>(input_filenames);
59 parser->setAppType(default_app_type);
60 parser->setCommandLineParams(command_line->buildHitParams());
61 parser->parse();
62
63 // Search the command line for either --app or Application/type and let the last one win
64 for (const auto & entry : std::as_const(*command_line).getEntries())
65 if (!entry.subapp_name && entry.value &&
66 (entry.name == "--app" || entry.name == "Application/type"))
67 parser->setAppType(*entry.value);
68
69 const auto & app_type = parser->getAppType();
70 if (!AppFactory::instance().isRegistered(app_type))
71 mooseError("'", app_type, "' is not a registered application type.");
72
73 // Create an instance of the application and store it in a smart pointer for easy cleanup
74 return AppFactory::create(std::move(parser), std::move(command_line));
75}
InputParameters emptyInputParameters()
if(!dmm->_nl) SETERRQ(PETSC_COMM_WORLD
static std::unique_ptr< MooseApp > create(const std::string &app_type, const std::vector< std::string > &cli_args={})
Create an app with no input and command line arguments.
Definition AppFactory.C:64
static AppFactory & instance()
Get the instance of the AppFactory.
Definition AppFactory.C:20
This class wraps provides and tracks access to command line parameters.
Definition CommandLine.h:30
static void addAppParam(InputParameters &params)
Definition MooseApp.C:262
static void addInputParam(InputParameters &params)
Definition MooseApp.C:269

Referenced by main().

◆ currentState()

StateArg Moose::currentState ( )
inline

◆ derivInsert() [1/2]

template<std::size_t N>
void Moose::derivInsert ( NumberArray< N, Real > &  derivs,
dof_id_type  index,
Real  value 
)
inline

Definition at line 19 of file NumberArrayOps.h.

20{
21 mooseAssert(index < MOOSE_AD_MAX_DOFS_PER_ELEM,
22 "The requested derivative index "
23 << index << " is not less than " << MOOSE_AD_MAX_DOFS_PER_ELEM
24 << ". You can run `configure --with-derivative-size=<n>` to request a larger "
25 "derivative container.");
26 derivs[index] = value;
27}

◆ derivInsert() [2/2]

template<std::size_t N>
void Moose::derivInsert ( SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N > > &  derivs,
libMesh::dof_id_type  index,
Real  value 
)
inline

Definition at line 21 of file ADReal.h.

24{
25#ifndef NDEBUG
26 try
27 {
28 derivs.insert(index) = value;
29 }
30 catch (MetaPhysicL::LogicError &)
31 {
32 // We don't want to use a MooseError here to keep the list of includes in parsed ADReal logic
33 // minimal
34 libmesh_error_msg(
35 "The last insertion into the sparse derivative storage container exceeded the "
36 "underlying array size. Consider running `configure --with-derivative-size=<n>` to "
37 "obtain a larger underlying container");
38 }
39#else
40 derivs.insert(index) = value;
41#endif
42}
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)

Referenced by MooseVariableScalar::computeAD(), MooseVariableDataFV< OutputType >::computeAD(), Assembly::computeFaceMap(), ADPenaltyPeriodicSegmentalConstraint::computeQpResidual(), ADPeriodicSegmentalConstraint::computeQpResidual(), ADPenaltyPeriodicSegmentalConstraint::computeScalarQpResidual(), Assembly::computeSinglePointMapAD(), MooseVariableFE< OutputType >::computeSolution(), MooseVariableScalar::evaluate(), MooseVariableFE< OutputType >::evaluate(), MooseVariableData< OutputType >::fetchADDofValues(), and MooseVariableDataFV< OutputType >::fetchADDofValues().

◆ doDerivatives()

bool Moose::doDerivatives ( const SubProblem subproblem,
const SystemBase sys 
)
Returns
whether we should be doing derivatives

Definition at line 83 of file ADUtils.C.

84{
85 return ADReal::do_derivatives && sys.number() == subproblem.currentNlSysNum();
86}
virtual unsigned int currentNlSysNum() const =0
unsigned int number() const
Gets the number of this system.

Referenced by MooseVariableFE< OutputType >::computeSolution(), MooseVariableScalar::evaluate(), MooseVariableFE< OutputType >::evaluate(), and MooseVariableData< OutputType >::fetchADDofValues().

◆ elementsIntersectedByLine() [1/2]

void Moose::elementsIntersectedByLine ( const Point &  p0,
const Point &  p1,
const MeshBase &  ,
const PointLocatorBase &  point_locator,
std::vector< Elem * > &  intersected_elems,
std::vector< LineSegment > &  segments 
)

Definition at line 192 of file RayTracing.C.

198{
199 // Make sure our list is clear
200 intersected_elems.clear();
201
202 // Find the starting element
203 const Elem * first_elem = point_locator(p0);
204
205 // Quick return if can't even locate the first element.
206 if (!first_elem)
207 return;
208
209 intersected_elems.push_back(const_cast<Elem *>(first_elem));
210
211 // Make a LineSegment object out of our two points for ease:
212 LineSegment line_segment = LineSegment(p0, p1);
213
214 // Find 'em!
216 line_segment, first_elem, -1, p0, intersected_elems, segments);
217}
The LineSegment class is used by the LineMaterialSamplerBase class and for some ray tracing stuff.
Definition LineSegment.h:31
void recursivelyFindElementsIntersectedByLine(const LineSegment &line_segment, const Elem *current_elem, int incoming_side, const Point &incoming_point, std::vector< Elem * > &intersected_elems, std::vector< LineSegment > &segments)
Recursively find all elements intersected by a line segment.
Definition RayTracing.C:144

◆ elementsIntersectedByLine() [2/2]

void Moose::elementsIntersectedByLine ( const Point &  p0,
const Point &  p1,
const MeshBase &  mesh,
const libMesh::PointLocatorBase point_locator,
std::vector< Elem * > &  intersected_elems,
std::vector< LineSegment > &  segments 
)

Find all of the elements intersected by a line.

The line is given as the beginning and ending points

Parameters
p0The beginning of the line
p1The end of the line
intersected_elemsThe elements intersected by the line. Will be empty if there are no intersections.
segmentsThe line segments across each element

Referenced by ElementsAlongLine::execute(), IntersectionPointsAlongLine::execute(), and LineMaterialSamplerBase< T >::execute().

◆ elementsIntersectedByPlane() [1/4]

void Moose::elementsIntersectedByPlane ( const libMesh::Point p0,
const libMesh::Point normal,
const libMesh::MeshBase mesh,
std::vector< const libMesh::Elem * > &  intersected_elems 
)

Find all of the elements intersected by a plane.

The plane is given as a point and a normal vector.

Parameters
p0Point in plane.
normalNormal vector to plane.
intersected_elemsThe elements intersected by the plane. Will be empty if there are no intersections.

Referenced by ElementsAlongPlane::execute().

◆ elementsIntersectedByPlane() [2/4]

void Moose::elementsIntersectedByPlane ( const libMesh::Point p0,
const libMesh::Point p1,
const libMesh::Point p2,
const libMesh::MeshBase mesh,
std::vector< const libMesh::Elem * > &  intersected_elems 
)

Find all of the elements intersected by a plane.

The plane is given as three points in the plane.

Parameters
p0Point in plane.
p1Point in plane.
p2Point in plane.
intersected_elemsThe elements intersected by the plane. Will be empty if there are no intersections.

◆ elementsIntersectedByPlane() [3/4]

void Moose::elementsIntersectedByPlane ( const Point &  p0,
const Point &  normal,
const MeshBase &  mesh,
std::vector< const Elem * > &  intersected_elems 
)

Definition at line 53 of file ElementsIntersectedByPlane.C.

57{
58 // Make sure our list is clear
59 intersected_elems.clear();
60
61 // Create plane from point and normal:
62 libMesh::Plane plane(p0, normal);
63
64 // Find 'em!
65 findElementsIntersectedByPlane(plane, mesh, intersected_elems);
66}
void findElementsIntersectedByPlane(const libMesh::Plane &plane, const MeshBase &mesh, std::vector< const Elem * > &intersected_elems)

◆ elementsIntersectedByPlane() [4/4]

void Moose::elementsIntersectedByPlane ( const Point &  p0,
const Point &  p1,
const Point &  p2,
const MeshBase &  mesh,
std::vector< const Elem * > &  intersected_elems 
)

Definition at line 69 of file ElementsIntersectedByPlane.C.

74{
75 // Make sure our list is clear
76 intersected_elems.clear();
77
78 // Create plane from three points:
79 libMesh::Plane plane(p0, p1, p2);
80
81 // Find 'em!
82 findElementsIntersectedByPlane(plane, mesh, intersected_elems);
83}

◆ enumerate() [1/3]

template<class Container >
_enumerate_range< typename Container::const_iterator > Moose::enumerate ( const Container &  content)

Definition at line 68 of file Enumerate.h.

69{
71 std::begin(content), std::end(content), 0);
72}

◆ enumerate() [2/3]

template<class Container >
_enumerate_range< typename Container::iterator > Moose::enumerate ( Container &  content)

Definition at line 61 of file Enumerate.h.

62{
63 return _enumerate_range<typename Container::iterator>(std::begin(content), std::end(content), 0);
64}

◆ enumerate() [3/3]

template<class Iterator >
_enumerate_range< Iterator > Moose::enumerate ( Iterator  first,
Iterator  last,
typename std::iterator_traits< Iterator >::difference_type  initial 
)

Enumerate function for iterating over a range and obtaining both a reference to the underlying type and an index simultaneously.

This method is forward-compatible with the C++17 structured bindings capability.

C++11 compatible usage:

for (auto it : Moose::enumerate(values)) _console << it.index() << ": " << it.value() << '
';

// Here the third argument is the starting index value for (auto it : Moose::enumerate(values.begin(), values.end(), 0)) _console << it.index() << ": " << it.value() << '
';

C++17 usage (DO NOT USE IN MOOSE):

for (auto [index, value] : Moose::enumerate(values)) _console << index << ": " << value << '
';

// Here the third argument is the starting index value for (auto [index, value] : Moose::enumerate(values.begin(), values.end(), 0)) _console << index << ": " << value << '
';

Definition at line 52 of file Enumerate.h.

55{
56 return _enumerate_range<Iterator>(first, last, initial);
57}

Referenced by JvarMapInterfaceBase< T >::JvarMapInterfaceBase(), NearestPointAverage::nearestPointIndex(), NearestPointIntegralVariablePostprocessor::nearestPointIndex(), and NearestPointBase< UserObjectType, BaseType >::nearestUserObject().

◆ fe_lagrange_1D_shape()

template<typename T >
T Moose::fe_lagrange_1D_shape ( const Order  order,
const unsigned int  i,
const T &  xi 
)

Definition at line 20 of file MooseLagrangeHelpers.h.

21{
22 switch (order)
23 {
24 // Lagrange linears
25 case libMesh::FIRST:
26 {
27 libmesh_assert_less(i, 2);
28
29 switch (i)
30 {
31 case 0:
32 return .5 * (1. - xi);
33
34 case 1:
35 return .5 * (1. + xi);
36
37 default:
38 mooseError("Invalid shape function index i = ", i);
39 }
40 }
41
42 // Lagrange quadratics
43 case libMesh::SECOND:
44 {
45 libmesh_assert_less(i, 3);
46
47 switch (i)
48 {
49 case 0:
50 return .5 * xi * (xi - 1.);
51
52 case 1:
53 return .5 * xi * (xi + 1);
54
55 case 2:
56 return (1. - xi * xi);
57
58 default:
59 mooseError("Invalid shape function index i = ", i);
60 }
61 }
62
63 // Lagrange cubics
64 case libMesh::THIRD:
65 {
66 libmesh_assert_less(i, 4);
67
68 switch (i)
69 {
70 case 0:
71 return 9. / 16. * (1. / 9. - xi * xi) * (xi - 1.);
72
73 case 1:
74 return -9. / 16. * (1. / 9. - xi * xi) * (xi + 1.);
75
76 case 2:
77 return 27. / 16. * (1. - xi * xi) * (1. / 3. - xi);
78
79 case 3:
80 return 27. / 16. * (1. - xi * xi) * (1. / 3. + xi);
81
82 default:
83 mooseError("Invalid shape function index i = ", i);
84 }
85 }
86
87 default:
88 mooseError("Unsupported order");
89 }
90}
Point xi
Definition MortarUtils.C:59

Referenced by AutomaticMortarGeneration::buildMortarSegmentMesh(), fe_lagrange_2D_shape(), fe_lagrange_2D_shape_deriv(), AutomaticMortarGeneration::getNormals(), AutomaticMortarGeneration::projectPrimaryNodesSinglePair(), and AutomaticMortarGeneration::projectSecondaryNodesSinglePair().

◆ fe_lagrange_1D_shape_deriv()

template<typename T >
T Moose::fe_lagrange_1D_shape_deriv ( const Order  order,
const unsigned int  i,
const T &  xi 
)

Definition at line 94 of file MooseLagrangeHelpers.h.

95{
96 switch (order)
97 {
98 // Lagrange linear shape function derivatives
99 case libMesh::FIRST:
100 {
101 libmesh_assert_less(i, 2);
102
103 switch (i)
104 {
105 case 0:
106 return -.5;
107
108 case 1:
109 return .5;
110
111 default:
112 mooseError("Invalid shape function index i = ", i);
113 }
114 }
115
116 // Lagrange quadratic shape function derivatives
117 case libMesh::SECOND:
118 {
119 libmesh_assert_less(i, 3);
120
121 switch (i)
122 {
123 case 0:
124 return xi - .5;
125
126 case 1:
127 return xi + .5;
128
129 case 2:
130 return -2. * xi;
131
132 default:
133 mooseError("Invalid shape function index i = ", i);
134 }
135 }
136
137 // Lagrange cubic shape function derivatives
138 case libMesh::THIRD:
139 {
140 libmesh_assert_less(i, 4);
141
142 switch (i)
143 {
144 case 0:
145 return -9. / 16. * (3. * xi * xi - 2. * xi - 1. / 9.);
146
147 case 1:
148 return -9. / 16. * (-3. * xi * xi - 2. * xi + 1. / 9.);
149
150 case 2:
151 return 27. / 16. * (3. * xi * xi - 2. / 3. * xi - 1.);
152
153 case 3:
154 return 27. / 16. * (-3. * xi * xi - 2. / 3. * xi + 1.);
155
156 default:
157 mooseError("Invalid shape function index i = ", i);
158 }
159 }
160
161 default:
162 mooseError("Unsupported order");
163 }
164}

Referenced by fe_lagrange_2D_shape_deriv().

◆ fe_lagrange_2D_shape()

template<typename T , template< typename > class VectorType>
T Moose::fe_lagrange_2D_shape ( const libMesh::ElemType  type,
const Order  order,
const unsigned int  i,
const VectorType< T > &  p 
)

Definition at line 169 of file MooseLagrangeHelpers.h.

173{
174 switch (order)
175 {
176 // linear Lagrange shape functions
177 case libMesh::FIRST:
178 {
179 switch (type)
180 {
181 case libMesh::QUAD4:
183 case libMesh::QUAD8:
185 case libMesh::QUAD9:
186 {
187 // Compute quad shape functions as a tensor-product
188 const T xi = p(0);
189 const T eta = p(1);
190
191 libmesh_assert_less(i, 4);
192
193 // 0 1 2 3
194 static const unsigned int i0[] = {0, 1, 1, 0};
195 static const unsigned int i1[] = {0, 0, 1, 1};
196
197 return (fe_lagrange_1D_shape(FIRST, i0[i], xi) * fe_lagrange_1D_shape(FIRST, i1[i], eta));
198 }
199
200 case libMesh::TRI3:
202 case libMesh::TRI6:
203 case libMesh::TRI7:
204 {
205 const T zeta1 = p(0);
206 const T zeta2 = p(1);
207 const T zeta0 = 1. - zeta1 - zeta2;
208
209 libmesh_assert_less(i, 3);
210
211 switch (i)
212 {
213 case 0:
214 return zeta0;
215
216 case 1:
217 return zeta1;
218
219 case 2:
220 return zeta2;
221
222 default:
223 mooseError("Invalid shape function index i = ", i);
224 }
225 }
226
227 default:
228 mooseError("Unsupported element type:", type);
229 }
230 }
231
232 // quadratic Lagrange shape functions
233 case libMesh::SECOND:
234 {
235 switch (type)
236 {
237 case libMesh::QUAD8:
238 {
239 // Compute quad shape functions as a tensor-product
240 const T xi = p(0);
241 const T eta = p(1);
242
243 libmesh_assert_less(i, 8);
244
245 switch (i)
246 {
247 case 0:
248 return .25 * (1. - xi) * (1. - eta) * (-1. - xi - eta);
249 case 1:
250 return .25 * (1. + xi) * (1. - eta) * (-1. + xi - eta);
251 case 2:
252 return .25 * (1. + xi) * (eta + 1.) * (-1. + xi + eta);
253 case 3:
254 return .25 * (1. - xi) * (eta + 1.) * (-1. - xi + eta);
255 case 4:
256 return .5 * (1. - xi * xi) * (1. - eta);
257 case 5:
258 return .5 * (1. + xi) * (1. - eta * eta);
259 case 6:
260 return .5 * (1. - xi * xi) * (1. + eta);
261 case 7:
262 return .5 * (1. - xi) * (1. - eta * eta);
263 default:
264 mooseError("Invalid shape function index i = ", i);
265 }
266 }
267 case libMesh::QUAD9:
268 {
269 // Compute quad shape functions as a tensor-product
270 const T xi = p(0);
271 const T eta = p(1);
272
273 libmesh_assert_less(i, 9);
274
275 // 0 1 2 3 4 5 6 7 8
276 static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
277 static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
278
279 return (fe_lagrange_1D_shape(libMesh::SECOND, i0[i], xi) *
281 }
282 case libMesh::TRI6:
283 case libMesh::TRI7:
284 {
285 const T zeta1 = p(0);
286 const T zeta2 = p(1);
287 const T zeta0 = 1. - zeta1 - zeta2;
288
289 libmesh_assert_less(i, 6);
290
291 switch (i)
292 {
293 case 0:
294 return 2. * zeta0 * (zeta0 - 0.5);
295
296 case 1:
297 return 2. * zeta1 * (zeta1 - 0.5);
298
299 case 2:
300 return 2. * zeta2 * (zeta2 - 0.5);
301
302 case 3:
303 return 4. * zeta0 * zeta1;
304
305 case 4:
306 return 4. * zeta1 * zeta2;
307
308 case 5:
309 return 4. * zeta2 * zeta0;
310
311 default:
312 mooseError("Invalid shape function index i = ", i);
313 }
314 }
315
316 default:
317 mooseError("Unsupported 2D element type");
318 }
319 }
320
321 // "cubic" (one cubic bubble) Lagrange shape functions
322 case libMesh::THIRD:
323 {
324 switch (type)
325 {
326 case libMesh::TRI7:
327 {
328 const T zeta1 = p(0);
329 const T zeta2 = p(1);
330 const T zeta0 = 1. - zeta1 - zeta2;
331 const T bubble_27th = zeta0 * zeta1 * zeta2;
332
333 libmesh_assert_less(i, 7);
334
335 switch (i)
336 {
337 case 0:
338 return 2. * zeta0 * (zeta0 - 0.5) + 3. * bubble_27th;
339
340 case 1:
341 return 2. * zeta1 * (zeta1 - 0.5) + 3. * bubble_27th;
342
343 case 2:
344 return 2. * zeta2 * (zeta2 - 0.5) + 3. * bubble_27th;
345
346 case 3:
347 return 4. * zeta0 * zeta1 - 12. * bubble_27th;
348
349 case 4:
350 return 4. * zeta1 * zeta2 - 12. * bubble_27th;
351
352 case 5:
353 return 4. * zeta2 * zeta0 - 12. * bubble_27th;
354
355 case 6:
356 return 27. * bubble_27th;
357
358 default:
359 mooseError("Invalid shape function index i = ", i);
360 }
361 }
362
363 default:
364 mooseError("Unsupported 2D element type");
365 }
366 }
367
368 // unsupported order
369 default:
370 mooseError("Unsupported order");
371 }
372}
Point eta
Definition MortarUtils.C:60
Real fe_lagrange_1D_shape(const Order order, const unsigned int i, const Real xi)

Referenced by AutomaticMortarGeneration::getNormals(), and Moose::Mortar::projectQPoints3d().

◆ fe_lagrange_2D_shape_deriv()

template<typename T , template< typename > class VectorType>
T Moose::fe_lagrange_2D_shape_deriv ( const libMesh::ElemType  type,
const Order  order,
const unsigned int  i,
const unsigned int  j,
const VectorType< T > &  p 
)

Definition at line 376 of file MooseLagrangeHelpers.h.

381{
382 libmesh_assert_less(j, 2);
383
384 switch (order)
385 {
386 // linear Lagrange shape functions
387 case libMesh::FIRST:
388 {
389 switch (type)
390 {
391 case libMesh::QUAD4:
393 case libMesh::QUAD8:
395 case libMesh::QUAD9:
396 {
397 // Compute quad shape functions as a tensor-product
398 const T xi = p(0);
399 const T eta = p(1);
400
401 libmesh_assert_less(i, 4);
402
403 // 0 1 2 3
404 static const unsigned int i0[] = {0, 1, 1, 0};
405 static const unsigned int i1[] = {0, 0, 1, 1};
406
407 switch (j)
408 {
409 // d()/dxi
410 case 0:
411 return (fe_lagrange_1D_shape_deriv(FIRST, i0[i], xi) *
412 fe_lagrange_1D_shape(FIRST, i1[i], eta));
413
414 // d()/deta
415 case 1:
416 return (fe_lagrange_1D_shape(FIRST, i0[i], xi) *
417 fe_lagrange_1D_shape_deriv(FIRST, i1[i], eta));
418
419 default:
420 mooseError("Invalid derivative index j = ", j);
421 }
422 }
423
424 case libMesh::TRI3:
426 case libMesh::TRI6:
427 case libMesh::TRI7:
428 {
429 libmesh_assert_less(i, 3);
430
431 const T dzeta0dxi = -1.;
432 const T dzeta1dxi = 1.;
433 const T dzeta2dxi = 0.;
434
435 const T dzeta0deta = -1.;
436 const T dzeta1deta = 0.;
437 const T dzeta2deta = 1.;
438
439 switch (j)
440 {
441 // d()/dxi
442 case 0:
443 {
444 switch (i)
445 {
446 case 0:
447 return dzeta0dxi;
448
449 case 1:
450 return dzeta1dxi;
451
452 case 2:
453 return dzeta2dxi;
454
455 default:
456 mooseError("Invalid shape function index i = ", i);
457 }
458 }
459 // d()/deta
460 case 1:
461 {
462 switch (i)
463 {
464 case 0:
465 return dzeta0deta;
466
467 case 1:
468 return dzeta1deta;
469
470 case 2:
471 return dzeta2deta;
472
473 default:
474 mooseError("Invalid shape function index i = ", i);
475 }
476 }
477 default:
478 mooseError("Invalid derivative index j = ", j);
479 }
480 }
481
482 default:
483 mooseError("Unsupported 2D element type");
484 }
485 }
486
487 // quadratic Lagrange shape functions
488 case libMesh::SECOND:
489 {
490 switch (type)
491 {
492 case libMesh::QUAD8:
494 {
495 const T xi = p(0);
496 const T eta = p(1);
497
498 libmesh_assert_less(i, 8);
499
500 switch (j)
501 {
502 // d/dxi
503 case 0:
504 switch (i)
505 {
506 case 0:
507 return .25 * (1. - eta) * ((1. - xi) * (-1.) + (-1.) * (-1. - xi - eta));
508
509 case 1:
510 return .25 * (1. - eta) * ((1. + xi) * (1.) + (1.) * (-1. + xi - eta));
511
512 case 2:
513 return .25 * (1. + eta) * ((1. + xi) * (1.) + (1.) * (-1. + xi + eta));
514
515 case 3:
516 return .25 * (1. + eta) * ((1. - xi) * (-1.) + (-1.) * (-1. - xi + eta));
517
518 case 4:
519 return .5 * (-2. * xi) * (1. - eta);
520
521 case 5:
522 return .5 * (1.) * (1. - eta * eta);
523
524 case 6:
525 return .5 * (-2. * xi) * (1. + eta);
526
527 case 7:
528 return .5 * (-1.) * (1. - eta * eta);
529
530 default:
531 mooseError("Invalid shape function index i = ", i);
532 }
533
534 // d/deta
535 case 1:
536 switch (i)
537 {
538 case 0:
539 return .25 * (1. - xi) * ((1. - eta) * (-1.) + (-1.) * (-1. - xi - eta));
540
541 case 1:
542 return .25 * (1. + xi) * ((1. - eta) * (-1.) + (-1.) * (-1. + xi - eta));
543
544 case 2:
545 return .25 * (1. + xi) * ((1. + eta) * (1.) + (1.) * (-1. + xi + eta));
546
547 case 3:
548 return .25 * (1. - xi) * ((1. + eta) * (1.) + (1.) * (-1. - xi + eta));
549
550 case 4:
551 return .5 * (1. - xi * xi) * (-1.);
552
553 case 5:
554 return .5 * (1. + xi) * (-2. * eta);
555
556 case 6:
557 return .5 * (1. - xi * xi) * (1.);
558
559 case 7:
560 return .5 * (1. - xi) * (-2. * eta);
561
562 default:
563 mooseError("Invalid shape function index i = ", i);
564 }
565
566 default:
567 mooseError("ERROR: Invalid derivative index j = ", j);
568 }
569 }
570
571 case libMesh::QUAD9:
572 {
573 // Compute quad shape functions as a tensor-product
574 const T xi = p(0);
575 const T eta = p(1);
576
577 libmesh_assert_less(i, 9);
578
579 // 0 1 2 3 4 5 6 7 8
580 static const unsigned int i0[] = {0, 1, 1, 0, 2, 1, 2, 0, 2};
581 static const unsigned int i1[] = {0, 0, 1, 1, 0, 2, 1, 2, 2};
582
583 switch (j)
584 {
585 // d()/dxi
586 case 0:
589
590 // d()/deta
591 case 1:
592 return (fe_lagrange_1D_shape(libMesh::SECOND, i0[i], xi) *
594
595 default:
596 mooseError("Invalid derivative index j = ", j);
597 }
598 }
599
600 case libMesh::TRI6:
601 case libMesh::TRI7:
602 {
603 libmesh_assert_less(i, 6);
604
605 const T zeta1 = p(0);
606 const T zeta2 = p(1);
607 const T zeta0 = 1. - zeta1 - zeta2;
608
609 const T dzeta0dxi = -1.;
610 const T dzeta1dxi = 1.;
611 const T dzeta2dxi = 0.;
612
613 const T dzeta0deta = -1.;
614 const T dzeta1deta = 0.;
615 const T dzeta2deta = 1.;
616
617 switch (j)
618 {
619 case 0:
620 {
621 switch (i)
622 {
623 case 0:
624 return (4. * zeta0 - 1.) * dzeta0dxi;
625
626 case 1:
627 return (4. * zeta1 - 1.) * dzeta1dxi;
628
629 case 2:
630 return (4. * zeta2 - 1.) * dzeta2dxi;
631
632 case 3:
633 return 4. * zeta1 * dzeta0dxi + 4. * zeta0 * dzeta1dxi;
634
635 case 4:
636 return 4. * zeta2 * dzeta1dxi + 4. * zeta1 * dzeta2dxi;
637
638 case 5:
639 return 4. * zeta2 * dzeta0dxi + 4 * zeta0 * dzeta2dxi;
640
641 default:
642 mooseError("Invalid shape function index i = ", i);
643 }
644 }
645
646 case 1:
647 {
648 switch (i)
649 {
650 case 0:
651 return (4. * zeta0 - 1.) * dzeta0deta;
652
653 case 1:
654 return (4. * zeta1 - 1.) * dzeta1deta;
655
656 case 2:
657 return (4. * zeta2 - 1.) * dzeta2deta;
658
659 case 3:
660 return 4. * zeta1 * dzeta0deta + 4. * zeta0 * dzeta1deta;
661
662 case 4:
663 return 4. * zeta2 * dzeta1deta + 4. * zeta1 * dzeta2deta;
664
665 case 5:
666 return 4. * zeta2 * dzeta0deta + 4 * zeta0 * dzeta2deta;
667
668 default:
669 mooseError("Invalid shape function index i = ", i);
670 }
671 }
672 default:
673 mooseError("ERROR: Invalid derivative index j = ", j);
674 }
675 }
676
677 default:
678 mooseError("ERROR: Unsupported 2D element type");
679 }
680 }
681
682 // "cubic" (one cubic bubble) Lagrange shape functions
683 case libMesh::THIRD:
684 {
685 switch (type)
686 {
687 case libMesh::TRI7:
688 {
689 libmesh_assert_less(i, 7);
690
691 const T zeta1 = p(0);
692 const T zeta2 = p(1);
693 const T zeta0 = 1. - zeta1 - zeta2;
694
695 const T dzeta0dxi = -1.;
696 const T dzeta1dxi = 1.;
697 const T dzeta2dxi = 0.;
698 const T dbubbledxi = zeta2 * (1. - 2. * zeta1 - zeta2);
699
700 const T dzeta0deta = -1.;
701 const T dzeta1deta = 0.;
702 const T dzeta2deta = 1.;
703 const T dbubbledeta = zeta1 * (1. - zeta1 - 2. * zeta2);
704
705 switch (j)
706 {
707 case 0:
708 {
709 switch (i)
710 {
711 case 0:
712 return (4. * zeta0 - 1.) * dzeta0dxi + 3. * dbubbledxi;
713
714 case 1:
715 return (4. * zeta1 - 1.) * dzeta1dxi + 3. * dbubbledxi;
716
717 case 2:
718 return (4. * zeta2 - 1.) * dzeta2dxi + 3. * dbubbledxi;
719
720 case 3:
721 return 4. * zeta1 * dzeta0dxi + 4. * zeta0 * dzeta1dxi - 12. * dbubbledxi;
722
723 case 4:
724 return 4. * zeta2 * dzeta1dxi + 4. * zeta1 * dzeta2dxi - 12. * dbubbledxi;
725
726 case 5:
727 return 4. * zeta2 * dzeta0dxi + 4 * zeta0 * dzeta2dxi - 12. * dbubbledxi;
728
729 case 6:
730 return 27. * dbubbledxi;
731
732 default:
733 mooseError("Invalid shape function index i = ", i);
734 }
735 }
736
737 case 1:
738 {
739 switch (i)
740 {
741 case 0:
742 return (4. * zeta0 - 1.) * dzeta0deta + 3. * dbubbledeta;
743
744 case 1:
745 return (4. * zeta1 - 1.) * dzeta1deta + 3. * dbubbledeta;
746
747 case 2:
748 return (4. * zeta2 - 1.) * dzeta2deta + 3. * dbubbledeta;
749
750 case 3:
751 return 4. * zeta1 * dzeta0deta + 4. * zeta0 * dzeta1deta - 12. * dbubbledeta;
752
753 case 4:
754 return 4. * zeta2 * dzeta1deta + 4. * zeta1 * dzeta2deta - 12. * dbubbledeta;
755
756 case 5:
757 return 4. * zeta2 * dzeta0deta + 4 * zeta0 * dzeta2deta - 12. * dbubbledeta;
758
759 case 6:
760 return 27. * dbubbledeta;
761
762 default:
763 mooseError("Invalid shape function index i = ", i);
764 }
765 }
766 default:
767 mooseError("ERROR: Invalid derivative index j = ", j);
768 }
769 }
770
771 default:
772 mooseError("ERROR: Unsupported 2D element type");
773 }
774 }
775
776 // unsupported order
777 default:
778 mooseError("Unsupported order");
779 }
780}
Real fe_lagrange_1D_shape_deriv(const Order order, const unsigned int i, const unsigned int j, const Real xi)

◆ findContactPoint() [1/2]

void Moose::findContactPoint ( PenetrationInfo p_info,
FEBase *  fe_elem,
FEBase *  fe_side,
FEType &  ,
const libMesh::Point secondary_point,
bool  start_with_centroid,
const Real  tangential_tolerance,
bool &  contact_point_on_side,
bool &  search_succeeded 
)

Finds the closest point (called the contact point) on the primary_elem on side "side" to the secondary_point.

Parameters
p_infoThe penetration info object, contains primary_elem, side, various other information
fe_elemFE object for the element
fe_sideFE object for the side
fe_side_typeUnused; was used for a now-deprecated inverse_map overload.
start_with_centroidif true, start inverse mapping procedure from element centroid
tangential_tolerance'tangential' tolerance for determining whether a contact point on a side
secondary_pointThe physical space coordinates of the secondary node
contact_point_on_sidewhether or not the contact_point actually lies on that side of the element.
search_succeededwhether or not the search for the contact point succeeded. If not it should likely be discarded

Definition at line 51 of file FindContactPoint.C.

60{
61 // Default to true and we'll switch on failures
62 search_succeeded = true;
63
64 const Elem * primary_elem = p_info._elem;
65
66 unsigned int dim = primary_elem->dim();
67
68 const Elem * side = p_info._side;
69
70 const std::vector<libMesh::Point> & phys_point = fe_side->get_xyz();
71
72 const std::vector<RealGradient> & dxyz_dxi = fe_side->get_dxyzdxi();
73 const std::vector<RealGradient> & d2xyz_dxi2 = fe_side->get_d2xyzdxi2();
74 const std::vector<RealGradient> & d2xyz_dxieta = fe_side->get_d2xyzdxideta();
75
76 const std::vector<RealGradient> & dxyz_deta = fe_side->get_dxyzdeta();
77 const std::vector<RealGradient> & d2xyz_deta2 = fe_side->get_d2xyzdeta2();
78 const std::vector<RealGradient> & d2xyz_detaxi = fe_side->get_d2xyzdxideta();
79
80 if (dim == 1)
81 {
82 const Node * nearest_node = side->node_ptr(0);
83 p_info._closest_point = *nearest_node;
84 p_info._closest_point_ref =
85 primary_elem->master_point(primary_elem->get_node_index(nearest_node));
86 std::vector<libMesh::Point> elem_points = {p_info._closest_point_ref};
87
88 const std::vector<RealGradient> & elem_dxyz_dxi = fe_elem->get_dxyzdxi();
89
90 fe_elem->reinit(primary_elem, &elem_points);
91 fe_side->reinit(side, &elem_points);
92
93 p_info._normal = elem_dxyz_dxi[0];
94 if (nearest_node->id() == primary_elem->node_id(0))
95 p_info._normal *= -1.0;
96 p_info._normal /= p_info._normal.norm();
97
98 libMesh::Point from_secondary_to_closest = p_info._closest_point - secondary_point;
99 p_info._distance = from_secondary_to_closest * p_info._normal;
100 libMesh::Point tangential = from_secondary_to_closest - p_info._distance * p_info._normal;
101 p_info._tangential_distance = tangential.norm();
102 p_info._dxyzdxi = dxyz_dxi;
103 p_info._dxyzdeta = dxyz_deta;
104 p_info._d2xyzdxideta = d2xyz_dxieta;
105 p_info._side_phi = fe_side->get_phi();
106 p_info._side_grad_phi = fe_side->get_dphi();
107 contact_point_on_side = true;
108 return;
109 }
110
111 libMesh::Point ref_point;
112
113 if (start_with_centroid)
114 ref_point = FEMap::inverse_map(dim - 1, side, side->vertex_average(), TOLERANCE, false);
115 else
116 ref_point = p_info._closest_point_ref;
117
118 std::vector<libMesh::Point> points = {ref_point};
119 fe_side->reinit(side, &points);
120 RealGradient d = secondary_point - phys_point[0];
121
122 Real update_size = std::numeric_limits<Real>::max();
123
124 // Least squares
125 for (unsigned int it = 0; it < 3 && update_size > TOLERANCE * 1e3; ++it)
126 {
127 DenseMatrix<Real> jac(dim - 1, dim - 1);
128 jac(0, 0) = -(dxyz_dxi[0] * dxyz_dxi[0]);
129
130 if (dim - 1 == 2)
131 {
132 jac(1, 0) = -(dxyz_dxi[0] * dxyz_deta[0]);
133 jac(0, 1) = -(dxyz_deta[0] * dxyz_dxi[0]);
134 jac(1, 1) = -(dxyz_deta[0] * dxyz_deta[0]);
135 }
136
137 DenseVector<Real> rhs(dim - 1);
138 rhs(0) = dxyz_dxi[0] * d;
139
140 if (dim - 1 == 2)
141 rhs(1) = dxyz_deta[0] * d;
142
143 DenseVector<Real> update(dim - 1);
144 jac.lu_solve(rhs, update);
145
146 ref_point(0) -= update(0);
147
148 if (dim - 1 == 2)
149 ref_point(1) -= update(1);
150
151 points[0] = ref_point;
152 fe_side->reinit(side, &points);
153 d = secondary_point - phys_point[0];
154
155 update_size = update.l2_norm();
156 }
157
158 update_size = std::numeric_limits<Real>::max();
159
160 unsigned nit = 0;
161
162 // Newton Loop
163 const auto max_newton_its = 25;
164 const auto tolerance_newton = 1e3 * TOLERANCE * TOLERANCE;
165 for (; nit < max_newton_its && update_size > tolerance_newton; nit++)
166 {
167 d = secondary_point - phys_point[0];
168
169 DenseMatrix<Real> jac(dim - 1, dim - 1);
170 jac(0, 0) = (d2xyz_dxi2[0] * d) - (dxyz_dxi[0] * dxyz_dxi[0]);
171
172 if (dim - 1 == 2)
173 {
174 jac(1, 0) = (d2xyz_dxieta[0] * d) - (dxyz_dxi[0] * dxyz_deta[0]);
175
176 jac(0, 1) = (d2xyz_detaxi[0] * d) - (dxyz_deta[0] * dxyz_dxi[0]);
177 jac(1, 1) = (d2xyz_deta2[0] * d) - (dxyz_deta[0] * dxyz_deta[0]);
178 }
179
180 DenseVector<Real> rhs(dim - 1);
181 rhs(0) = -dxyz_dxi[0] * d;
182
183 if (dim - 1 == 2)
184 rhs(1) = -dxyz_deta[0] * d;
185
186 DenseVector<Real> update(dim - 1);
187 jac.lu_solve(rhs, update);
188
189 // Improvised line search in case the update is too large and gets out of the element so bad
190 // that we cannot reinit at the new point
191 Real mult = 1;
192 while (true)
193 {
194 try
195 {
196 ref_point(0) += mult * update(0);
197
198 if (dim - 1 == 2)
199 ref_point(1) += mult * update(1);
200
201 points[0] = ref_point;
202 fe_side->reinit(side, &points);
203 d = secondary_point - phys_point[0];
204
205 // we don't multiply by 'mult' because it is used for convergence
206 update_size = update.l2_norm();
207 break;
208 }
209 // libMesh might throw here if we hit a zero/negative Jacobian
210 catch (std::exception & e)
211 {
212 // Make sure this *is* just a bad mapping Jacobian
213 if (!strstr(e.what(), "Jacobian") && !strstr(e.what(), "det != 0"))
214 throw;
215
216 ref_point(0) -= mult * update(0);
217 if (dim - 1 == 2)
218 ref_point(1) -= mult * update(1);
219
220 mult *= 0.5;
221 if (mult < 1e-6)
222 {
223#ifndef NDEBUG
224 mooseWarning("We could not solve for the contact point.", e.what());
225#endif
226 update_size = update.l2_norm();
227 d = (secondary_point - phys_point[0]) * mult;
228 break;
229 }
230 }
231 }
232 // We failed the line search, make sure to trigger the error
233 if (mult < 1e-6)
234 {
235 nit = max_newton_its;
236 update_size = 1;
237 break;
238 }
239 }
240
241 if (nit == max_newton_its && update_size > tolerance_newton)
242 {
243 search_succeeded = false;
244#ifndef NDEBUG
245 const auto initial_point =
246 start_with_centroid ? side->vertex_average() : ref_point = p_info._closest_point_ref;
247 Moose::err << "Warning! Newton solve for contact point failed to converge!\nLast update "
248 "distance was: "
249 << update_size << "\nInitial point guess: " << initial_point
250 << "\nLast considered point: " << phys_point[0]
251 << "\nThis potential contact pair (face, point) will be discarded." << std::endl;
252#endif
253 return;
254 }
255
256 p_info._closest_point_ref = ref_point;
257 p_info._closest_point = phys_point[0];
258 p_info._distance = d.norm();
259
260 if (dim - 1 == 2)
261 {
262 p_info._normal = dxyz_dxi[0].cross(dxyz_deta[0]);
263 if (!MooseUtils::absoluteFuzzyEqual(p_info._normal.norm(), 0))
264 p_info._normal /= p_info._normal.norm();
265 }
266 else
267 {
268 const Node * const * elem_nodes = primary_elem->get_nodes();
269 const libMesh::Point in_plane_vector1 = *elem_nodes[1] - *elem_nodes[0];
270 const libMesh::Point in_plane_vector2 = *elem_nodes[2] - *elem_nodes[0];
271
272 libMesh::Point out_of_plane_normal = in_plane_vector1.cross(in_plane_vector2);
273 out_of_plane_normal /= out_of_plane_normal.norm();
274
275 p_info._normal = dxyz_dxi[0].cross(out_of_plane_normal);
276 if (std::fabs(p_info._normal.norm()) > 1e-15)
277 p_info._normal /= p_info._normal.norm();
278 }
279
280 // If the point has not penetrated the face, make the distance negative
281 const Real dot(d * p_info._normal);
282 if (dot > 0.0)
283 p_info._distance = -p_info._distance;
284
285 contact_point_on_side = side->on_reference_element(ref_point);
286
287 p_info._tangential_distance = 0.0;
288
289 if (!contact_point_on_side)
290 {
291 p_info._closest_point_on_face_ref = ref_point;
293
294 points[0] = p_info._closest_point_on_face_ref;
295 fe_side->reinit(side, &points);
296 libMesh::Point closest_point_on_face(phys_point[0]);
297
298 RealGradient off_face = closest_point_on_face - p_info._closest_point;
299 Real tangential_distance = off_face.norm();
300 p_info._tangential_distance = tangential_distance;
301 if (tangential_distance <= tangential_tolerance)
302 {
303 contact_point_on_side = true;
304 }
305 }
306
307 const std::vector<std::vector<Real>> & phi = fe_side->get_phi();
308 const std::vector<std::vector<RealGradient>> & grad_phi = fe_side->get_dphi();
309
310 points[0] = p_info._closest_point_ref;
311 fe_side->reinit(side, &points);
312
313 p_info._side_phi = phi;
314 p_info._side_grad_phi = grad_phi;
315 p_info._dxyzdxi = dxyz_dxi;
316 p_info._dxyzdeta = dxyz_deta;
317 p_info._d2xyzdxideta = d2xyz_dxieta;
318}
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
Definition MooseError.h:345
unsigned int dim
std::vector< const Node * > _off_edge_nodes
const Elem * _side
std::vector< RealGradient > _d2xyzdxideta
Point _closest_point_on_face_ref
std::vector< RealGradient > _dxyzdeta
std::vector< RealGradient > _dxyzdxi
std::vector< std::vector< Real > > _side_phi
const Elem * _elem
std::vector< std::vector< RealGradient > > _side_grad_phi
RealVectorValue _normal
TypeVector< typename CompareTypes< Real, T2 >::supertype > cross(const TypeVector< T2 > &v) const
auto norm() const
void restrictPointToFace(libMesh::Point &p, const libMesh::Elem *side, std::vector< const libMesh::Node * > &off_edge_nodes)
RealVectorValue RealGradient
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ findContactPoint() [2/2]

void Moose::findContactPoint ( PenetrationInfo p_info,
libMesh::FEBase fe_elem,
libMesh::FEBase fe_side,
libMesh::FEType fe_side_type,
const libMesh::Point secondary_point,
bool  start_with_centroid,
const Real  tangential_tolerance,
bool &  contact_point_on_side,
bool &  search_succeeded 
)

◆ findElementsIntersectedByPlane()

void Moose::findElementsIntersectedByPlane ( const libMesh::Plane plane,
const MeshBase &  mesh,
std::vector< const Elem * > &  intersected_elems 
)

Definition at line 24 of file ElementsIntersectedByPlane.C.

27{
28 // Loop over all elements to find elements intersected by the plane
29 for (const auto & elem : mesh.element_ptr_range())
30 {
31 bool intersected = false;
32
33 // Check whether the first node of this element is below or above the plane
34 const Node & node0 = elem->node_ref(0);
35 bool node0_above_plane = plane.above_surface(node0);
36
37 // Loop over the rest of the nodes and check if any node is on the other side of the plane
38 for (unsigned int i = 1; i < elem->n_nodes(); ++i)
39 {
40 const Node & node = elem->node_ref(i);
41
42 bool node_above_plane = plane.above_surface(node);
43 if (node0_above_plane != node_above_plane)
44 intersected = true;
45 }
46
47 if (intersected)
48 intersected_elems.push_back(elem);
49 }
50}
virtual bool above_surface(const Point &p) const override
MeshBase & mesh

Referenced by elementsIntersectedByPlane(), and elementsIntersectedByPlane().

◆ findSimilar()

std::vector< std::string > Moose::findSimilar ( const std::string &  param,
const std::vector< std::string > &  options 
)

Definition at line 80 of file Builder.C.

81{
82 std::vector<std::string> candidates;
83 if (options.size() == 0)
84 return candidates;
85
86 int mindist = MooseUtils::levenshteinDist(options[0], param);
87 for (const auto & opt : options)
88 {
89 const int dist = MooseUtils::levenshteinDist(opt, param);
90 // magic number heuristics to get similarity distance cutoff
91 const int dist_cutoff = 1 + param.size() / 5;
92 if (dist > dist_cutoff || dist > mindist)
93 continue;
94
95 if (dist < mindist)
96 {
97 mindist = dist;
98 candidates.clear();
99 }
100 candidates.push_back(opt);
101 }
102 return candidates;
103}
std::string opt
int levenshteinDist(const std::string &s1, const std::string &s2)
Definition MooseUtils.C:187

Referenced by Moose::UnusedWalker::walk().

◆ getExec()

std::string Moose::getExec ( )

Gets the full path to the running executable on Mac OS X and linux.

Not implemented for windows.

Definition at line 24 of file ExecutablePath.C.

25{
26 std::string exec_path;
27 char path[1024];
28
29#if defined(__APPLE__)
30 uint32_t size = sizeof(path);
31 if (_NSGetExecutablePath(path, &size) == 0)
32 exec_path = path;
33 else
34 mooseError("Unable to retrieve executable path");
35#elif defined(__WIN32__)
36 return "./";
37#else // Linux with Proc
38 std::ostringstream oss;
39 oss << "/proc/" << getpid() << "/exe";
40 int ch = readlink(oss.str().c_str(), path, 1024);
41 if (ch != -1)
42 {
43 path[ch] = 0;
44 exec_path = path;
45 }
46#endif
47 return exec_path;
48}

Referenced by SystemInfo::getExecutable(), getExecutableName(), getExecutablePath(), and Moose::internal::Capabilities::registerMooseCapabilities().

◆ getExecutableName()

std::string Moose::getExecutableName ( )

Gets the name of the running executable on Mac OS X and linux.

Not implemented for windows.

Definition at line 60 of file ExecutablePath.C.

61{
62 auto name = getExec();
63 // strip off the path to get the name
64 std::string::size_type start = name.find_last_of("/");
65 if (start == std::string::npos)
66 start = 0;
67 return name.substr(start, std::string::npos);
68}
std::string getExec()
Gets the full path to the running executable on Mac OS X and linux.

Referenced by MooseApp::appBinaryName(), and MooseApp::runInputs().

◆ getExecutablePath()

std::string Moose::getExecutablePath ( )

Gets the directory the running executable is on Mac OS X and linux.

Not implemented for windows.

Definition at line 51 of file ExecutablePath.C.

52{
53 auto exec_path = getExec();
54 // strip off the exeuctable to get the PATH
55 std::string::size_type t = exec_path.find_last_of("/");
56 return exec_path.substr(0, t) + "/";
57}

Referenced by Registry::determineDataFilePath(), MooseUtils::docsDir(), MooseUtils::installedInputsDir(), ADFParser::JITCompile(), and MooseUtils::runTestsExecutable().

◆ globalADIndexing()

bool Moose::globalADIndexing ( )
inline

Whether we are using global AD indexing.

Definition at line 28 of file ADUtils.h.

29{
30 return true;
31}

Referenced by FEProblemBase::init().

◆ globalDofIndexToDerivative() [1/2]

std::unordered_map< dof_id_type, Real > Moose::globalDofIndexToDerivative ( const ADReal ad_real,
const SystemBase sys,
ElementType  elem_type = ElementType::Element,
THREAD_ID  tid = 0 
)

Generate a map from global dof index to derivative value.

Definition at line 27 of file ADUtils.C.

31{
32 mooseAssert(dynamic_cast<const NonlinearSystemBase *>(&sys),
33 "This must be a nonlinear system base object");
34 const Assembly & assembly = sys.subproblem().assembly(tid, sys.number());
35 const Elem * elem;
36 switch (elem_type)
37 {
38 case ElementType::Element:
39 elem = assembly.elem();
40 break;
41
42 case ElementType::Neighbor:
43 elem = assembly.neighbor();
44 break;
45
46 case ElementType::Lower:
47 elem = assembly.lowerDElem();
48 break;
49
50 default:
51 mooseError("Unrecognized element type");
52 }
53
54 std::unordered_map<dof_id_type, Real> ret_val;
55
56 const System & libmesh_sys = sys.system();
57 const DofMap & dof_map = libmesh_sys.get_dof_map();
58
59 const unsigned int num_vars = libmesh_sys.n_vars();
60
61 const auto max_dofs_per_elem = sys.getMaxVarNDofsPerElem();
62
63 for (unsigned int var_num = 0; var_num < num_vars; ++var_num)
64 {
65 std::vector<dof_id_type> global_indices;
66
67 // Get the global indices corresponding to var_num that exist on elem
68 dof_map.dof_indices(elem, global_indices, var_num);
69
70 // determine the AD offset for the current var
71 const auto ad_offset = adOffset(var_num, max_dofs_per_elem, elem_type, num_vars);
72
73 // Map from global index to derivative
74 for (MooseIndex(global_indices) local_index = 0; local_index < global_indices.size();
75 ++local_index)
76 ret_val[global_indices[local_index]] = ad_real.derivatives()[ad_offset + local_index];
77 }
78
79 return ret_val;
80}
Keeps track of stuff related to assembling.
Definition Assembly.h:101
const Elem *const & elem() const
Return the current element.
Definition Assembly.h:405
const Elem *const & neighbor() const
Return the neighbor element.
Definition Assembly.h:461
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition Assembly.h:467
Nonlinear system to be solved.
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num)=0
SubProblem & subproblem()
Definition SystemBase.h:102
std::size_t getMaxVarNDofsPerElem() const
Gets the maximum number of dofs used by any one variable on any one element.
Definition SystemBase.h:604
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
unsigned int n_vars() const
const DofMap & get_dof_map() const

Referenced by globalDofIndexToDerivative().

◆ globalDofIndexToDerivative() [2/2]

template<typename T >
auto Moose::globalDofIndexToDerivative ( const T &  ad_real_container,
const SystemBase sys,
ElementType  elem_type = ElementType::Element,
THREAD_ID  tid = 0 
) -> std::vector<std::unordered_map< dof_id_type, typename std::enable_if<std::is_same<ADReal, typename T::value_type>::value, Real>::type>>

Generate a map from global dof index to derivative value for a (probably quadrature-point-based) container like a material property or a variable value.

Definition at line 135 of file ADUtils.h.

142{
143 std::vector<std::unordered_map<dof_id_type, Real>> ret_val(ad_real_container.size());
144
145 for (MooseIndex(ad_real_container) i = 0; i < ad_real_container.size(); ++i)
146 ret_val[i] = globalDofIndexToDerivative(ad_real_container[i], sys, elem_type, tid);
147
148 return ret_val;
149}
std::unordered_map< dof_id_type, Real > globalDofIndexToDerivative(const ADReal &ad_real, const SystemBase &sys, ElementType elem_type=ElementType::Element, THREAD_ID tid=0)
Generate a map from global dof index to derivative value.
Definition ADUtils.C:27

◆ hash_combine() [1/4]

void Moose::hash_combine ( std::size_t &  )
inline

◆ hash_combine() [2/4]

template<typename T , typename... Rest>
void Moose::hash_combine ( std::size_t &  seed,
const std::set< T > &  v,
Rest &&...  rest 
)
inline

Used for hash function specialization for Attribute objects.

Definition at line 50 of file MooseHashing.h.

51{
52 for (auto & val : v)
53 hash_combine(seed, val);
54 hash_combine(seed, std::forward<Rest>(rest)...);
55}

◆ hash_combine() [3/4]

template<typename T , typename... Rest>
void Moose::hash_combine ( std::size_t &  seed,
const std::vector< T > &  v,
Rest &&...  rest 
)
inline

Used for hash function specialization for Attribute objects.

Definition at line 40 of file MooseHashing.h.

41{
42 for (auto & val : v)
43 hash_combine(seed, val);
44 hash_combine(seed, std::forward<Rest>(rest)...);
45}

◆ hash_combine() [4/4]

template<typename T , typename... Rest>
void Moose::hash_combine ( std::size_t &  seed,
const T &  v,
Rest &&...  rest 
)
inline

Used to combine an existing hash value with the hash of one or more other values (v and rest).

For example "auto h = std::hash("hello"); hash_combine(h, my_int_val, my_float_val, etc.);"

Definition at line 30 of file MooseHashing.h.

31{
32 std::hash<T> hasher;
33 seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
34 hash_combine(seed, std::forward<Rest>(rest)...);
35}

◆ hitMessagePrefix()

std::string Moose::hitMessagePrefix ( const hit::Node &  node)

Get the prefix to be associated with a hit node for a message.

Definition at line 909 of file Moose.C.

913 : _throw_on_error_before(Moose::_throw_on_error)
914{
915 mooseAssert(!libMesh::Threads::in_threads, "Cannot be used in threads");
916 Moose::_throw_on_error = throw_on_error;
917}
918
bool _throw_on_error
Variable to turn on exceptions during mooseError(), should only be used within MOOSE unit tests or wh...
Definition Moose.C:922

Referenced by MooseBase::messagePrefix(), moose::internal::mooseErrorRaw(), and InputParameters::paramMessagePrefix().

◆ indirectSort() [1/2]

template<class RandomAccessIterator >
void Moose::indirectSort ( RandomAccessIterator  beg,
RandomAccessIterator  end,
std::vector< size_t > &  b 
)

Definition at line 68 of file IndirectSort.h.

69{
70 // Space in b
71 initialize_indirect_sort(beg, end, b);
72
73 // Typedef for less typing. Note: use of std::iterator_traits means this should work with
74 // naked pointers too...
75 typedef std::less<typename std::iterator_traits<RandomAccessIterator>::value_type>
76 LessThanComparator;
77
78 // Construct comparator object
80
81 // Sort the indices, based on the data
82 //
83 // Many use cases pass in a partial order, not a total order; use
84 // stable_sort to make the results of that as reproduceable as
85 // possible.
86 std::stable_sort(b.begin(), b.end(), ic);
87}
void initialize_indirect_sort(RandomAccessIterator beg, RandomAccessIterator end, std::vector< size_t > &b)

Referenced by SamplerBase::finalize(), and PerfGraph::printHeaviestSections().

◆ indirectSort() [2/2]

template<class RandomAccessIterator , class UserComparisonFunctor >
void Moose::indirectSort ( RandomAccessIterator  beg,
RandomAccessIterator  end,
std::vector< size_t > &  b,
UserComparisonFunctor  user_comp 
)

Definition at line 93 of file IndirectSort.h.

97{
98 // Space in b
99 initialize_indirect_sort(beg, end, b);
100
101 // Construct comparator object
103
104 // Sort the indices, based on the data
105 //
106 // Many use cases pass in a partial order, not a total order; use
107 // stable_sort to make the results of that as reproduceable as
108 // possible.
109 std::stable_sort(b.begin(), b.end(), ic);
110}

◆ initCoordinateSystemType()

void Moose::initCoordinateSystemType ( )

Definition at line 35 of file Conversion.C.

36{
38 {
42 }
43}
std::map< std::string, CoordinateSystemType > coordinate_system_type_to_enum
Definition Conversion.C:24

Referenced by stringToEnum< CoordinateSystemType >().

◆ initDofIndices()

template<typename T >
void Moose::initDofIndices ( T &  data,
const Elem &  elem 
)

Definition at line 47 of file MooseVariableDataFV.h.

48{
49 if (data._prev_elem != &elem)
50 {
51 data._dof_map.dof_indices(&elem, data._dof_indices, data._var_num);
52 data._prev_elem = &elem;
53 }
54}

Referenced by MooseVariableFV< OutputType >::getValue(), MooseVariableDataFV< OutputType >::initDofIndices(), and MooseVariableDataLinearFV< OutputType >::initDofIndices().

◆ initEigenProlemType()

void Moose::initEigenProlemType ( )

Definition at line 76 of file Conversion.C.

77{
79 {
87 }
88}
std::map< std::string, EigenProblemType > eigen_problem_type_to_enum
Definition Conversion.C:27

Referenced by stringToEnum< EigenProblemType >().

◆ initEigenSolveType()

void Moose::initEigenSolveType ( )

Definition at line 59 of file Conversion.C.

60{
61 if (eigen_solve_type_to_enum.empty())
62 {
72 }
73}
std::map< std::string, EigenSolveType > eigen_solve_type_to_enum
Definition Conversion.C:26

Referenced by stringToEnum< EigenSolveType >().

◆ initial_condition()

void Moose::initial_condition ( libMesh::EquationSystems es,
const std::string &  system_name 
)
private

◆ initialize_indirect_sort()

template<class RandomAccessIterator >
void Moose::initialize_indirect_sort ( RandomAccessIterator  beg,
RandomAccessIterator  end,
std::vector< size_t > &  b 
)

Definition at line 52 of file IndirectSort.h.

55{
56 // enough storage for all the indices
57 b.resize(std::distance(beg, end));
58
59 // iota
60 for (size_t i = 0; i < b.size(); ++i)
61 b[i] = i;
62}

Referenced by indirectSort(), and indirectSort().

◆ initLineSearchType()

void Moose::initLineSearchType ( )

Definition at line 110 of file Conversion.C.

111{
112 if (line_search_type_to_enum.empty())
113 {
117
124 }
125}
std::map< std::string, LineSearchType > line_search_type_to_enum
Definition Conversion.C:29

Referenced by stringToEnum< LineSearchType >().

◆ initMffdType()

void Moose::initMffdType ( )

Definition at line 143 of file Conversion.C.

144{
145 if (mffd_type_to_enum.empty())
146 {
149 }
150}
std::map< std::string, MffdType > mffd_type_to_enum
Definition Conversion.C:31

Referenced by stringToEnum< MffdType >().

◆ initRMType()

void Moose::initRMType ( )

Definition at line 153 of file Conversion.C.

154{
155 if (rm_type_to_enum.empty())
156 {
157 rm_type_to_enum["DEFAULT"] = RelationshipManagerType::DEFAULT;
158 rm_type_to_enum["GEOMETRIC"] = RelationshipManagerType::GEOMETRIC;
159 rm_type_to_enum["ALGEBRAIC"] = RelationshipManagerType::ALGEBRAIC;
160 rm_type_to_enum["COUPLING"] = RelationshipManagerType::COUPLING;
161 }
162}
std::map< std::string, RelationshipManagerType > rm_type_to_enum
Definition Conversion.C:32

Referenced by stringToEnum< RelationshipManagerType >().

◆ initSolveType()

void Moose::initSolveType ( )

Definition at line 46 of file Conversion.C.

47{
48 if (solve_type_to_enum.empty())
49 {
52 solve_type_to_enum["NEWTON"] = ST_NEWTON;
54 solve_type_to_enum["LINEAR"] = ST_LINEAR;
55 }
56}
std::map< std::string, SolveType > solve_type_to_enum
Definition Conversion.C:25

Referenced by stringToEnum< SolveType >().

◆ initTimeIntegratorsType()

void Moose::initTimeIntegratorsType ( )

Definition at line 128 of file Conversion.C.

129{
130 if (time_integrator_to_enum.empty())
131 {
132 time_integrator_to_enum["IMPLICIT_EULER"] = TI_IMPLICIT_EULER;
133 time_integrator_to_enum["EXPLICIT_EULER"] = TI_EXPLICIT_EULER;
134 time_integrator_to_enum["CRANK_NICOLSON"] = TI_CRANK_NICOLSON;
136 time_integrator_to_enum["EXPLICIT_MIDPOINT"] = TI_EXPLICIT_MIDPOINT;
137 time_integrator_to_enum["LSTABLE_DIRK2"] = TI_LSTABLE_DIRK2;
139 }
140}
std::map< std::string, TimeIntegratorType > time_integrator_to_enum
Definition Conversion.C:30

Referenced by stringToEnum< TimeIntegratorType >().

◆ initWhichEigenPairs()

void Moose::initWhichEigenPairs ( )

Definition at line 91 of file Conversion.C.

92{
93 if (which_eigen_pairs_to_enum.empty())
94 {
106 }
107}
std::map< std::string, WhichEigenPairs > which_eigen_pairs_to_enum
Definition Conversion.C:28

Referenced by stringToEnum< WhichEigenPairs >().

◆ isSectionActive()

bool Moose::isSectionActive ( const hit::Node &  node)

Definition at line 45 of file Builder.C.

46{
47 const hit::Node * n = &node;
48 while (n)
49 {
50 const auto section = n->parent();
51 if (section)
52 {
53 // only check current level, not nested ones
54 if (const auto active = section->find("active");
55 active && active->type() == hit::NodeType::Field && active->parent() == section)
56 {
57 const auto vars = active->param<std::vector<std::string>>();
58 return std::find_if(vars.begin(),
59 vars.end(),
60 [&n](const auto & var)
61 { return n->path() == hit::pathNorm(var); }) != vars.end();
62 }
63 // only check current level, not nested ones
64 if (const auto inactive = section->find("inactive");
65 inactive && inactive->type() == hit::NodeType::Field && inactive->parent() == section)
66 {
67 const auto vars = inactive->param<std::vector<std::string>>();
68 return std::find_if(vars.begin(),
69 vars.end(),
70 [&n](const auto & var)
71 { return n->path() == hit::pathNorm(var); }) == vars.end();
72 }
73 }
74 n = section;
75 }
76 return true;
77}
char ** vars

Referenced by Moose::UnusedWalker::walk(), and Moose::Builder::walkRaw().

◆ isSolverExecFlag()

bool Moose::isSolverExecFlag ( const ExecFlagType exec_flag)
Returns
whether exec_flag is a solver execution flag, e.g. a flag on which a solver evaluation such as a residual, Jacobian, or postcheck evaluation is performed

When a solver execution flag is added to the list of execution flags above, add it to the implementation of this method as well so that logic keyed on solver evaluations, such as the MooseException handling in FEProblemBase::checkExceptionAndStopSolve(), picks it up

Definition at line 68 of file Moose.C.

69{
70 return exec_flag == EXEC_LINEAR || exec_flag == EXEC_NONLINEAR || exec_flag == EXEC_POSTCHECK;
71}
const ExecFlagType EXEC_POSTCHECK
Definition Moose.C:36
const ExecFlagType EXEC_LINEAR
Definition Moose.C:32
const ExecFlagType EXEC_NONLINEAR
Definition Moose.C:34

Referenced by FEProblemBase::checkExceptionAndStopSolve(), and FEProblemBase::computeUserObjects().

◆ main()

template<typename DefaultAppType >
int Moose::main ( int  argc,
char *  argv[] 
)

Initialize, create and run a MooseApp.

Definition at line 31 of file MooseMain.h.

32{
33 MooseInit init(argc, argv);
34
35 DefaultAppType::registerApps();
36
37 const auto default_app_type = MooseUtils::prettyCppType<DefaultAppType>();
38
39 auto app = createMooseApp(default_app_type, argc, argv);
40
41 app->run();
42
43 return app->exitCode();
44}
Initialization object for any MOOSE-based application.
Definition MooseInit.h:24
std::unique_ptr< MooseApp > createMooseApp(const std::string &default_app_type, int argc, char *argv[])
Create a MooseApp from command-line arguments.
Definition MooseMain.C:27

◆ makeSpan()

template<class C >
auto Moose::makeSpan ( C &  container,
std::size_t  offset,
std::size_t  n 
)

Helper function for creating a span from a given container.

This helper function will automatically deduce whether we're spanning over non-const or const elements

Definition at line 1095 of file MooseTypes.h.

1096{
1097 using PointerType = decltype(std::data(container));
1098 using ElementType = std::remove_pointer_t<PointerType>;
1099 return Moose::Span<ElementType>{std::data(container) + offset, n};
1100}
Replacement for std::span which we only get in c++20.

Referenced by TaggingInterface::addJacobian(), and TaggingInterface::addResiduals().

◆ oldState()

StateArg Moose::oldState ( )
inline

Definition at line 162 of file MooseFunctorArguments.h.

163{
164 return {(unsigned int)1};
165}
void ErrorVector unsigned int

Referenced by TransientInterface::determineState(), and FunctorChangeFunctorMaterialTempl< is_ad >::referenceState().

◆ previousMultiAppFixedPointState()

StateArg Moose::previousMultiAppFixedPointState ( )
inline

Definition at line 174 of file MooseFunctorArguments.h.

175{
176 return {(unsigned int)1, SolutionIterationType::MultiAppFixedPoint};
177}

Referenced by FunctorChangeFunctorMaterialTempl< is_ad >::referenceState().

◆ previousMultiSystemFixedPointState()

StateArg Moose::previousMultiSystemFixedPointState ( )
inline

Definition at line 180 of file MooseFunctorArguments.h.

181{
182 return {(unsigned int)1, SolutionIterationType::MultiSystemFixedPoint};
183}

Referenced by FunctorChangeFunctorMaterialTempl< is_ad >::referenceState().

◆ previousNonlinearState()

StateArg Moose::previousNonlinearState ( )
inline

Definition at line 168 of file MooseFunctorArguments.h.

169{
170 return {(unsigned int)1, SolutionIterationType::Nonlinear};
171}

Referenced by FunctorChangeFunctorMaterialTempl< is_ad >::referenceState().

◆ recursivelyFindElementsIntersectedByLine()

void Moose::recursivelyFindElementsIntersectedByLine ( const LineSegment line_segment,
const Elem *  current_elem,
int  incoming_side,
const Point &  incoming_point,
std::vector< Elem * > &  intersected_elems,
std::vector< LineSegment > &  segments 
)

Recursively find all elements intersected by a line segment.

Works by moving from one element to the next through the side of the current element. This means that (other than for the first element) there is always an incoming_side that is the reason we ended up in this element in the first place. Search all the other sides to see if there is a next element...

Parameters
line_segmentthe LineSegment to intersect
current_elemThe current element that needs to be searched
incoming_sideThe side of the current element that was intersected by the LineSegment that brought us here
intersected_elemsThe output
segmentsLine segments for the path across each element

Definition at line 144 of file RayTracing.C.

150{
151 Point intersection_point;
152
153 std::vector<int> not_side(1, incoming_side);
154
155 // Find the side of this element that the LineSegment intersects... while ignoring the incoming
156 // side (we don't want to move backward!)
157 int intersected_side =
158 sideIntersectedByLine(current_elem, not_side, line_segment, intersection_point);
159
160 if (intersected_side != -1) // -1 means that we didn't find any side
161 {
162 // Get the neighbor on that side
163 const Elem * neighbor = current_elem->neighbor_ptr(intersected_side);
164
165 if (neighbor)
166 {
167 // Add it to the list
168 intersected_elems.push_back(const_cast<Elem *>(neighbor));
169
170 // Add the line segment across the element to the segments list
171 segments.push_back(LineSegment(incoming_point, intersection_point));
172
173 // Note: This is finding the side the current_elem is on for the neighbor. That's the
174 // "incoming_side" for the neighbor
175 int incoming_side = sideNeighborIsOn(neighbor, current_elem);
176
177 // Recurse
179 line_segment, neighbor, incoming_side, intersection_point, intersected_elems, segments);
180 }
181 else // Add the final segment
182 segments.push_back(LineSegment(incoming_point, line_segment.end()));
183 }
184 else // Add the final segment
185 segments.push_back(LineSegment(incoming_point, line_segment.end()));
186
187 // Finished... return out!
188 return;
189}
const Point & end() const
Ending of the line segment.
Definition LineSegment.h:90
int sideIntersectedByLine(const Elem *elem, std::vector< int > &not_side, const LineSegment &line_segment, Point &intersection_point)
Figure out which (if any) side of an Elem is intersected by a line.
Definition RayTracing.C:34
int sideNeighborIsOn(const Elem *elem, const Elem *neighbor)
Returns the side number for elem that neighbor is on.
Definition RayTracing.C:115

Referenced by elementsIntersectedByLine(), and recursivelyFindElementsIntersectedByLine().

◆ registerActions() [1/2]

void Moose::registerActions ( Syntax syntax,
ActionFactory action_factory 
)

Multiple Action class can be associated with a single input file section, in which case all associated Actions will be created and "acted" on when the associated input file section is seen.

Action classes can also be registered to act on more than one input file section for a different task if similar logic can work in multiple cases

Example: "add_variable" <--— -> [Variables/ *] \ / CopyNodalVarsAction / \ "add_aux_variable" <- -> [AuxVariables/ *]

Note: Placeholder "no_action" actions must be put in places where it is possible to match an object with a star or a more specific parent later on. (i.e. where one needs to negate the '*' matching prematurely).

Definition at line 591 of file Moose.C.

Referenced by registerAll(), and setColorConsole().

◆ registerActions() [2/2]

void Moose::registerActions ( Syntax syntax,
ActionFactory action_factory,
const std::set< std::string > &  obj_labels 
)

Definition at line 598 of file Moose.C.

607 :
608

◆ registerAll()

void Moose::registerAll ( Factory f,
ActionFactory af,
Syntax s 
)

Register objects that are in MOOSE.

Definition at line 76 of file Moose.C.

77{
78 registerObjects(f, {"MooseApp"});
79 associateSyntaxInner(s, af);
80 registerActions(s, af, {"MooseApp"});
81 registerAppDataFilePath("moose");
82 registerRepository("moose", "github.com/idaholab/moose");
83
84 // Citation emitted by the --citations command-line option: the current framework paper is tied to
85 // "MooseApp" (so it is cited whenever a MooseApp object is used, and apps composed of MooseApp
86 // inherit it), and modules register their own app citations (via Registry::addAppCitation) which
87 // are cited only when one of their objects is actually used. PETSc and its sub-packages register
88 // their own citations, which --citations emits through PETSc.
89 Registry::addAppCitation("MooseApp",
90 "harbour2025moose",
91 R"(@article{harbour2025moose,
92 title = {4.0 {MOOSE}: Enabling massively parallel Multiphysics simulation},
93 journal = {{SoftwareX}},
94 volume = {31},
95 pages = {102264},
96 year = {2025},
97 issn = {2352-7110},
98 doi = {https://doi.org/10.1016/j.softx.2025.102264},
99 url = {https://www.sciencedirect.com/science/article/pii/S2352711025002316},
100 author = {Logan Harbour and Guillaume Giudicelli and Alexander D. Lindsay and Peter German and Joshua Hansel and Casey Icenhour and Mengnan Li and Jason M. Miller and Roy H. Stogner and Patrick Behne and Daniel Yankura and Zachary M. Prince and Corey DeChant and Daniel Schwen and Benjamin W. Spencer and Mauricio Tano and Namjae Choi and Yaqi Wang and Max Nezdyur and Yinbin Miao and Tianchen Hu and Shikhar Kumar and Christopher Matthews and Brandon Langley and Nuno Nobre and Alexander Blair and Chris MacMackin and Henrique Bergallo Rocha and Edward Palmer and Jesse Carter and J{\"o}rg Meier and Andrew E. Slaughter and David Andr{\v{s}} and Robert W. Carlsen and Fande Kong and Derek R. Gaston and Cody J. Permann},
101})");
102
103 // The libMesh citation is registered under "libMesh" but not tied to any object label, so the
104 // per-object loop in MooseApp::requestCitations() does not emit it; emission is gated on the
105 // finite element backend actually used in the run.
106 Registry::addAppCitation("libMesh",
107 "libMeshPaper",
static void addAppCitation(const std::string &app_name, const std::string &key, const std::string &bibtex)
Register a citation (the full BibTeX bibtex text, identified by key) tied to the app app_name; emitte...
Definition Registry.C:198

◆ registerObjects()

void Moose::registerObjects ( Factory factory,
const std::set< std::string > &  obj_labels 
)

Definition at line 110 of file Moose.C.

110 {{\texttt{libMesh}: A C++ Library for Parallel Adaptive Mesh
111 Refinement/Coarsening Simulations}},
112 journal = {Engineering with Computers},
113 volume = {22},
Real volume(const MeshBase &mesh, unsigned int dim=libMesh::invalid_uint)
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...

Referenced by registerAll().

◆ restrictPointToFace() [1/2]

void Moose::restrictPointToFace ( libMesh::Point p,
const Elem *  side,
std::vector< const Node * > &  off_edge_nodes 
)

Definition at line 321 of file FindContactPoint.C.

324{
325 const ElemType t(side->type());
326 off_edge_nodes.clear();
327 Real & xi = p(0);
328 Real & eta = p(1);
329
330 switch (t)
331 {
332 case EDGE2:
333 case EDGE3:
334 case EDGE4:
335 {
336 // The reference 1D element is [-1,1].
337 if (xi < -1.0)
338 {
339 xi = -1.0;
340 off_edge_nodes.push_back(side->node_ptr(0));
341 }
342 else if (xi > 1.0)
343 {
344 xi = 1.0;
345 off_edge_nodes.push_back(side->node_ptr(1));
346 }
347 break;
348 }
349
350 case TRI3:
351 case TRI6:
352 case TRI7:
353 {
354 // The reference triangle is isosceles
355 // and is bound by xi=0, eta=0, and xi+eta=1.
356
357 if (xi <= 0.0 && eta <= 0.0)
358 {
359 xi = 0.0;
360 eta = 0.0;
361 off_edge_nodes.push_back(side->node_ptr(0));
362 }
363 else if (xi > 0.0 && xi < 1.0 && eta < 0.0)
364 {
365 eta = 0.0;
366 off_edge_nodes.push_back(side->node_ptr(0));
367 off_edge_nodes.push_back(side->node_ptr(1));
368 }
369 else if (eta > 0.0 && eta < 1.0 && xi < 0.0)
370 {
371 xi = 0.0;
372 off_edge_nodes.push_back(side->node_ptr(2));
373 off_edge_nodes.push_back(side->node_ptr(0));
374 }
375 else if (xi >= 1.0 && (eta - xi) <= -1.0)
376 {
377 xi = 1.0;
378 eta = 0.0;
379 off_edge_nodes.push_back(side->node_ptr(1));
380 }
381 else if (eta >= 1.0 && (eta - xi) >= 1.0)
382 {
383 xi = 0.0;
384 eta = 1.0;
385 off_edge_nodes.push_back(side->node_ptr(2));
386 }
387 else if ((xi + eta) > 1.0)
388 {
389 Real delta = (xi + eta - 1.0) / 2.0;
390 xi -= delta;
391 eta -= delta;
392 off_edge_nodes.push_back(side->node_ptr(1));
393 off_edge_nodes.push_back(side->node_ptr(2));
394 }
395 break;
396 }
397
398 case QUAD4:
399 case QUAD8:
400 case QUAD9:
401 {
402 // The reference quadrilateral element is [-1,1]^2.
403 if (xi < -1.0)
404 {
405 xi = -1.0;
406 if (eta < -1.0)
407 {
408 eta = -1.0;
409 off_edge_nodes.push_back(side->node_ptr(0));
410 }
411 else if (eta > 1.0)
412 {
413 eta = 1.0;
414 off_edge_nodes.push_back(side->node_ptr(3));
415 }
416 else
417 {
418 off_edge_nodes.push_back(side->node_ptr(3));
419 off_edge_nodes.push_back(side->node_ptr(0));
420 }
421 }
422 else if (xi > 1.0)
423 {
424 xi = 1.0;
425 if (eta < -1.0)
426 {
427 eta = -1.0;
428 off_edge_nodes.push_back(side->node_ptr(1));
429 }
430 else if (eta > 1.0)
431 {
432 eta = 1.0;
433 off_edge_nodes.push_back(side->node_ptr(2));
434 }
435 else
436 {
437 off_edge_nodes.push_back(side->node_ptr(1));
438 off_edge_nodes.push_back(side->node_ptr(2));
439 }
440 }
441 else
442 {
443 if (eta < -1.0)
444 {
445 eta = -1.0;
446 off_edge_nodes.push_back(side->node_ptr(0));
447 off_edge_nodes.push_back(side->node_ptr(1));
448 }
449 else if (eta > 1.0)
450 {
451 eta = 1.0;
452 off_edge_nodes.push_back(side->node_ptr(2));
453 off_edge_nodes.push_back(side->node_ptr(3));
454 }
455 }
456 break;
457 }
458
459 default:
460 {
461 mooseError("Unsupported face type: ", t);
462 break;
463 }
464 }
465}

◆ restrictPointToFace() [2/2]

void Moose::restrictPointToFace ( libMesh::Point p,
const libMesh::Elem side,
std::vector< const libMesh::Node * > &  off_edge_nodes 
)

Referenced by findContactPoint().

◆ SERIAL_ACCESS_CONST_SIZE() [1/3]

Moose::SERIAL_ACCESS_CONST_SIZE ( libMesh::VectorValue  ,
obj0u,
Moose::dim   
)

◆ SERIAL_ACCESS_CONST_SIZE() [2/3]

Moose::SERIAL_ACCESS_CONST_SIZE ( RankFourTensorTempl  ,
obj0u, 0u, 0u, 0u,
RankFourTensorTempl< T >::N4   
)

◆ SERIAL_ACCESS_CONST_SIZE() [3/3]

Moose::SERIAL_ACCESS_CONST_SIZE ( RankTwoTensorTempl  ,
obj0u, 0u,
RankTwoTensorTempl< T >::N2   
)

◆ SERIAL_ACCESS_DYNAMIC_SIZE()

Moose::SERIAL_ACCESS_DYNAMIC_SIZE ( DenseVector  ,
obj0u,
obj.  size() 
)

◆ SERIAL_ACCESS_SCALAR() [1/2]

Moose::SERIAL_ACCESS_SCALAR ( ADReal  )

◆ SERIAL_ACCESS_SCALAR() [2/2]

Moose::SERIAL_ACCESS_SCALAR ( Real  )

◆ serialAccess()

template<typename T >
SerialAccessRange< T > Moose::serialAccess ( T &  obj)

◆ setColorConsole()

bool Moose::setColorConsole ( bool  use_color,
bool  force = false 
)

Turns color escape sequences on/off for info written to stdout.

Returns the the set value which may be different than use_color.

Definition at line 877 of file Moose.C.

877{
878 associateSyntaxInner(syntax, action_factory);
879 registerActions(syntax, action_factory);
880}
881

Referenced by CommonOutputAction::act(), and MooseApp::setupOptions().

◆ setSolverDefaults()

void Moose::setSolverDefaults ( FEProblemBase problem)

Definition at line 854 of file Moose.C.

◆ sideIntersectedByLine()

int Moose::sideIntersectedByLine ( const Elem *  elem,
std::vector< int > &  not_side,
const LineSegment line_segment,
Point &  intersection_point 
)

Figure out which (if any) side of an Elem is intersected by a line.

Parameters
elemThe elem to search
not_sideSides to not search (Use -1 if you want to search all sides)
intersection_pointIf an intersection is found this will be filled with the x,y,z position of that intersection
Returns
The side that is intersected by the line. Will return -1 if it doesn't intersect any side

Definition at line 34 of file RayTracing.C.

38{
39 unsigned int n_sides = elem->n_sides();
40
41 // Whether or not they intersect
42 bool intersect = false;
43
44 unsigned int dim = elem->dim();
45
46 for (unsigned int i = 0; i < n_sides; i++)
47 {
48 // Don't search the "not_side"
49 // Note: A linear search is fine here because this vector is going to be < n_sides
50 if (std::find(not_side.begin(), not_side.end(), static_cast<int>(i)) != not_side.end())
51 continue;
52
53 // Get a simplified side element
54 std::unique_ptr<const Elem> side_elem = elem->side_ptr(i);
55
56 if (dim == 3)
57 {
58 // Make a plane out of the first three nodes on the side
59 libMesh::Plane plane(side_elem->point(0), side_elem->point(1), side_elem->point(2));
60
61 // See if they intersect
62 intersect = line_segment.intersect(plane, intersection_point);
63 }
64 else if (dim == 2)
65 {
66 // Make a Line Segment out of the first two nodes on the side
67 LineSegment side_segment(side_elem->point(0), side_elem->point(1));
68
69 // See if they intersect
70 intersect = line_segment.intersect(side_segment, intersection_point);
71 }
72 else // 1D
73 {
74 // See if the line segment contains the point
75 intersect = line_segment.contains_point(side_elem->point(0));
76
77 // If it does then save off that one point as the intersection point
78 if (intersect)
79 intersection_point = side_elem->point(0);
80 }
81
82 if (intersect)
83 {
84 if (side_elem->contains_point(intersection_point))
85 {
86 const Elem * neighbor = elem->neighbor_ptr(i);
87
88 // If this side is on a boundary, let's do another search and see if we can find a better
89 // candidate
90 if (!neighbor)
91 {
92 not_side.push_back(i); // Make sure we don't find this side again
93
94 int better_side = sideIntersectedByLine(elem, not_side, line_segment, intersection_point);
95
96 if (better_side != -1)
97 return better_side;
98 }
99
100 return i;
101 }
102 }
103 }
104
105 // Didn't find one
106 return -1;
107}
bool intersect(const libMesh::Plane &pl, Point &intersect_p) const
Check if a line segment intersects a plane, and if so, return the intersection point.
Definition LineSegment.C:67
bool contains_point(const Point &p) const
Determines whether a point is in a line segment or not.
Definition LineSegment.C:60

Referenced by recursivelyFindElementsIntersectedByLine(), and sideIntersectedByLine().

◆ sideNeighborIsOn()

int Moose::sideNeighborIsOn ( const Elem *  elem,
const Elem *  neighbor 
)

Returns the side number for elem that neighbor is on.

Returns -1 if the neighbor can't be found to be a neighbor

Definition at line 115 of file RayTracing.C.

116{
117 unsigned int n_sides = elem->n_sides();
118
119 for (unsigned int i = 0; i < n_sides; i++)
120 {
121 if (elem->neighbor_ptr(i) == neighbor)
122 return i;
123 }
124
125 return -1;
126}

Referenced by recursivelyFindElementsIntersectedByLine().

◆ stringify() [1/22]

std::string Moose::stringify ( bool  v)
inline

Definition at line 73 of file Conversion.h.

74{
75 return v ? "true" : "false";
76}

◆ stringify() [2/22]

std::string Moose::stringify ( const EigenSolveType t)

Convert eigen solve type into human readable string.

Definition at line 401 of file Conversion.C.

402{
403 switch (t)
404 {
405 case EST_POWER:
406 return "Power";
407 case EST_ARNOLDI:
408 return "ARNOLDI";
409 case EST_KRYLOVSCHUR:
410 return "KRYLOVSCHUR";
412 return "Jacobi Davidson";
414 return "Nonlinear Power";
415 case EST_PJFNKMO:
416 return "PJFNK with Matrix Only";
417 case EST_NEWTON:
418 return "Newton";
419 case EST_JFNK:
420 return "JFNK";
421 case EST_PJFNK:
422 return "Preconditioned JFNK";
423 }
424 return "";
425}

◆ stringify() [3/22]

std::string Moose::stringify ( const Moose::RelationshipManagerType t)

Definition at line 324 of file Conversion.C.

325{
326 // Cannot make a switch statement because the boolean logic doesn't work well with the class type
327 // enumeration and because Cody says so.
328 if (t == RelationshipManagerType::DEFAULT)
329 return "DEFAULT";
330 if (t == RelationshipManagerType::GEOMETRIC)
331 return "GEOMETRIC";
332 if (t == RelationshipManagerType::ALGEBRAIC)
333 return "ALGEBRAIC";
334 if (t == (RelationshipManagerType::GEOMETRIC | RelationshipManagerType::ALGEBRAIC))
335 return "GEOMETRIC and ALGEBRAIC";
336 if (t == (RelationshipManagerType::ALGEBRAIC | RelationshipManagerType::COUPLING))
337 return "ALGEBRAIC and COUPLING";
338 if (t == (RelationshipManagerType::GEOMETRIC | RelationshipManagerType::ALGEBRAIC |
339 RelationshipManagerType::COUPLING))
340 return "GEOMETRIC and ALGEBRAIC and COUPLING";
341 if (t == RelationshipManagerType::COUPLING)
342 return "COUPLING";
343
344 mooseError("Unknown RelationshipManagerType");
345}

◆ stringify() [4/22]

std::string Moose::stringify ( const Moose::TimeIntegratorType t)

Definition at line 349 of file Conversion.C.

350{
351 switch (t)
352 {
353 case TimeIntegratorType::TI_IMPLICIT_EULER:
354 return "IMPLICIT_EULER";
355 case TimeIntegratorType::TI_EXPLICIT_EULER:
356 return "EXPLICIT_EULER";
357 case TimeIntegratorType::TI_CRANK_NICOLSON:
358 return "CRANK_NICOLSON";
359 case TimeIntegratorType::TI_BDF2:
360 return "BDF2";
361 case TimeIntegratorType::TI_EXPLICIT_MIDPOINT:
362 return "EXPLICIT_MIDPOINT";
363 case TimeIntegratorType::TI_LSTABLE_DIRK2:
364 return "LSTABLE_DIRK2";
365 case TimeIntegratorType::TI_EXPLICIT_TVD_RK_2:
366 return "EXPLICIT_TVDRK2";
367 default:
368 mooseError("Unknown TimeIntegratorType");
369 }
370}

◆ stringify() [5/22]

std::string Moose::stringify ( const SolveType t)

Convert solve type into human readable string.

Definition at line 382 of file Conversion.C.

383{
384 switch (t)
385 {
386 case ST_NEWTON:
387 return "NEWTON";
388 case ST_JFNK:
389 return "JFNK";
390 case ST_PJFNK:
391 return "Preconditioned JFNK";
392 case ST_FD:
393 return "FD";
394 case ST_LINEAR:
395 return "Linear";
396 }
397 return "";
398}

◆ stringify() [6/22]

template<typename T , typename U >
std::string Moose::stringify ( const std::pair< T, U > &  p,
const std::string &  delim = ":" 
)

Add pair stringify to support maps.

Definition at line 154 of file Conversion.h.

154 :")
155{
156 return stringify(p.first) + delim + stringify(p.second);
157}

◆ stringify() [7/22]

std::string Moose::stringify ( const std::string &  s)

Add no-op stringify if the argument already is a string (must use overloading)

Definition at line 487 of file Conversion.C.

488{
489 return s;
490}

◆ stringify() [8/22]

template<typename... Args>
std::string Moose::stringify ( const std::tuple< Args... > &  t,
const std::string &  delim = ":" 
)

Add tuple stringify.

Definition at line 162 of file Conversion.h.

162 :")
163{
164 if constexpr (sizeof...(Args) == 0)
165 {
166 return "";
167 }
168
169 return std::apply(
170 [&delim](const auto &... args)
171 {
172 std::size_t n{0};
173 std::string result;
174 ((result += (n++ == 0 ? "" : delim) + stringify(args)), ...);
175 return result;
176 },
177 t);
178}

◆ stringify() [9/22]

template<typename T >
std::string Moose::stringify ( const T &  t)

conversion to string

Definition at line 64 of file Conversion.h.

65{
66 std::ostringstream os;
67 os << t;
68 return os.str();
69}

Referenced by MaterialDerivativeTestAction::act(), SetupResidualDebugAction::act(), FEProblemBase::addAuxArrayVariable(), FEProblemBase::addAuxScalarVariable(), PhysicsComponentInterface::addBoundaryConditionsFromComponents(), PhysicsComponentInterface::addInitialConditionsFromComponents(), LinearFVFluxKernel::addMatrixContribution(), ComponentPhysicsInterface::addPhysics(), AddActionComponentAction::addRelationshipManagers(), LinearFVFluxKernel::addRightHandSideContribution(), MooseVariableData< OutputType >::adGradPhi(), MooseVariableData< OutputType >::adGradPhiFace(), MooseEnum::assign(), MooseEnum::assign(), AuxKernelBase::AuxKernelBase(), MooseMeshUtils::buildLoopBoundaryOf2DMesh(), ParsedFunctorMaterialTempl< is_ad >::buildParsedFunction(), CartesianMeshGenerator::CartesianMeshGenerator(), Moose::BSpline::CdBBasis(), PhysicsBase::checkBlockRestrictionIdentical(), InputParametersChecksUtils< C >::checkBlockwiseConsistency(), MooseMesh::checkCoordinateSystems(), MeshDiagnosticsGenerator::checkElementOverlap(), MeshDiagnosticsGenerator::checkElementTypes(), FEProblemBase::checkExceptionAndStopSolve(), Moose::FunctorBase< T >::checkFace(), MeshGenerator::checkGetMesh(), Steady::checkIntegrity(), MeshDiagnosticsGenerator::checkLocalJacobians(), MeshDiagnosticsGenerator::checkNonConformalMesh(), MeshDiagnosticsGenerator::checkNonConformalMeshFromAdaptivity(), MeshDiagnosticsGenerator::checkNonMatchingEdges(), MeshDiagnosticsGenerator::checkNonPlanarSides(), MultiAppTransfer::checkParentAppUserObjectExecuteOn(), MeshDiagnosticsGenerator::checkPolygons(), FEProblemBase::checkProblemIntegrity(), ActionComponent::checkRequiredTasks(), PhysicsBase::checkRequiredTasks(), InputParametersChecksUtils< C >::checkTwoDVectorParamsNoRespectiveOverlap(), BlockRestrictable::checkVariable(), InputParametersChecksUtils< C >::checkVectorParamsNoOverlap(), CircularBoundaryCorrectionGenerator::circularCenterCalculator(), Moose::SlepcSupport::clearFreeNonlinearPowerIterations(), FEProblemBase::computeUserObjectsInternal(), CopyValueAux::CopyValueAux(), PhysicsBase::copyVariablesFromMesh(), Moose::Kokkos::ArrayBase< T, dimension, index_type >::createInternal(), Moose::Kokkos::dataLoad(), DebugResidualAux::DebugResidualAux(), DGKernelBase::DGKernelBase(), CartesianGridDivision::divisionIndex(), CylindricalGridDivision::divisionIndex(), SphericalGridDivision::divisionIndex(), FEProblemBase::duplicateVariableCheck(), MonotoneCubicInterpolation::errorCheck(), UnitsConversionEvaler::eval(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MeshDivisionFunctorReductionVectorPostprocessor::execute(), DOFMapOutput::filename(), ElementQualityChecker::finalize(), DiracKernelInfo::findPoint(), ParsedMaterialHelper< is_ad >::functionParse(), FunctorSmootherTempl< T >::FunctorSmootherTempl(), SurfaceSubdomainsDelaunayRemesher::General2DDelaunay(), AdvancedExtruderGenerator::generate(), CoarsenBlockGenerator::generate(), ExtraNodesetGenerator::generate(), RefineBlockGenerator::generate(), ActionWarehouse::getAction(), FunctorBinnedValuesDivision::getBinIndex(), ComputeFVFluxThread< RangeType, AttributeTagType >::getBlockNames(), MeshCoarseningUtils::getFineElementsFromInteriorNode(), SolutionUserObjectBase::getLocalVarIndex(), MooseEnumBase::getRawNames(), MooseApp::getRelationshipManagerInfo(), SystemBase::getScalarVariable(), ProjectedStatefulMaterialStorageAction::getTypeEnum(), SystemBase::getVariable(), Moose::FV::harmonicInterpolation(), ParsedDownSelectionPositions::initialize(), BlockRestrictable::initializeBlockRestrictable(), MultiAppGeneralFieldTransfer::initialSetup(), MatrixTools::inverse(), LeastSquaresFitHistory::LeastSquaresFitHistory(), MultiApp::localApp(), ParsedConvergence::makeParsedFunction(), MeshDivisionAux::MeshDivisionAux(), MultiAppTransfer::MultiAppTransfer(), SystemBase::oldSolutionStateVectorName(), ComputeLinearFVLimitedGradientThread::operator()(), MaterialOutputAction::outputHelper(), Parser::parse(), PatternedMeshGenerator::PatternedMeshGenerator(), ProjectSideSetOntoLevelSetGenerator::pointPairLevelSetInterception(), CompileTimeDerivatives::CTValue< tag, T >::print(), CompileTimeDerivatives::CTArrayRef< tag, T, I >::print(), CompileTimeDerivatives::CTIPow< B, E >::print(), libMesh::print_helper(), BlockRestrictionDebugOutput::printBlockRestrictionMap(), CompileTimeDerivatives::printTag(), TopResidualDebugOutput::printTopResiduals(), ProjectedStatefulMaterialStorageAction::processProperty(), DerivativeParsedMaterialHelperTempl< is_ad >::recurseMatProps(), CoarsenBlockGenerator::recursiveCoarsen(), Moose::internal::Capabilities::registerMooseCapabilities(), PhysicsBase::reportPotentiallyMissedParameters(), Moose::Kokkos::Thread< thread_id_type, max_dimension >::resize(), PicardSolve::saveVariableValues(), SecantSolve::saveVariableValues(), SteffensenSolve::saveVariableValues(), MeshRepairGenerator::separateSubdomainsByElementType(), MooseMesh::setCoordSystem(), Moose::SlepcSupport::setFreeNonlinearPowerIterations(), Moose::SlepcSupport::setNewtonPetscOptions(), Moose::SlepcSupport::setSlepcEigenSolverTolerances(), Split::setup(), MultiSystemSolveObject::setupMultiSystemFixedPointRelaxationFactors(), SamplerBase::setupVariables(), PhysicsBase::shouldCreateIC(), PhysicsBase::shouldCreateTimeDerivative(), PhysicsBase::shouldCreateVariable(), SystemBase::solutionState(), FEProblemBase::solverSysNum(), FEProblemBase::solverTypeString(), EigenProblem::solverTypeString(), StitchMeshGenerator::StitchMeshGenerator(), NonlinearSystem::stopSolve(), stringify(), stringify(), stringify(), Moose::internal::stringify_variant(), PiecewiseByBlockLambdaFunctor< T >::subdomainErrorMessage(), PiecewiseByBlockLambdaFunctor< T >::subdomainNameAndID(), and FEProblemSolve::validParams().

◆ stringify() [10/22]

template<template< typename... > class T, typename... U>
std::string Moose::stringify ( const T< U... > &  c,
const std::string &  delim = ", ",
const std::string &  elem_encl = "",
bool  enclose_list_in_curly_braces = false 
)

Convert a container to a string with elements separated by delimiter of user's choice.

Optionally, the container elements can be enclosed by curly braces and can enclose elements in quotations (or other characters) to make the separation of elements more clear.

Parameters
[in]cContainer to stringify
[in]delimString to print between elements
[in]elem_enclString to use at the beginning and end of each element, typically quotation marks
[in]enclose_list_in_curly_bracesEnclose the list string in curly braces?

Definition at line 195 of file Conversion.h.

199{
200 std::string str;
201 if (enclose_list_in_curly_braces)
202 str += "{";
203 const auto begin = c.begin();
204 const auto end = c.end();
205 for (auto i = begin; i != end; ++i)
206 str += (i != begin ? delim : "") + elem_encl + stringify(*i) + elem_encl;
207 if (enclose_list_in_curly_braces)
208 str += "}";
209 return str;
210}

◆ stringify() [11/22]

std::string Moose::stringify ( const VarFieldType t)

Convert variable field type into human readable string.

Definition at line 428 of file Conversion.C.

429{
430 switch (t)
431 {
433 return "STANDARD";
434 case VAR_FIELD_VECTOR:
435 return "VECTOR";
436 case VAR_FIELD_ARRAY:
437 return "ARRAY";
438 case VAR_FIELD_SCALAR:
439 return "SCALAR";
440 case VAR_FIELD_ANY:
441 return "ANY";
442 }
443 return "";
444}

◆ stringify() [12/22]

std::string Moose::stringify ( ElementType  t)

Convert ElementType into string.

Definition at line 465 of file Conversion.C.

466{
467 switch (t)
468 {
469 case ElementType::Element:
470 return "ELEMENT";
471 case ElementType::Neighbor:
472 return "NEIGHBOR";
473 case ElementType::Lower:
474 return "LOWER";
475 default:
476 mooseError("unrecognized type");
477 }
478}

◆ stringify() [13/22]

std::string Moose::stringify ( int  v)
inline

Definition at line 80 of file Conversion.h.

81{
82 return std::to_string(v);
83}

◆ stringify() [14/22]

std::string Moose::stringify ( libMesh::ElemType  t)

Convert the libmesh ElemType into string.

Definition at line 481 of file Conversion.C.

482{
484}
std::string enum_to_string(const T e)

◆ stringify() [15/22]

std::string Moose::stringify ( libMesh::FEFamily  f)

Convert FEType from libMesh into string.

Definition at line 373 of file Conversion.C.

374{
376}

◆ stringify() [16/22]

std::string Moose::stringify ( long long  v)
inline

Definition at line 90 of file Conversion.h.

91{
92 return std::to_string(v);
93}

◆ stringify() [17/22]

std::string Moose::stringify ( long  v)
inline

Definition at line 85 of file Conversion.h.

86{
87 return std::to_string(v);
88}

◆ stringify() [18/22]

std::string Moose::stringify ( SolutionIterationType  t)

Convert SolutionIterationType into string.

Definition at line 447 of file Conversion.C.

448{
449 switch (t)
450 {
451 case SolutionIterationType::Time:
452 return "time";
453 case SolutionIterationType::Nonlinear:
454 return "nonlinear";
455 case SolutionIterationType::MultiAppFixedPoint:
456 return "multiapp_fixed_point";
457 case SolutionIterationType::MultiSystemFixedPoint:
458 return "multisystem_fixed_point";
459 default:
460 mooseError("Unhandled SolutionIterationType");
461 }
462}

◆ stringify() [19/22]

template<typename... T>
std::string Moose::stringify ( std::variant< T... >  v)
inline

Definition at line 122 of file Conversion.h.

123{
124 return (internal::stringify_variant<T>(v) + ...);
125}

◆ stringify() [20/22]

std::string Moose::stringify ( unsigned int  v)
inline

Definition at line 95 of file Conversion.h.

96{
97 return std::to_string(v);
98}

◆ stringify() [21/22]

std::string Moose::stringify ( unsigned long long  v)
inline

Definition at line 105 of file Conversion.h.

106{
107 return std::to_string(v);
108}

◆ stringify() [22/22]

std::string Moose::stringify ( unsigned long  v)
inline

Definition at line 100 of file Conversion.h.

101{
102 return std::to_string(v);
103}

◆ stringifyExact()

std::string Moose::stringifyExact ( Real  t)

Stringify Reals with enough precision to guarantee lossless Real -> string -> Real roundtrips.

Definition at line 493 of file Conversion.C.

494{
495 // this or std::numeric_limits<T>::max_digits10
496 const unsigned int max_digits10 =
497 std::floor(std::numeric_limits<Real>::digits * std::log10(2) + 2);
498
499 std::ostringstream os;
500 os << std::setprecision(max_digits10) << t;
501 return os.str();
502}

◆ stringToEnum()

template<typename T >
T Moose::stringToEnum ( const std::string &  s)

◆ stringToEnum< CoordinateSystemType >() [1/2]

template<>
CoordinateSystemType Moose::stringToEnum< CoordinateSystemType > ( const std::string &  s)

Definition at line 185 of file Conversion.C.

187{
189
190 std::string upper(s);
191 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
192
193 if (!coordinate_system_type_to_enum.count(upper))
194 mooseError("Unknown coordinate system type: ", upper);
195
196 return coordinate_system_type_to_enum[upper];
197}
void initCoordinateSystemType()
Definition Conversion.C:35

◆ stringToEnum< CoordinateSystemType >() [2/2]

template<>
CoordinateSystemType Moose::stringToEnum< CoordinateSystemType > ( const std::string &  s)

Definition at line 185 of file Conversion.C.

187{
189
190 std::string upper(s);
191 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
192
193 if (!coordinate_system_type_to_enum.count(upper))
194 mooseError("Unknown coordinate system type: ", upper);
195
196 return coordinate_system_type_to_enum[upper];
197}

◆ stringToEnum< EigenProblemType >()

template<>
EigenProblemType Moose::stringToEnum< EigenProblemType > ( const std::string &  s)

Definition at line 230 of file Conversion.C.

232{
234
235 std::string upper(s);
236 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
237
238 if (!eigen_problem_type_to_enum.count(upper))
239 mooseError("Unknown eigen problem type: ", upper);
240
241 return eigen_problem_type_to_enum[upper];
242}
void initEigenProlemType()
Definition Conversion.C:76

◆ stringToEnum< EigenSolveType >()

template<>
EigenSolveType Moose::stringToEnum< EigenSolveType > ( const std::string &  s)

Definition at line 215 of file Conversion.C.

217{
219
220 std::string upper(s);
221 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
222
223 if (!eigen_solve_type_to_enum.count(upper))
224 mooseError("Unknown eigen solve type: ", upper);
225
226 return eigen_solve_type_to_enum[upper];
227}
void initEigenSolveType()
Definition Conversion.C:59

◆ stringToEnum< libMesh::Order >()

template<>
libMesh::Order Moose::stringToEnum< libMesh::Order > ( const std::string &  s)

◆ stringToEnum< libMesh::QuadratureType >()

template<>
libMesh::QuadratureType Moose::stringToEnum< libMesh::QuadratureType > ( const std::string &  s)

◆ stringToEnum< LineSearchType >() [1/2]

template<>
LineSearchType Moose::stringToEnum< LineSearchType > ( const std::string &  s)

Definition at line 260 of file Conversion.C.

262{
264
265 std::string upper(s);
266 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
267
268 if (!line_search_type_to_enum.count(upper))
269 mooseError("Unknown line search type: ", upper);
270
271 return line_search_type_to_enum[upper];
272}
void initLineSearchType()
Definition Conversion.C:110

◆ stringToEnum< LineSearchType >() [2/2]

template<>
LineSearchType Moose::stringToEnum< LineSearchType > ( const std::string &  s)

Definition at line 260 of file Conversion.C.

262{
264
265 std::string upper(s);
266 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
267
268 if (!line_search_type_to_enum.count(upper))
269 mooseError("Unknown line search type: ", upper);
270
271 return line_search_type_to_enum[upper];
272}

◆ stringToEnum< MffdType >()

template<>
MffdType Moose::stringToEnum< MffdType > ( const std::string &  s)

Definition at line 290 of file Conversion.C.

292{
293 initMffdType();
294
295 std::string upper(s);
296 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
297
298 if (!mffd_type_to_enum.count(upper))
299 mooseError("Unknown mffd type: ", upper);
300
301 return mffd_type_to_enum[upper];
302}
void initMffdType()
Definition Conversion.C:143

◆ stringToEnum< Order >()

template<>
Order Moose::stringToEnum< Order > ( const std::string &  s)

Definition at line 172 of file Conversion.C.

174{
175 std::string upper(s);
176 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
177
178 if (upper.compare("AUTO") == 0)
179 return INVALID_ORDER;
180 else
181 return Utility::string_to_enum<Order>(upper);
182}

Referenced by SetupQuadratureAction::act(), and DeleteElementsNearMeshGenerator::generate().

◆ stringToEnum< QuadratureType >()

template<>
QuadratureType Moose::stringToEnum< QuadratureType > ( const std::string &  s)

Definition at line 165 of file Conversion.C.

167{
168 return Utility::string_to_enum<QuadratureType>("Q" + s);
169}

◆ stringToEnum< RelationshipManagerType >() [1/2]

template<>
RelationshipManagerType Moose::stringToEnum< RelationshipManagerType > ( const std::string &  s)

Definition at line 305 of file Conversion.C.

307{
308 initRMType();
309
310 std::string upper(s);
311 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
312
313 if (!rm_type_to_enum.count(upper))
314 mooseError("Unknown RelationshipManager type: ", upper);
315
316 return rm_type_to_enum[upper];
317}
void initRMType()
Definition Conversion.C:153

◆ stringToEnum< RelationshipManagerType >() [2/2]

template<>
RelationshipManagerType Moose::stringToEnum< RelationshipManagerType > ( const std::string &  s)

Definition at line 305 of file Conversion.C.

307{
308 initRMType();
309
310 std::string upper(s);
311 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
312
313 if (!rm_type_to_enum.count(upper))
314 mooseError("Unknown RelationshipManager type: ", upper);
315
316 return rm_type_to_enum[upper];
317}

◆ stringToEnum< SolveType >() [1/2]

template<>
SolveType Moose::stringToEnum< SolveType > ( const std::string &  s)

Definition at line 200 of file Conversion.C.

202{
204
205 std::string upper(s);
206 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
207
208 if (!solve_type_to_enum.count(upper))
209 mooseError("Unknown solve type: ", upper);
210
211 return solve_type_to_enum[upper];
212}
void initSolveType()
Definition Conversion.C:46

◆ stringToEnum< SolveType >() [2/2]

template<>
SolveType Moose::stringToEnum< SolveType > ( const std::string &  s)

Definition at line 200 of file Conversion.C.

202{
204
205 std::string upper(s);
206 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
207
208 if (!solve_type_to_enum.count(upper))
209 mooseError("Unknown solve type: ", upper);
210
211 return solve_type_to_enum[upper];
212}

◆ stringToEnum< TimeIntegratorType >() [1/2]

template<>
TimeIntegratorType Moose::stringToEnum< TimeIntegratorType > ( const std::string &  s)

Definition at line 275 of file Conversion.C.

277{
279
280 std::string upper(s);
281 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
282
283 if (!time_integrator_to_enum.count(upper))
284 mooseError("Unknown time integrator: ", upper);
285
286 return time_integrator_to_enum[upper];
287}
void initTimeIntegratorsType()
Definition Conversion.C:128

◆ stringToEnum< TimeIntegratorType >() [2/2]

template<>
TimeIntegratorType Moose::stringToEnum< TimeIntegratorType > ( const std::string &  s)

Definition at line 275 of file Conversion.C.

277{
279
280 std::string upper(s);
281 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
282
283 if (!time_integrator_to_enum.count(upper))
284 mooseError("Unknown time integrator: ", upper);
285
286 return time_integrator_to_enum[upper];
287}

◆ stringToEnum< WhichEigenPairs >()

template<>
WhichEigenPairs Moose::stringToEnum< WhichEigenPairs > ( const std::string &  s)

Definition at line 245 of file Conversion.C.

247{
249
250 std::string upper(s);
251 std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
252
253 if (!which_eigen_pairs_to_enum.count(upper))
254 mooseError("Unknown type of WhichEigenPairs: ", upper);
255
256 return which_eigen_pairs_to_enum[upper];
257}
void initWhichEigenPairs()
Definition Conversion.C:91

◆ swapLibMeshComm()

MPI_Comm Moose::swapLibMeshComm ( MPI_Comm  new_comm)

Swap the libMesh MPI communicator out for ours.

Note that you should usually use the Moose::ScopedCommSwapper class instead of calling this function.

Definition at line 861 of file Moose.C.

Referenced by Moose::ScopedCommSwapper::forceSwap(), and Moose::ScopedCommSwapper::~ScopedCommSwapper().

◆ to_json()

void Moose::to_json ( nlohmann::json &  json,
const Moose::LibtorchArtificialNeuralNet *const &  network 
)

Definition at line 151 of file LibtorchArtificialNeuralNet.C.

152{
153 if (network)
154 network->store(json);
155}
void store(nlohmann::json &json) const
Store the network architecture in a json file (for debugging, visualization)

◆ toPoint()

Point Moose::toPoint ( const std::vector< Real > &  pos)

Definition at line 505 of file Conversion.C.

506{
507 mooseAssert(pos.size() == LIBMESH_DIM, "Wrong array size while converting into a point");
508 return Point(pos[0], pos[1], pos[2]);
509}

◆ typeLoop()

template<template< typename, int > class L, typename... Ts, typename... As>
void Moose::typeLoop ( TypeList< Ts... >  ,
As...  args 
)

Type loop.

Definition at line 178 of file SerialAccess.h.

179{
180 typeLoopInternal<L, 0>(TypeList<Ts...>{}, args...);
181}
Helper structure to hold a list of types.

◆ typeLoopInternal()

template<template< typename, int > class L, int I, typename T , typename... Ts, typename... As>
void Moose::typeLoopInternal ( TypeList< T, Ts... >  ,
As...  args 
)

Type loop.

Definition at line 168 of file SerialAccess.h.

169{
170 L<T, I>::apply(args...);
171 if constexpr (sizeof...(Ts) > 0)
172 typeLoopInternal<L, I + 1>(TypeList<Ts...>{}, args...);
173}

◆ vectorStringsToEnum()

template<typename T >
std::vector< T > Moose::vectorStringsToEnum ( const MultiMooseEnum v)

Variable Documentation

◆ _color_console

bool Moose::_color_console = isatty(fileno(stdout))
static

Definition at line 868 of file Moose.C.

Referenced by Moose::ScopedDeprecatedIsError::ScopedDeprecatedIsError().

◆ _deprecated_is_error

bool Moose::_deprecated_is_error = false

Variable to toggle only deprecated warnings as errors.

Definition at line 921 of file Moose.C.

Referenced by moose::internal::mooseDeprecatedStream(), and MooseApp::setupOptions().

◆ _throw_on_error

bool Moose::_throw_on_error = false

Variable to turn on exceptions during mooseError(), should only be used within MOOSE unit tests or when about to perform threaded operations because exception throwing in threaded regions is safe while aborting is inherently not when singletons are involved (e.g.

what thread is responsible for destruction, or what do you do about mutexes?)

Definition at line 922 of file Moose.C.

Referenced by moose::internal::mooseErrorRaw(), MooseApp::run(), CommandLine::setCommandLineParam(), ThreadedFaceLoop< RangeType >::ThreadedFaceLoop(), and ThreadedFaceLoop< RangeType >::~ThreadedFaceLoop().

◆ _throw_on_warning

bool Moose::_throw_on_warning = false

Variable to turn on exceptions during mooseWarning(), should only be used in MOOSE unit tests.

Definition at line 923 of file Moose.C.

Referenced by moose::internal::mooseUnusedStream(), and moose::internal::mooseWarningStream().

◆ _trap_fpe

bool Moose::_trap_fpe
extern

Variable indicating whether we will enable FPE trapping for this run.

◆ _warnings_are_errors

bool Moose::_warnings_are_errors = false

Variable to toggle any warning into an error (includes deprecated code warnings)

Definition at line 920 of file Moose.C.

Referenced by moose::internal::mooseWarningStream(), and MooseApp::setupOptions().

◆ always_false

template<class... Ts>
constexpr std::false_type Moose::always_false {}
constexpr

This is a helper variable template for cases when we want to use a default compile-time error with constexpr-based if conditions.

The templating delays the triggering of the static assertion until the template is instantiated.

Definition at line 640 of file MooseTypes.h.

640{};

◆ ANY_BLOCK_ID

const SubdomainID Moose::ANY_BLOCK_ID = libMesh::Elem::invalid_subdomain_id - 1

◆ ANY_BOUNDARY_ID

const BoundaryID Moose::ANY_BOUNDARY_ID = static_cast<BoundaryID>(-1)

◆ constMaxQpsPerElem

constexpr std::size_t Moose::constMaxQpsPerElem = 1000
constexpr

This is used for places where we initialize some qp-sized data structures that would end up being sized too small after the quadrature order gets bumped (dynamically in-sim).

So for these cases, we just use this constant to size those data structures overly large to accommodate rather than come up with some overkill complex mechanism for dynamically resizing them. Eventually, we may need or implement that more sophisticated mechanism and will no longer need this.

Definition at line 258 of file MooseTypes.h.

Referenced by MaterialPropertyInterface::defaultGenericMaterialProperty(), and FEProblemBase::updateMaxQps().

◆ coordinate_system_type_to_enum

std::map<std::string, CoordinateSystemType> Moose::coordinate_system_type_to_enum

Definition at line 24 of file Conversion.C.

Referenced by initCoordinateSystemType(), and stringToEnum< CoordinateSystemType >().

◆ dim

constexpr std::size_t Moose::dim = LIBMESH_DIM
staticconstexpr

This is the dimension of all vector and tensor datastructures used in MOOSE.

We enforce LIBMESH_DIM == 3 through a static assertion above. Note that lower dimensional simulations embedded in 3D space can always be requested at runtime.

Definition at line 175 of file Moose.h.

Referenced by ADNodalBCTempl< Real, ADDirichletBCBase >::addResidual(), BatchMeshGeneratorAction::BatchMeshGeneratorAction(), ParsedFunctorMaterialTempl< is_ad >::buildParsedFunction(), Moose::Kokkos::Vector3< T >::cartesian_product(), ColumnMajorMatrixTempl< T >::ColumnMajorMatrixTempl(), ColumnMajorMatrixTempl< Real >::ColumnMajorMatrixTempl(), LinearFVAnisotropicDiffusion::computeBoundaryMatrixContribution(), LinearFVAnisotropicDiffusionFunctorNeumannBC::computeBoundaryNormalGradient(), LinearFVAnisotropicDiffusion::computeBoundaryRHSContribution(), LinearFVAnisotropicDiffusion::computeFluxMatrixContribution(), LinearFVAnisotropicDiffusion::computeFluxRHSContribution(), GenericFunctionVectorMaterialTempl< is_ad >::computeQpFunctions(), ElementW1pError::computeQpIntegral(), GenericConstantVectorMaterialTempl< is_ad >::computeQpProperties(), FVAnisotropicDiffusion::computeQpResidual(), ArrayParsedAux::computeValue(), ElementH1ErrorFunctionAux::computeValue(), ParsedAux::computeValue(), ParsedVectorAux::computeValue(), Moose::Kokkos::Real33::contract(), BatchMeshGeneratorAction::convertStringToCompoundRealScalar(), Moose::Kokkos::curlFromVectorGradient(), Moose::Kokkos::dataLoad(), dataLoad(), dataLoad(), dataLoad(), Moose::Kokkos::dataStore(), dataStore(), dataStore(), dataStore(), MooseMesh::detectOrthogonalDimRanges(), Moose::Kokkos::Real33::determinant(), SideDiffusiveFluxIntegralTempl< is_ad, T >::diffusivityGradientProduct(), MoveNodesByParsedExpressionModifier::displaceNode(), InitialConditionTempl< T >::dotHelper(), Moose::MFEM::NLCurlCurlJacMatrixCoefficient::Eval(), IntersectionPointsAlongLine::execute(), LinearFVAnisotropicDiffusion::faceDiffusionTensor(), MooseVariableData< OutputType >::fill(), ColumnMajorMatrixTempl< T >::fill(), findContactPoint(), GenericFunctionVectorMaterialTempl< is_ad >::GenericFunctionVectorMaterialTempl(), Coupleable::getDefaultVectorValue(), MooseVariableFE< RealEigenVector >::getElementalValue(), MultiAppTransfer::getFromBoundingBoxes(), MultiAppGeneralFieldTransfer::getMaxToProblemsBBoxDimensions(), MultiAppGeneralFieldTransfer::getRestrictedFromBoundingBoxes(), ArrayFunctionIC::gradient(), Moose::FV::greenGaussGradient(), Moose::FV::greenGaussGradient(), Moose::FV::greenGaussGradient(), Moose::FV::harmonicInterpolation(), MooseAppCoordTransform::hasScalingOrRotationTransformation(), Moose::Kokkos::Real33::identity(), CartesianGridDivision::initialize(), ParsedDownSelectionPositions::initialize(), PropertyReadFile::initVoronoiCenterPoints(), Moose::Kokkos::Real33::inverse(), MooseUtils::isFinitePoint(), MultiAppCoordTransform::isIdentity(), NestedSolveTempl< is_ad >::isRelSmall(), PointListAdaptor< PointObject >::kdtree_distance(), PointListAdaptor< PointObject >::kdtree_get_pt(), Moose::Kokkos::ArrayBase< T, dimension, index_type >::n(), Moose::Kokkos::JaggedArrayInnerData< T, inner, layout >::n(), Moose::Kokkos::JaggedArray< T, inner, outer, index_type, layout >::n(), Moose::Kokkos::MaterialPropertyValueBase< T, dimension >::n(), MathUtils::normSquared(), ResetDisplacedMeshThread::onNode(), SecondaryNeighborhoodThread::operator()(), Moose::Kokkos::Thread< thread_id_type, max_dimension >::operator()(), Moose::Kokkos::JaggedArray< T, inner, outer, index_type, layout >::operator()(), Moose::Kokkos::operator*(), ColumnMajorMatrixTempl< T >::operator*(), Moose::Kokkos::Real33::operator*=(), Moose::Kokkos::Real33::operator+=(), ColumnMajorMatrixTempl< T >::operator+=(), Moose::Kokkos::Real33::operator=(), Moose::Kokkos::Real33::operator=(), Moose::Kokkos::Real33::operator=(), ColumnMajorMatrixTempl< T >::operator=(), Moose::Kokkos::JaggedArray< T, inner, outer, index_type, layout >::operator[](), ParsedFunctorMaterialTempl< is_ad >::ParsedFunctorMaterialTempl(), PointIndexedMap::PointIndexedMap(), PropertyReadFile::PropertyReadFile(), Moose::Kokkos::JaggedArray< T, inner, outer, index_type, layout >::reserve(), Moose::Kokkos::Thread< thread_id_type, max_dimension >::resize(), sideIntersectedByLine(), Moose::Kokkos::Thread< thread_id_type, max_dimension >::size(), MultiApp::transformBoundingBox(), Moose::Kokkos::Real33::transpose(), BoundingBoxIC::value(), and MoveNodesByParsedExpressionModifier::writeOutputs().

◆ eigen_problem_type_to_enum

std::map<std::string, EigenProblemType> Moose::eigen_problem_type_to_enum

Definition at line 27 of file Conversion.C.

Referenced by initEigenProlemType(), and stringToEnum< EigenProblemType >().

◆ eigen_solve_type_to_enum

std::map<std::string, EigenSolveType> Moose::eigen_solve_type_to_enum

Definition at line 26 of file Conversion.C.

Referenced by initEigenSolveType(), and stringToEnum< EigenSolveType >().

◆ EMPTY_BLOCK_IDS

const std::set<SubdomainID> Moose::EMPTY_BLOCK_IDS = {}

Definition at line 737 of file MooseTypes.h.

737{};

◆ EMPTY_BOUNDARY_IDS

const std::set<BoundaryID> Moose::EMPTY_BOUNDARY_IDS = {}

Definition at line 738 of file MooseTypes.h.

738{};

◆ execute_flags

ExecFlagEnum Moose::execute_flags
extern

Storage for the registered execute flags.

This is needed for the ExecuteMooseObjectWarehouse to create the necessary storage containers on a per flag basis. This isn't something that should be used by application developers.

◆ interrupt_signal_number

volatile std::sig_atomic_t Moose::interrupt_signal_number = 0

Used by the signal handler to determine if we should write a checkpoint file out at any point during operation.

Definition at line 924 of file Moose.C.

Referenced by Output::outputStep(), Checkpoint::shouldOutput(), and SigHandler().

◆ INVALID_BLOCK_ID

const SubdomainID Moose::INVALID_BLOCK_ID = libMesh::Elem::invalid_subdomain_id

Definition at line 20 of file MooseTypes.C.

Referenced by FEProblemBase::checkProblemIntegrity(), ComputeFullJacobianThread::computeOnInternalFace(), ComputeResidualThread::computeOnInternalFace(), MultiAppGeometricInterpolationTransfer::computeTransformation(), MooseMeshUtils::convertBlockToMesh(), SubdomainsDivision::divisionIndex(), ElementSubdomainModifier::execute(), MultiAppGeometricInterpolationTransfer::fillSourceInterpolationPoints(), ElementSubdomainModifierBase::gatherMovingBoundaryChangesHelper(), RenameBlockGenerator::generate(), RenumberBySubdomainGenerator::generate(), XYMeshLineCutter::generate(), MooseMeshUtils::getSubdomainID(), TimedSubdomainModifier::getSubdomainIDAndCheck(), MooseMeshUtils::hasSubdomainID(), ElementSubdomainModifierBase::initialSetup(), MultiAppDofCopyTransfer::initialSetup(), MultiAppGeometricInterpolationTransfer::interpolateTargetPoints(), AttribSubdomains::isMatch(), FaceInfo::neighborSubdomainID(), ComputeLinearFVElementalThread::operator()(), ComputeLinearFVFaceThread::operator()(), ComputeJacobianForScalingThread::operator()(), ThreadedFaceLoop< RangeType >::operator()(), ThreadedElementLoopBase< RangeType >::operator()(), ComputeLinearFVFaceThread::printBlockExecutionInformation(), ComputeFVFluxThread< RangeType, AttributeTagType >::printBlockExecutionInformation(), ComputeFVFluxThread< RangeType, AttributeTagType >::printBoundaryExecutionInformation(), MooseMeshXYCuttingUtils::quadToTriOnLine(), MooseMeshXYCuttingUtils::quasiTriElementsFixer(), PiecewiseByBlockLambdaFunctor< T >::setFunctor(), and MeshTriangulationUtils::triangulateWithDelaunay().

◆ INVALID_BOUNDARY_ID

const BoundaryID Moose::INVALID_BOUNDARY_ID = libMesh::BoundaryInfo::invalid_id

◆ INVALID_PROCESSOR_ID

const processor_id_type Moose::INVALID_PROCESSOR_ID = libMesh::DofObject::invalid_processor_id

Definition at line 18 of file MooseTypes.C.

◆ invalid_size_t

constexpr std::size_t Moose::invalid_size_t = std::numeric_limits<std::size_t>::max()
inlineconstexpr

Value for invalid size_t indices.

Definition at line 178 of file Moose.h.

◆ INVALID_TAG_ID

const TagID Moose::INVALID_TAG_ID = static_cast<TagID>(-1)

◆ INVALID_TAG_TYPE_ID

const TagTypeID Moose::INVALID_TAG_TYPE_ID = static_cast<TagTypeID>(-1)

Definition at line 24 of file MooseTypes.C.

◆ line_search_type_to_enum

std::map<std::string, LineSearchType> Moose::line_search_type_to_enum

Definition at line 29 of file Conversion.C.

Referenced by initLineSearchType(), and stringToEnum< LineSearchType >().

◆ mffd_type_to_enum

std::map<std::string, MffdType> Moose::mffd_type_to_enum

Definition at line 31 of file Conversion.C.

Referenced by initMffdType(), and stringToEnum< MffdType >().

◆ OLD_SOLUTION_TAG

const TagName Moose::OLD_SOLUTION_TAG = "SOLUTION_STATE_1"

◆ OLDER_SOLUTION_TAG

const TagName Moose::OLDER_SOLUTION_TAG = "SOLUTION_STATE_2"

◆ perf_log

libMesh::PerfLog Moose::perf_log
extern

Perflog to be used by applications.

If the application prints this in the end they will get performance info.

This is no longer instantiated in the framework and will be removed in the future.

◆ PREVIOUS_MULTIAPP_FP_SOLUTION_TAG

const TagName Moose::PREVIOUS_MULTIAPP_FP_SOLUTION_TAG = "U_PREVIOUS_MULTIAPP_FP"

◆ PREVIOUS_MULTISYSTEM_FP_SOLUTION_TAG

const TagName Moose::PREVIOUS_MULTISYSTEM_FP_SOLUTION_TAG = "U_PREVIOUS_MULTISYSTEM_FP"

Definition at line 30 of file MooseTypes.C.

Referenced by SystemBase::oldSolutionStateVectorName().

◆ PREVIOUS_NL_SOLUTION_TAG

const TagName Moose::PREVIOUS_NL_SOLUTION_TAG = "U_PREVIOUS_NL_NEWTON"

◆ rm_type_to_enum

std::map<std::string, RelationshipManagerType> Moose::rm_type_to_enum

Definition at line 32 of file Conversion.C.

Referenced by initRMType(), and stringToEnum< RelationshipManagerType >().

◆ show_multiple

bool Moose::show_multiple = false

Set to false (the default) to display an error message only once for each error call code location (as opposed to every time the code is executed).

Definition at line 925 of file Moose.C.

◆ SOLUTION_DOT_TAG

const TagName Moose::SOLUTION_DOT_TAG = "u_dot_factor"

Definition at line 31 of file MooseTypes.C.

◆ SOLUTION_DOTDOT_TAG

const TagName Moose::SOLUTION_DOTDOT_TAG = "u_dotdot_factor"

Definition at line 32 of file MooseTypes.C.

◆ SOLUTION_TAG

const TagName Moose::SOLUTION_TAG = "SOLUTION"

◆ solve_type_to_enum

std::map<std::string, SolveType> Moose::solve_type_to_enum

Definition at line 25 of file Conversion.C.

Referenced by initSolveType(), and stringToEnum< SolveType >().

◆ time_integrator_to_enum

std::map<std::string, TimeIntegratorType> Moose::time_integrator_to_enum

Definition at line 30 of file Conversion.C.

Referenced by initTimeIntegratorsType(), and stringToEnum< TimeIntegratorType >().

◆ which_eigen_pairs_to_enum

std::map<std::string, WhichEigenPairs> Moose::which_eigen_pairs_to_enum

Definition at line 28 of file Conversion.C.

Referenced by initWhichEigenPairs(), and stringToEnum< WhichEigenPairs >().