www.mooseframework.org
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

 FV
 
 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< RankFourTensor >
 
struct  ADType< RankThreeTensor >
 
struct  ADType< RankTwoTensor >
 
struct  ADType< Real >
 
struct  ADType< RealEigenVector >
 
struct  ADType< SymmetricRankFourTensor >
 
struct  ADType< SymmetricRankTwoTensor >
 
struct  ADType< VariableGradient >
 
struct  ADType< VariableSecond >
 
struct  ADType< VariableValue >
 
struct  ADType< W< ADReal > >
 
struct  ADType< W< Real > >
 
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  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
 
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...
 
class  LibtorchTorchScriptNeuralNet
 
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...
 
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 }
 

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)
 
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_name, int argc, char *argv[])
 Create a MooseApp from command-line arguments. More...
 
void addMainCommandLineParams (InputParameters &params)
 Adds the command line parameters needed from within main, which will also need to be added to MooseApp so that they show up in –help. More...
 
template<typename DefaultAppType >
void main (int argc, char *argv[])
 Initialize, create and run a MooseApp. More...
 
void findContactPoint (PenetrationInfo &p_info, FEBase *fe_elem, FEBase *fe_side, FEType &fe_side_type, const Point &secondary_point, bool start_with_centroid, const Real tangential_tolerance, bool &contact_point_on_side)
 Finds the closest point (called the contact point) on the primary_elem on side "side" to the secondary_point. More...
 
void restrictPointToFace (Point &p, const Elem *side, std::vector< const Node *> &off_edge_nodes)
 
void to_json (nlohmann::json &json, const Moose::LibtorchArtificialNeuralNet *const &network)
 
void initial_condition (EquationSystems &es, const std::string &system_name)
 
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<>
QuadratureType stringToEnum< QuadratureType > (const std::string &s)
 
template<>
Order stringToEnum< Order > (const std::string &s)
 
template<>
CoordinateSystemType stringToEnum< CoordinateSystemType > (const std::string &s)
 
template<>
SolveType stringToEnum< SolveType > (const std::string &s)
 
template<>
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)
 
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 (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 Point &p0, const Point &normal, const MeshBase &mesh, std::vector< const Elem *> &intersected_elems)
 Find all of the elements intersected by a plane. More...
 
