https://mooseframework.inl.gov
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

 DataFileUtils
 
 FV
 
 internal
 
 MFEM
 
 Mortar
 
 PetscSupport
 
 SlepcSupport
 

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< MooseUtils::SemidynamicVector< T, N, value_init > >
 
struct  ADType< Point >
 
struct  ADType< RankFourTensor >
 
struct  ADType< RankThreeTensor >
 
struct  ADType< RankTwoTensor >
 
struct  ADType< Real >
 
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  Builder
 Parses MOOSE input using HIT/WASP. More...
 
class  Capabilities
 This singleton class holds a registry for capabilities supported by the current app. More...
 
class  ConstantFunctor
 Class template for creating constant functors. 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  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  PassKey
 
class  RawValueFunctor
 
class  ScopedCommSwapper
 
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 > >
 
struct  StateArg
 State argument for evaluating functors. More...
 
class  TorchScriptModule
 
struct  TypeList
 Helper structure to hold a list of types. 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. More...
 

Enumerations

enum  FunctorEvaluationKind { FunctorEvaluationKind::Value, FunctorEvaluationKind::Gradient, FunctorEvaluationKind::Dot, FunctorEvaluationKind::GradDot }
 An enumeration of possible functor evaluation kinds. More...
 
enum  SolutionState : int { Current = 0, Old = 1, Older = 2, PreviousNL = -1 }
 
enum  SolutionIterationType : unsigned short { SolutionIterationType::Time = 0, SolutionIterationType::Nonlinear }
 
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  ElementType : unsigned int { ElementType::Element = DGResidualType::Element, ElementType::Neighbor = DGResidualType::Neighbor, ElementType::Lower = DGResidualType::Neighbor + 1 }
 
enum  MortarType : unsigned int { MortarType::Secondary = static_cast<unsigned int>(Moose::ElementType::Element), MortarType::Primary = static_cast<unsigned int>(Moose::ElementType::Neighbor), MortarType::Lower = static_cast<unsigned int>(Moose::ElementType::Lower) }
 
enum  ComputeType { ComputeType::Residual, ComputeType::Jacobian, ComputeType::ResidualAndJacobian }
 The type of nonlinear computation being performed. More...
 