void elementsIntersectedByPlane (const Point &p0, const Point &p1, const Point &p2, const MeshBase &mesh, std::vector< const 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...
 
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 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 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 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 (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<std::size_t N>
void derivInsert (SemiDynamicSparseNumberArray< Real, libMesh::dof_id_type, NWrapper< N >> &derivs, libMesh::dof_id_type index, Real value)
 
template<typename T >
void initDofIndices (T &data, const Elem &elem)
 
void associateSyntaxInner (Syntax &syntax, ActionFactory &action_factory)
 
void registerAll (Factory &f, ActionFactory &af, Syntax &s)
 
void registerObjects (Factory &factory)
 
void registerObjects (Factory &factory, const std::set< std::string > &obj_labels)
 
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<>
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)
 
std::string stringify (libMesh::FEFamily f)
 
Point toPoint (const std::vector< Real > &pos)
 Convert point represented as std::vector into Point. More...
 
void findElementsIntersectedByPlane (const 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...
 

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...
 
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 = 216
 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 T >
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 INTERNAL_SIDE_LOWERD_ID = libMesh::Elem::invalid_subdomain_id - 2
 
const SubdomainID BOUNDARY_SIDE_LOWERD_ID = libMesh::Elem::invalid_subdomain_id - 3
 
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 555 of file MooseTypes.h.

◆ RelationshipManagerInputParameterCallback

The type for the callback to set RelationshipManager parameters.

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

617 {
618  PRE_IC = 0,
619  PRE_AUX = 1,
620  POST_AUX = 2,
621  ALL = 3
622 };

◆ ComputeType

enum Moose::ComputeType
strong

The type of nonlinear computation being performed.

Enumerator
Residual 
Jacobian 
ResidualAndJacobian 

Definition at line 693 of file MooseTypes.h.

◆ ConstraintFormulationType

Type of constraint formulation.

Enumerator
Penalty 
Kinematic 

Definition at line 830 of file MooseTypes.h.

831 {
832  Penalty,
833  Kinematic
834 };

◆ ConstraintJacobianType

Enumerator
SecondarySecondary 
SecondaryPrimary 
PrimarySecondary 
PrimaryPrimary 
LowerLower 
LowerSecondary 
LowerPrimary 
SecondaryLower 
PrimaryLower 

Definition at line 709 of file MooseTypes.h.

◆ ConstraintSideType

Enumerator
SIDE_PRIMARY 
SIDE_SECONDARY 

Definition at line 650 of file MooseTypes.h.

◆ ConstraintType

Enumerator
Secondary 
Primary 

Definition at line 670 of file MooseTypes.h.

◆ CoordinateSystemType

Enumerator
COORD_XYZ 
COORD_RZ 
COORD_RSPHERICAL 

Definition at line 722 of file MooseTypes.h.

722  : int
723 {
724  COORD_XYZ = 0,
725  COORD_RZ,
727 };

◆ CouplingType

Enumerator
COUPLING_DIAG 
COUPLING_FULL 
COUPLING_CUSTOM 

Definition at line 643 of file MooseTypes.h.

◆ DGJacobianType

Enumerator
ElementElement 
ElementNeighbor 
NeighborElement 
NeighborNeighbor 

Definition at line 662 of file MooseTypes.h.

◆ DGResidualType

Enumerator
Element 
Neighbor 

Definition at line 656 of file MooseTypes.h.

657 {
658  Element,
659  Neighbor
660 };

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

784 {
785  EPT_HERMITIAN,
792 };
Generalized Non-Hermitian.
Definition: MooseTypes.h:789
Generalized Hermitian indefinite.
Definition: MooseTypes.h:788
use whatever SLPEC has by default
Definition: MooseTypes.h:791
Generalized Non-Hermitian with positive (semi-)definite B.
Definition: MooseTypes.h:790
Non-Hermitian.
Definition: MooseTypes.h:786
Generalized Hermitian.
Definition: MooseTypes.h:787

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

768 {
769  EST_POWER,
770  EST_ARNOLDI,
774  EST_NEWTON,
775  EST_PJFNK,
776  EST_PJFNKMO,
777  EST_JFNK
778 };
Newton-based eigensolver with an assembled Jacobian matrix (fully coupled by default) ...
Definition: MooseTypes.h:774
The same as PJFNK except that matrix-vector multiplication is employed to replace residual evaluation...
Definition: MooseTypes.h:776
Power / Inverse / RQI.
Definition: MooseTypes.h:769
Krylov-Schur.
Definition: MooseTypes.h:771
Preconditioned Jacobian-free Newton Krylov.
Definition: MooseTypes.h:775
Nonlinear inverse power.
Definition: MooseTypes.h:773
Jacobi-Davidson.
Definition: MooseTypes.h:772
Jacobian-free Newton Krylov.
Definition: MooseTypes.h:777

◆ ElementType

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

Definition at line 676 of file MooseTypes.h.

676  : unsigned int
677 {
678  Element = DGResidualType::Element,
681 };

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

237 {
238  Volume,
239  Face
240 };

◆ 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 838 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 604 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 855 of file MooseTypes.h.

856 {
857  MFFD_INVALID,
858  MFFD_WP,
859  MFFD_DS
860 };
means not set
Definition: MooseTypes.h:857

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

◆ MortarType

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

Definition at line 683 of file MooseTypes.h.

683  : unsigned int
684 {
685  Secondary = static_cast<unsigned int>(Moose::ElementType::Element),
686  Primary = static_cast<unsigned int>(Moose::ElementType::Neighbor),
687  Lower = static_cast<unsigned int>(Moose::ElementType::Lower)
688 };

◆ PatchUpdateType

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

Enumerator
Never 
Always 
Auto 
Iteration 

Definition at line 865 of file MooseTypes.h.

866 {
867  Never,
868  Always,
869  Auto,
870  Iteration
871 };

◆ PCSideType

Preconditioning side.

Enumerator
PCS_LEFT 
PCS_RIGHT 
PCS_SYMMETRIC 
PCS_DEFAULT 

Use whatever we have in PETSc.

Definition at line 732 of file MooseTypes.h.

733 {
734  PCS_LEFT,
735  PCS_RIGHT,
737  PCS_DEFAULT
738 };
Use whatever we have in PETSc.
Definition: MooseTypes.h:737

◆ RelationshipManagerType

enum Moose::RelationshipManagerType : unsigned char
strong

Main types of Relationship Managers.

Enumerator
DEFAULT 
GEOMETRIC 
ALGEBRAIC 
COUPLING 

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

704  : unsigned char
705 {
707 };

◆ RMSystemType

Enumerator
NONLINEAR 
AUXILIARY 
NONE 

Definition at line 884 of file MooseTypes.h.

885 {
886  NONLINEAR,
887  AUXILIARY,
888  NONE
889 };

◆ SolutionIterationType

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

Definition at line 229 of file MooseTypes.h.

229  : unsigned short
230 {
231  Time = 0,
232  Nonlinear
233 };

◆ SolutionState

Enumerator
Current 
Old 
Older 
PreviousNL 

Definition at line 221 of file MooseTypes.h.

221  : int
222 {
223  Current = 0,
224  Old = 1,
225  Older = 2,
226  PreviousNL = -1
227 };

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

756 {
757  ST_PJFNK,
758  ST_JFNK,
759  ST_NEWTON,
760  ST_FD,
761  ST_LINEAR
762 };
Full Newton Solve.
Definition: MooseTypes.h:759
Solving a linear problem.
Definition: MooseTypes.h:761
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:758
Use finite differences to compute Jacobian.
Definition: MooseTypes.h:760
Preconditioned Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:757

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

◆ VarFieldType

Enumerator
VAR_FIELD_STANDARD 
VAR_FIELD_SCALAR 
VAR_FIELD_VECTOR 
VAR_FIELD_ARRAY 
VAR_FIELD_ANY 

Definition at line 634 of file MooseTypes.h.

◆ VarKindType

Framework-wide stuff.

Enumerator
VAR_SOLVER 
VAR_AUXILIARY 
VAR_ANY 

Definition at line 627 of file MooseTypes.h.

◆ VectorTagType

Enumerator
VECTOR_TAG_RESIDUAL 
VECTOR_TAG_SOLUTION 
VECTOR_TAG_ANY 

Definition at line 891 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 797 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  registerTask("init_physics", false);
102 
103  // This task does not construct an object, but it needs all of the parameters that
104  // would normally be used to construct an object.
105  registerMooseObjectTask("determine_system_type", Executioner, true);
106 
107  registerMooseObjectTask("setup_mesh", MooseMesh, false);
108  registerMooseObjectTask("set_mesh_base", MooseMesh, false);
109  registerMooseObjectTask("init_mesh", MooseMesh, false);
110  registerMooseObjectTask("add_mesh_generator", MeshGenerator, false);
111  registerTask("create_added_mesh_generators", true);
112  registerMooseObjectTask("append_mesh_generator", MeshGenerator, false);
113 
114  registerMooseObjectTask("add_kernel", Kernel, false);
115  appendMooseObjectTask ("add_kernel", EigenKernel);
116  appendMooseObjectTask ("add_kernel", VectorKernel);
117  appendMooseObjectTask ("add_kernel", ArrayKernel);
118 
119  registerMooseObjectTask("add_variable", MooseVariableBase, false);
120  registerMooseObjectTask("add_aux_variable", MooseVariableBase, false);
121  registerMooseObjectTask("add_elemental_field_variable", MooseVariableBase, false);
122 
123  registerMooseObjectTask("add_nodal_kernel", NodalKernel, false);
124 
125  registerMooseObjectTask("add_functor_material", FunctorMaterial, false);
126  registerMooseObjectTask("add_material", MaterialBase, false);
127  appendDeprecatedMooseObjectTask("add_material", FunctorMaterial);
128  registerMooseObjectTask("add_bc", BoundaryCondition, false);
129 
130  registerMooseObjectTask("add_function", Function, false);
131  registerMooseObjectTask("add_distribution", Distribution, false);
132  registerMooseObjectTask("add_sampler", Sampler, false);
133 
134  registerMooseObjectTask("add_aux_kernel", AuxKernel, false);
135  appendMooseObjectTask ("add_aux_kernel", VectorAuxKernel);
136  appendMooseObjectTask ("add_aux_kernel", ArrayAuxKernel);
137  registerMooseObjectTask("add_bound", Bounds, false);
138 
139  registerMooseObjectTask("add_scalar_kernel", ScalarKernel, false);
140  registerMooseObjectTask("add_aux_scalar_kernel", AuxScalarKernel, false);
141  registerMooseObjectTask("add_dirac_kernel", DiracKernel, false);
142  appendMooseObjectTask ("add_dirac_kernel", VectorDiracKernel);
143  registerMooseObjectTask("add_dg_kernel", DGKernel, false);
144  registerMooseObjectTask("add_fv_kernel", FVKernel, false);
145  registerMooseObjectTask("add_linear_fv_kernel", LinearFVKernel, false);
146  registerMooseObjectTask("add_fv_bc", FVBoundaryCondition, false);
147  registerMooseObjectTask("add_linear_fv_bc", LinearFVBoundaryCondition, false);
148  registerMooseObjectTask("add_fv_ik", FVInterfaceKernel, false);
149  registerMooseObjectTask("add_interface_kernel", InterfaceKernel, false);
150  appendMooseObjectTask ("add_interface_kernel", VectorInterfaceKernel);
151  registerMooseObjectTask("add_constraint", Constraint, false);
152 
153  registerMooseObjectTask("add_ic", InitialCondition, false);
154  appendMooseObjectTask ("add_ic", ScalarInitialCondition);
155 
156  registerMooseObjectTask("add_fv_ic", FVInitialCondition, false);
157 
158  registerMooseObjectTask("add_damper", Damper, false);
159  registerMooseObjectTask("setup_predictor", Predictor, false);
160  registerMooseObjectTask("add_time_steppers", TimeStepper, false);
161  registerMooseObjectTask("add_time_stepper", TimeStepper, false);
162  registerTask ("compose_time_stepper", true);
163  registerMooseObjectTask("setup_time_integrator", TimeIntegrator, false);
164 
165  registerMooseObjectTask("add_preconditioning", MoosePreconditioner, false);
166  registerMooseObjectTask("add_field_split", Split, false);
167 
168  registerMooseObjectTask("add_mesh_division", MeshDivision, false);
169  registerMooseObjectTask("add_user_object", UserObject, false);
170  appendMooseObjectTask ("add_user_object", Postprocessor);
171 
172  registerMooseObjectTask("add_postprocessor", Postprocessor, false);
173  registerMooseObjectTask("add_vector_postprocessor", VectorPostprocessor, false);
174  registerMooseObjectTask("add_reporter", Reporter, false);
175  registerMooseObjectTask("add_positions", Positions, false);
176  registerMooseObjectTask("add_times", Times, false);
177 
178  registerMooseObjectTask("add_indicator", Indicator, false);
179  registerMooseObjectTask("add_marker", Marker, false);
180 
181  registerMooseObjectTask("add_multi_app", MultiApp, false);
182  registerMooseObjectTask("add_transfer", Transfer, false);
183 
184  registerMooseObjectTask("add_output", Output, false);
185 
186  registerMooseObjectTask("add_control", Control, false);
187  registerMooseObjectTask("add_partitioner", MoosePartitioner, false);
188 
189  // clang-format on
190 
191  registerTask("dynamic_object_registration", false);
192  registerTask("common_output", true);
193  registerTask("setup_recover_file_base", true);
194  registerTask("recover_meta_data", true);
195 
196  registerTask("add_bounds_vectors", false);
197  registerTask("add_periodic_bc", false);
198  registerTask("add_aux_variable", false);
199  registerTask("add_external_aux_variables", true);
200  registerTask("add_variable", false);
201  registerTask("add_mortar_variable", false);
202 
203  registerTask("execute_mesh_generators", true);
204  registerTask("uniform_refine_mesh", false);
205  registerTask("prepare_mesh", false);
206  registerTask("delete_remote_elements_after_late_geometric_ghosting", false);
207  registerTask("setup_mesh_complete", true); // calls prepare
208  registerTask("post_mesh_prepared", false);
209  registerTask("add_geometric_rm", false);
210  registerTask("attach_geometric_rm", true);
211  registerTask("attach_geometric_rm_final", true);
212 
213  registerTask("init_displaced_problem", false);
214 
215  registerTask("add_algebraic_rm", false);
216  registerTask("attach_algebraic_rm", true);
217  registerTask("add_coupling_rm", false);
218  registerTask("attach_coupling_rm", true);
219  registerTask("init_problem", true);
220  registerTask("check_copy_nodal_vars", true);
221  registerTask("copy_nodal_vars", true);
222  registerTask("copy_nodal_aux_vars", true);
223  registerTask("setup_postprocessor_data", false);
224  registerTask("setup_time_steppers", true);
225 
226  registerTask("setup_dampers", true);
227  registerTask("check_integrity", true);
228  registerTask("resolve_optional_materials", true);
229  registerTask("check_integrity_early", true);
230  registerTask("setup_quadrature", true);
231 
233  registerTask("no_action", false); // Used for Empty Action placeholders
234  registerTask("set_global_params", false);
235  registerTask("setup_adaptivity", false);
236  registerTask("meta_action", false);
237  registerTask("setup_residual_debug", false);
238  registerTask("setup_oversampling", false);
239  registerTask("deprecated_block", false);
240  registerTask("set_adaptivity_options", false);
241  registerTask("add_mortar_interface", false);
242  registerTask("coupling_functor_check", true);
243  registerTask("add_master_action_material", false);
244  registerTask("setup_projected_properties", false);
245  registerTask("create_application_block", false);
246 
247  // Dummy Actions (useful for sync points in the dependencies)
248  registerTask("setup_function_complete", false);
249  registerTask("setup_variable_complete", false);
250  registerTask("setup_executioner_complete", false);
251  registerTask("ready_to_init", true);
252 
253  // Output related actions
254  registerTask("add_output_aux_variables", true);
255  registerTask("check_output", true);
256  registerTask("declare_late_reporters", true);
257 
258  registerTask("create_problem_default", true);
259  registerTask("create_problem_custom", false);
260  registerTask("create_problem_complete", false);
261 
262  // Action for setting up the signal-based checkpoint
263  registerTask("auto_checkpoint_action", true);
264  /**************************/
265  /****** Dependencies ******/
266  /**************************/
277  // clang-format off
278  syntax.addDependencySets("(meta_action)"
279  "(dynamic_object_registration)"
280  "(common_output)"
281  "(set_global_params)"
282  "(setup_recover_file_base)"
283  "(check_copy_nodal_vars)"
284  "(setup_mesh)"
285  "(add_geometric_rm)"
286  "(add_partitioner)"
287  "(add_mesh_generator)"
288  "(create_added_mesh_generators)"
289  "(append_mesh_generator)"
290  "(execute_mesh_generators)"
291  "(recover_meta_data)"
292  "(set_mesh_base)"
293  "(attach_geometric_rm)"
294  "(init_mesh)"
295  "(prepare_mesh)"
296  "(add_mortar_interface)"
297  "(uniform_refine_mesh)"
298  "(setup_mesh_complete)"
299  "(post_mesh_prepared)"
300  "(determine_system_type)"
301  "(create_problem)"
302  "(create_problem_custom)"
303  "(create_problem_default)"
304  "(create_problem_complete)"
305  "(init_physics)"
306  "(setup_postprocessor_data)"
307  "(setup_time_integrator)"
308  "(setup_executioner)"
309  "(setup_executioner_complete)"
310  "(read_executor)"
311  "(add_executor)"
312  "(check_integrity_early)"
313  "(setup_predictor)"
314  "(init_displaced_problem)"
315  "(add_aux_variable, add_variable, add_elemental_field_variable,"
316  " add_external_aux_variables)"
317  "(add_mortar_variable)"
318  "(setup_variable_complete)"
319  "(setup_quadrature)"
320  "(add_function)"
321  "(add_periodic_bc)"
322  "(add_user_object)"
323  "(add_distribution)"
324  "(add_sampler)"
325  "(setup_function_complete)"
326  "(setup_adaptivity)"
327  "(set_adaptivity_options)"
328  "(add_ic, add_fv_ic)"
329  "(add_constraint, add_field_split)"
330  "(add_preconditioning)"
331  "(add_times)"
332  "(add_time_stepper, add_time_steppers)"
333  "(compose_time_stepper)"
334  "(setup_time_steppers)"
335  "(ready_to_init)"
336  "(setup_dampers)"
337  "(setup_residual_debug)"
338  "(add_bounds_vectors)"
339  "(add_positions)"
340  "(add_mesh_division)" // NearestPositionsDivision uses a Positions
341  "(add_multi_app)"
342  "(add_transfer)"
343  "(copy_nodal_vars, copy_nodal_aux_vars)"
344  "(add_material)"
345  "(add_master_action_material)"
346  "(add_functor_material)"
347  "(setup_projected_properties)"
348  "(add_output_aux_variables)"
349  "(add_output)"
350  "(auto_checkpoint_action)"
351  "(add_postprocessor)"
352  "(add_vector_postprocessor)" // MaterialVectorPostprocessor requires this
353  // to be after material objects are created.
354  "(add_reporter)"
355  "(declare_late_reporters)"
356  "(add_aux_kernel, add_bc, add_damper, add_dirac_kernel, add_kernel,"
357  " add_nodal_kernel, add_dg_kernel, add_fv_kernel, add_linear_fv_kernel,"
358  " add_fv_bc, add_linear_fv_bc, add_fv_ik, add_interface_kernel,"
359  " add_scalar_kernel, add_aux_scalar_kernel, add_indicator, add_marker,"
360  " add_bound)"
361  "(resolve_optional_materials)"
362  "(add_algebraic_rm)"
363  "(add_coupling_rm)"
364  "(attach_geometric_rm_final)"
365  "(attach_algebraic_rm)"
366  "(attach_coupling_rm)"
367  "(coupling_functor_check)"
368  "(delete_remote_elements_after_late_geometric_ghosting)"
369  "(init_problem)"
370  "(add_control)"
371  "(check_output)"
372  "(check_integrity)"
373  "(create_application_block)");
374  // clang-format on
375 }
Base class for function objects.
Definition: Function.h:37
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:19
Class that hold the whole problem being solved.
Definition: Problem.h:19
Definition: Marker.h:35
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
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.
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 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
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 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:60
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:39
The Executor class directs the execution flow of simulations.
Definition: Executor.h:26
Base class for all Transfer objects.
Definition: Transfer.h:36

◆ addMainCommandLineParams()

void Moose::addMainCommandLineParams ( InputParameters params)

Adds the command line parameters needed from within main, which will also need to be added to MooseApp so that they show up in –help.

Definition at line 26 of file MooseMain.C.

Referenced by createMooseApp(), and MooseApp::validParams().

27 {
28  params.addCommandLineParam<std::vector<std::string>>(
29  "input_file",
30  "-i <input_files>",
31  "Specify one or multiple input files. Multiple files get merged into a single simulation "
32  "input.");
33 
34  params.addCommandLineParam<std::string>(
35  "application_type", "Application/type=<app_type>", "Specify the application type.");
36 }
void addCommandLineParam(const std::string &name, const std::string &syntax, const std::string &doc_string)

◆ 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:299

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

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

Definition at line 40 of file NonlinearEigenSystem.C.

Referenced by NonlinearEigenSystem::NonlinearEigenSystem().

41 {
42  EigenProblem * p = es.parameters.get<EigenProblem *>("_eigen_problem");
43  EigenSystem & eigen_system = es.get_system<EigenSystem>(system_name);
44  NonlinearEigenSystem & eigen_nl = p->getNonlinearEigenSystem(/*nl_sys_num=*/0);
45 
46  // If this is a nonlinear eigenvalue problem,
47  // we do not need to assemble anything
49  {
50  // If you want an efficient eigensolver,
51  // please use PETSc 3.13 or newer.
52  // We need to do an unnecessary assembly,
53  // if you use PETSc that is older than 3.13.
54 #if PETSC_RELEASE_LESS_THAN(3, 13, 0)
55  if (eigen_system.has_matrix_B())
56  p->computeJacobianTag(*eigen_system.current_local_solution,
57  eigen_system.get_matrix_B(),
58  eigen_nl.eigenMatrixTag());
59 #endif
60  return;
61  }
62 
63 #if !PETSC_RELEASE_LESS_THAN(3, 13, 0)
64  // If we use shell matrices and do not use a shell preconditioning matrix,
65  // we only need to form a preconditioning matrix
66  if (eigen_system.use_shell_matrices() && !eigen_system.use_shell_precond_matrix())
67  {
68  p->computeJacobianTag(*eigen_system.current_local_solution,
69  eigen_system.get_precond_matrix(),
70  eigen_nl.precondMatrixTag());
71  return;
72  }
73 #endif
74  // If it is a linear generalized eigenvalue problem,
75  // we assemble A and B together
76  if (eigen_system.generalized())
77  {
78  p->computeJacobianAB(*eigen_system.current_local_solution,
79  eigen_system.get_matrix_A(),
80  eigen_system.get_matrix_B(),
81  eigen_nl.nonEigenMatrixTag(),
82  eigen_nl.eigenMatrixTag());
83 #if LIBMESH_HAVE_SLEPC
84  if (p->negativeSignEigenKernel())
85  MatScale(static_cast<PetscMatrix<Number> &>(eigen_system.get_matrix_B()).mat(), -1.0);
86 #endif
87  return;
88  }
89 
90  // If it is a linear eigenvalue problem, we assemble matrix A
91  {
92  p->computeJacobianTag(*eigen_system.current_local_solution,
93  eigen_system.get_matrix_A(),
94  eigen_nl.nonEigenMatrixTag());
95 
96  return;
97  }
98 }
Nonlinear eigenvalue system to be solved.
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
bool negativeSignEigenKernel() const
A flag indicates if a negative sign is used in eigen kernels.
Definition: EigenProblem.h:60
bool isNonlinearEigenvalueSolver() const
Definition: EigenProblem.C:640
NonlinearEigenSystem & getNonlinearEigenSystem(const unsigned int nl_sys_num)
Definition: EigenProblem.h:302
const InputParameters & parameters() const
Get the parameters of the object.
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:250
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:166

◆ associateSyntax()

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

Definition at line 608 of file Moose.C.

609 {
610  associateSyntaxInner(syntax, action_factory);
611  registerActions(syntax, action_factory);
612 }
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:406
void associateSyntaxInner(Syntax &syntax, ActionFactory &action_factory)
Definition: Moose.C:424

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

Referenced by associateSyntax(), and registerAll().

425 {
431  registerSyntax("DiffusionCG", "Physics/Diffusion/ContinuousGalerkin/*");
432  registerSyntax("DiffusionFV", "Physics/Diffusion/FiniteVolume/*");
433 
434  registerSyntaxTask("CopyNodalVarsAction", "Variables/*", "check_copy_nodal_vars");
435  registerSyntaxTask("CopyNodalVarsAction", "Variables/*", "copy_nodal_vars");
436  registerSyntaxTask("CopyNodalVarsAction", "AuxVariables/*", "check_copy_nodal_vars");
437  registerSyntaxTask("CopyNodalVarsAction", "AuxVariables/*", "copy_nodal_aux_vars");
438 
439  registerSyntaxTask("AddKernelAction", "Kernels/*", "add_kernel");
440  registerSyntaxTask("AddNodalKernelAction", "NodalKernels/*", "add_nodal_kernel");
441  registerSyntaxTask("AddKernelAction", "AuxKernels/*", "add_aux_kernel");
442 
443  registerSyntax("AddAuxKernelAction", "AuxVariables/*/AuxKernel");
444 
445  registerSyntaxTask("AddScalarKernelAction", "ScalarKernels/*", "add_scalar_kernel");
446  registerSyntaxTask("AddScalarKernelAction", "AuxScalarKernels/*", "add_aux_scalar_kernel");
447 
448  registerSyntaxTask("AddBCAction", "BCs/*", "add_bc");
449 
450  registerSyntax("CreateProblemAction", "Problem");
451  registerSyntax("DynamicObjectRegistrationAction", "Problem");
452 
453  registerSyntax("SetupMeshAction", "Mesh");
454  registerSyntax("SetupMeshCompleteAction", "Mesh");
455  registerSyntax("CreateDisplacedProblemAction", "Mesh");
456  registerSyntax("DisplayGhostingAction", "Mesh");
457  registerSyntax("AddMeshGeneratorAction", "Mesh/*");
458  registerSyntax("ElementIDOutputAction", "Mesh");
459  syntax.registerSyntaxType("Mesh/*", "MeshGeneratorName");
460 
461  registerSyntax("AddFunctionAction", "Functions/*");
462  syntax.registerSyntaxType("Functions/*", "FunctionName");
463 
464  registerSyntax("AddMeshDivisionAction", "MeshDivisions/*");
465  syntax.registerSyntaxType("MeshDivisions/*", "MeshDivisionName");
466 
467  registerSyntax("GlobalParamsAction", "GlobalParams");
468 
469  registerSyntax("AddDistributionAction", "Distributions/*");
470  syntax.registerSyntaxType("Distributions/*", "DistributionName");
471 
472  registerSyntax("AddSamplerAction", "Samplers/*");
473  syntax.registerSyntaxType("Samplers/*", "SamplerName");
474 
475  registerSyntax("SetupDebugAction", "Debug");
476  registerSyntax("SetupResidualDebugAction", "Debug");
477 
479  registerSyntax("AddVariableAction", "Variables/*");
480  syntax.registerSyntaxType("Variables/*", "VariableName");
481  syntax.registerSyntaxType("Variables/*", "NonlinearVariableName");
482 
483  registerSyntax("AddICAction", "Variables/*/InitialCondition");
484  registerSyntax("AddFVICAction", "Variables/*/FVInitialCondition");
485 
486  registerSyntax("AddAuxVariableAction", "AuxVariables/*");
487  syntax.registerSyntaxType("AuxVariables/*", "VariableName");
488  syntax.registerSyntaxType("AuxVariables/*", "AuxVariableName");
489 
490  registerSyntax("AddICAction", "AuxVariables/*/InitialCondition");
491  registerSyntax("AddFVICAction", "AuxVariables/*/FVInitialCondition");
492 
493  registerSyntaxTask("EmptyAction", "BCs/Periodic", "no_action"); // placeholder
494  registerSyntax("AddPeriodicBCAction", "BCs/Periodic/*");
495 
496  registerSyntaxTask("AddInitialConditionAction", "ICs/*", "add_ic");
497  registerSyntaxTask("AddFVInitialConditionAction", "FVICs/*", "add_fv_ic");
498 
499  registerSyntax("AddMaterialAction", "Materials/*");
500  syntax.registerSyntaxType("Materials/*", "MaterialName");
501 
502  registerSyntax("AddFunctorMaterialAction", "FunctorMaterials/*");
503  syntax.registerSyntaxType("FunctorMaterials/*", "MaterialName");
504 
505  registerSyntax("AddPostprocessorAction", "Postprocessors/*");
506  syntax.registerSyntaxType("Postprocessors/*", "PostprocessorName");
507  syntax.registerSyntaxType("Postprocessors/*", "UserObjectName");
508 
509  registerSyntax("AddVectorPostprocessorAction", "VectorPostprocessors/*");
510  syntax.registerSyntaxType("VectorPostprocessors/*", "VectorPostprocessorName");
511 
512  registerSyntax("AddReporterAction", "Reporters/*");
513  syntax.registerSyntaxType("Reporters/*", "ReporterName");
514 
515  registerSyntax("AddPositionsAction", "Positions/*");
516  syntax.registerSyntaxType("Positions/*", "PositionsName");
517 
518  registerSyntax("AddTimesAction", "Times/*");
519  syntax.registerSyntaxType("Times/*", "TimesName");
520 
521  registerSyntax("AddDamperAction", "Dampers/*");
522 
523  registerSyntax("AddOutputAction", "Outputs/*");
524  registerSyntax("CommonOutputAction", "Outputs");
525  syntax.registerSyntaxType("Outputs/*", "OutputName");
526 
527  // Note: Preconditioner Actions will be built by this setup action
528  registerSyntax("SetupPreconditionerAction", "Preconditioning/*");
529  registerSyntax("AddFieldSplitAction", "Preconditioning/*/*");
530 
531  registerSyntax("CreateExecutionerAction", "Executioner");
532  registerSyntax("ReadExecutorParamsAction", "Executors/*");
533 
534  registerSyntaxTask("AddTimeStepperAction", "Executioner/TimeSteppers/*", "add_time_steppers");
535  registerSyntaxTask("AddTimeStepperAction", "Executioner/TimeStepper", "add_time_stepper");
536  registerSyntaxTask(
537  "ComposeTimeStepperAction", "Executioner/TimeSteppers", "compose_time_stepper");
538  registerSyntax("SetupTimeIntegratorAction", "Executioner/TimeIntegrator");
539  syntax.registerSyntaxType("Executors/*", "ExecutorName");
540 
541  registerSyntax("SetupQuadratureAction", "Executioner/Quadrature");
542  registerSyntax("SetupPredictorAction", "Executioner/Predictor");
543 #ifdef LIBMESH_ENABLE_AMR
544  registerSyntax("AdaptivityAction", "Executioner/Adaptivity");
545 #endif
546 
547  registerSyntax("PartitionerAction", "Mesh/Partitioner");
548 
549  registerSyntax("AddDiracKernelAction", "DiracKernels/*");
550 
551  registerSyntax("AddDGKernelAction", "DGKernels/*");
552  registerSyntax("AddFVKernelAction", "FVKernels/*");
553  registerSyntax("AddFVBCAction", "FVBCs/*");
554  registerSyntax("AddLinearFVBCAction", "LinearFVBCs/*");
555  registerSyntax("AddFVInterfaceKernelAction", "FVInterfaceKernels/*");
556  registerSyntax("CheckFVBCAction", "FVBCs");
557 
558  registerSyntax("AddLinearFVKernelAction", "LinearFVKernels/*");
559 
560  registerSyntax("AddInterfaceKernelAction", "InterfaceKernels/*");
561 
562  registerSyntax("AddConstraintAction", "Constraints/*");
563 
564  registerSyntax("AddUserObjectAction", "UserObjects/*");
565  syntax.registerSyntaxType("UserObjects/*", "UserObjectName");
566  registerSyntax("AddControlAction", "Controls/*");
567  registerSyntax("AddBoundAction", "Bounds/*");
568  registerSyntax("AddBoundsVectorsAction", "Bounds");
569 
570  registerSyntax("AddNodalNormalsAction", "NodalNormals");
571 
572  // Indicator
573  registerSyntax("AddElementalFieldAction", "Adaptivity/Indicators/*");
574  registerSyntax("AddIndicatorAction", "Adaptivity/Indicators/*");
575  syntax.registerSyntaxType("Adaptivity/Indicators/*", "IndicatorName");
576 
577  // Marker
578  registerSyntax("AddElementalFieldAction", "Adaptivity/Markers/*");
579  registerSyntax("AddMarkerAction", "Adaptivity/Markers/*");
580  syntax.registerSyntaxType("Adaptivity/Markers/*", "MarkerName");
581 
582  // New Adaptivity System
583  registerSyntax("SetAdaptivityOptionsAction", "Adaptivity");
584 
585  // Deprecated Block
586  registerSyntax("DeprecatedBlockAction", "DeprecatedBlock");
587 
588  // Multi Apps
589  registerSyntax("AddMultiAppAction", "MultiApps/*");
590  syntax.registerSyntaxType("MultiApps/*", "MultiAppName");
591 
592  // Transfers
593  registerSyntax("AddTransferAction", "Transfers/*");
594 
595  // Material derivative test
596  registerSyntaxTask("EmptyAction", "Debug/MaterialDerivativeTest", "no_action"); // placeholder
597  registerSyntax("MaterialDerivativeTestAction", "Debug/MaterialDerivativeTest/*");
598 
599  registerSyntax("ProjectedStatefulMaterialStorageAction", "ProjectedStatefulMaterialStorage/*");
600 
601  // Application Block System
602  registerSyntax("CreateApplicationBlockAction", "Application");
603 
604  addActionTypes(syntax);
605 }
void registerSyntaxType(const std::string &syntax, const std::string &type)
Register a type with a block.
Definition: Syntax.C:356
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 2080 of file Builder.C.

2086 {
2087  std::vector<std::string> names =
2088  MooseUtils::rsplit(root()->param<std::string>(full_name), "/", 2);
2089  if (names.size() != 2)
2090  _errmsg += hit::errormsg(root()->find(full_name),
2091  "The supplied name ReporterName '",
2092  full_name,
2093  "' must contain the '/' delimiter.");
2094  else
2095  param->set() = ReporterName(names[0], names[1]);
2096 }
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:1135
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 2269 of file Builder.C.

2275 {
2276  // Parsed as a vector of string, the vectors parameters are being cut
2277  auto rnames = root()->param<std::vector<std::string>>(full_name);
2278  param->set().resize(rnames.size()); // slightly oversized if vectors have been split
2279 
2280  // Skip empty parameter
2281  if (rnames.empty())
2282  return;
2283 
2284  // Re-assemble vector parameters
2285  unsigned int i_param = 0;
2286  bool vector_param_detected = false;
2287  for (unsigned int i = 0; i < rnames.size(); ++i)
2288  {
2289  // Look for a quote, both types
2290  std::vector<std::string> double_split =
2292  std::vector<std::string> single_split =
2294  if (double_split.size() + single_split.size() >= 3)
2295  // Either entering or exiting a vector parameter (>3 is entering another vector)
2296  // Even and >2 number of quotes means both finished and started another vector parameter
2297  if ((double_split.size() + single_split.size()) % 2 == 1)
2298  vector_param_detected = !vector_param_detected;
2299 
2300  // We're building a vector parameters, just append the text, rebuild the spaces
2301  if (vector_param_detected)
2302  param->set()[i_param] += rnames[i] + ' ';
2303  else
2304  {
2305  param->set()[i_param] += rnames[i];
2306  i_param++;
2307  }
2308  }
2309  // Use actual size after re-forming vector parameters
2310  param->set().resize(i_param);
2311 }
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:1135

◆ 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 2244 of file Builder.C.

2250 {
2251  auto rnames = root()->param<std::vector<std::string>>(full_name);
2252  param->set().resize(rnames.size());
2253 
2254  for (unsigned int i = 0; i < rnames.size(); ++i)
2255  {
2256  std::vector<std::string> names = MooseUtils::rsplit(rnames[i], "/", 2);
2257  if (names.size() != 2)
2258  _errmsg += hit::errormsg(root()->find(full_name),
2259  "The supplied name ReporterName '",
2260  rnames[i],
2261  "' must contain the '/' delimiter.");
2262  else
2263  param->set()[i] = ReporterName(names[0], names[1]);
2264  }
2265 }
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:1135
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 632 of file Moose.C.

633 {
634  return _color_console;
635 }
static bool _color_console
Definition: Moose.C:629

◆ commonAdaptivityParams()

InputParameters Moose::commonAdaptivityParams ( )

Definition at line 24 of file SetAdaptivityOptionsAction.C.

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

25 {
27  params.addParam<unsigned int>(
28  "steps", 0, "The number of adaptive steps to use when doing a Steady simulation.");
29  params.addRangeCheckedParam<unsigned int>(
30  "interval", 1, "interval>0", "The number of time steps betweeen each adaptivity phase");
31  params.addParam<unsigned int>(
32  "max_h_level",
33  0,
34  "Maximum number of times a single element can be refined. If 0 then infinite.");
35  params.addParam<Real>("start_time",
37  "The time that adaptivity will be active after.");
38  params.addParam<Real>("stop_time",
40  "The time after which adaptivity will no longer be active.");
41  params.addParam<unsigned int>(
42  "cycles_per_step",
43  1,
44  "The number of adaptive steps to use when on each timestep during a Transient simulation.");
45  params.addParam<bool>(
46  "recompute_markers_during_cycles", false, "Recompute markers during adaptivity cycles");
47  params.addParam<bool>("switch_h_to_p_refinement", false, "True to perform p-refinement");
48  const auto families_enum = AddVariableAction::getNonlinearVariableFamilies();
49  MultiMooseEnum disable_p_refinement_for_families(families_enum.getRawNames());
50  params.addParam<MultiMooseEnum>("disable_p_refinement_for_families",
51  disable_p_refinement_for_families,
52  "What families we should disable p-refinement for.");
53  return params;
54 }
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static MooseEnum getNonlinearVariableFamilies()
Get the possible variable families.
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 option 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)
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...

◆ compute_bounds()

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

Definition at line 43 of file NonlinearSystem.C.

Referenced by NonlinearSystem::NonlinearSystem().

46 {
47  FEProblemBase * p =
48  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
49  p->computeBounds(sys, lower, upper);
50 }
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
virtual void computeBounds(NonlinearImplicitSystem &sys, NumericVector< Number > &lower, NumericVector< Number > &upper)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters() const
Get the parameters of the object.

◆ compute_jacobian()

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

Definition at line 33 of file NonlinearSystem.C.

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

36 {
37  FEProblemBase * p =
38  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
39  p->computeJacobianSys(sys, soln, jacobian);
40 }
virtual void computeJacobianSys(NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian)
Form a Jacobian matrix.
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters() const
Get the parameters of the object.

◆ compute_linear_system()

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

Definition at line 60 of file LinearSystem.C.

Referenced by LinearSystem::LinearSystem().

61 {
62  FEProblemBase * p = es.parameters.get<FEProblemBase *>("_fe_problem_base");
63  auto & sys = p->getLinearSystem(p->linearSysNum(system_name));
64  auto & lin_sys = sys.linearImplicitSystem();
65  auto & matrix = *(sys.linearImplicitSystem().matrix);
66  auto & rhs = *(sys.linearImplicitSystem().rhs);
67  p->computeLinearSystemSys(lin_sys, matrix, rhs);
68 }
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
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
void computeLinearSystemSys(LinearImplicitSystem &sys, SparseMatrix< Number > &system_matrix, NumericVector< Number > &rhs)
Assemble both the right hand side and the system matrix of a given linear system. ...