enum  RESTARTABLE_FILTER : unsigned char { RESTARTABLE_FILTER::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  RelationshipManagerType : unsigned char { RelationshipManagerType::DEFAULT = 0, RelationshipManagerType::GEOMETRIC = 1 << 0, RelationshipManagerType::ALGEBRAIC = 1 << 1, RelationshipManagerType::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  FEBackend { FEBackend::LibMesh, FEBackend::MFEM }
 

Functions

InputParameters commonAdaptivityParams ()
 
bool colorConsole ()
 Returns whether Console coloring is turned on (default: true). More...
 
bool setColorConsole (bool use_color, bool force=false)
 Turns color escape sequences on/off for info written to stdout. More...
 
void registerAll (Factory &f, ActionFactory &af, Syntax &s)
 Register objects that are in MOOSE. More...
 
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. More...
 
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. More...
 
StateArg currentState ()
 
StateArg oldState ()
 
StateArg previousNonlinearState ()
 
std::shared_ptr< MooseAppcreateMooseApp (const std::string &default_app_type, int argc, char *argv[])
 Create a MooseApp from command-line arguments. More...
 
template<typename DefaultAppType >
int main (int argc, char *argv[])
 Initialize, create and run a MooseApp. More...
 
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. More...
 
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. More...
 
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. More...
 
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, RealglobalDofIndexToDerivative (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. More...
 
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. More...
 
bool doDerivatives (const SubProblem &subproblem, const SystemBase &sys)
 
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 More...
 
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. More...
 
std::string stringify (const EigenSolveType &t)
 Convert eigen solve type into human readable string. More...
 
std::string stringify (const VarFieldType &t)
 Convert variable field type into human readable string. More...
 
std::string stringify (const std::string &s)
 Add no-op stringify if the argument already is a string (must use overloading) More...
 
std::string stringify (libMesh::FEFamily f)
 Convert FEType from libMesh into string. More...
 
std::string stringify (SolutionIterationType t)
 Convert SolutionIterationType into string. More...
 
std::string stringify (ElementType t)
 Convert ElementType into string. More...
 
std::string stringify (libMesh::ElemType t)
 Convert the libmesh ElemType into string. More...
 
template<typename T , typename U >
std::string stringify (const std::pair< T, U > &p, const std::string &delim=":")
 Add pair stringify to support maps. More...
 
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. More...
 
std::string stringifyExact (Real)
 Stringify Reals with enough precision to guarantee lossless Real -> string -> Real roundtrips. More...
 
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. More...
 
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. More...
 
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. More...
 
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 getExecutablePath ()
 This function returns the PATH of the running executable. More...
 
std::string getExecutableName ()
 This function returns the name of the running executable. More...
 
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. More...
 
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. More...
 
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. More...
 
void hash_combine (std::size_t &)
 Used for hash function specialization for Attribute objects. More...
 
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). More...
 
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. More...
 
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. More...
 
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<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. More...
 
 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. More...
 
template<template< typename, int > class L, typename... Ts, typename... As>
void typeLoop (TypeList< Ts... >, As... args)
 Type loop. More...
 
template<typename T >
void initDofIndices (T &data, const Elem &elem)
 
void associateSyntaxInner (Syntax &syntax, ActionFactory &action_factory)
 
bool isSectionActive (std::string path, hit::Node *root)
 
std::vector< std::string > findSimilar (std::string param, std::vector< std::string > options)
 
template<>
void Builder::setScalarParameter< ReporterName, std::string > (const std::string &full_name, const std::string &short_name, InputParameters::Parameter< ReporterName > *param, bool in_global, GlobalParamsAction *global_block)
 
template<>
void Builder::setVectorParameter< ReporterName, std::string > (const std::string &full_name, const std::string &short_name, InputParameters::Parameter< std::vector< ReporterName >> *param, bool in_global, GlobalParamsAction *global_block)
 
template<>
void Builder::setVectorParameter< CLIArgString, std::string > (const std::string &full_name, const std::string &short_name, InputParameters::Parameter< std::vector< CLIArgString >> *param, bool in_global, GlobalParamsAction *global_block)
 
template<typename T >
bool toBool (const std::string &, T &)
 
template<>
bool toBool< bool > (const std::string &s, bool &val)
 
void compute_linear_system (libMesh::EquationSystems &es, const std::string &system_name)
 
void assemble_matrix (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<>
EigenSolveType stringToEnum< EigenSolveType > (const std::string &s)
 
template<>
EigenProblemType stringToEnum< EigenProblemType > (const std::string &s)
 
template<>
WhichEigenPairs stringToEnum< WhichEigenPairs > (const std::string &s)
 
template<>
MffdType stringToEnum< MffdType > (const std::string &s)
 
Point toPoint (const std::vector< Real > &pos)
 Convert point represented as std::vector into Point. More...
 
void findElementsIntersectedByPlane (const libMesh::Plane &plane, const MeshBase &mesh, std::vector< const Elem *> &intersected_elems)
 
std::string getExec ()
 
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. More...
 
int sideNeighborIsOn (const Elem *elem, const Elem *neighbor)
 Returns the side number for elem that neighbor is on. More...
 
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. More...
 
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. More...
 
int interrupt_signal_number = 0
 Used by the signal handler to determine if we should write a checkpoint file out at any point during operation. More...
 
bool show_trace = true
 Set to true (the default) to print the stack trace with error and warning messages - false to omit it. More...
 
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). More...
 
libMesh::PerfLog perf_log
 Perflog to be used by applications. More...
 
bool _trap_fpe
 Variable indicating whether we will enable FPE trapping for this run. More...
 
bool _warnings_are_errors = false
 Variable to toggle any warning into an error (includes deprecated code warnings) More...
 
bool _deprecated_is_error = false
 Variable to toggle only deprecated warnings as errors. More...
 
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. More...
 
bool _throw_on_warning = false
 Variable to turn on exceptions during mooseWarning(), should only be used in MOOSE unit tests. More...
 
ExecFlagEnum execute_flags
 Storage for the registered execute flags. More...
 
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). More...
 
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. More...
 
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"
 
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 644 of file MooseTypes.h.

◆ RelationshipManagerInputParameterCallback

The type for the callback to set RelationshipManager parameters.

Definition at line 989 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 703 of file MooseTypes.h.

704 {
705  PRE_IC = 0,
706  PRE_AUX = 1,
707  POST_AUX = 2,
708  ALL = 3
709 };

◆ ComputeType

enum Moose::ComputeType
strong

The type of nonlinear computation being performed.

Enumerator
Residual 
Jacobian 
ResidualAndJacobian 

Definition at line 780 of file MooseTypes.h.

◆ ConstraintFormulationType

Type of constraint formulation.

Enumerator
Penalty 
Kinematic 

Definition at line 917 of file MooseTypes.h.

918 {
919  Penalty,
920  Kinematic
921 };

◆ ConstraintJacobianType

Enumerator
SecondarySecondary 
SecondaryPrimary 
PrimarySecondary 
PrimaryPrimary 
LowerLower 
LowerSecondary 
LowerPrimary 
SecondaryLower 
PrimaryLower 

Definition at line 796 of file MooseTypes.h.

◆ ConstraintSideType

Enumerator
SIDE_PRIMARY 
SIDE_SECONDARY 

Definition at line 737 of file MooseTypes.h.

◆ ConstraintType

Enumerator
Secondary 
Primary 

Definition at line 757 of file MooseTypes.h.

◆ CoordinateSystemType

Enumerator
COORD_XYZ 
COORD_RZ 
COORD_RSPHERICAL 

Definition at line 809 of file MooseTypes.h.

809  : int
810 {
811  COORD_XYZ = 0,
812  COORD_RZ,
814 };

◆ CouplingType

Enumerator
COUPLING_DIAG 
COUPLING_FULL 
COUPLING_CUSTOM 

Definition at line 730 of file MooseTypes.h.

◆ DGJacobianType

Enumerator
ElementElement 
ElementNeighbor 
NeighborElement 
NeighborNeighbor 

Definition at line 749 of file MooseTypes.h.

◆ DGResidualType

Enumerator
Element 
Neighbor 

Definition at line 743 of file MooseTypes.h.

744 {
745  Element,
746  Neighbor
747 };

◆ 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 870 of file MooseTypes.h.

871 {
872  EPT_HERMITIAN,
879 };
Generalized Non-Hermitian.
Definition: MooseTypes.h:876
Generalized Hermitian indefinite.
Definition: MooseTypes.h:875
use whatever SLPEC has by default
Definition: MooseTypes.h:878
Generalized Non-Hermitian with positive (semi-)definite B.
Definition: MooseTypes.h:877
Non-Hermitian.
Definition: MooseTypes.h:873
Generalized Hermitian.
Definition: MooseTypes.h:874

◆ 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 854 of file MooseTypes.h.

855 {
856  EST_POWER,
857  EST_ARNOLDI,
861  EST_NEWTON,
862  EST_PJFNK,
863  EST_PJFNKMO,
864  EST_JFNK
865 };
Newton-based eigensolver with an assembled Jacobian matrix (fully coupled by default) ...
Definition: MooseTypes.h:861
The same as PJFNK except that matrix-vector multiplication is employed to replace residual evaluation...
Definition: MooseTypes.h:863
Power / Inverse / RQI.
Definition: MooseTypes.h:856
Krylov-Schur.
Definition: MooseTypes.h:858
Preconditioned Jacobian-free Newton Krylov.
Definition: MooseTypes.h:862
Nonlinear inverse power.
Definition: MooseTypes.h:860
Jacobi-Davidson.
Definition: MooseTypes.h:859
Jacobian-free Newton Krylov.
Definition: MooseTypes.h:864

◆ ElementType

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

Definition at line 763 of file MooseTypes.h.

763  : unsigned int
764 {
765  Element = DGResidualType::Element,
768 };

◆ FEBackend

enum Moose::FEBackend
strong
Enumerator
LibMesh 
MFEM 

Definition at line 1199 of file MooseTypes.h.

1200 {
1201  LibMesh
1202 #ifdef MOOSE_MFEM_ENABLED
1203  ,
1204  MFEM
1205 #endif
1206 };

◆ FunctorEvaluationKind

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 248 of file MooseTypes.h.

249 {
250  Volume,
251  Face
252 };

◆ 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 925 of file MooseTypes.h.

◆ 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 691 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 942 of file MooseTypes.h.

943 {
944  MFFD_INVALID,
945  MFFD_WP,
946  MFFD_DS
947 };
means not set
Definition: MooseTypes.h:944

◆ 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 830 of file MooseTypes.h.

◆ MortarType

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

Definition at line 770 of file MooseTypes.h.

770  : unsigned int
771 {
772  Secondary = static_cast<unsigned int>(Moose::ElementType::Element),
773  Primary = static_cast<unsigned int>(Moose::ElementType::Neighbor),
774  Lower = static_cast<unsigned int>(Moose::ElementType::Lower)
775 };

◆ PatchUpdateType

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

Enumerator
Never 
Always 
Auto 
Iteration 

Definition at line 952 of file MooseTypes.h.

953 {
954  Never,
955  Always,
956  Auto,
957  Iteration
958 };

◆ PCSideType

Preconditioning side.

Enumerator
PCS_LEFT 
PCS_RIGHT 
PCS_SYMMETRIC 
PCS_DEFAULT 

Use whatever we have in PETSc.

Definition at line 819 of file MooseTypes.h.

820 {
821  PCS_LEFT,
822  PCS_RIGHT,
824  PCS_DEFAULT
825 };
Use whatever we have in PETSc.
Definition: MooseTypes.h:824

◆ RelationshipManagerType

enum Moose::RelationshipManagerType : unsigned char
strong

Main types of Relationship Managers.

Enumerator
DEFAULT 
GEOMETRIC 
ALGEBRAIC 
COUPLING 

Definition at line 963 of file MooseTypes.h.

◆ RESTARTABLE_FILTER

enum 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 791 of file MooseTypes.h.

791  : unsigned char
792 {
794 };

◆ RMSystemType

Enumerator
NONLINEAR 
AUXILIARY 
NONE 

Definition at line 971 of file MooseTypes.h.

972 {
973  NONLINEAR,
974  AUXILIARY,
975  NONE
976 };

◆ SolutionIterationType

enum Moose::SolutionIterationType : unsigned short
strong
Enumerator
Time 
Nonlinear 

Definition at line 241 of file MooseTypes.h.

241  : unsigned short
242 {
243  Time = 0,
244  Nonlinear
245 };

◆ SolutionState

Enumerator
Current 
Old 
Older 
PreviousNL 

Definition at line 233 of file MooseTypes.h.

233  : int
234 {
235  Current = 0,
236  Old = 1,
237  Older = 2,
238  PreviousNL = -1
239 };

◆ 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 842 of file MooseTypes.h.

843 {
844  ST_PJFNK,
845  ST_JFNK,
846  ST_NEWTON,
847  ST_FD,
848  ST_LINEAR
849 };
Full Newton Solve.
Definition: MooseTypes.h:846
Solving a linear problem.
Definition: MooseTypes.h:848
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:845
Use finite differences to compute Jacobian.
Definition: MooseTypes.h:847
Preconditioned Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:844

◆ 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 902 of file MooseTypes.h.

◆ VarFieldType

Enumerator
VAR_FIELD_STANDARD 
VAR_FIELD_SCALAR 
VAR_FIELD_VECTOR 
VAR_FIELD_ARRAY 
VAR_FIELD_ANY 

Definition at line 721 of file MooseTypes.h.

◆ VarKindType

Framework-wide stuff.

Enumerator
VAR_SOLVER 
VAR_AUXILIARY 
VAR_ANY 

Definition at line 714 of file MooseTypes.h.

◆ VectorTagType

Enumerator
VECTOR_TAG_RESIDUAL 
VECTOR_TAG_SOLUTION 
VECTOR_TAG_ANY 

Definition at line 978 of file MooseTypes.h.

◆ 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 884 of file MooseTypes.h.

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 79 of file Moose.C.

Referenced by associateSyntaxInner().

80 {
93  // clang-format off
94  /**************************/
95  /**** Register Actions ****/
96  /**************************/
97  registerMooseObjectTask("create_problem", Problem, false);
98  registerMooseObjectTask("setup_executioner", Executioner, false);
99  registerMooseObjectTask("read_executor", Executor, false);
100  registerTask("add_executor", true);
101 
102  // TODO Organize these somewhere
103  registerTask("init_physics", false);
104  registerTask("init_component_physics", false);
105  registerTask("meta_action_component", false);
106  registerTask("setup_component", false);
107  // 'list_component' is used to retrieve ActionComponents for the syntax JSON
108  registerTask("list_component", false);
109 
110  // This task does not construct an object, but it needs all of the parameters that
111  // would normally be used to construct an object.
112  registerMooseObjectTask("determine_system_type", Executioner, true);
113 
114  registerMooseObjectTask("setup_mesh", MooseMesh, false);
115  registerMooseObjectTask("set_mesh_base", MooseMesh, false);
116  registerMooseObjectTask("init_mesh", MooseMesh, false);
117  registerMooseObjectTask("add_mesh_generator", MeshGenerator, false);
118  registerTask("create_added_mesh_generators", true);
119  registerMooseObjectTask("append_mesh_generator", MeshGenerator, false);
120 
121  registerMooseObjectTask("add_kernel", Kernel, false);
122  appendMooseObjectTask ("add_kernel", EigenKernel);
123  appendMooseObjectTask ("add_kernel", VectorKernel);
124  appendMooseObjectTask ("add_kernel", ArrayKernel);
125 
126  registerMooseObjectTask("add_variable", MooseVariableBase, false);
127  registerMooseObjectTask("add_aux_variable", MooseVariableBase, false);
128  registerMooseObjectTask("add_elemental_field_variable", MooseVariableBase, false);
129 
130  registerMooseObjectTask("add_nodal_kernel", NodalKernel, false);
131 
132  registerMooseObjectTask("add_functor_material", FunctorMaterial, false);
133  registerMooseObjectTask("add_material", MaterialBase, false);
134  appendDeprecatedMooseObjectTask("add_material", FunctorMaterial);
135  registerMooseObjectTask("add_bc", BoundaryCondition, false);
136 
137  registerMooseObjectTask("add_function", Function, false);
138  registerMooseObjectTask("add_distribution", Distribution, false);
139  registerMooseObjectTask("add_sampler", Sampler, false);
140 
141  registerMooseObjectTask("add_aux_kernel", AuxKernel, false);
142  appendMooseObjectTask ("add_aux_kernel", VectorAuxKernel);
143  appendMooseObjectTask ("add_aux_kernel", ArrayAuxKernel);
144  registerMooseObjectTask("add_bound", Bounds, false);
145 
146  registerMooseObjectTask("add_scalar_kernel", ScalarKernel, false);
147  registerMooseObjectTask("add_aux_scalar_kernel", AuxScalarKernel, false);
148  registerMooseObjectTask("add_dirac_kernel", DiracKernel, false);
149  appendMooseObjectTask ("add_dirac_kernel", VectorDiracKernel);
150  registerMooseObjectTask("add_dg_kernel", DGKernel, false);
151  registerMooseObjectTask("add_fv_kernel", FVKernel, false);
152  registerMooseObjectTask("add_linear_fv_kernel", LinearFVKernel, false);
153  registerMooseObjectTask("add_fv_bc", FVBoundaryCondition, false);
154  registerMooseObjectTask("add_linear_fv_bc", LinearFVBoundaryCondition, false);
155  registerMooseObjectTask("add_fv_ik", FVInterfaceKernel, false);
156  registerMooseObjectTask("add_interface_kernel", InterfaceKernel, false);
157  appendMooseObjectTask ("add_interface_kernel", VectorInterfaceKernel);
158  registerMooseObjectTask("add_constraint", Constraint, false);
159  registerMooseObjectTask("add_hybridized_kernel", HDGKernel, false);
160  registerMooseObjectTask("add_hybridized_integrated_bc", HDGIntegratedBC, false);
161 
162  registerMooseObjectTask("add_ic", InitialCondition, false);
163  appendMooseObjectTask ("add_ic", ScalarInitialCondition);
164 
165  registerMooseObjectTask("add_fv_ic", FVInitialCondition, false);
166 
167  registerMooseObjectTask("add_damper", Damper, false);
168  registerMooseObjectTask("setup_predictor", Predictor, false);
169  registerMooseObjectTask("add_time_steppers", TimeStepper, false);
170  registerMooseObjectTask("add_time_stepper", TimeStepper, false);
171  registerTask ("compose_time_stepper", true);
172  registerMooseObjectTask("setup_time_integrators", TimeIntegrator, false);
173  registerMooseObjectTask("setup_time_integrator", TimeIntegrator, false);
174  registerMooseObjectTask("add_convergence", Convergence, false);
175 
176  registerMooseObjectTask("add_preconditioning", MoosePreconditioner, false);
177  registerMooseObjectTask("add_field_split", Split, false);
178 
179  registerMooseObjectTask("add_mesh_division", MeshDivision, false);
180  registerMooseObjectTask("add_user_object", UserObject, false);
181  appendMooseObjectTask ("add_user_object", Postprocessor);
182  appendDeprecatedMooseObjectTask("add_user_object", Corrector);
183  registerMooseObjectTask("add_corrector", Corrector, false);
184  appendDeprecatedMooseObjectTask("add_user_object", MeshModifier);
185  registerMooseObjectTask("add_mesh_modifier", MeshModifier, false);
186 
187  registerMooseObjectTask("add_postprocessor", Postprocessor, false);
188  registerMooseObjectTask("add_vector_postprocessor", VectorPostprocessor, false);
189  registerMooseObjectTask("add_reporter", Reporter, false);
190  registerMooseObjectTask("add_positions", Positions, false);
191  registerMooseObjectTask("add_times", Times, false);
192 
193  registerMooseObjectTask("add_indicator", Indicator, false);
194  registerMooseObjectTask("add_marker", Marker, false);
195 
196  registerMooseObjectTask("add_multi_app", MultiApp, false);
197  registerMooseObjectTask("add_transfer", Transfer, false);
198 
199  registerMooseObjectTask("add_output", Output, false);
200 
201  registerMooseObjectTask("add_control", Control, false);
202  registerMooseObjectTask("add_chain_control", ChainControl, false);
203  registerMooseObjectTask("add_partitioner", MoosePartitioner, false);
204 
205  // clang-format on
206 
207  registerTask("dynamic_object_registration", false);
208  registerTask("common_output", true);
209  registerTask("setup_recover_file_base", true);
210  registerTask("recover_meta_data", true);
211 
212  registerTask("add_bounds_vectors", false);
213  registerTask("add_periodic_bc", false);
214  registerTask("add_aux_variable", false);
215  registerTask("add_external_aux_variables", true);
216  registerTask("add_variable", false);
217  registerTask("add_mortar_variable", false);
218 
219  registerTask("execute_mesh_generators", true);
220  registerTask("uniform_refine_mesh", false);
221  registerTask("prepare_mesh", false);
222  registerTask("delete_remote_elements_after_late_geometric_ghosting", false);
223  registerTask("setup_mesh_complete", true); // calls prepare
224  registerTask("post_mesh_prepared", false);
225  registerTask("add_geometric_rm", false);
226  registerTask("attach_geometric_rm", true);
227  registerTask("attach_geometric_rm_final", true);
228 
229  registerTask("init_displaced_problem", false);
230 
231  registerTask("add_algebraic_rm", false);
232  registerTask("attach_algebraic_rm", true);
233  registerTask("add_coupling_rm", false);
234  registerTask("attach_coupling_rm", true);
235  registerTask("init_problem", true);
236  registerTask("check_copy_nodal_vars", true);
237  registerTask("copy_nodal_vars", true);
238  registerTask("copy_nodal_aux_vars", true);
239  registerTask("copy_vars_physics", false);
240  registerTask("setup_postprocessor_data", false);
241  registerTask("setup_time_steppers", true);
242 
243  registerTask("setup_dampers", true);
244  registerTask("check_integrity", true);
245  registerTask("resolve_optional_materials", true);
246  registerTask("check_integrity_early", true);
247  registerTask("check_integrity_early_physics", false);
248  registerTask("setup_quadrature", true);
249 
250  registerTask("mesh_modifiers", false);
251 
253  registerTask("no_action", false); // Used for Empty Action placeholders
254  registerTask("set_global_params", false);
255  registerTask("setup_adaptivity", false);
256  registerTask("meta_action", false);
257  registerTask("setup_residual_debug", false);
258  registerTask("setup_oversampling", false);
259  registerTask("deprecated_block", false);
260  registerTask("set_adaptivity_options", false);
261  registerTask("add_mortar_interface", false);
262  registerTask("coupling_functor_check", true);
263  registerTask("add_master_action_material", false);
264  registerTask("setup_projected_properties", false);
265  registerTask("create_application_block", false);
266 
267  // Dummy Actions (useful for sync points in the dependencies)
268  registerTask("setup_function_complete", false);
269  registerTask("setup_variable_complete", false);
270  registerTask("setup_executioner_complete", false);
271  registerTask("ready_to_init", true);
272 
273  // Output related actions
274  registerTask("add_output_aux_variables", true);
275  registerTask("check_output", true);
276  registerTask("declare_late_reporters", true);
277 
278  registerTask("create_problem_default", true);
279  registerTask("create_problem_custom", false);
280  registerTask("create_problem_complete", false);
281 
282  registerTask("add_default_nonlinear_convergence", true);
283  registerTask("add_default_multiapp_fixed_point_convergence", true);
284 
285  registerTask("chain_control_setup", true);
286 
287  // Action for setting up the signal-based checkpoint
288  registerTask("auto_checkpoint_action", true);
289  /**************************/
290  /****** Dependencies ******/
291  /**************************/
302  // clang-format off
303  syntax.addDependencySets("(meta_action)"
304  "(meta_action_component)"
305  "(dynamic_object_registration)"
306  "(common_output)"
307  "(set_global_params)"
308  "(setup_recover_file_base)"
309  "(check_copy_nodal_vars)"
310  "(setup_mesh)"
311  "(add_geometric_rm)"
312  "(add_partitioner)"
313  "(add_mesh_generator)"
314  "(create_added_mesh_generators)"
315  "(append_mesh_generator)"
316  "(execute_mesh_generators)"
317  "(recover_meta_data)"
318  "(set_mesh_base)"
319  "(attach_geometric_rm)"
320  "(init_mesh)"
321  "(prepare_mesh)"
322  "(add_mortar_interface)"
323  "(uniform_refine_mesh)"
324  "(setup_mesh_complete)"
325  "(post_mesh_prepared)"
326  "(determine_system_type)"
327  "(create_problem)"
328  "(create_problem_custom)"
329  "(create_problem_default)"
330  "(create_problem_complete)"
331  "(init_displaced_problem)" // Problem must be init-ed before we start adding functors
332  "(add_function)" // Functions can depend on scalar variables & PPs, but this dependence can be
333  // added on initialSetup() rather than construction
334  "(init_component_physics)" // components must add their blocks to physics before init_physics
335  "(init_physics)"
336  "(setup_postprocessor_data)"
337  "(setup_time_integrator, setup_time_integrators)"
338  "(setup_executioner)"
339  "(setup_executioner_complete)"
340  "(setup_component)" // no particular reason for that placement
341  "(read_executor)"
342  "(add_executor)"
343  "(check_integrity_early)"
344  "(setup_predictor)"
345  "(add_aux_variable, add_variable, add_elemental_field_variable,"
346  " add_external_aux_variables)"
347  "(add_mortar_variable)"
348  "(setup_variable_complete)"
349  "(check_integrity_early_physics)" // checks that systems and variables are consistent
350  "(setup_quadrature)"
351  "(add_convergence)"
352  "(add_default_nonlinear_convergence,"
353  " add_default_multiapp_fixed_point_convergence)"
354  "(add_periodic_bc)"
355  "(add_user_object, add_corrector, add_mesh_modifier)"
356  "(add_distribution)"
357  "(add_sampler)"
358  "(setup_function_complete)"
359  "(setup_adaptivity)"
360  "(set_adaptivity_options)"
361  "(add_ic, add_fv_ic)"
362  "(add_constraint, add_field_split)"
363  "(add_preconditioning)"
364  "(add_times)"
365  "(add_time_stepper, add_time_steppers)"
366  "(compose_time_stepper)"
367  "(setup_time_steppers)"
368  "(ready_to_init)"
369  "(setup_dampers)"
370  "(setup_residual_debug)"
371  "(add_bounds_vectors)"
372  "(add_positions)"
373  "(add_mesh_division)" // NearestPositionsDivision uses a Positions
374  "(add_multi_app)"
375  "(add_transfer)"
376  "(copy_nodal_vars, copy_nodal_aux_vars, copy_vars_physics)"
377  "(add_material)"
378  "(add_master_action_material)"
379  "(add_functor_material)"
380  "(setup_projected_properties)"
381  "(add_output_aux_variables)"
382  "(add_output)"
383  "(auto_checkpoint_action)"
384  "(add_postprocessor)"
385  "(add_vector_postprocessor)" // MaterialVectorPostprocessor requires this
386  // to be after material objects are created.
387  "(add_reporter)"
388  "(declare_late_reporters)"
389  "(add_aux_kernel, add_bc, add_damper, add_dirac_kernel, add_kernel,"
390  " add_nodal_kernel, add_dg_kernel, add_fv_kernel, add_linear_fv_kernel,"
391  " add_fv_bc, add_linear_fv_bc, add_fv_ik, add_interface_kernel,"
392  " add_scalar_kernel, add_aux_scalar_kernel, add_indicator, add_marker,"
393  " add_bound, add_hybridized_kernel, add_hybridized_integrated_bc)"
394  "(resolve_optional_materials)"
395  "(add_algebraic_rm)"
396  "(add_coupling_rm)"
397  "(attach_geometric_rm_final)"
398  "(attach_algebraic_rm)"
399  "(attach_coupling_rm)"
400  "(coupling_functor_check)"
401  "(delete_remote_elements_after_late_geometric_ghosting)"
402  "(init_problem)"
403  "(add_control, add_chain_control)"
404  "(chain_control_setup)"
405  "(check_output)"
406  "(check_integrity)"
407  "(create_application_block)");
408  // clang-format on
409 
410 #ifdef MOOSE_MFEM_ENABLED
411  registerTask("add_mfem_problem_operator", true);
412  addTaskDependency("add_mfem_problem_operator", "init_mesh");
413  addTaskDependency("add_variable", "add_mfem_problem_operator");
414  addTaskDependency("add_aux_variable", "add_mfem_problem_operator");
415  addTaskDependency("add_elemental_field_variable", "add_mfem_problem_operator");
416  addTaskDependency("add_kernel", "add_mfem_problem_operator");
417 
418  // add SubMeshes
419  registerMooseObjectTask("add_mfem_submeshes", MFEMSubMesh, false);
420  addTaskDependency("add_mfem_submeshes", "create_problem_complete");
421 
422  // add SubMesh transfers
423  appendMooseObjectTask("add_transfer", MFEMSubMeshTransfer);
424 
425  // add FESpaces
426  registerMooseObjectTask("add_mfem_fespaces", MFEMFESpace, false);
427  appendMooseObjectTask("add_mfem_fespaces", MFEMFECollection);
428  addTaskDependency("add_mfem_fespaces", "add_mfem_submeshes");
429  addTaskDependency("add_variable", "add_mfem_fespaces");
430  addTaskDependency("add_aux_variable", "add_mfem_fespaces");
431  addTaskDependency("add_elemental_field_variable", "add_mfem_fespaces");
432  addTaskDependency("add_kernel", "add_mfem_fespaces");
433 
434  // set mesh FE space
435  registerTask("set_mesh_fe_space", true);
436  addTaskDependency("set_mesh_fe_space", "add_variable");
437  addTaskDependency("set_mesh_fe_space", "init_mesh");
438 
439  // add preconditioning.
440  registerMooseObjectTask("add_mfem_preconditioner", MFEMSolverBase, false);
441  addTaskDependency("add_mfem_preconditioner", "add_mfem_problem_operator");
442  addTaskDependency("add_mfem_preconditioner", "add_variable");
443 
444  // add solver.
445  registerMooseObjectTask("add_mfem_solver", MFEMSolverBase, true);
446  addTaskDependency("add_mfem_solver", "add_mfem_preconditioner");
447  addTaskDependency("add_mfem_solver", "add_mfem_problem_operator");
448 #endif
449 
450  registerTask("parse_neml2", /*required=*/false);
451  addTaskDependency("add_material", "parse_neml2");
452  addTaskDependency("add_user_object", "parse_neml2");
453 }
Base class for function objects.
Definition: Function.h:36
A kernel for hybridized finite element formulations.
Definition: HDGKernel.h:17
Base class for boundary conditions for linear FV systems.
Base class for split-based preconditioners.
Definition: Split.h:25
Base class for finite volume kernels that contribute to a linear systems.
This is the base class for Samplers as used within the Stochastic Tools module.
Definition: Sampler.h:43
Base class for predictors.
Definition: Predictor.h:28
Base class for creating new types of boundary conditions.
InterfaceKernel and VectorInterfaceKernel is responsible for interfacing physics across subdomains...
This is a template class that implements the workhorse compute and computeNodal methods.
Base class for all Constraint types.
Definition: Constraint.h:19
Positions objects are under the hood Reporters.
Definition: Positions.h:20
Class that hold the whole problem being solved.
Definition: Problem.h:19
Definition: Marker.h:41
Base class for time stepping.
Definition: TimeStepper.h:22
Times objects are under the hood Reporters, but limited to a vector of Real.
Definition: Times.h:18
All Distributions should inherit from this class.
Definition: Distribution.h:18
Class to transfer MFEM variable data to or from a restricted copy of the variable defined on an a sub...
Base class for MeshDivision objects.
Definition: MeshDivision.h:35
Reporter objects allow for the declaration of arbitrary data types that are aggregate values for a si...
Definition: Reporter.h:47
Base class for MOOSE preconditioners.
Based class for output objects.
Definition: Output.h:43
FunctorMaterials compute functor material properties.
Base class for convergence criteria.
Definition: Convergence.h:21
The DGKernel class is responsible for calculating the residuals for various physics on internal sides...
Definition: DGKernel.h:18
Base class for making kernels that work on auxiliary scalar variables.
Base class for construction of a mfem::ParSubMesh object.
Definition: MFEMSubMesh.h:22
Base class for creating kernels that interface physics between subdomains.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:88
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:30
Base class for all Postprocessors.
Definition: Postprocessor.h:23
The behavior of this kernel is controlled by one problem-wise global parameter eigen_on_current - boo...
Definition: EigenKernel.h:23
InitialConditions are objects that set the initial value of variables.
A DiracKernel is used when you need to add contributions to the residual by means of multiplying some...
Definition: DiracKernel.h:19
Constructs and stores an mfem::ParFiniteElementSpace object.
Definition: MFEMFESpace.h:22
void addDependencySets(const std::string &action_sets)
Adds all dependencies in a single call.
Definition: Syntax.C:69
FVKernel is a base class for all finite volume method kernels.
Definition: FVKernel.h:32
Base class for creating new types of boundary conditions.
Base class for time integrators.
Base class for Control objects.
Definition: Control.h:33
Base class for MOOSE partitioner.
Base class for wrapping mfem::Solver-derived classes.
Base class for deriving dampers.
Definition: Damper.h:24
Definition: Kernel.h:15
Base class for creating nodal kernels with hand-coded Jacobians.
Definition: NodalKernel.h:17
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition: MultiApp.h:112
Base class for Postprocessors that produce a vector of values.
MaterialBases compute MaterialProperties.
Definition: MaterialBase.h:62
MeshGenerators are objects that can modify or add to an existing mesh.
Definition: MeshGenerator.h:32
This is a template class that implements the workhorse compute and computeNodal methods.
Base class for user-specific data.
Definition: UserObject.h:40
The Executor class directs the execution flow of simulations.
Definition: Executor.h:26
Control that additionally provides the capability to produce/consume data values, to allow control op...
Definition: ChainControl.h:21
Base class for all Transfer objects.
Definition: Transfer.h:36

◆ adOffset() [1/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 79 of file ADUtils.h.

Referenced by adOffset(), and globalDofIndexToDerivative().

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

◆ adOffset() [2/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 109 of file ADUtils.h.

113 {
114  if (dg_jacobian_type == DGJacobianType::ElementElement ||
115  dg_jacobian_type == DGJacobianType::NeighborElement)
116  return adOffset(var_num, max_dofs_per_elem, ElementType::Element);
117  else
118  return adOffset(var_num, max_dofs_per_elem, ElementType::Neighbor, num_vars_in_system);
119 }
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)
Definition: ADUtils.h:109

◆ 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 108 of file IndirectSort.h.

Referenced by ElementMaterialSampler::sortVecs().

109 {
110  T tmp;
111  tmp.resize(container.size());
112  for (size_t i = 0; i < indices.size(); i++)
113  tmp[i] = container[indices[i]];
114  std::swap(tmp, container);
115 }
void swap(std::vector< T > &data, const std::size_t idx0, const std::size_t idx1, const libMesh::Parallel::Communicator &comm)
Swap function for serial or distributed vector of data.
Definition: Shuffle.h:494

◆ assemble_matrix() [1/2]

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

Referenced by EigenProblem::init().

◆ assemble_matrix() [2/2]

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

Definition at line 44 of file NonlinearEigenSystem.C.

45 {
46  EigenProblem * p = es.parameters.get<EigenProblem *>("_eigen_problem");
47  CondensedEigenSystem & eigen_system = es.get_system<CondensedEigenSystem>(system_name);
48  NonlinearEigenSystem & eigen_nl =
49  p->getNonlinearEigenSystem(/*nl_sys_num=*/eigen_system.number());
50 
51  // If this is a nonlinear eigenvalue problem,
52  // we do not need to assemble anything
53  if (p->isNonlinearEigenvalueSolver(eigen_nl.number()))
54  {
55  // If you want an efficient eigensolver,
56  // please use PETSc 3.13 or newer.
57  // We need to do an unnecessary assembly,
58  // if you use PETSc that is older than 3.13.
59 #if PETSC_RELEASE_LESS_THAN(3, 13, 0)
60  if (eigen_system.has_matrix_B())
61  p->computeJacobianTag(*eigen_system.current_local_solution,
62  eigen_system.get_matrix_B(),
63  eigen_nl.eigenMatrixTag());
64 #endif
65  return;
66  }
67 
68 #if !PETSC_RELEASE_LESS_THAN(3, 13, 0)
69  // If we use shell matrices and do not use a shell preconditioning matrix,
70  // we only need to form a preconditioning matrix
71  if (eigen_system.use_shell_matrices() && !eigen_system.use_shell_precond_matrix())
72  {
73  p->computeJacobianTag(*eigen_system.current_local_solution,
74  eigen_system.get_precond_matrix(),
75  eigen_nl.precondMatrixTag());
76  return;
77  }
78 #endif
79  // If it is a linear generalized eigenvalue problem,
80  // we assemble A and B together
81  if (eigen_system.generalized())
82  {
83  p->computeJacobianAB(*eigen_system.current_local_solution,
84  eigen_system.get_matrix_A(),
85  eigen_system.get_matrix_B(),
86  eigen_nl.nonEigenMatrixTag(),
87  eigen_nl.eigenMatrixTag());
88 #if LIBMESH_HAVE_SLEPC
89  if (p->negativeSignEigenKernel())
90  LibmeshPetscCallA(
91  p->comm().get(),
92  MatScale(static_cast<PetscMatrix<Number> &>(eigen_system.get_matrix_B()).mat(), -1.0));
93 #endif
94  return;
95  }
96 
97  // If it is a linear eigenvalue problem, we assemble matrix A
98  {
99  p->computeJacobianTag(*eigen_system.current_local_solution,
100  eigen_system.get_matrix_A(),
101  eigen_nl.nonEigenMatrixTag());
102 
103  return;
104  }
105 }
Nonlinear eigenvalue system to be solved.
bool negativeSignEigenKernel() const
A flag indicates if a negative sign is used in eigen kernels.
Definition: EigenProblem.h:57
const Parallel::Communicator & comm() const
const T_sys & get_system(std::string_view name) const
bool isNonlinearEigenvalueSolver(unsigned int eigen_sys_num) const
Definition: EigenProblem.C:676
const T & get(std::string_view) const
NonlinearEigenSystem & getNonlinearEigenSystem(const unsigned int nl_sys_num)
Definition: EigenProblem.h:299
Problem for solving eigenvalue problems.
Definition: EigenProblem.h:21
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.
Definition: EigenProblem.C:259
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.
Definition: EigenProblem.C:176

◆ associateSyntax()

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

Definition at line 720 of file Moose.C.

721 {
722  associateSyntaxInner(syntax, action_factory);
723  registerActions(syntax, action_factory);
724 }
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:484
void associateSyntaxInner(Syntax &syntax, ActionFactory &action_factory)
Definition: Moose.C:503

◆ 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 503 of file Moose.C.

Referenced by associateSyntax(), and registerAll().

504 {
510  registerSyntax("DiffusionCG", "Physics/Diffusion/ContinuousGalerkin/*");
511  registerSyntax("DiffusionFV", "Physics/Diffusion/FiniteVolume/*");
512 
513  registerSyntax("AddActionComponentAction", "ActionComponents/*");
514  registerSyntax("CombineComponentsMeshes", "ActionComponents");
515 
516  registerSyntaxTask("CopyNodalVarsAction", "Variables/*", "check_copy_nodal_vars");
517  registerSyntaxTask("CopyNodalVarsAction", "Variables/*", "copy_nodal_vars");
518  registerSyntaxTask("CopyNodalVarsAction", "AuxVariables/*", "check_copy_nodal_vars");
519  registerSyntaxTask("CopyNodalVarsAction", "AuxVariables/*", "copy_nodal_aux_vars");
520 
521  registerSyntaxTask("AddKernelAction", "Kernels/*", "add_kernel");
522  registerSyntaxTask("AddNodalKernelAction", "NodalKernels/*", "add_nodal_kernel");
523  registerSyntaxTask("AddKernelAction", "AuxKernels/*", "add_aux_kernel");
524 
525  registerSyntaxTask("AddHDGKernelAction", "HDGKernels/*", "add_hybridized_kernel");
526 
527  registerSyntax("AddAuxKernelAction", "AuxVariables/*/AuxKernel");
528 
529  registerSyntaxTask("AddScalarKernelAction", "ScalarKernels/*", "add_scalar_kernel");
530  registerSyntaxTask("AddScalarKernelAction", "AuxScalarKernels/*", "add_aux_scalar_kernel");
531 
532  registerSyntaxTask("AddBCAction", "BCs/*", "add_bc");
533 
534  registerSyntax("CreateProblemAction", "Problem");
535  registerSyntax("DynamicObjectRegistrationAction", "Problem");
536 
537  registerSyntax("SetupMeshAction", "Mesh");
538  registerSyntax("SetupMeshCompleteAction", "Mesh");
539  // Components should be able create a Mesh without a Mesh block
540  registerSyntax("CreateMeshSetupActionsForComponents", "ActionComponents");
541  registerSyntax("CreateDisplacedProblemAction", "Mesh");
542  registerSyntax("DisplayGhostingAction", "Mesh");
543  registerSyntax("AddMeshGeneratorAction", "Mesh/*");
544  registerSyntaxTask("EmptyAction", "Mesh/BatchMeshGeneratorAction", "no_action");
545  registerSyntax("BatchMeshGeneratorAction", "Mesh/BatchMeshGeneratorAction/*");
546  registerSyntax("ElementIDOutputAction", "Mesh");
547  syntax.registerSyntaxType("Mesh/*", "MeshGeneratorName");
548 
549  registerSyntax("AddFunctionAction", "Functions/*");
550  syntax.registerSyntaxType("Functions/*", "FunctionName");
551 
552  registerSyntax("AddMeshDivisionAction", "MeshDivisions/*");
553  syntax.registerSyntaxType("MeshDivisions/*", "MeshDivisionName");
554  registerSyntax("AddConvergenceAction", "Convergence/*");
555  syntax.registerSyntaxType("Convergence/*", "ConvergenceName");
556 
557  registerSyntax("GlobalParamsAction", "GlobalParams");
558 
559  registerSyntax("AddDistributionAction", "Distributions/*");
560  syntax.registerSyntaxType("Distributions/*", "DistributionName");
561 
562  registerSyntax("AddSamplerAction", "Samplers/*");
563  syntax.registerSyntaxType("Samplers/*", "SamplerName");
564 
565  registerSyntax("SetupDebugAction", "Debug");
566  registerSyntax("SetupResidualDebugAction", "Debug");
567 
569  registerSyntax("AddVariableAction", "Variables/*");
570  syntax.registerSyntaxType("Variables/*", "VariableName");
571  syntax.registerSyntaxType("Variables/*", "NonlinearVariableName");
572 
573  registerSyntax("AddICAction", "Variables/*/InitialCondition");
574  registerSyntax("AddFVICAction", "Variables/*/FVInitialCondition");
575 
576  registerSyntax("AddAuxVariableAction", "AuxVariables/*");
577  syntax.registerSyntaxType("AuxVariables/*", "VariableName");
578  syntax.registerSyntaxType("AuxVariables/*", "AuxVariableName");
579 
580  registerSyntax("AddICAction", "AuxVariables/*/InitialCondition");
581  registerSyntax("AddFVICAction", "AuxVariables/*/FVInitialCondition");
582 
583  registerSyntaxTask("EmptyAction", "BCs/Periodic", "no_action"); // placeholder
584  registerSyntax("AddPeriodicBCAction", "BCs/Periodic/*");
585 
586  registerSyntaxTask("AddInitialConditionAction", "ICs/*", "add_ic");
587  registerSyntaxTask("AddFVInitialConditionAction", "FVICs/*", "add_fv_ic");
588 
589  registerSyntax("AddMaterialAction", "Materials/*");
590  syntax.registerSyntaxType("Materials/*", "MaterialName");
591 
592  registerSyntax("AddFunctorMaterialAction", "FunctorMaterials/*");
593  syntax.registerSyntaxType("FunctorMaterials/*", "MaterialName");
594 
595  registerSyntax("AddPostprocessorAction", "Postprocessors/*");
596  syntax.registerSyntaxType("Postprocessors/*", "PostprocessorName");
597  syntax.registerSyntaxType("Postprocessors/*", "UserObjectName");
598 
599  registerSyntax("AddVectorPostprocessorAction", "VectorPostprocessors/*");
600  syntax.registerSyntaxType("VectorPostprocessors/*", "VectorPostprocessorName");
601 
602  registerSyntax("AddReporterAction", "Reporters/*");
603  syntax.registerSyntaxType("Reporters/*", "ReporterName");
604 
605  registerSyntax("AddPositionsAction", "Positions/*");
606  syntax.registerSyntaxType("Positions/*", "PositionsName");
607 
608  registerSyntax("AddTimesAction", "Times/*");
609  syntax.registerSyntaxType("Times/*", "TimesName");
610 
611  registerSyntax("AddDamperAction", "Dampers/*");
612 
613  registerSyntax("AddOutputAction", "Outputs/*");
614  registerSyntax("CommonOutputAction", "Outputs");
615  registerSyntax("MaterialOutputAction", "Outputs");
616  registerSyntax("AutoCheckpointAction", "Outputs");
617  syntax.registerSyntaxType("Outputs/*", "OutputName");
618 
619  // Note: Preconditioner Actions will be built by this setup action
620  registerSyntax("SetupPreconditionerAction", "Preconditioning/*");
621  registerSyntax("AddFieldSplitAction", "Preconditioning/*/*");
622 
623  registerSyntax("CreateExecutionerAction", "Executioner");
624  registerSyntax("ReadExecutorParamsAction", "Executors/*");
625 
626  registerSyntaxTask("AddTimeStepperAction", "Executioner/TimeSteppers/*", "add_time_steppers");
627  registerSyntaxTask("AddTimeStepperAction", "Executioner/TimeStepper", "add_time_stepper");
628  registerSyntaxTask(
629  "ComposeTimeStepperAction", "Executioner/TimeSteppers", "compose_time_stepper");
630  registerSyntaxTask(
631  "SetupTimeIntegratorAction", "Executioner/TimeIntegrators/*", "setup_time_integrators");
632  registerSyntaxTask(
633  "SetupTimeIntegratorAction", "Executioner/TimeIntegrator", "setup_time_integrator");
634  syntax.registerSyntaxType("Executors/*", "ExecutorName");
635 
636  registerSyntax("SetupQuadratureAction", "Executioner/Quadrature");
637  registerSyntax("SetupPredictorAction", "Executioner/Predictor");
638 #ifdef LIBMESH_ENABLE_AMR
639  registerSyntax("AdaptivityAction", "Executioner/Adaptivity");
640 #endif
641 
642  registerSyntax("PartitionerAction", "Mesh/Partitioner");
643 
644  registerSyntax("AddDiracKernelAction", "DiracKernels/*");
645 
646  registerSyntax("AddDGKernelAction", "DGKernels/*");
647  registerSyntax("AddFVKernelAction", "FVKernels/*");
648  registerSyntax("AddFVBCAction", "FVBCs/*");
649  registerSyntax("AddLinearFVBCAction", "LinearFVBCs/*");
650  registerSyntax("AddFVInterfaceKernelAction", "FVInterfaceKernels/*");
651  registerSyntax("CheckFVBCAction", "FVBCs");
652 
653  registerSyntax("AddLinearFVKernelAction", "LinearFVKernels/*");
654 
655  registerSyntax("AddInterfaceKernelAction", "InterfaceKernels/*");
656 
657  registerSyntax("AddConstraintAction", "Constraints/*");
658 
659  registerSyntax("AddControlAction", "Controls/*");
660  registerSyntax("AddChainControlAction", "ChainControls/*");
661  registerSyntax("AddBoundAction", "Bounds/*");
662  registerSyntax("AddBoundsVectorsAction", "Bounds");
663 
664  // UserObject and some derived classes
665  registerSyntax("AddUserObjectAction", "UserObjects/*");
666  syntax.registerSyntaxType("UserObjects/*", "UserObjectName");
667  registerSyntax("AddCorrectorAction", "Correctors/*");
668  syntax.registerSyntaxType("Correctors/*", "UserObjectName");
669  registerSyntax("AddMeshModifiersAction", "MeshModifiers/*");
670  syntax.registerSyntaxType("MeshModifiers/*", "UserObjectName");
671 
672  registerSyntax("AddNodalNormalsAction", "NodalNormals");
673 
674  // Indicator
675  registerSyntax("AddElementalFieldAction", "Adaptivity/Indicators/*");
676  registerSyntax("AddIndicatorAction", "Adaptivity/Indicators/*");
677  syntax.registerSyntaxType("Adaptivity/Indicators/*", "IndicatorName");
678 
679  // Marker
680  registerSyntax("AddElementalFieldAction", "Adaptivity/Markers/*");
681  registerSyntax("AddMarkerAction", "Adaptivity/Markers/*");
682  syntax.registerSyntaxType("Adaptivity/Markers/*", "MarkerName");
683 
684  // New Adaptivity System
685  registerSyntax("SetAdaptivityOptionsAction", "Adaptivity");
686 
687  // Deprecated Block
688  registerSyntax("DeprecatedBlockAction", "DeprecatedBlock");
689 
690  // Multi Apps
691  registerSyntax("AddMultiAppAction", "MultiApps/*");
692  syntax.registerSyntaxType("MultiApps/*", "MultiAppName");
693 
694  // Transfers
695  registerSyntax("AddTransferAction", "Transfers/*");
696 
697  // Material derivative test
698  registerSyntaxTask("EmptyAction", "Debug/MaterialDerivativeTest", "no_action"); // placeholder
699  registerSyntax("MaterialDerivativeTestAction", "Debug/MaterialDerivativeTest/*");
700 
701  registerSyntax("ProjectedStatefulMaterialStorageAction", "ProjectedStatefulMaterialStorage/*");
702 
703  // Application Block System
704  registerSyntax("CreateApplicationBlockAction", "Application");
705 
706 #ifdef MOOSE_MFEM_ENABLED
707  registerSyntaxTask("AddMFEMSubMeshAction", "SubMeshes/*", "add_mfem_submeshes");
708  registerSyntaxTask("AddMFEMFESpaceAction", "FESpaces/*", "add_mfem_fespaces");
709  registerSyntaxTask("AddMFEMPreconditionerAction", "Preconditioner/*", "add_mfem_preconditioner");
710  registerSyntaxTask("AddMFEMSolverAction", "Solver", "add_mfem_solver");
711 #endif
712 
713  registerSyntax("NEML2ActionCommon", "NEML2");
714  registerSyntax("NEML2Action", "NEML2/*");
715 
716  addActionTypes(syntax);
717 }
void registerSyntaxType(const std::string &syntax, const std::string &type)
Register a type with a block.
Definition: Syntax.C:362
void addActionTypes(Syntax &syntax)
Definition: Moose.C:79

◆ Builder::setScalarParameter< ReporterName, std::string >()

template<>
void Moose::Builder::setScalarParameter< ReporterName, std::string > ( const std::string &  full_name,
const std::string &  short_name,
InputParameters::Parameter< ReporterName > *  param,
bool  in_global,
GlobalParamsAction global_block 
)

Definition at line 2090 of file Builder.C.

2096 {
2097  std::vector<std::string> names =
2098  MooseUtils::rsplit(root()->param<std::string>(full_name), "/", 2);
2099  if (names.size() != 2)
2100  _errmsg += hit::errormsg(root()->find(full_name),
2101  "The supplied name ReporterName '",
2102  full_name,
2103  "' must contain the '/' delimiter.");
2104  else
2105  param->set() = ReporterName(names[0], names[1]);
2106 }
std::vector< std::string > rsplit(const std::string &str, const std::string &delimiter, std::size_t max_count=std::numeric_limits< std::size_t >::max())
Definition: MooseUtils.C:1146
The Reporter system is comprised of objects that can contain any number of data values.
Definition: ReporterName.h:30

◆ Builder::setVectorParameter< CLIArgString, std::string >()

template<>
void Moose::Builder::setVectorParameter< CLIArgString, std::string > ( const std::string &  full_name,
const std::string &  short_name,
InputParameters::Parameter< std::vector< CLIArgString >> *  param,
bool  in_global,
GlobalParamsAction global_block 
)

Definition at line 2315 of file Builder.C.

2321 {
2322  // Parsed as a vector of string, the vectors parameters are being cut
2323  auto rnames = root()->param<std::vector<std::string>>(full_name);
2324  param->set().resize(rnames.size()); // slightly oversized if vectors have been split
2325 
2326  // Skip empty parameter
2327  if (rnames.empty())
2328  return;
2329 
2330  // Re-assemble vector parameters
2331  unsigned int i_param = 0;
2332  bool vector_param_detected = false;
2333  for (unsigned int i = 0; i < rnames.size(); ++i)
2334  {
2335  // Look for a quote, both types
2336  std::vector<std::string> double_split =
2338  std::vector<std::string> single_split =
2340  if (double_split.size() + single_split.size() >= 3)
2341  // Either entering or exiting a vector parameter (>3 is entering another vector)
2342  // Even and >2 number of quotes means both finished and started another vector parameter
2343  if ((double_split.size() + single_split.size()) % 2 == 1)
2344  vector_param_detected = !vector_param_detected;
2345 
2346  // We're building a vector parameters, just append the text, rebuild the spaces
2347  if (vector_param_detected)
2348  param->set()[i_param] += rnames[i] + ' ';
2349  else
2350  {
2351  param->set()[i_param] += rnames[i];
2352  i_param++;
2353  }
2354  }
2355  // Use actual size after re-forming vector parameters
2356  param->set().resize(i_param);
2357 }
auto max(const L &left, const R &right)
std::vector< std::string > rsplit(const std::string &str, const std::string &delimiter, std::size_t max_count=std::numeric_limits< std::size_t >::max())
Definition: MooseUtils.C:1146

◆ Builder::setVectorParameter< ReporterName, std::string >()

template<>
void Moose::Builder::setVectorParameter< ReporterName, std::string > ( const std::string &  full_name,
const std::string &  short_name,
InputParameters::Parameter< std::vector< ReporterName >> *  param,
bool  in_global,
GlobalParamsAction global_block 
)

Definition at line 2290 of file Builder.C.

2296 {
2297  auto rnames = root()->param<std::vector<std::string>>(full_name);
2298  param->set().resize(rnames.size());
2299 
2300  for (unsigned int i = 0; i < rnames.size(); ++i)
2301  {
2302  std::vector<std::string> names = MooseUtils::rsplit(rnames[i], "/", 2);
2303  if (names.size() != 2)
2304  _errmsg += hit::errormsg(root()->find(full_name),
2305  "The supplied name ReporterName '",
2306  rnames[i],
2307  "' must contain the '/' delimiter.");
2308  else
2309  param->set()[i] = ReporterName(names[0], names[1]);
2310  }
2311 }
std::vector< std::string > rsplit(const std::string &str, const std::string &delimiter, std::size_t max_count=std::numeric_limits< std::size_t >::max())
Definition: MooseUtils.C:1146
The Reporter system is comprised of objects that can contain any number of data values.
Definition: ReporterName.h:30

◆ colorConsole()

bool Moose::colorConsole ( )

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

Definition at line 744 of file Moose.C.

745 {
746  return _color_console;
747 }
static bool _color_console
Definition: Moose.C:741

◆ commonAdaptivityParams()

InputParameters Moose::commonAdaptivityParams ( )

Definition at line 23 of file SetAdaptivityOptionsAction.C.

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

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.addParam<Real>("start_time",
36  "The time that adaptivity will be active after.");
37  params.addParam<Real>("stop_time",
39  "The time after which adaptivity will no longer be active.");
40  params.addParam<unsigned int>(
41  "cycles_per_step",
42  1,
43  "The number of adaptive steps to use when on each timestep during a Transient simulation.");
44  params.addParam<bool>(
45  "recompute_markers_during_cycles", false, "Recompute markers during adaptivity cycles");
46  params.addParam<bool>("switch_h_to_p_refinement", false, "True to perform p-refinement");
47  return params;
48 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
auto max(const L &left, const R &right)
static InputParameters validParams()
Definition: Action.C:24
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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 addRangeCheckedParam(const std::string &name, const T &value, const std::string &parsed_function, const std::string &doc_string)

◆ compute_bounds()

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

Definition at line 48 of file NonlinearSystem.C.

Referenced by NonlinearSystem::NonlinearSystem().

51 {
52  FEProblemBase * p =
53  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
54  p->computeBounds(sys, lower, upper);
55 }
const EquationSystems & get_equation_systems() const
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const T & get(std::string_view) const
virtual void computeBounds(libMesh::NonlinearImplicitSystem &sys, NumericVector< libMesh::Number > &lower, NumericVector< libMesh::Number > &upper)

◆ compute_jacobian()

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

Definition at line 38 of file NonlinearSystem.C.

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

41 {
42  FEProblemBase * p =
43  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
44  p->computeJacobianSys(sys, soln, jacobian);
45 }
const EquationSystems & get_equation_systems() const
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void computeJacobianSys(libMesh::NonlinearImplicitSystem &sys, const NumericVector< libMesh::Number > &soln, libMesh::SparseMatrix< libMesh::Number > &jacobian)
Form a Jacobian matrix.
const T & get(std::string_view) const

◆ compute_linear_system()

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

Definition at line 64 of file LinearSystem.C.

Referenced by LinearSystem::LinearSystem().

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 }
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
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. ...
const T & get(std::string_view) const
LinearSystem & getLinearSystem(unsigned int sys_num)
Get non-constant reference to a linear system.
unsigned int linearSysNum(const LinearSystemName &linear_sys_name) const override

◆ compute_nearnullspace()

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

Definition at line 75 of file NonlinearSystem.C.

Referenced by NonlinearSystem::NonlinearSystem().

76 {
77  FEProblemBase * p =
78  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
79  p->computeNearNullSpace(sys, sp);
80 }
const EquationSystems & get_equation_systems() const
virtual void computeNearNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > *> &sp)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const T & get(std::string_view) const