◆ compute_nearnullspace()

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

Definition at line 70 of file NonlinearSystem.C.

Referenced by NonlinearSystem::NonlinearSystem().

71 {
72  FEProblemBase * p =
73  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
74  p->computeNearNullSpace(sys, sp);
75 }
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters() const
Get the parameters of the object.
virtual void computeNearNullSpace(NonlinearImplicitSystem &sys, std::vector< NumericVector< Number > *> &sp)

◆ compute_nullspace()

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

Definition at line 53 of file NonlinearSystem.C.

Referenced by NonlinearSystem::NonlinearSystem().

54 {
55  FEProblemBase * p =
56  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
57  p->computeNullSpace(sys, sp);
58 }
virtual void computeNullSpace(NonlinearImplicitSystem &sys, std::vector< NumericVector< Number > *> &sp)
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters() const
Get the parameters of the object.

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

Referenced by NonlinearSystem::solve().

84 {
85  FEProblemBase * p =
86  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
88  sys, old_soln, search_direction, new_soln, changed_search_direction, changed_new_soln);
89 }
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual void computePostCheck(NonlinearImplicitSystem &sys, const NumericVector< Number > &old_soln, NumericVector< Number > &search_direction, NumericVector< Number > &new_soln, bool &changed_search_direction, bool &changed_new_soln)
const InputParameters & parameters() const
Get the parameters of the object.

◆ compute_transpose_nullspace()

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

Definition at line 61 of file NonlinearSystem.C.

Referenced by NonlinearSystem::NonlinearSystem().

63 {
64  FEProblemBase * p =
65  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
66  p->computeTransposeNullSpace(sys, sp);
67 }
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters() const
Get the parameters of the object.
virtual void computeTransposeNullSpace(NonlinearImplicitSystem &sys, std::vector< NumericVector< Number > *> &sp)

◆ createMooseApp()

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

Create a MooseApp from command-line arguments.

Definition at line 39 of file MooseMain.C.

Referenced by main().