◆ compute_nullspace()

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

Definition at line 58 of file NonlinearSystem.C.

Referenced by NonlinearSystem::NonlinearSystem().

59 {
60  FEProblemBase * p =
61  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
62  p->computeNullSpace(sys, sp);
63 }
const EquationSystems & get_equation_systems() const
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const T & get(std::string_view) const
virtual void computeNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > *> &sp)

◆ 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 83 of file NonlinearSystem.C.

Referenced by NonlinearSystem::solve().

89 {
90  FEProblemBase * p =
91  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
93  sys, old_soln, search_direction, new_soln, changed_search_direction, changed_new_soln);
94 }
const EquationSystems & get_equation_systems() const
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const T & get(std::string_view) const
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)

◆ compute_transpose_nullspace()

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

Definition at line 66 of file NonlinearSystem.C.

Referenced by NonlinearSystem::NonlinearSystem().

68 {
69  FEProblemBase * p =
70  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
71  p->computeTransposeNullSpace(sys, sp);
72 }
const EquationSystems & get_equation_systems() const
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const T & get(std::string_view) const
virtual void computeTransposeNullSpace(libMesh::NonlinearImplicitSystem &sys, std::vector< NumericVector< libMesh::Number > *> &sp)

◆ 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 }
const std::string & name() const
Definition: MooseEnumItem.h:35
MooseEnumIterator begin() const
Returns a begin/end iterator to all of the set values in the enum.
unsigned int size() const
Return the number of active items in the MultiMooseEnum.
std::string getRawNames() const
Method for returning the raw name strings for this instance.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
Definition: MooseEnum.h:33
Class for containing MooseEnum item information.
Definition: MooseEnumItem.h:18