40 {
41  auto command_line = std::make_shared<CommandLine>(argc, argv);
42 
43  {
44  auto input_param = emptyInputParameters();
45  addMainCommandLineParams(input_param);
46  command_line->addCommandLineOptionsFromParams(input_param);
47  }
48 
49  std::vector<std::string> input_filenames;
50  std::string cl_app_type;
51 
52  // Get command line arguments
53  command_line->search("input_file", input_filenames);
54  command_line->search("application_type", cl_app_type);
55 
56  // loop over all the command line arguments and error out when the user uses Application block for
57  // subapps
58  auto cli_args = command_line->getArguments();
59  if (std::find_if(cli_args.begin(),
60  cli_args.end(),
61  [&](auto & arg) {
62  return std::regex_match(arg, std::regex("[A-Za-z0-9]*:Application/.*"));
63  }) != cli_args.end())
64  mooseError("Using the CommandLine option to overwite [Application] block is not supported for "
65  "sub_apps");
66 
67  auto parser = std::make_unique<Parser>(input_filenames);
68  if (input_filenames.size())
69  parser->parse();
70 
71  // Check whether the application name given in [Application] block is registered or not
72  if (!cl_app_type.empty())
73  parser->setAppType(cl_app_type);
74 
75  auto app_type = parser->getAppType();
76  if (!app_type.empty())
77  if (!AppFactory::instance().isRegistered(app_type))
78  mooseError("'", app_type, "' is not a registered application name.\n");
79 
80  // Create an instance of the application and store it in a smart pointer for easy cleanup
81  return AppFactory::createAppShared(default_app_name, argc, argv, std::move(parser));
82 }
bool isRegistered(const std::string &app_name) const
Returns a Boolean indicating whether an application type has been registered.
Definition: AppFactory.h:119
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
InputParameters emptyInputParameters()
void addMainCommandLineParams(InputParameters &params)
Adds the command line parameters needed from within main, which will also need to be added to MooseAp...
Definition: MooseMain.C:26
static AppFactory & instance()
Get the instance of the AppFactory.
Definition: AppFactory.C:17
static MooseAppPtr createAppShared(const std::string &default_app_type, int argc, char **argv, std::unique_ptr< Parser > parser, MPI_Comm comm_word=MPI_COMM_WORLD)
Helper function for creating a MooseApp from command-line arguments and a Parser. ...
Definition: AppFactory.C:39

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

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 >::fetchADDoFValues(), and MooseVariableFV< Real >::getElemValue().

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

23 {
24 #ifndef NDEBUG
25  try
26  {
27  derivs.insert(index) = value;
28  }
29  catch (MetaPhysicL::LogicError &)
30  {
31  mooseError("The last insertion into the sparse derivative storage container exceeded the "
32  "underlying array size. Consider running `configure --with-derivative-size=<n>` to "
33  "obtain a larger underlying container");
34  }
35 #else
36  derivs.insert(index) = value;
37 #endif
38 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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 79 of file ADUtils.C.

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

80 {
81  return ADReal::do_derivatives && sys.number() == subproblem.currentNlSysNum();
82 }
virtual unsigned int currentNlSysNum() const =0
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1132

◆ elementsIntersectedByLine()

void Moose::elementsIntersectedByLine ( const Point &  p0,
const Point &  p1,
const MeshBase &  mesh,
const 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

Definition at line 192 of file RayTracing.C.

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

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

◆ elementsIntersectedByPlane() [1/2]

void Moose::elementsIntersectedByPlane ( const Point &  p0,
const Point &  normal,
const MeshBase &  mesh,
std::vector< const 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 53 of file ElementsIntersectedByPlane.C.

Referenced by ElementsAlongPlane::execute().

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

◆ elementsIntersectedByPlane() [2/2]

void Moose::elementsIntersectedByPlane ( const Point &  p0,
const Point &  p1,
const Point &  p2,
const MeshBase &  mesh,
std::vector< const 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 69 of file ElementsIntersectedByPlane.C.

74 {
75  // Make sure our list is clear
76  intersected_elems.clear();
77 
78  // Create plane from three points:
79  Plane plane(p0, p1, p2);
80 
81  // Find 'em!
82  findElementsIntersectedByPlane(plane, mesh, intersected_elems);
83 }
void findElementsIntersectedByPlane(const 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 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 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 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:299
FIRST
SECOND
THIRD

◆ 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 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 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 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:299
FIRST
SECOND
THIRD

◆ fe_lagrange_2D_shape()

template<typename T , template< typename > class VectorType>
T Moose::fe_lagrange_2D_shape ( const 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 FIRST:
180  {
181  switch (type)
182  {
183  case QUAD4:
184  case QUADSHELL4:
185  case QUAD8:
186  case QUADSHELL8:
187  case 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 TRI3:
203  case TRISHELL3:
204  case TRI6:
205  case 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 SECOND:
236  {
237  switch (type)
238  {
239  case 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 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(SECOND, i0[i], xi) *
282  fe_lagrange_1D_shape(SECOND, i1[i], eta));
283  }
284  case TRI6:
285  case 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 THIRD:
325  {
326  switch (type)
327  {
328  case 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 }
QUAD8
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
FIRST
SECOND
TRI3
QUAD4
TRI6
QUADSHELL4
QUADSHELL8
Real fe_lagrange_1D_shape(const Order order, const unsigned int i, const Real xi)
TRISHELL3
TRI7
QUAD9
THIRD

◆ fe_lagrange_2D_shape_deriv()

template<typename T , template< typename > class VectorType>
T Moose::fe_lagrange_2D_shape_deriv ( const 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 FIRST:
390  {
391  switch (type)
392  {
393  case QUAD4:
394  case QUADSHELL4:
395  case QUAD8:
396  case QUADSHELL8:
397  case 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 TRI3:
427  case TRISHELL3:
428  case TRI6:
429  case 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 SECOND:
491  {
492  switch (type)
493  {
494  case QUAD8:
495  case 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 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(SECOND, i0[i], xi) *
590  fe_lagrange_1D_shape(SECOND, i1[i], eta));
591 
592  // d()/deta
593  case 1:
594  return (fe_lagrange_1D_shape(SECOND, i0[i], xi) *
595  fe_lagrange_1D_shape_deriv(SECOND, i1[i], eta));
596 
597  default:
598  mooseError("Invalid derivative index j = ", j);
599  }
600  }
601 
602  case TRI6:
603  case 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 THIRD:
686  {
687  switch (type)
688  {
689  case 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 }
QUAD8
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
FIRST
SECOND
Real fe_lagrange_1D_shape_deriv(const Order order, const unsigned int i, const unsigned int j, const Real xi)
TRI3
QUAD4
TRI6
QUADSHELL4
QUADSHELL8
Real fe_lagrange_1D_shape(const Order order, const unsigned int i, const Real xi)
TRISHELL3
TRI7
QUAD9
THIRD

◆ findContactPoint()

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

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_typeThe type of fe_side, needed for inverse_map routines
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.

Definition at line 45 of file FindContactPoint.C.

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

53 {
54  const Elem * primary_elem = p_info._elem;
55 
56  unsigned int dim = primary_elem->dim();
57 
58  const Elem * side = p_info._side;
59 
60  const std::vector<Point> & phys_point = fe_side->get_xyz();
61 
62  const std::vector<RealGradient> & dxyz_dxi = fe_side->get_dxyzdxi();
63  const std::vector<RealGradient> & d2xyz_dxi2 = fe_side->get_d2xyzdxi2();
64  const std::vector<RealGradient> & d2xyz_dxieta = fe_side->get_d2xyzdxideta();
65 
66  const std::vector<RealGradient> & dxyz_deta = fe_side->get_dxyzdeta();
67  const std::vector<RealGradient> & d2xyz_deta2 = fe_side->get_d2xyzdeta2();
68  const std::vector<RealGradient> & d2xyz_detaxi = fe_side->get_d2xyzdxideta();
69 
70  if (dim == 1)
71  {
72  const Node * nearest_node = side->node_ptr(0);
73  p_info._closest_point = *nearest_node;
74  p_info._closest_point_ref =
75  primary_elem->master_point(primary_elem->get_node_index(nearest_node));
76  std::vector<Point> elem_points = {p_info._closest_point_ref};
77 
78  const std::vector<RealGradient> & elem_dxyz_dxi = fe_elem->get_dxyzdxi();
79 
80  fe_elem->reinit(primary_elem, &elem_points);
81  fe_side->reinit(side, &elem_points);
82 
83  p_info._normal = elem_dxyz_dxi[0];
84  if (nearest_node->id() == primary_elem->node_id(0))
85  p_info._normal *= -1.0;
86  p_info._normal /= p_info._normal.norm();
87 
88  Point from_secondary_to_closest = p_info._closest_point - secondary_point;
89  p_info._distance = from_secondary_to_closest * p_info._normal;
90  Point tangential = from_secondary_to_closest - p_info._distance * p_info._normal;
91  p_info._tangential_distance = tangential.norm();
92  p_info._dxyzdxi = dxyz_dxi;
93  p_info._dxyzdeta = dxyz_deta;
94  p_info._d2xyzdxideta = d2xyz_dxieta;
95  p_info._side_phi = fe_side->get_phi();
96  p_info._side_grad_phi = fe_side->get_dphi();
97  contact_point_on_side = true;
98  return;
99  }
100 
101  Point ref_point;
102 
103  if (start_with_centroid)
104  ref_point = FEInterface::inverse_map(
105  dim - 1, fe_side_type, side, side->vertex_average(), TOLERANCE, false);
106  else
107  ref_point = p_info._closest_point_ref;
108 
109  std::vector<Point> points = {ref_point};
110  fe_side->reinit(side, &points);
111  RealGradient d = secondary_point - phys_point[0];
112 
113  Real update_size = std::numeric_limits<Real>::max();
114 
115  // Least squares
116  for (unsigned int it = 0; it < 3 && update_size > TOLERANCE * 1e3; ++it)
117  {
118  DenseMatrix<Real> jac(dim - 1, dim - 1);
119 
120  jac(0, 0) = -(dxyz_dxi[0] * dxyz_dxi[0]);
121 
122  if (dim - 1 == 2)
123  {
124  jac(1, 0) = -(dxyz_dxi[0] * dxyz_deta[0]);
125  jac(0, 1) = -(dxyz_deta[0] * dxyz_dxi[0]);
126  jac(1, 1) = -(dxyz_deta[0] * dxyz_deta[0]);
127  }
128 
129  DenseVector<Real> rhs(dim - 1);
130 
131  rhs(0) = dxyz_dxi[0] * d;
132 
133  if (dim - 1 == 2)
134  rhs(1) = dxyz_deta[0] * d;
135 
136  DenseVector<Real> update(dim - 1);
137 
138  jac.lu_solve(rhs, update);
139 
140  ref_point(0) -= update(0);
141 
142  if (dim - 1 == 2)
143  ref_point(1) -= update(1);
144 
145  points[0] = ref_point;
146  fe_side->reinit(side, &points);
147  d = secondary_point - phys_point[0];
148 
149  update_size = update.l2_norm();
150  }
151 
152  update_size = std::numeric_limits<Real>::max();
153 
154  unsigned nit = 0;
155 
156  // Newton Loop
157  for (; nit < 12 && update_size > TOLERANCE * TOLERANCE; nit++)
158  {
159  d = secondary_point - phys_point[0];
160 
161  DenseMatrix<Real> jac(dim - 1, dim - 1);
162 
163  jac(0, 0) = (d2xyz_dxi2[0] * d) - (dxyz_dxi[0] * dxyz_dxi[0]);
164 
165  if (dim - 1 == 2)
166  {
167  jac(1, 0) = (d2xyz_dxieta[0] * d) - (dxyz_dxi[0] * dxyz_deta[0]);
168 
169  jac(0, 1) = (d2xyz_detaxi[0] * d) - (dxyz_deta[0] * dxyz_dxi[0]);
170  jac(1, 1) = (d2xyz_deta2[0] * d) - (dxyz_deta[0] * dxyz_deta[0]);
171  }
172 
173  DenseVector<Real> rhs(dim - 1);
174 
175  rhs(0) = -dxyz_dxi[0] * d;
176 
177  if (dim - 1 == 2)
178  rhs(1) = -dxyz_deta[0] * d;
179 
180  DenseVector<Real> update(dim - 1);
181 
182  jac.lu_solve(rhs, update);
183 
184  ref_point(0) += update(0);
185 
186  if (dim - 1 == 2)
187  ref_point(1) += update(1);
188 
189  points[0] = ref_point;
190  fe_side->reinit(side, &points);
191  d = secondary_point - phys_point[0];
192 
193  update_size = update.l2_norm();
194  }
195 
196  /*
197  if (nit == 12 && update_size > TOLERANCE*TOLERANCE)
198  Moose::err<<"Warning! Newton solve for contact point failed to converge!"<<std::endl;
199  */
200 
201  p_info._closest_point_ref = ref_point;
202  p_info._closest_point = phys_point[0];
203  p_info._distance = d.norm();
204 
205  if (dim - 1 == 2)
206  {
207  p_info._normal = dxyz_dxi[0].cross(dxyz_deta[0]);
208  p_info._normal /= p_info._normal.norm();
209  }
210  else
211  {
212  const Node * const * elem_nodes = primary_elem->get_nodes();
213  const Point in_plane_vector1 = *elem_nodes[1] - *elem_nodes[0];
214  const Point in_plane_vector2 = *elem_nodes[2] - *elem_nodes[0];
215 
216  Point out_of_plane_normal = in_plane_vector1.cross(in_plane_vector2);
217  out_of_plane_normal /= out_of_plane_normal.norm();
218 
219  p_info._normal = dxyz_dxi[0].cross(out_of_plane_normal);
220  if (std::fabs(p_info._normal.norm()) > 1e-15)
221  p_info._normal /= p_info._normal.norm();
222  }
223 
224  // If the point has not penetrated the face, make the distance negative
225  const Real dot(d * p_info._normal);
226  if (dot > 0.0)
227  p_info._distance = -p_info._distance;
228 
229  contact_point_on_side = FEInterface::on_reference_element(ref_point, side->type());
230 
231  p_info._tangential_distance = 0.0;
232 
233  if (!contact_point_on_side)
234  {
235  p_info._closest_point_on_face_ref = ref_point;
237 
238  points[0] = p_info._closest_point_on_face_ref;
239  fe_side->reinit(side, &points);
240  Point closest_point_on_face(phys_point[0]);
241 
242  RealGradient off_face = closest_point_on_face - p_info._closest_point;
243  Real tangential_distance = off_face.norm();
244  p_info._tangential_distance = tangential_distance;
245  if (tangential_distance <= tangential_tolerance)
246  {
247  contact_point_on_side = true;
248  }
249  }
250 
251  const std::vector<std::vector<Real>> & phi = fe_side->get_phi();
252  const std::vector<std::vector<RealGradient>> & grad_phi = fe_side->get_dphi();
253 
254  points[0] = p_info._closest_point_ref;
255  fe_side->reinit(side, &points);
256 
257  p_info._side_phi = phi;
258  p_info._side_grad_phi = grad_phi;
259  p_info._dxyzdxi = dxyz_dxi;
260  p_info._dxyzdeta = dxyz_deta;
261  p_info._d2xyzdxideta = d2xyz_dxieta;
262 }
std::vector< RealGradient > _d2xyzdxideta
auto norm() const -> decltype(std::norm(Real()))
RealVectorValue _normal
Point _closest_point_on_face_ref
void restrictPointToFace(Point &p, const Elem *side, std::vector< const Node *> &off_edge_nodes)
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
Definition: Moose.h:148
std::vector< std::vector< RealGradient > > _side_grad_phi
std::vector< std::vector< Real > > _side_phi
auto max(const L &left, const R &right)
const Elem * _elem
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
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< RealGradient > _dxyzdeta

◆ findElementsIntersectedByPlane()

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

Definition at line 24 of file ElementsIntersectedByPlane.C.

Referenced by elementsIntersectedByPlane().

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

◆ findSimilar()

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

Definition at line 95 of file Builder.C.

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

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

◆ 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:299

◆ 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 MooseUtils::docsDir(), DataFileInterface< Action >::getDataFileNameByName(), 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 23 of file ADUtils.C.

Referenced by globalDofIndexToDerivative().

27 {
28  mooseAssert(dynamic_cast<const NonlinearSystemBase *>(&sys),
29  "This must be a nonlinear system base object");
30  const Assembly & assembly = sys.subproblem().assembly(tid, sys.number());
31  const Elem * elem;
32  switch (elem_type)
33  {
34  case ElementType::Element:
35  elem = assembly.elem();
36  break;
37 
39  elem = assembly.neighbor();
40  break;
41 
42  case ElementType::Lower:
43  elem = assembly.lowerDElem();
44  break;
45 
46  default:
47  mooseError("Unrecognized element type");
48  }
49 
50  std::unordered_map<dof_id_type, Real> ret_val;
51 
52  const System & libmesh_sys = sys.system();
53  const DofMap & dof_map = libmesh_sys.get_dof_map();
54 
55  const unsigned int num_vars = libmesh_sys.n_vars();
56 
57  const auto max_dofs_per_elem = sys.getMaxVarNDofsPerElem();
58 
59  for (unsigned int var_num = 0; var_num < num_vars; ++var_num)
60  {
61  std::vector<dof_id_type> global_indices;
62 
63  // Get the global indices corresponding to var_num that exist on elem
64  dof_map.dof_indices(elem, global_indices, var_num);
65 
66  // determine the AD offset for the current var
67  const auto ad_offset = adOffset(var_num, max_dofs_per_elem, elem_type, num_vars);
68 
69  // Map from global index to derivative
70  for (MooseIndex(global_indices) local_index = 0; local_index < global_indices.size();
71  ++local_index)
72  ret_val[global_indices[local_index]] = ad_real.derivatives()[ad_offset + local_index];
73  }
74 
75  return ret_val;
76 }
const Elem *const & elem() const
Return the current element.
Definition: Assembly.h:367
Keeps track of stuff related to assembling.
Definition: Assembly.h:93
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
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:102
virtual System & system()=0
Get the reference to the libMesh system.
unsigned int number() const
Gets the number of this system.
Definition: SystemBase.C:1132
std::size_t getMaxVarNDofsPerElem() const
Gets the maximum number of dofs used by any one variable on any one element.
Definition: SystemBase.h:573
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:423
const Elem *const & lowerDElem() const
Return the lower dimensional element.
Definition: Assembly.h:429

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

Referenced by stringToEnum< CoordinateSystemType >().

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

◆ initDofIndices()

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

◆ initEigenProlemType()

void Moose::initEigenProlemType ( )

Definition at line 76 of file Conversion.C.

Referenced by stringToEnum< EigenProblemType >().

77 {
78  if (eigen_problem_type_to_enum.empty())
79  {
85  eigen_problem_type_to_enum["POS_GEN_NON_HERMITIAN"] = EPT_POS_GEN_NON_HERMITIAN;
87  }
88 }
Generalized Non-Hermitian.
Definition: MooseTypes.h:789
Generalized Hermitian indefinite.
Definition: MooseTypes.h:788
std::map< std::string, EigenProblemType > eigen_problem_type_to_enum
Definition: Conversion.C:27
use whatever SLPEC has by default
Definition: MooseTypes.h:791
Generalized Non-Hermitian with positive (semi-)definite B.
Definition: MooseTypes.h:790
Non-Hermitian.
Definition: MooseTypes.h:786
Generalized Hermitian.
Definition: MooseTypes.h:787

◆ initEigenSolveType()

void Moose::initEigenSolveType ( )

Definition at line 59 of file Conversion.C.

Referenced by stringToEnum< EigenSolveType >().

60 {
61  if (eigen_solve_type_to_enum.empty())
62  {
66  eigen_solve_type_to_enum["JACOBI_DAVIDSON"] = EST_JACOBI_DAVIDSON;
67  eigen_solve_type_to_enum["NONLINEAR_POWER"] = EST_NONLINEAR_POWER;
72  }
73 }
std::map< std::string, EigenSolveType > eigen_solve_type_to_enum
Definition: Conversion.C:26
Newton-based eigensolver with an assembled Jacobian matrix (fully coupled by default) ...
Definition: MooseTypes.h:774
The same as PJFNK except that matrix-vector multiplication is employed to replace residual evaluation...
Definition: MooseTypes.h:776
Power / Inverse / RQI.
Definition: MooseTypes.h:769
Krylov-Schur.
Definition: MooseTypes.h:771
Preconditioned Jacobian-free Newton Krylov.
Definition: MooseTypes.h:775
Nonlinear inverse power.
Definition: MooseTypes.h:773
Jacobi-Davidson.
Definition: MooseTypes.h:772
Jacobian-free Newton Krylov.
Definition: MooseTypes.h:777

◆ initial_condition()

void Moose::initial_condition ( 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 110 of file Conversion.C.

Referenced by stringToEnum< LineSearchType >().

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

◆ initMffdType()

void Moose::initMffdType ( )

Definition at line 143 of file Conversion.C.

Referenced by stringToEnum< MffdType >().

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

◆ initRMType()

void Moose::initRMType ( )

Definition at line 153 of file Conversion.C.

Referenced by stringToEnum< RelationshipManagerType >().

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

◆ initSolveType()

void Moose::initSolveType ( )

Definition at line 46 of file Conversion.C.

Referenced by stringToEnum< SolveType >().

47 {
48  if (solve_type_to_enum.empty())
49  {
50  solve_type_to_enum["PJFNK"] = ST_PJFNK;
51  solve_type_to_enum["JFNK"] = ST_JFNK;
52  solve_type_to_enum["NEWTON"] = ST_NEWTON;
53  solve_type_to_enum["FD"] = ST_FD;
54  solve_type_to_enum["LINEAR"] = ST_LINEAR;
55  }
56 }
Full Newton Solve.
Definition: MooseTypes.h:759
Solving a linear problem.
Definition: MooseTypes.h:761
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:758
Use finite differences to compute Jacobian.
Definition: MooseTypes.h:760
Preconditioned Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:757
std::map< std::string, SolveType > solve_type_to_enum
Definition: Conversion.C:25

◆ initTimeIntegratorsType()

void Moose::initTimeIntegratorsType ( )

Definition at line 128 of file Conversion.C.

Referenced by stringToEnum< TimeIntegratorType >().

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

◆ initWhichEigenPairs()

void Moose::initWhichEigenPairs ( )

Definition at line 91 of file Conversion.C.

Referenced by stringToEnum< WhichEigenPairs >().

92 {
93  if (which_eigen_pairs_to_enum.empty())
94  {
95  which_eigen_pairs_to_enum["LARGEST_MAGNITUDE"] = WEP_LARGEST_MAGNITUDE;
96  which_eigen_pairs_to_enum["SMALLEST_MAGNITUDE"] = WEP_SMALLEST_MAGNITUDE;
99  which_eigen_pairs_to_enum["LARGEST_IMAGINARY"] = WEP_LARGEST_IMAGINARY;
100  which_eigen_pairs_to_enum["SMALLEST_IMAGINARY"] = WEP_SMALLEST_IMAGINARY;
101  which_eigen_pairs_to_enum["TARGET_MAGNITUDE"] = WEP_TARGET_MAGNITUDE;
103  which_eigen_pairs_to_enum["TARGET_IMAGINARY"] = WEP_TARGET_IMAGINARY;
104  which_eigen_pairs_to_enum["ALL_EIGENVALUES"] = WEP_ALL_EIGENVALUES;
105  which_eigen_pairs_to_enum["SLEPC_DEFAULT"] = WEP_SLEPC_DEFAULT;
106  }
107 }
smallest magnitude
Definition: MooseTypes.h:800
std::map< std::string, WhichEigenPairs > which_eigen_pairs_to_enum
Definition: Conversion.C:28
target magnitude
Definition: MooseTypes.h:805
target imaginary
Definition: MooseTypes.h:807
smallest imaginary
Definition: MooseTypes.h:804
largest imaginary
Definition: MooseTypes.h:803
all eigenvalues
Definition: MooseTypes.h:808
use whatever we have in SLEPC
Definition: MooseTypes.h:809
largest magnitude
Definition: MooseTypes.h:799

◆ isSectionActive()

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

Definition at line 58 of file Builder.C.

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

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

◆ main()

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

Initialize, create and run a MooseApp.

Definition at line 37 of file MooseMain.h.

Referenced by removeSubstring().

38 {
39  MooseInit init(argc, argv);
40 
41  DefaultAppType::registerApps();
42 
43  const auto default_app_name = MooseUtils::prettyCppType<DefaultAppType>();
44 
45  auto app = createMooseApp(default_app_name, argc, argv);
46 
47  app->run();
48 }
Initialization object for any MOOSE-based application.
Definition: MooseInit.h:23
void init(triangulateio &t)
std::shared_ptr< MooseApp > createMooseApp(const std::string &default_app_name, int argc, char *argv[])
Create a MooseApp from command-line arguments.
Definition: MooseMain.C:39

◆ oldState()

StateArg Moose::oldState ( )
inline

Definition at line 250 of file MooseFunctorArguments.h.

Referenced by TransientInterface::determineState().

251 {
252  return {(unsigned int)1};
253 }
void ErrorVector unsigned int

◆ previousNonlinearState()

StateArg Moose::previousNonlinearState ( )
inline

Definition at line 256 of file MooseFunctorArguments.h.

257 {
258  return {(unsigned int)1, SolutionIterationType::Nonlinear};
259 }
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 144 of file RayTracing.C.

Referenced by elementsIntersectedByLine().

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

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

Referenced by associateSyntax(), and registerAll().

407 {
408  mooseDeprecated("use registerAll instead of registerActions");
409  registerActions(syntax, action_factory, {"MooseApp"});
410 }
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:406
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:350

◆ registerActions() [2/2]

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

Definition at line 413 of file Moose.C.

416 {
417  Registry::registerActionsTo(action_factory, obj_labels);
418 
419  // TODO: Why is this here?
420  registerTask("finish_input_file_output", false);
421 }
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:66

◆ registerAll() [1/2]

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

Definition at line 56 of file Moose.C.

57 {
58  registerObjects(f, {"MooseApp"});
59  associateSyntaxInner(s, af);
60  registerActions(s, af, {"MooseApp"});
61  registerDataFilePath();
62  registerRepository("moose", "github.com/idaholab/moose");
63 }
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:406
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:424

◆ registerAll() [2/2]

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

Register objects that are in MOOSE.

Referenced by MooseApp::MooseApp().

◆ registerObjects() [1/4]

void Moose::registerObjects ( Factory factory)

Definition at line 66 of file Moose.C.

67 {
68  mooseDeprecated("use registerAll instead of registerObjects");
69  registerObjects(factory, {"MooseApp"});
70 }
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:350
void registerObjects(Factory &factory, const std::set< std::string > &obj_labels)
Definition: Moose.C:73

◆ registerObjects() [2/4]

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

Definition at line 73 of file Moose.C.

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:32

◆ registerObjects() [3/4]

void Moose::registerObjects ( Factory factory)

Referenced by registerAll(), and registerObjects().

◆ registerObjects() [4/4]

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

◆ restrictPointToFace()

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

Definition at line 265 of file FindContactPoint.C.

Referenced by findContactPoint().

266 {
267  const ElemType t(side->type());
268  off_edge_nodes.clear();
269  Real & xi = p(0);
270  Real & eta = p(1);
271 
272  switch (t)
273  {
274  case EDGE2:
275  case EDGE3:
276  case EDGE4:
277  {
278  // The reference 1D element is [-1,1].
279  if (xi < -1.0)
280  {
281  xi = -1.0;
282  off_edge_nodes.push_back(side->node_ptr(0));
283  }
284  else if (xi > 1.0)
285  {
286  xi = 1.0;
287  off_edge_nodes.push_back(side->node_ptr(1));
288  }
289  break;
290  }
291 
292  case TRI3:
293  case TRI6:
294  case TRI7:
295  {
296  // The reference triangle is isosceles
297  // and is bound by xi=0, eta=0, and xi+eta=1.
298 
299  if (xi <= 0.0 && eta <= 0.0)
300  {
301  xi = 0.0;
302  eta = 0.0;
303  off_edge_nodes.push_back(side->node_ptr(0));
304  }
305  else if (xi > 0.0 && xi < 1.0 && eta < 0.0)
306  {
307  eta = 0.0;
308  off_edge_nodes.push_back(side->node_ptr(0));
309  off_edge_nodes.push_back(side->node_ptr(1));
310  }
311  else if (eta > 0.0 && eta < 1.0 && xi < 0.0)
312  {
313  xi = 0.0;
314  off_edge_nodes.push_back(side->node_ptr(2));
315  off_edge_nodes.push_back(side->node_ptr(0));
316  }
317  else if (xi >= 1.0 && (eta - xi) <= -1.0)
318  {
319  xi = 1.0;
320  eta = 0.0;
321  off_edge_nodes.push_back(side->node_ptr(1));
322  }
323  else if (eta >= 1.0 && (eta - xi) >= 1.0)
324  {
325  xi = 0.0;
326  eta = 1.0;
327  off_edge_nodes.push_back(side->node_ptr(2));
328  }
329  else if ((xi + eta) > 1.0)
330  {
331  Real delta = (xi + eta - 1.0) / 2.0;
332  xi -= delta;
333  eta -= delta;
334  off_edge_nodes.push_back(side->node_ptr(1));
335  off_edge_nodes.push_back(side->node_ptr(2));
336  }
337  break;
338  }
339 
340  case QUAD4:
341  case QUAD8:
342  case QUAD9:
343  {
344  // The reference quadrilateral element is [-1,1]^2.
345  if (xi < -1.0)
346  {
347  xi = -1.0;
348  if (eta < -1.0)
349  {
350  eta = -1.0;
351  off_edge_nodes.push_back(side->node_ptr(0));
352  }
353  else if (eta > 1.0)
354  {
355  eta = 1.0;
356  off_edge_nodes.push_back(side->node_ptr(3));
357  }
358  else
359  {
360  off_edge_nodes.push_back(side->node_ptr(3));
361  off_edge_nodes.push_back(side->node_ptr(0));
362  }
363  }
364  else if (xi > 1.0)
365  {
366  xi = 1.0;
367  if (eta < -1.0)
368  {
369  eta = -1.0;
370  off_edge_nodes.push_back(side->node_ptr(1));
371  }
372  else if (eta > 1.0)
373  {
374  eta = 1.0;
375  off_edge_nodes.push_back(side->node_ptr(2));
376  }
377  else
378  {
379  off_edge_nodes.push_back(side->node_ptr(1));
380  off_edge_nodes.push_back(side->node_ptr(2));
381  }
382  }
383  else
384  {
385  if (eta < -1.0)
386  {
387  eta = -1.0;
388  off_edge_nodes.push_back(side->node_ptr(0));
389  off_edge_nodes.push_back(side->node_ptr(1));
390  }
391  else if (eta > 1.0)
392  {
393  eta = 1.0;
394  off_edge_nodes.push_back(side->node_ptr(2));
395  off_edge_nodes.push_back(side->node_ptr(3));
396  }
397  }
398  break;
399  }
400 
401  default:
402  {
403  mooseError("Unsupported face type: ", t);
404  break;
405  }
406  }
407 }
ElemType
QUAD8
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:299
EDGE4
TRI3
QUAD4
TRI6
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
EDGE2
TRI7
QUAD9
EDGE3

◆ SERIAL_ACCESS_CONST_SIZE() [1/3]

Moose::SERIAL_ACCESS_CONST_SIZE ( 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 638 of file Moose.C.

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

639 {
640  _color_console = (isatty(fileno(stdout)) || force) && use_color;
641  return _color_console;
642 }
static bool _color_console
Definition: Moose.C:629

◆ setSolverDefaults()

void Moose::setSolverDefaults ( FEProblemBase problem)

Definition at line 615 of file Moose.C.

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

◆ sideIntersectedByLine()

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

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

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

Definition at line 34 of file RayTracing.C.

Referenced by recursivelyFindElementsIntersectedByLine().

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

◆ sideNeighborIsOn()

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

Returns the side number for elem that neighbor is on.

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

Definition at line 115 of file RayTracing.C.

Referenced by recursivelyFindElementsIntersectedByLine().

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

◆ stringify() [1/21]

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

conversion to string

Definition at line 62 of file Conversion.h.

Referenced by SetupResidualDebugAction::act(), MaterialDerivativeTestAction::act(), FEProblemBase::addAuxArrayVariable(), FEProblemBase::addAuxScalarVariable(), FEProblemBase::addAuxVariable(), DiracKernelBase::addPoint(), Action::addRelationshipManager(), MooseVariableData< OutputType >::adGradPhi(), MooseVariableData< OutputType >::adGradPhiFace(), MooseEnum::assign(), AuxKernelTempl< Real >::AuxKernelTempl(), ParsedFunctorMaterialTempl< is_ad >::buildParsedFunction(), MooseMesh::checkCoordinateSystems(), MeshDiagnosticsGenerator::checkElementOverlap(), MeshDiagnosticsGenerator::checkElementTypes(), FEProblemBase::checkExceptionAndStopSolve(), Moose::FunctorBase< libMesh::VectorValue >::checkFace(), MeshDiagnosticsGenerator::checkLocalJacobians(), MeshDiagnosticsGenerator::checkNonConformalMesh(), MeshDiagnosticsGenerator::checkNonConformalMeshFromAdaptivity(), MeshDiagnosticsGenerator::checkNonPlanarSides(), PhysicsBase::checkRequiredTasks(), BlockRestrictable::checkVariable(), PhysicsBase::checkVectorParamsNoOverlap(), CircularBoundaryCorrectionGenerator::circularCenterCalculator(), Moose::SlepcSupport::clearFreeNonlinearPowerIterations(), FEProblemBase::computeUserObjectsInternal(), CopyValueAux::CopyValueAux(), DGKernelBase::DGKernelBase(), CartesianGridDivision::divisionIndex(), CylindricalGridDivision::divisionIndex(), SphericalGridDivision::divisionIndex(), MonotoneCubicInterpolation::errorCheck(), UnitsConversionEvaler::eval(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), MeshDivisionFunctorReductionVectorPostprocessor::execute(), DOFMapOutput::filename(), ElementQualityChecker::finalize(), ParsedMaterialHelper< is_ad >::functionParse(), ExtraNodesetGenerator::generate(), CoarsenBlockGenerator::generate(), ActionWarehouse::getAction(), FunctorBinnedValuesDivision::getBinIndex(), ComputeFVFluxThread< RangeType, AttribMatrixTags >::getBlockNames(), ExecFlagEnum::getDocString(), MooseLinearVariableFV< Real >::getElemValue(), MooseVariableFV< Real >::getElemValue(), MeshCoarseningUtils::getFineElementsFromInteriorNode(), SolutionUserObject::getLocalVarIndex(), Positions::getNearestPositionIndex(), MooseEnumBase::getRawNames(), MooseApp::getRelationshipManagerInfo(), SystemBase::getScalarVariable(), ProjectedStatefulMaterialStorageAction::getTypeEnum(), SystemBase::getVariable(), SubProblem::getVariableHelper(), Moose::FV::harmonicInterpolation(), MultiAppGeneralFieldTransfer::initialSetup(), MatrixTools::inverse(), LeastSquaresFitHistory::LeastSquaresFitHistory(), MultiApp::localApp(), MeshDivisionAux::MeshDivisionAux(), SystemBase::oldSolutionStateVectorName(), operator<<(), Parser::parse(), PatternedMeshGenerator::PatternedMeshGenerator(), CompileTimeDerivatives::CTValue< tag, T >::print(), CompileTimeDerivatives::CTArrayRef< tag, T, I >::print(), CompileTimeDerivatives::CTIPow< B, E >::print(), libMesh::print_helper(), CompileTimeDerivatives::printTag(), TopResidualDebugOutput::printTopResiduals(), ProjectedStatefulMaterialStorageAction::processProperty(), DerivativeParsedMaterialHelperTempl< is_ad >::recurseMatProps(), CoarsenBlockGenerator::recursiveCoarsen(), MeshRepairGenerator::separateSubdomainsByElementType(), MooseMesh::setCoordSystem(), Moose::SlepcSupport::setFreeNonlinearPowerIterations(), Moose::SlepcSupport::setNewtonPetscOptions(), Moose::SlepcSupport::setSlepcEigenSolverTolerances(), Split::setup(), SystemBase::solutionState(), EigenProblem::solverTypeString(), FEProblemBase::solverTypeString(), NonlinearSystem::stopSolve(), stringify(), and FEProblemSolve::validParams().

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

◆ stringify() [2/21]

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

Definition at line 71 of file Conversion.h.

72 {
73  return v ? "true" : "false";
74 }

◆ stringify() [3/21]

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

Definition at line 78 of file Conversion.h.

79 {
80  return std::to_string(v);
81 }

◆ stringify() [4/21]

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

Definition at line 83 of file Conversion.h.

84 {
85  return std::to_string(v);
86 }

◆ stringify() [5/21]

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

Definition at line 88 of file Conversion.h.

89 {
90  return std::to_string(v);
91 }

◆ stringify() [6/21]

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

Definition at line 93 of file Conversion.h.

94 {
95  return std::to_string(v);
96 }

◆ stringify() [7/21]

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

Definition at line 98 of file Conversion.h.

99 {
100  return std::to_string(v);
101 }

◆ stringify() [8/21]

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

Definition at line 103 of file Conversion.h.

104 {
105  return std::to_string(v);
106 }

◆ stringify() [9/21]

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

Convert solve type into human readable string.

Definition at line 357 of file Conversion.C.

358 {
359  switch (t)
360  {
361  case ST_NEWTON:
362  return "NEWTON";
363  case ST_JFNK:
364  return "JFNK";
365  case ST_PJFNK:
366  return "Preconditioned JFNK";
367  case ST_FD:
368  return "FD";
369  case ST_LINEAR:
370  return "Linear";
371  }
372  return "";
373 }
Full Newton Solve.
Definition: MooseTypes.h:759
Solving a linear problem.
Definition: MooseTypes.h:761
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:758
Use finite differences to compute Jacobian.
Definition: MooseTypes.h:760
Preconditioned Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:757

◆ stringify() [10/21]

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

Convert eigen solve type into human readable string.

Definition at line 376 of file Conversion.C.

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

◆ stringify() [11/21]

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

Convert variable field type into human readable string.

Definition at line 403 of file Conversion.C.

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

◆ stringify() [12/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 458 of file Conversion.C.

459 {
460  return s;
461 }

◆ stringify() [13/21]

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

Convert FEType from libMesh into string.

◆ stringify() [14/21]

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

Convert SolutionIterationType into string.

Definition at line 422 of file Conversion.C.

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

◆ stringify() [15/21]

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

Convert ElementType into string.

Definition at line 436 of file Conversion.C.

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

◆ stringify() [16/21]

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

Convert the libmesh ElemType into string.

Definition at line 452 of file Conversion.C.

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

◆ stringify() [17/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 135 of file Conversion.h.

135  :")
136 {
137  return stringify(p.first) + delim + stringify(p.second);
138 }

◆ stringify() [18/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 155 of file Conversion.h.

159 {
160  std::string str;
161  if (enclose_list_in_curly_braces)
162  str += "{";
163  const auto begin = c.begin();
164  const auto end = c.end();
165  for (auto i = begin; i != end; ++i)
166  str += (i != begin ? delim : "") + elem_encl + stringify(*i) + elem_encl;
167  if (enclose_list_in_curly_braces)
168  str += "}";
169  return str;
170 }
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:155

◆ stringify() [19/21]

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

Definition at line 348 of file Conversion.C.

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

◆ stringify() [20/21]

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

Definition at line 324 of file Conversion.C.

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

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

465 {
466  // this or std::numeric_limits<T>::max_digits10
467  const unsigned int max_digits10 =
468  std::floor(std::numeric_limits<Real>::digits * std::log10(2) + 2);
469 
470  std::ostringstream os;
471  os << std::setprecision(max_digits10) << t;
472  return os.str();
473 }
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 186 of file Conversion.C.

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

◆ stringToEnum< EigenProblemType >()

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

Definition at line 231 of file Conversion.C.

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

◆ stringToEnum< EigenSolveType >()

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

Definition at line 216 of file Conversion.C.

217 {
219 
220  std::string upper(s);
221  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
222 
223  if (!eigen_solve_type_to_enum.count(upper))
224  mooseError("Unknown eigen solve type: ", upper);
225 
226  return eigen_solve_type_to_enum[upper];
227 }
std::map< std::string, EigenSolveType > eigen_solve_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:299
void initEigenSolveType()
Definition: Conversion.C:59

◆ stringToEnum< LineSearchType >()

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

Definition at line 261 of file Conversion.C.

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

◆ stringToEnum< MffdType >()

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

Definition at line 291 of file Conversion.C.

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

◆ stringToEnum< Order >()

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

Definition at line 173 of file Conversion.C.

Referenced by SetupQuadratureAction::act().

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

◆ stringToEnum< QuadratureType >()

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

Definition at line 166 of file Conversion.C.

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

◆ stringToEnum< RelationshipManagerType >()

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

Definition at line 306 of file Conversion.C.

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

◆ stringToEnum< SolveType >()

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

Definition at line 201 of file Conversion.C.

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

◆ stringToEnum< TimeIntegratorType >()

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

Definition at line 276 of file Conversion.C.

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

◆ stringToEnum< WhichEigenPairs >()

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

Definition at line 246 of file Conversion.C.

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

◆ swapLibMeshComm()

MPI_Comm Moose::swapLibMeshComm ( MPI_Comm  new_comm)

Swap the libMesh MPI communicator out for ours.

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

Definition at line 622 of file Moose.C.

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

623 {
624  MPI_Comm old_comm = PETSC_COMM_WORLD;
625  PETSC_COMM_WORLD = new_comm;
626  return old_comm;
627 }

◆ to_json()

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

Definition at line 140 of file LibtorchArtificialNeuralNet.C.

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

141 {
142  if (network)
143  network->store(json);
144 }
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 &   
)

Definition at line 1343 of file Builder.C.

Referenced by Moose::Builder::setScalarParameter(), and toBool< bool >().

1344 {
1345  return false;
1346 }

◆ toBool< bool >()

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

Definition at line 1350 of file Builder.C.

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

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

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

◆ 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 629 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 645 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 646 of file Moose.C.

Referenced by moose::internal::mooseErrorRaw(), MooseServer::parseDocumentForDiagnostics(), CommandLine::setArgument(), 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 647 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 644 of file Moose.C.

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

◆ always_false

template<class T >
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 503 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)

◆ BOUNDARY_SIDE_LOWERD_ID

const SubdomainID Moose::BOUNDARY_SIDE_LOWERD_ID = libMesh::Elem::invalid_subdomain_id - 3

◆ constMaxQpsPerElem

constexpr std::size_t Moose::constMaxQpsPerElem = 216

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

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

◆ coordinate_system_type_to_enum

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

Definition at line 24 of file Conversion.C.

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

◆ dim

constexpr std::size_t Moose::dim = LIBMESH_DIM
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 148 of file Moose.h.

Referenced by HierarchicalGridPartitioner::_do_partition(), GridPartitioner::_do_partition(), Assembly::Assembly(), Assembly::attachQRuleElem(), Assembly::attachQRuleFace(), 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(), Assembly::computeFaceMap(), Assembly::computeGradPhiAD(), GenericFunctionVectorMaterialTempl< is_ad >::computeQpFunctions(), ElementW1pError::computeQpIntegral(), GenericConstantVectorMaterialTempl< is_ad >::computeQpProperties(), FVAnisotropicDiffusion::computeQpResidual(), Assembly::computeSinglePointMapAD(), ParsedVectorAux::computeValue(), ArrayParsedAux::computeValue(), ElementH1ErrorFunctionAux::computeValue(), MooseVariableData< OutputType >::computeValues(), StackGenerator::computeWidth(), 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(), MaterialOutputAction::functorMaterialOutputHelper(), 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(), 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(), MaterialOutputAction::materialOutputHelper(), NodalPatchRecovery::multiIndex(), MathUtils::multiIndex(), ResetDisplacedMeshThread::onNode(), SecondaryNeighborhoodThread::operator()(), ColumnMajorMatrixTempl< Real >::operator*(), ColumnMajorMatrixTempl< Real >::operator+=(), ColumnMajorMatrixTempl< Real >::operator=(), 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 27 of file Conversion.C.

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

◆ eigen_solve_type_to_enum

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

Definition at line 26 of file Conversion.C.

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

◆ EMPTY_BLOCK_IDS

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

Definition at line 596 of file MooseTypes.h.

◆ EMPTY_BOUNDARY_IDS

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

Definition at line 597 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().

◆ INTERNAL_SIDE_LOWERD_ID

const SubdomainID Moose::INTERNAL_SIDE_LOWERD_ID = libMesh::Elem::invalid_subdomain_id - 2

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

◆ 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 25 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 26 of file MooseTypes.C.

◆ line_search_type_to_enum

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

Definition at line 29 of file Conversion.C.

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

◆ mffd_type_to_enum

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

Definition at line 31 of file Conversion.C.

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

◆ OLD_SOLUTION_TAG

const TagName Moose::OLD_SOLUTION_TAG = "SOLUTION_STATE_1"

◆ OLDER_SOLUTION_TAG

const TagName Moose::OLDER_SOLUTION_TAG = "SOLUTION_STATE_2"

◆ perf_log

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

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

◆ show_multiple

bool Moose::show_multiple = false

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

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

Referenced by InputParameters::attemptPrintDeprecated(), Factory::deprecatedMessage(), 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 25 of file Conversion.C.

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

◆ time_integrator_to_enum

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

Definition at line 30 of file Conversion.C.

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

◆ which_eigen_pairs_to_enum

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

Definition at line 28 of file Conversion.C.

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