◆ 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::shared_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.

Referenced by main().

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  CommandLine cl(argc, argv);
34  cl.parse();
35  auto command_line_params = emptyInputParameters();
36  MooseApp::addInputParam(command_line_params);
37  MooseApp::addAppParam(command_line_params);
38  cl.populateCommandLineParams(command_line_params);
39 
40  // Do not allow overriding Application/type= for subapps
41  for (const auto & arg : cl.getArguments())
42  if (std::regex_match(arg, std::regex("[A-Za-z0-9]*:Application/.*")))
43  mooseError(
44  "For command line argument '",
45  arg,
46  "': overriding the application type for MultiApps via command line is not allowed.");
47 
48  // Parse the input file; this will set Parser::getAppType() if Application/type= is found
49  const auto & input_filenames = command_line_params.get<std::vector<std::string>>("input_file");
50  auto parser = std::make_unique<Parser>(input_filenames);
51  parser->setAppType(default_app_type);
52  if (input_filenames.size())
53  parser->parse();
54 
55  // Search the command line for either --app or Application/type and let the last one win
56  for (const auto & entry : std::as_const(cl).getEntries())
57  if (!entry.subapp_name && entry.value &&
58  (entry.name == "--app" || entry.name == "Application/type"))
59  parser->setAppType(*entry.value);
60 
61  const auto & app_type = parser->getAppType();
62  if (!AppFactory::instance().isRegistered(app_type))
63  mooseError("'", app_type, "' is not a registered application type.");
64 
65  // Create an instance of the application and store it in a smart pointer for easy cleanup
66  return AppFactory::createAppShared(argc, argv, std::move(parser));
67 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
static void addInputParam(InputParameters &params)
Definition: MooseApp.C:101
InputParameters emptyInputParameters()
This class wraps provides and tracks access to command line parameters.
Definition: CommandLine.h:29
static MooseAppPtr createAppShared(int argc, char **argv, std::unique_ptr< Parser > parser)
Helper function for creating a MooseApp from command-line arguments and a Parser. ...
Definition: AppFactory.C:60
static AppFactory & instance()
Get the instance of the AppFactory.
Definition: AppFactory.C:18
static void addAppParam(InputParameters &params)
Definition: MooseApp.C:94

◆ 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 20 of file NumberArrayOps.h.

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

◆ 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.

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

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)

◆ 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.

Referenced by MooseVariableData< OutputType >::computeAD(), MooseVariableFE< Real >::computeSolution(), and MooseVariableFE< Real >::evaluate().

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.
Definition: SystemBase.C:1159

◆ elementsIntersectedByLine() [1/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< Real >::execute().

◆ elementsIntersectedByLine() [2/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 194 of file RayTracing.C.

200 {
201  // Make sure our list is clear
202  intersected_elems.clear();
203 
204  // Find the starting element
205  const Elem * first_elem = point_locator(p0);
206 
207  // Quick return if can't even locate the first element.
208  if (!first_elem)
209  return;
210 
211  intersected_elems.push_back(const_cast<Elem *>(first_elem));
212 
213  // Make a LineSegment object out of our two points for ease:
214  LineSegment line_segment = LineSegment(p0, p1);
215 
216  // Find 'em!
218  line_segment, first_elem, -1, p0, intersected_elems, segments);
219 }
The LineSegment class is used by the LineMaterialSamplerBase class and for some ray tracing stuff...
Definition: LineSegment.h:28
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:146
bool first_elem
Definition: InfixIterator.h:35

◆ elementsIntersectedByPlane() [1/2]

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.

Definition at line 55 of file ElementsIntersectedByPlane.C.

Referenced by ElementsAlongPlane::execute().

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

◆ elementsIntersectedByPlane() [2/2]

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.

Definition at line 71 of file ElementsIntersectedByPlane.C.

76 {
77  // Make sure our list is clear
78  intersected_elems.clear();
79 
80  // Create plane from three points:
81  libMesh::Plane plane(p0, p1, p2);
82 
83  // Find 'em!
84  findElementsIntersectedByPlane(plane, mesh, intersected_elems);
85 }
void findElementsIntersectedByPlane(const libMesh::Plane &plane, const MeshBase &mesh, std::vector< const Elem *> &intersected_elems)

◆ enumerate() [1/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.

Referenced by JvarMapInterfaceBase< Kernel >::JvarMapInterfaceBase(), NearestPointIntegralVariablePostprocessor::nearestPointIndex(), NearestPointAverage::nearestPointIndex(), and NearestPointBase< LayeredSideDiffusiveFluxAverage, SideIntegralVariableUserObject >::nearestUserObject().

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

◆ 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 Container >
_enumerate_range<typename Container::const_iterator> Moose::enumerate ( const Container &  content)

Definition at line 68 of file Enumerate.h.

69 {
70  return _enumerate_range<typename Container::const_iterator>(
71  std::begin(content), std::end(content), 0);
72 }

◆ 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 22 of file MooseLagrangeHelpers.h.

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

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

◆ 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 96 of file MooseLagrangeHelpers.h.

Referenced by fe_lagrange_2D_shape_deriv().

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

◆ 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 171 of file MooseLagrangeHelpers.h.

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

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

◆ 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 378 of file MooseLagrangeHelpers.h.

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

◆ findContactPoint()

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 50 of file FindContactPoint.C.

Referenced by PenetrationThread::createInfoForElem(), and PenetrationThread::operator()().

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

◆ findElementsIntersectedByPlane()

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

Definition at line 26 of file ElementsIntersectedByPlane.C.

Referenced by elementsIntersectedByPlane().

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

◆ findSimilar()

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

Definition at line 97 of file Builder.C.

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

98 {
99  std::vector<std::string> candidates;
100  if (options.size() == 0)
101  return candidates;
102 
103  int mindist = MooseUtils::levenshteinDist(options[0], param);
104  for (auto & opt : options)
105  {
106  int dist = MooseUtils::levenshteinDist(opt, param);
107  // magic number heuristics to get similarity distance cutoff
108  int dist_cutoff = 1 + param.size() / 5;
109  if (dist > dist_cutoff || dist > mindist)
110  continue;
111 
112  if (dist < mindist)
113  {
114  mindist = dist;
115  candidates.clear();
116  }
117  candidates.push_back(opt);
118  }
119  return candidates;
120 }
std::string opt
int levenshteinDist(const std::string &s1, const std::string &s2)
Computes and returns the Levenshtein distance between strings s1 and s2.
Definition: MooseUtils.C:172

◆ getExec()

std::string Moose::getExec ( )

Definition at line 24 of file ExecutablePath.C.

Referenced by getExecutableName(), and getExecutablePath().

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 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ getExecutableName()

std::string Moose::getExecutableName ( )

This function returns the name of the running executable.

There is not a portable way to do this function implements this function for Mac OS X and Linux boxes containing a normal /proc tree

Definition at line 60 of file ExecutablePath.C.

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

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 name(const ElemQuality q)
std::string getExec()

◆ getExecutablePath()

std::string Moose::getExecutablePath ( )

This function returns the PATH of the running executable.

There is not a portable way to do this function implements this function for Mac OS X and Linux boxes containing a normal /proc tree

Definition at line 51 of file ExecutablePath.C.

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

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 }
std::string getExec()

◆ globalADIndexing()

bool Moose::globalADIndexing ( )
inline

Whether we are using global AD indexing.

Definition at line 29 of file ADUtils.h.

Referenced by FEProblemBase::init().

30 {
31  return true;
32 }

◆ 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.

Referenced by globalDofIndexToDerivative().

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 
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 }
const Elem *const & elem() const
Return the current element.
Definition: Assembly.h:375
Keeps track of stuff related to assembling.
Definition: Assembly.h:101
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
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:79
SubProblem & subproblem()
Definition: SystemBase.h:101
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1159
std::size_t getMaxVarNDofsPerElem() const
Gets the maximum number of dofs used by any one variable on any one element.
Definition: SystemBase.h:586
virtual Assembly & assembly(const THREAD_ID tid, const unsigned int sys_num)=0
const Elem *const & neighbor() const
Return the neighbor element.
Definition: Assembly.h:431
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition: Assembly.h:437
const DofMap & get_dof_map() const

◆ 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 136 of file ADUtils.h.

143 {
144  std::vector<std::unordered_map<dof_id_type, Real>> ret_val(ad_real_container.size());
145 
146  for (MooseIndex(ad_real_container) i = 0; i < ad_real_container.size(); ++i)
147  ret_val[i] = globalDofIndexToDerivative(ad_real_container[i], sys, elem_type, tid);
148 
149  return ret_val;
150 }
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) cont...
Definition: ADUtils.h:136

◆ 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 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 }
void hash_combine(std::size_t &seed, const T &value)

◆ 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 }
void hash_combine(std::size_t &seed, const T &value)

◆ hash_combine() [4/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 }
void hash_combine(std::size_t &seed, const T &value)

◆ 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.

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

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
79  indirect_comparator<RandomAccessIterator, LessThanComparator> ic(beg, LessThanComparator());
80 
81  // Sort the indices, based on the data
82  std::sort(b.begin(), b.end(), ic);
83 }
void initialize_indirect_sort(RandomAccessIterator beg, RandomAccessIterator end, std::vector< size_t > &b)
Definition: IndirectSort.h:52

◆ 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 89 of file IndirectSort.h.

93 {
94  // Space in b
95  initialize_indirect_sort(beg, end, b);
96 
97  // Construct comparator object
98  indirect_comparator<RandomAccessIterator, UserComparisonFunctor> ic(beg, user_comp);
99 
100  // Sort the indices, based on the data
101  std::sort(b.begin(), b.end(), ic);
102 }
void initialize_indirect_sort(RandomAccessIterator beg, RandomAccessIterator end, std::vector< size_t > &b)
Definition: IndirectSort.h:52

◆ initCoordinateSystemType()

void Moose::initCoordinateSystemType ( )

Definition at line 37 of file Conversion.C.

Referenced by stringToEnum< CoordinateSystemType >().

38 {
40  {
44  }
45 }
std::map< std::string, CoordinateSystemType > coordinate_system_type_to_enum
Definition: Conversion.C:26

◆ initDofIndices()

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

◆ initEigenProlemType()

void Moose::initEigenProlemType ( )

Definition at line 78 of file Conversion.C.

Referenced by stringToEnum< EigenProblemType >().

79 {
80  if (eigen_problem_type_to_enum.empty())
81  {
87  eigen_problem_type_to_enum["POS_GEN_NON_HERMITIAN"] = EPT_POS_GEN_NON_HERMITIAN;
89  }
90 }
Generalized Non-Hermitian.
Definition: MooseTypes.h:876
Generalized Hermitian indefinite.
Definition: MooseTypes.h:875
std::map< std::string, EigenProblemType > eigen_problem_type_to_enum
Definition: Conversion.C:29
use whatever SLPEC has by default
Definition: MooseTypes.h:878
Generalized Non-Hermitian with positive (semi-)definite B.
Definition: MooseTypes.h:877
Non-Hermitian.
Definition: MooseTypes.h:873
Generalized Hermitian.
Definition: MooseTypes.h:874

◆ initEigenSolveType()

void Moose::initEigenSolveType ( )

Definition at line 61 of file Conversion.C.

Referenced by stringToEnum< EigenSolveType >().

62 {
63  if (eigen_solve_type_to_enum.empty())
64  {
68  eigen_solve_type_to_enum["JACOBI_DAVIDSON"] = EST_JACOBI_DAVIDSON;
69  eigen_solve_type_to_enum["NONLINEAR_POWER"] = EST_NONLINEAR_POWER;
74  }
75 }
std::map< std::string, EigenSolveType > eigen_solve_type_to_enum
Definition: Conversion.C:28
Newton-based eigensolver with an assembled Jacobian matrix (fully coupled by default) ...
Definition: MooseTypes.h:861
The same as PJFNK except that matrix-vector multiplication is employed to replace residual evaluation...
Definition: MooseTypes.h:863
Power / Inverse / RQI.
Definition: MooseTypes.h:856
Krylov-Schur.
Definition: MooseTypes.h:858
Preconditioned Jacobian-free Newton Krylov.
Definition: MooseTypes.h:862
Nonlinear inverse power.
Definition: MooseTypes.h:860
Jacobi-Davidson.
Definition: MooseTypes.h:859
Jacobian-free Newton Krylov.
Definition: MooseTypes.h:864

◆ initial_condition()

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

◆ 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.

Referenced by indirectSort().

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 }

◆ initLineSearchType()

void Moose::initLineSearchType ( )

Definition at line 112 of file Conversion.C.

Referenced by stringToEnum< LineSearchType >().

113 {
114  if (line_search_type_to_enum.empty())
115  {
119 
126  }
127 }
std::map< std::string, LineSearchType > line_search_type_to_enum
Definition: Conversion.C:31

◆ initMffdType()

void Moose::initMffdType ( )

Definition at line 145 of file Conversion.C.

Referenced by stringToEnum< MffdType >().

146 {
147  if (mffd_type_to_enum.empty())
148  {
149  mffd_type_to_enum["DS"] = MFFD_DS;
150  mffd_type_to_enum["WP"] = MFFD_WP;
151  }
152 }
std::map< std::string, MffdType > mffd_type_to_enum
Definition: Conversion.C:33

◆ initRMType()

void Moose::initRMType ( )

Definition at line 155 of file Conversion.C.

Referenced by stringToEnum< RelationshipManagerType >().

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

◆ initSolveType()

void Moose::initSolveType ( )

Definition at line 48 of file Conversion.C.

Referenced by stringToEnum< SolveType >().

49 {
50  if (solve_type_to_enum.empty())
51  {
52  solve_type_to_enum["PJFNK"] = ST_PJFNK;
53  solve_type_to_enum["JFNK"] = ST_JFNK;
54  solve_type_to_enum["NEWTON"] = ST_NEWTON;
55  solve_type_to_enum["FD"] = ST_FD;
56  solve_type_to_enum["LINEAR"] = ST_LINEAR;
57  }
58 }
Full Newton Solve.
Definition: MooseTypes.h:846
Solving a linear problem.
Definition: MooseTypes.h:848
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:845
Use finite differences to compute Jacobian.
Definition: MooseTypes.h:847
Preconditioned Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:844
std::map< std::string, SolveType > solve_type_to_enum
Definition: Conversion.C:27

◆ initTimeIntegratorsType()

void Moose::initTimeIntegratorsType ( )

Definition at line 130 of file Conversion.C.

Referenced by stringToEnum< TimeIntegratorType >().

131 {
132  if (time_integrator_to_enum.empty())
133  {
134  time_integrator_to_enum["IMPLICIT_EULER"] = TI_IMPLICIT_EULER;
135  time_integrator_to_enum["EXPLICIT_EULER"] = TI_EXPLICIT_EULER;
136  time_integrator_to_enum["CRANK_NICOLSON"] = TI_CRANK_NICOLSON;
138  time_integrator_to_enum["EXPLICIT_MIDPOINT"] = TI_EXPLICIT_MIDPOINT;
139  time_integrator_to_enum["LSTABLE_DIRK2"] = TI_LSTABLE_DIRK2;
140  time_integrator_to_enum["EXPLICIT_TVDRK2"] = TI_EXPLICIT_TVD_RK_2;
141  }
142 }
std::map< std::string, TimeIntegratorType > time_integrator_to_enum
Definition: Conversion.C:32

◆ initWhichEigenPairs()

void Moose::initWhichEigenPairs ( )

Definition at line 93 of file Conversion.C.

Referenced by stringToEnum< WhichEigenPairs >().

94 {
95  if (which_eigen_pairs_to_enum.empty())
96  {
97  which_eigen_pairs_to_enum["LARGEST_MAGNITUDE"] = WEP_LARGEST_MAGNITUDE;
98  which_eigen_pairs_to_enum["SMALLEST_MAGNITUDE"] = WEP_SMALLEST_MAGNITUDE;
100  which_eigen_pairs_to_enum["SMALLEST_REAL"] = WEP_SMALLEST_REAL;
101  which_eigen_pairs_to_enum["LARGEST_IMAGINARY"] = WEP_LARGEST_IMAGINARY;
102  which_eigen_pairs_to_enum["SMALLEST_IMAGINARY"] = WEP_SMALLEST_IMAGINARY;
103  which_eigen_pairs_to_enum["TARGET_MAGNITUDE"] = WEP_TARGET_MAGNITUDE;
105  which_eigen_pairs_to_enum["TARGET_IMAGINARY"] = WEP_TARGET_IMAGINARY;
106  which_eigen_pairs_to_enum["ALL_EIGENVALUES"] = WEP_ALL_EIGENVALUES;
107  which_eigen_pairs_to_enum["SLEPC_DEFAULT"] = WEP_SLEPC_DEFAULT;
108  }
109 }
smallest magnitude
Definition: MooseTypes.h:887
std::map< std::string, WhichEigenPairs > which_eigen_pairs_to_enum
Definition: Conversion.C:30
target magnitude
Definition: MooseTypes.h:892
target imaginary
Definition: MooseTypes.h:894
smallest imaginary
Definition: MooseTypes.h:891
largest imaginary
Definition: MooseTypes.h:890
all eigenvalues
Definition: MooseTypes.h:895
use whatever we have in SLEPC
Definition: MooseTypes.h:896
largest magnitude
Definition: MooseTypes.h:886

◆ isSectionActive()

bool Moose::isSectionActive ( std::string  path,
hit::Node *  root 
)

Definition at line 60 of file Builder.C.

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

61 {
62  hit::Node * n = root->find(path);
63  while (n)
64  {
65  hit::Node * section = n->parent();
66  if (section)
67  {
68  auto actives = section->find("active");
69  auto inactives = section->find("inactive");
70 
71  // only check current level, not nested ones
72  if (actives && actives->type() == hit::NodeType::Field && actives->parent() == section)
73  {
74  auto vars = section->param<std::vector<std::string>>("active");
75  bool have_var = false;
76  for (auto & var : vars)
77  if (n->path() == hit::pathNorm(var))
78  have_var = true;
79  if (!have_var)
80  return false;
81  }
82  // only check current level, not nested ones
83  if (inactives && inactives->type() == hit::NodeType::Field && inactives->parent() == section)
84  {
85  auto vars = section->param<std::vector<std::string>>("inactive");
86  for (auto & var : vars)
87  if (n->path() == hit::pathNorm(var))
88  return false;
89  }
90  }
91  n = section;
92  }
93  return true;
94 }
char ** vars

◆ 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.

Referenced by removeSubstring().

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 }
std::shared_ptr< MooseApp > createMooseApp(const std::string &default_app_type, int argc, char *argv[])
Create a MooseApp from command-line arguments.
Definition: MooseMain.C:27
Initialization object for any MOOSE-based application.
Definition: MooseInit.h:23
void init(triangulateio &t)

◆ oldState()

StateArg Moose::oldState ( )
inline

Definition at line 157 of file MooseFunctorArguments.h.

Referenced by TransientInterface::determineState().

158 {
159  return {(unsigned int)1};
160 }
void ErrorVector unsigned int

◆ previousNonlinearState()

StateArg Moose::previousNonlinearState ( )
inline

Definition at line 163 of file MooseFunctorArguments.h.

164 {
165  return {(unsigned int)1, SolutionIterationType::Nonlinear};
166 }
void ErrorVector unsigned int

◆ 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 146 of file RayTracing.C.

Referenced by elementsIntersectedByLine().

152 {
153  Point intersection_point;
154 
155  std::vector<int> not_side(1, incoming_side);
156 
157  // Find the side of this element that the LineSegment intersects... while ignoring the incoming
158  // side (we don't want to move backward!)
159  int intersected_side =
160  sideIntersectedByLine(current_elem, not_side, line_segment, intersection_point);
161 
162  if (intersected_side != -1) // -1 means that we didn't find any side
163  {
164  // Get the neighbor on that side
165  const Elem * neighbor = current_elem->neighbor_ptr(intersected_side);
166 
167  if (neighbor)
168  {
169  // Add it to the list
170  intersected_elems.push_back(const_cast<Elem *>(neighbor));
171 
172  // Add the line segment across the element to the segments list
173  segments.push_back(LineSegment(incoming_point, intersection_point));
174 
175  // Note: This is finding the side the current_elem is on for the neighbor. That's the
176  // "incoming_side" for the neighbor
177  int incoming_side = sideNeighborIsOn(neighbor, current_elem);
178 
179  // Recurse
181  line_segment, neighbor, incoming_side, intersection_point, intersected_elems, segments);
182  }
183  else // Add the final segment
184  segments.push_back(LineSegment(incoming_point, line_segment.end()));
185  }
186  else // Add the final segment
187  segments.push_back(LineSegment(incoming_point, line_segment.end()));
188 
189  // Finished... return out!
190  return;
191 }
const Point & end() const
Ending of the line segment.
Definition: LineSegment.h:67
int sideNeighborIsOn(const Elem *elem, const Elem *neighbor)
Returns the side number for elem that neighbor is on.
Definition: RayTracing.C:117
The LineSegment class is used by the LineMaterialSamplerBase class and for some ray tracing stuff...
Definition: LineSegment.h:28
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:146
const Elem * neighbor_ptr(unsigned int i) const
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:36

◆ 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 484 of file Moose.C.

Referenced by associateSyntax(), and registerAll().

485 {
486  mooseDeprecated("use registerAll instead of registerActions");
487  registerActions(syntax, action_factory, {"MooseApp"});
488 }
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:484
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:353

◆ registerActions() [2/2]

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

Definition at line 491 of file Moose.C.

494 {
495  Registry::registerActionsTo(action_factory, obj_labels);
496 
497  // Add these actions here so they are always executed last, without setting any dependency
498  registerTask("dump_objects", false);
499  registerTask("finish_input_file_output", false);
500 }
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:68

◆ registerAll()

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

Register objects that are in MOOSE.

Definition at line 63 of file Moose.C.

Referenced by MooseApp::MooseApp().

64 {
65  registerObjects(f, {"MooseApp"});
66  associateSyntaxInner(s, af);
67  registerActions(s, af, {"MooseApp"});
68  registerAppDataFilePath("moose");
69  registerRepository("moose", "github.com/idaholab/moose");
70 }
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:484
void registerObjects(Factory &factory, const std::set< std::string > &obj_labels)
Definition: Moose.C:73
void associateSyntaxInner(Syntax &syntax, ActionFactory &action_factory)
Definition: Moose.C:503

◆ registerObjects()

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

Definition at line 73 of file Moose.C.

Referenced by registerAll().

74 {
75  Registry::registerObjectsTo(factory, obj_labels);
76 }
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:34

◆ restrictPointToFace()

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

Definition at line 315 of file FindContactPoint.C.

Referenced by findContactPoint().

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

◆ 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 ( RankTwoTensorTempl  ,
obj0u, 0u,
RankTwoTensorTempl< T >::N2   
)

◆ SERIAL_ACCESS_CONST_SIZE() [3/3]

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

◆ SERIAL_ACCESS_DYNAMIC_SIZE()

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

◆ SERIAL_ACCESS_SCALAR() [1/2]

Moose::SERIAL_ACCESS_SCALAR ( Real  )

◆ SERIAL_ACCESS_SCALAR() [2/2]

Moose::SERIAL_ACCESS_SCALAR ( ADReal  )

◆ 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 750 of file Moose.C.

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

751 {
752  _color_console = (isatty(fileno(stdout)) || force) && use_color;
753  return _color_console;
754 }
static bool _color_console
Definition: Moose.C:741

◆ setSolverDefaults()

void Moose::setSolverDefaults ( FEProblemBase problem)

Definition at line 727 of file Moose.C.

728 {
729  // May be a touch expensive to create a new DM every time, but probably safer to do it this way
731 }
void petscSetDefaults(FEProblemBase &problem)
Sets the default options for PETSc.
Definition: PetscSupport.C:488

◆ 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 36 of file RayTracing.C.

Referenced by recursivelyFindElementsIntersectedByLine().

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

◆ 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 117 of file RayTracing.C.

Referenced by recursivelyFindElementsIntersectedByLine().

118 {
119  unsigned int n_sides = elem->n_sides();
120 
121  for (unsigned int i = 0; i < n_sides; i++)
122  {
123  if (elem->neighbor_ptr(i) == neighbor)
124  return i;
125  }
126 
127  return -1;
128 }
virtual unsigned int n_sides() const=0
const Elem * neighbor_ptr(unsigned int i) const

◆ stringify() [1/21]

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

conversion to string

Definition at line 64 of file Conversion.h.

Referenced by SetupResidualDebugAction::act(), MaterialDerivativeTestAction::act(), Moose::Capabilities::add(), FEProblemBase::addAuxArrayVariable(), FEProblemBase::addAuxScalarVariable(), FEProblemBase::addAuxVariable(), PhysicsComponentInterface::addBoundaryConditionsFromComponents(), PhysicsComponentInterface::addInitialConditionsFromComponents(), LinearFVFluxKernel::addMatrixContribution(), ComponentPhysicsInterface::addPhysics(), DiracKernelBase::addPoint(), Action::addRelationshipManager(), MooseVariableData< OutputType >::adGradPhi(), MooseVariableData< OutputType >::adGradPhiFace(), MooseEnum::assign(), AuxKernelTempl< Real >::AuxKernelTempl(), ParsedFunctorMaterialTempl< is_ad >::buildParsedFunction(), CartesianMeshGenerator::CartesianMeshGenerator(), PhysicsBase::checkBlockRestrictionIdentical(), InputParametersChecksUtils< BatchMeshGeneratorAction >::checkBlockwiseConsistency(), MooseMesh::checkCoordinateSystems(), MeshDiagnosticsGenerator::checkElementOverlap(), MeshDiagnosticsGenerator::checkElementTypes(), FEProblemBase::checkExceptionAndStopSolve(), Moose::FunctorBase< libMesh::VectorValue >::checkFace(), MeshGenerator::checkGetMesh(), Steady::checkIntegrity(), MeshDiagnosticsGenerator::checkLocalJacobians(), MeshDiagnosticsGenerator::checkNonConformalMesh(), MeshDiagnosticsGenerator::checkNonConformalMeshFromAdaptivity(), MeshDiagnosticsGenerator::checkNonMatchingEdges(), MeshDiagnosticsGenerator::checkNonPlanarSides(), FEProblemBase::checkProblemIntegrity(), ActionComponent::checkRequiredTasks(), PhysicsBase::checkRequiredTasks(), InputParametersChecksUtils< BatchMeshGeneratorAction >::checkTwoDVectorParamsNoRespectiveOverlap(), BlockRestrictable::checkVariable(), InputParametersChecksUtils< BatchMeshGeneratorAction >::checkVectorParamsNoOverlap(), CircularBoundaryCorrectionGenerator::circularCenterCalculator(), Moose::SlepcSupport::clearFreeNonlinearPowerIterations(), FEProblemBase::computeUserObjectsInternal(), CopyValueAux::CopyValueAux(), PhysicsBase::copyVariablesFromMesh(), 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(), ParsedMaterialHelper< is_ad >::functionParse(), ExtraNodesetGenerator::generate(), CoarsenBlockGenerator::generate(), AdvancedExtruderGenerator::generate(), ActionWarehouse::getAction(), FunctorBinnedValuesDivision::getBinIndex(), ComputeFVFluxThread< RangeType, AttribMatrixTags >::getBlockNames(), MooseLinearVariableFV< Real >::getElemValue(), MooseVariableFV< Real >::getElemValue(), MeshCoarseningUtils::getFineElementsFromInteriorNode(), SolutionUserObjectBase::getLocalVarIndex(), MooseEnumBase::getRawNames(), MooseApp::getRelationshipManagerInfo(), SystemBase::getScalarVariable(), ProjectedStatefulMaterialStorageAction::getTypeEnum(), SystemBase::getVariable(), SubProblem::getVariableHelper(), Moose::FV::harmonicInterpolation(), ParsedDownSelectionPositions::initialize(), BlockRestrictable::initializeBlockRestrictable(), MultiAppGeneralFieldTransfer::initialSetup(), MatrixTools::inverse(), LeastSquaresFitHistory::LeastSquaresFitHistory(), MultiApp::localApp(), ParsedConvergence::makeParsedFunction(), MeshDivisionAux::MeshDivisionAux(), SystemBase::oldSolutionStateVectorName(), operator<<(), MaterialOutputAction::outputHelper(), Parser::parse(), PatternedMeshGenerator::PatternedMeshGenerator(), 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(), PhysicsBase::reportPotentiallyMissedParameters(), MeshRepairGenerator::separateSubdomainsByElementType(), MooseMesh::setCoordSystem(), Moose::SlepcSupport::setFreeNonlinearPowerIterations(), Moose::SlepcSupport::setNewtonPetscOptions(), Moose::SlepcSupport::setSlepcEigenSolverTolerances(), Split::setup(), PhysicsBase::shouldCreateIC(), PhysicsBase::shouldCreateTimeDerivative(), PhysicsBase::shouldCreateVariable(), SystemBase::solutionState(), FEProblemBase::solverSysNum(), EigenProblem::solverTypeString(), FEProblemBase::solverTypeString(), NonlinearSystem::stopSolve(), stringify(), Moose::internal::stringify_variant(), PiecewiseByBlockLambdaFunctor< T >::subdomainErrorMessage(), and FEProblemSolve::validParams().

65 {
66  std::ostringstream os;
67  os << t;
68  return os.str();
69 }
std::basic_ostream< charT, traits > * os
Definition: InfixIterator.h:33

◆ stringify() [2/21]

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

Definition at line 73 of file Conversion.h.

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

◆ stringify() [3/21]

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

Definition at line 80 of file Conversion.h.

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

◆ stringify() [4/21]

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

Definition at line 85 of file Conversion.h.

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

◆ stringify() [5/21]

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() [6/21]

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() [7/21]

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

Definition at line 100 of file Conversion.h.

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

◆ stringify() [8/21]

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() [9/21]

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() [10/21]

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

Convert solve type into human readable string.

Definition at line 359 of file Conversion.C.

360 {
361  switch (t)
362  {
363  case ST_NEWTON:
364  return "NEWTON";
365  case ST_JFNK:
366  return "JFNK";
367  case ST_PJFNK:
368  return "Preconditioned JFNK";
369  case ST_FD:
370  return "FD";
371  case ST_LINEAR:
372  return "Linear";
373  }
374  return "";
375 }
Full Newton Solve.
Definition: MooseTypes.h:846
Solving a linear problem.
Definition: MooseTypes.h:848
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:845
Use finite differences to compute Jacobian.
Definition: MooseTypes.h:847
Preconditioned Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:844

◆ stringify() [11/21]

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

Convert eigen solve type into human readable string.

Definition at line 378 of file Conversion.C.

379 {
380  switch (t)
381  {
382  case EST_POWER:
383  return "Power";
384  case EST_ARNOLDI:
385  return "ARNOLDI";
386  case EST_KRYLOVSCHUR:
387  return "KRYLOVSCHUR";
388  case EST_JACOBI_DAVIDSON:
389  return "Jacobi Davidson";
390  case EST_NONLINEAR_POWER:
391  return "Nonlinear Power";
392  case EST_PJFNKMO:
393  return "PJFNK with Matrix Only";
394  case EST_NEWTON:
395  return "Newton";
396  case EST_JFNK:
397  return "JFNK";
398  case EST_PJFNK:
399  return "Preconditioned JFNK";
400  }
401  return "";
402 }
Newton-based eigensolver with an assembled Jacobian matrix (fully coupled by default) ...
Definition: MooseTypes.h:861
The same as PJFNK except that matrix-vector multiplication is employed to replace residual evaluation...
Definition: MooseTypes.h:863
Power / Inverse / RQI.
Definition: MooseTypes.h:856
Krylov-Schur.
Definition: MooseTypes.h:858
Preconditioned Jacobian-free Newton Krylov.
Definition: MooseTypes.h:862
Nonlinear inverse power.
Definition: MooseTypes.h:860
Jacobi-Davidson.
Definition: MooseTypes.h:859
Jacobian-free Newton Krylov.
Definition: MooseTypes.h:864

◆ stringify() [12/21]

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

Convert variable field type into human readable string.

Definition at line 405 of file Conversion.C.

406 {
407  switch (t)
408  {
409  case VAR_FIELD_STANDARD:
410  return "STANDARD";
411  case VAR_FIELD_VECTOR:
412  return "VECTOR";
413  case VAR_FIELD_ARRAY:
414  return "ARRAY";
415  case VAR_FIELD_SCALAR:
416  return "SCALAR";
417  case VAR_FIELD_ANY:
418  return "ANY";
419  }
420  return "";
421 }

◆ stringify() [13/21]

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 460 of file Conversion.C.

461 {
462  return s;
463 }

◆ stringify() [14/21]

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

Convert FEType from libMesh into string.

Definition at line 350 of file Conversion.C.

351 {
353 }
std::string enum_to_string(const T e)

◆ stringify() [15/21]

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

Convert SolutionIterationType into string.

Definition at line 424 of file Conversion.C.

425 {
426  switch (t)
427  {
428  case SolutionIterationType::Time:
429  return "time";
430  case SolutionIterationType::Nonlinear:
431  return "nonlinear";
432  default:
433  mooseError("Unhandled SolutionIterationType");
434  }
435 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ stringify() [16/21]

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

Convert ElementType into string.

Definition at line 438 of file Conversion.C.

439 {
440  switch (t)
441  {
442  case ElementType::Element:
443  return "ELEMENT";
445  return "NEIGHBOR";
446  case ElementType::Lower:
447  return "LOWER";
448  default:
449  mooseError("unrecognized type");
450  }
451 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ stringify() [17/21]

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

Convert the libmesh ElemType into string.

Definition at line 454 of file Conversion.C.

455 {
457 }
std::string enum_to_string(const T e)

◆ stringify() [18/21]

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() [19/21]

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 174 of file Conversion.h.

178 {
179  std::string str;
180  if (enclose_list_in_curly_braces)
181  str += "{";
182  const auto begin = c.begin();
183  const auto end = c.end();
184  for (auto i = begin; i != end; ++i)
185  str += (i != begin ? delim : "") + elem_encl + stringify(*i) + elem_encl;
186  if (enclose_list_in_curly_braces)
187  str += "}";
188  return str;
189 }
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&#39;s choice.
Definition: Conversion.h:174

◆ stringify() [20/21]

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

Definition at line 326 of file Conversion.C.

327 {
328  // Cannot make a switch statement because the boolean logic doesn't work well with the class type
329  // enumeration and because Cody says so.
330  if (t == RelationshipManagerType::DEFAULT)
331  return "DEFAULT";
332  if (t == RelationshipManagerType::GEOMETRIC)
333  return "GEOMETRIC";
334  if (t == RelationshipManagerType::ALGEBRAIC)
335  return "ALGEBRAIC";
336  if (t == (RelationshipManagerType::GEOMETRIC | RelationshipManagerType::ALGEBRAIC))
337  return "GEOMETRIC and ALGEBRAIC";
338  if (t == (RelationshipManagerType::ALGEBRAIC | RelationshipManagerType::COUPLING))
339  return "ALGEBRAIC and COUPLING";
340  if (t == (RelationshipManagerType::GEOMETRIC | RelationshipManagerType::ALGEBRAIC |
341  RelationshipManagerType::COUPLING))
342  return "GEOMETRIC and ALGEBRAIC and COUPLING";
343  if (t == RelationshipManagerType::COUPLING)
344  return "COUPLING";
345 
346  mooseError("Unknown RelationshipManagerType");
347 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302

◆ stringify() [21/21]

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

◆ stringifyExact()

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

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

Definition at line 466 of file Conversion.C.

467 {
468  // this or std::numeric_limits<T>::max_digits10
469  const unsigned int max_digits10 =
470  std::floor(std::numeric_limits<Real>::digits * std::log10(2) + 2);
471 
472  std::ostringstream os;
473  os << std::setprecision(max_digits10) << t;
474  return os.str();
475 }
std::basic_ostream< charT, traits > * os
Definition: InfixIterator.h:33

◆ stringToEnum()

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

◆ stringToEnum< CoordinateSystemType >()

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

Definition at line 188 of file Conversion.C.

189 {
191 
192  std::string upper(s);
193  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
194 
195  if (!coordinate_system_type_to_enum.count(upper))
196  mooseError("Unknown coordinate system type: ", upper);
197 
198  return coordinate_system_type_to_enum[upper];
199 }
std::map< std::string, CoordinateSystemType > coordinate_system_type_to_enum
Definition: Conversion.C:26
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
void initCoordinateSystemType()
Definition: Conversion.C:37

◆ stringToEnum< EigenProblemType >()

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

Definition at line 233 of file Conversion.C.

234 {
236 
237  std::string upper(s);
238  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
239 
240  if (!eigen_problem_type_to_enum.count(upper))
241  mooseError("Unknown eigen problem type: ", upper);
242 
243  return eigen_problem_type_to_enum[upper];
244 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::map< std::string, EigenProblemType > eigen_problem_type_to_enum
Definition: Conversion.C:29
void initEigenProlemType()
Definition: Conversion.C:78

◆ stringToEnum< EigenSolveType >()

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

Definition at line 218 of file Conversion.C.

219 {
221 
222  std::string upper(s);
223  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
224 
225  if (!eigen_solve_type_to_enum.count(upper))
226  mooseError("Unknown eigen solve type: ", upper);
227 
228  return eigen_solve_type_to_enum[upper];
229 }
std::map< std::string, EigenSolveType > eigen_solve_type_to_enum
Definition: Conversion.C:28
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
void initEigenSolveType()
Definition: Conversion.C:61

◆ 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 >()

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

Definition at line 263 of file Conversion.C.

264 {
266 
267  std::string upper(s);
268  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
269 
270  if (!line_search_type_to_enum.count(upper))
271  mooseError("Unknown line search type: ", upper);
272 
273  return line_search_type_to_enum[upper];
274 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
void initLineSearchType()
Definition: Conversion.C:112
std::map< std::string, LineSearchType > line_search_type_to_enum
Definition: Conversion.C:31

◆ stringToEnum< MffdType >()

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

Definition at line 293 of file Conversion.C.

294 {
295  initMffdType();
296 
297  std::string upper(s);
298  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
299 
300  if (!mffd_type_to_enum.count(upper))
301  mooseError("Unknown mffd type: ", upper);
302 
303  return mffd_type_to_enum[upper];
304 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
void initMffdType()
Definition: Conversion.C:145
std::map< std::string, MffdType > mffd_type_to_enum
Definition: Conversion.C:33

◆ stringToEnum< Order >()

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

Definition at line 175 of file Conversion.C.

Referenced by SetupQuadratureAction::act().

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

◆ stringToEnum< QuadratureType >()

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

Definition at line 168 of file Conversion.C.

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

◆ stringToEnum< RelationshipManagerType >()

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

Definition at line 308 of file Conversion.C.

309 {
310  initRMType();
311 
312  std::string upper(s);
313  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
314 
315  if (!rm_type_to_enum.count(upper))
316  mooseError("Unknown RelationshipManager type: ", upper);
317 
318  return rm_type_to_enum[upper];
319 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::map< std::string, RelationshipManagerType > rm_type_to_enum
Definition: Conversion.C:34
void initRMType()
Definition: Conversion.C:155

◆ stringToEnum< SolveType >()

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

Definition at line 203 of file Conversion.C.

204 {
205  initSolveType();
206 
207  std::string upper(s);
208  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
209 
210  if (!solve_type_to_enum.count(upper))
211  mooseError("Unknown solve type: ", upper);
212 
213  return solve_type_to_enum[upper];
214 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
void initSolveType()
Definition: Conversion.C:48
std::map< std::string, SolveType > solve_type_to_enum
Definition: Conversion.C:27

◆ stringToEnum< TimeIntegratorType >()

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

Definition at line 278 of file Conversion.C.

279 {
281 
282  std::string upper(s);
283  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
284 
285  if (!time_integrator_to_enum.count(upper))
286  mooseError("Unknown time integrator: ", upper);
287 
288  return time_integrator_to_enum[upper];
289 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::map< std::string, TimeIntegratorType > time_integrator_to_enum
Definition: Conversion.C:32
void initTimeIntegratorsType()
Definition: Conversion.C:130

◆ stringToEnum< WhichEigenPairs >()

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

Definition at line 248 of file Conversion.C.

249 {
251 
252  std::string upper(s);
253  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
254 
255  if (!which_eigen_pairs_to_enum.count(upper))
256  mooseError("Unknown type of WhichEigenPairs: ", upper);
257 
258  return which_eigen_pairs_to_enum[upper];
259 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::map< std::string, WhichEigenPairs > which_eigen_pairs_to_enum
Definition: Conversion.C:30
void initWhichEigenPairs()
Definition: Conversion.C:93

◆ 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 734 of file Moose.C.

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

735 {
736  MPI_Comm old_comm = PETSC_COMM_WORLD;
737  PETSC_COMM_WORLD = new_comm;
738  return old_comm;
739 }

◆ to_json()

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

Definition at line 151 of file LibtorchArtificialNeuralNet.C.

Referenced by JSONOutput::outputSystemInformation(), ReporterContext< std::vector< T > >::store(), and RestartableData< std::list< T > >::storeJSONValue().

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)

◆ toBool()

template<typename T >
bool Moose::toBool ( const std::string &  ,
T &   
)

◆ toBool< bool >()

template<>
bool Moose::toBool< bool > ( const std::string &  s,
bool &  val 
)

Definition at line 1349 of file Builder.C.

1350 {
1351  return hit::toBool(s, &val);
1352 }
bool toBool(const std::string &, T &)
Definition: Builder.C:1342

◆ toPoint()

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

Convert point represented as std::vector into Point.

Parameters
posPoint represented as a vector
Returns
Converted point

Definition at line 478 of file Conversion.C.

479 {
480  mooseAssert(pos.size() == LIBMESH_DIM, "Wrong array size while converting into a point");
481  return Point(pos[0], pos[1], pos[2]);
482 }

◆ 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 }

◆ 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 }
void typeLoopInternal(TypeList< T, Ts... >, As... args)
Type loop.
Definition: SerialAccess.h:168

◆ 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 741 of file Moose.C.

Referenced by colorConsole(), and setColorConsole().

◆ _deprecated_is_error

bool Moose::_deprecated_is_error = false

Variable to toggle only deprecated warnings as errors.

Definition at line 757 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 758 of file Moose.C.

Referenced by InputParameters::finalize(), DataFileInterface::getDataFilePath(), moose::internal::mooseErrorRaw(), MooseServer::parseDocumentForDiagnostics(), 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 759 of file Moose.C.

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

◆ _trap_fpe

bool Moose::_trap_fpe

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 756 of file Moose.C.

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

◆ always_false

template<class... Ts>
constexpr std::false_type Moose::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.

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

Definition at line 590 of file MooseTypes.h.

◆ 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

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 230 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 26 of file Conversion.C.

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

◆ dim

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

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 153 of file Moose.h.

Referenced by HierarchicalGridPartitioner::_do_partition(), GridPartitioner::_do_partition(), MFEMProblem::addFunction(), Assembly::Assembly(), Assembly::attachQRuleElem(), Assembly::attachQRuleFace(), BatchMeshGeneratorAction::BatchMeshGeneratorAction(), MeshGenerator::buildDistributedMesh(), Assembly::buildFaceFE(), Assembly::buildFaceNeighborFE(), Assembly::buildFE(), Assembly::buildLowerDDualFE(), Assembly::buildLowerDFE(), MooseMesh::buildMeshBaseObject(), MeshGenerator::buildMeshBaseObject(), Assembly::buildNeighborFE(), ParsedFunctorMaterialTempl< is_ad >::buildParsedFunction(), MooseMesh::buildPRefinementAndCoarseningMaps(), MeshGenerator::buildReplicatedMesh(), MooseMesh::buildTypedMesh(), Assembly::buildVectorDualLowerDFE(), Assembly::buildVectorFaceFE(), Assembly::buildVectorFaceNeighborFE(), Assembly::buildVectorFE(), Assembly::buildVectorLowerDFE(), Assembly::buildVectorNeighborFE(), ColumnMajorMatrixTempl< Real >::ColumnMajorMatrixTempl(), Assembly::computeADFace(), LinearFVAnisotropicDiffusion::computeBoundaryMatrixContribution(), LinearFVAnisotropicDiffusion::computeBoundaryRHSContribution(), Assembly::computeFaceMap(), LinearFVAnisotropicDiffusion::computeFluxMatrixContribution(), LinearFVAnisotropicDiffusion::computeFluxRHSContribution(), Assembly::computeGradPhiAD(), GenericFunctionVectorMaterialTempl< is_ad >::computeQpFunctions(), ElementW1pError::computeQpIntegral(), GenericConstantVectorMaterialTempl< is_ad >::computeQpProperties(), FVAnisotropicDiffusion::computeQpResidual(), Assembly::computeSinglePointMapAD(), ArrayParsedAux::computeValue(), ParsedAux::computeValue(), ParsedVectorAux::computeValue(), ElementH1ErrorFunctionAux::computeValue(), MooseVariableData< OutputType >::computeValuesInternal(), StackGenerator::computeWidth(), BatchMeshGeneratorAction::convertStringToCompoundRealScalar(), Assembly::createQRules(), dataLoad(), dataStore(), MooseMesh::detectOrthogonalDimRanges(), MooseMesh::detectPairedSidesets(), SideDiffusiveFluxIntegralTempl< is_ad, Real >::diffusivityGradientProduct(), InitialConditionTempl< T >::dotHelper(), MooseMesh::effectiveSpatialDimension(), MooseVariableFE< Real >::evaluate(), IntersectionPointsAlongLine::execute(), FaceInfo::FaceInfo(), ColumnMajorMatrixTempl< Real >::fill(), MooseMesh::findAdaptivityQpMaps(), findContactPoint(), ExtraNodesetGenerator::generate(), StackGenerator::generate(), GenericFunctionVectorMaterialTempl< is_ad >::GenericFunctionVectorMaterialTempl(), MooseMesh::getBlocksMaxDimension(), Coupleable::getDefaultVectorValue(), Assembly::getFE(), Assembly::getFEFace(), Assembly::getFEFaceNeighbor(), Assembly::getFENeighbor(), MultiAppTransfer::getFromBoundingBoxes(), PenetrationThread::getInfoForFacesWithCommonNodes(), MultiAppGeneralFieldTransfer::getMaxToProblemsBBoxDimensions(), Assembly::getVectorFE(), Assembly::getVectorFEFace(), Assembly::getVectorFEFaceNeighbor(), Assembly::getVectorFENeighbor(), ArrayFunctionIC::gradient(), Moose::FV::greenGaussGradient(), Moose::FV::harmonicInterpolation(), MooseAppCoordTransform::hasScalingOrRotationTransformation(), Assembly::havePRefinement(), Assembly::helpersRequestData(), ParsedDownSelectionPositions::initialize(), PropertyReadFile::initVoronoiCenterPoints(), PenetrationThread::isFaceReasonableCandidate(), MultiAppCoordTransform::isIdentity(), MooseUtils::isZero(), PointListAdaptor< Point >::kdtree_distance(), ValueCache< T >::kdtree_get_pt(), PointListAdaptor< Point >::kdtree_get_pt(), NanoflannMeshAdaptor< Dim >::kdtree_get_pt(), NanoflannMeshSubdomainAdaptor< Dim >::kdtree_get_pt(), NodalPatchRecovery::multiIndex(), MathUtils::multiIndex(), ResetDisplacedMeshThread::onNode(), SecondaryNeighborhoodThread::operator()(), ColumnMajorMatrixTempl< Real >::operator*(), ColumnMajorMatrixTempl< Real >::operator+=(), ColumnMajorMatrixTempl< Real >::operator=(), MaterialOutputAction::outputHelper(), GriddedData::parse(), ParsedFunctorMaterialTempl< is_ad >::ParsedFunctorMaterialTempl(), PenetrationLocator::PenetrationLocator(), PropertyReadFile::PropertyReadFile(), Assembly::qruleFaceHelper(), Assembly::qrules(), Assembly::reinitFE(), Assembly::reinitFEFace(), Assembly::reinitFVFace(), Assembly::reinitNeighbor(), MooseUtils::relativeFuzzyEqual(), Assembly::resizeADMappingObjects(), PiecewiseMultilinear::sampleInternal(), Assembly::setFaceQRule(), Assembly::setLowerQRule(), Assembly::setMortarQRule(), Assembly::setNeighborQRule(), SideSetsGeneratorBase::setup(), Assembly::setVolumeQRule(), sideIntersectedByLine(), MultiIndex< Real >::slice(), MultiApp::transformBoundingBox(), MortarData::update(), BoundingBoxIC::value(), MeshBaseImageSampler::vtkFlip(), Assembly::~Assembly(), and PenetrationLocator::~PenetrationLocator().

◆ eigen_problem_type_to_enum

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

Definition at line 29 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 28 of file Conversion.C.

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

◆ EMPTY_BLOCK_IDS

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

Definition at line 683 of file MooseTypes.h.

◆ EMPTY_BOUNDARY_IDS

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

Definition at line 684 of file MooseTypes.h.

◆ execute_flags

ExecFlagEnum Moose::execute_flags

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.

Referenced by InputParameters::declareControllable(), and groupUserObjects().

◆ interrupt_signal_number

int 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 760 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(), ComputeResidualThread::computeOnInternalFace(), ComputeFullJacobianThread::computeOnInternalFace(), MultiAppGeometricInterpolationTransfer::computeTransformation(), SubdomainsDivision::divisionIndex(), ElementSubdomainModifier::execute(), MultiAppGeometricInterpolationTransfer::fillSourceInterpolationPoints(), ElementSubdomainModifierBase::gatherMovingBoundaryChangesHelper(), RenameBlockGenerator::generate(), BlockToMeshConverterGenerator::generate(), XYDelaunayGenerator::generate(), XYMeshLineCutter::generate(), MooseMeshUtils::getSubdomainID(), TimedSubdomainModifier::getSubdomainIDAndCheck(), MooseMeshUtils::hasSubdomainID(), ElementSubdomainModifierBase::initialSetup(), MultiAppDofCopyTransfer::initialSetup(), MultiAppGeometricInterpolationTransfer::interpolateTargetPoints(), AttribSubdomains::isMatch(), FaceInfo::neighborSubdomainID(), ComputeJacobianForScalingThread::operator()(), ThreadedElementLoopBase< ConstElemPointerRange >::operator()(), ComputeLinearFVElementalThread::operator()(), ComputeLinearFVFaceThread::operator()(), ThreadedFaceLoop< RangeType >::operator()(), ComputeLinearFVFaceThread::printBlockExecutionInformation(), ComputeFVFluxThread< RangeType, AttribMatrixTags >::printBlockExecutionInformation(), ComputeFVFluxThread< RangeType, AttribMatrixTags >::printBoundaryExecutionInformation(), MooseMeshXYCuttingUtils::quadToTriOnLine(), MooseMeshXYCuttingUtils::quasiTriElementsFixer(), and PiecewiseByBlockLambdaFunctor< T >::setFunctor().

◆ 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_TAG_ID

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

Definition at line 23 of file MooseTypes.C.

Referenced by MooseVariableDataBase< OutputType >::assignNodalValue().

◆ 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 31 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 33 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

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_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 34 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 762 of file Moose.C.

◆ show_trace

bool Moose::show_trace = true

Set to true (the default) to print the stack trace with error and warning messages - false to omit it.

Definition at line 761 of file Moose.C.

Referenced by InputParameters::attemptPrintDeprecated(), Factory::deprecatedMessage(), MooseApp::MooseApp(), moose::internal::mooseDeprecatedStream(), moose::internal::mooseErrorRaw(), and MooseBaseParameterInterface::paramError().

◆ 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 27 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 32 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 30 of file Conversion.C.

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