www.mooseframework.org
Namespaces | Classes | Enumerations | Functions | Variables
Moose Namespace Reference

Namespaces

 PetscSupport
 
 SlepcSupport
 

Classes

struct  indirect_comparator
 
class  ScopedCommSwapper
 

Enumerations

enum  MaterialDataType { BLOCK_MATERIAL_DATA, BOUNDARY_MATERIAL_DATA, FACE_MATERIAL_DATA, NEIGHBOR_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_NONLINEAR, VAR_AUXILIARY, VAR_ANY }
 Framework-wide stuff. More...
 
enum  VarFieldType { VAR_FIELD_STANDARD, VAR_FIELD_SCALAR, VAR_FIELD_VECTOR, VAR_FIELD_ANY }
 
enum  CouplingType { COUPLING_DIAG, COUPLING_FULL, COUPLING_CUSTOM }
 
enum  ConstraintSideType { SIDE_MASTER, SIDE_SLAVE }
 
enum  DGResidualType { Element, Neighbor }
 
enum  DGJacobianType { ElementElement, ElementNeighbor, NeighborElement, NeighborNeighbor }
 
enum  ConstraintType { Slave = Element, Master = Neighbor }
 
enum  ConstraintJacobianType { SlaveSlave = ElementElement, SlaveMaster = ElementNeighbor, MasterSlave = NeighborElement, MasterMaster = NeighborNeighbor }
 
enum  CoordinateSystemType { COORD_XYZ, 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_MF_NONLINEAR_POWER, EST_MONOLITH_NEWTON, EST_MF_MONOLITH_NEWTON
}
 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_CUBIC, LS_QUADRATIC, LS_BASICNONORMS, LS_SHELL,
  LS_CONTACT, 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...
 

Functions

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 registerExecFlags (Factory &factory)
 
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...
 
void findContactPoint (PenetrationInfo &p_info, FEBase *fe_elem, FEBase *fe_side, FEType &fe_side_type, const Point &slave_point, bool start_with_centroid, const Real tangential_tolerance, bool &contact_point_on_side)
 Finds the closest point (called the contact point) on the master_elem on side "side" to the slave_point. More...
 
void restrictPointToFace (Point &p, const Elem *side, std::vector< const Node *> &off_edge_nodes)
 
void initial_condition (EquationSystems &es, const std::string &system_name)
 
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 (const SolveType &t)
 Convert solve 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...
 
template<typename T , typename U >
std::string stringify (const std::pair< T, U > &p)
 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...
 
std::string getExecutablePath ()
 This function returns the PATH 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...
 
std::string stringify (const Moose::RelationshipManagerType &t)
 
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...
 
void associateSyntaxInner (Syntax &syntax, ActionFactory &action_factory)
 
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 initQuadratureType ()
 
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)
 
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)
 
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

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() and mooseWarning(), should only be used with MOOSE unit. More...
 
ExecFlagEnum execute_flags
 Storage for the registered execute flags. More...
 
const SubdomainID ANY_BLOCK_ID = libMesh::Elem::invalid_subdomain_id - 1
 
const SubdomainID INVALID_BLOCK_ID = libMesh::Elem::invalid_subdomain_id
 
const BoundaryID ANY_BOUNDARY_ID = static_cast<BoundaryID>(-1)
 
const BoundaryID INVALID_BOUNDARY_ID = libMesh::BoundaryInfo::invalid_id
 
const std::set< SubdomainIDEMPTY_BLOCK_IDS = {}
 
const std::set< BoundaryIDEMPTY_BOUNDARY_IDS = {}
 
static bool _color_console = isatty(fileno(stdout))
 
std::map< std::string, QuadratureType > quadrature_type_to_enum
 
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
 

Enumeration Type Documentation

◆ AuxGroup

Flag for AuxKernel related execution type.

Enumerator
PRE_IC 
PRE_AUX 
POST_AUX 
ALL 

Definition at line 342 of file MooseTypes.h.

343 {
344  PRE_IC = 0,
345  PRE_AUX = 1,
346  POST_AUX = 2,
347  ALL = 3
348 };

◆ ConstraintFormulationType

Type of constraint formulation.

Enumerator
Penalty 
Kinematic 

Definition at line 516 of file MooseTypes.h.

517 {
518  Penalty,
519  Kinematic
520 };

◆ ConstraintJacobianType

◆ ConstraintSideType

Enumerator
SIDE_MASTER 
SIDE_SLAVE 

Definition at line 375 of file MooseTypes.h.

◆ ConstraintType

Enumerator
Slave 
Master 

Definition at line 395 of file MooseTypes.h.

◆ CoordinateSystemType

Enumerator
COORD_XYZ 
COORD_RZ 
COORD_RSPHERICAL 

Definition at line 409 of file MooseTypes.h.

◆ CouplingType

Enumerator
COUPLING_DIAG 
COUPLING_FULL 
COUPLING_CUSTOM 

Definition at line 368 of file MooseTypes.h.

◆ DGJacobianType

Enumerator
ElementElement 
ElementNeighbor 
NeighborElement 
NeighborNeighbor 

Definition at line 387 of file MooseTypes.h.

◆ DGResidualType

Enumerator
Element 
Neighbor 

Definition at line 381 of file MooseTypes.h.

382 {
383  Element,
384  Neighbor
385 };

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

470 {
471  EPT_HERMITIAN,
478 };
Generalized Non-Hermitian.
Definition: MooseTypes.h:475
Generalized Hermitian indefinite.
Definition: MooseTypes.h:474
use whatever SLPEC has by default
Definition: MooseTypes.h:477
Generalized Non-Hermitian with positive (semi-)definite B.
Definition: MooseTypes.h:476
Non-Hermitian.
Definition: MooseTypes.h:472
Generalized Hermitian.
Definition: MooseTypes.h:473

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

Matrix-free nonlinear inverse power.

EST_MONOLITH_NEWTON 

Newton-based eigen solver.

EST_MF_MONOLITH_NEWTON 

Matrix-free Newton-based eigen solver.

Definition at line 454 of file MooseTypes.h.

455 {
456  EST_POWER,
457  EST_ARNOLDI,
464 };
Newton-based eigen solver.
Definition: MooseTypes.h:462
Matrix-free Newton-based eigen solver.
Definition: MooseTypes.h:463
Matrix-free nonlinear inverse power.
Definition: MooseTypes.h:461
Power / Inverse / RQI.
Definition: MooseTypes.h:456
Krylov-Schur.
Definition: MooseTypes.h:458
Nonlinear inverse power.
Definition: MooseTypes.h:460
Jacobi-Davidson.
Definition: MooseTypes.h:459

◆ LineSearchType

Type of the line search.

Enumerator
LS_INVALID 

means not set

LS_DEFAULT 
LS_NONE 
LS_BASIC 
LS_CUBIC 
LS_QUADRATIC 
LS_BASICNONORMS 
LS_SHELL 
LS_CONTACT 
LS_L2 
LS_BT 
LS_CP 

Definition at line 524 of file MooseTypes.h.

525 {
526  LS_INVALID,
527  LS_DEFAULT,
528  LS_NONE,
529  LS_BASIC,
530 #ifdef LIBMESH_HAVE_PETSC
531 #if PETSC_VERSION_LESS_THAN(3, 3, 0)
532  LS_CUBIC,
533  LS_QUADRATIC,
535 #else
536  LS_SHELL,
537  LS_CONTACT,
538  LS_L2,
539  LS_BT,
540  LS_CP
541 #endif
542 #endif
543 };
means not set
Definition: MooseTypes.h:526

◆ MaterialDataType

MaterialData types.

See also
FEProblemBase, MaterialPropertyInterface
Enumerator
BLOCK_MATERIAL_DATA 
BOUNDARY_MATERIAL_DATA 
FACE_MATERIAL_DATA 
NEIGHBOR_MATERIAL_DATA 

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

549 {
550  MFFD_INVALID,
551  MFFD_WP,
552  MFFD_DS
553 };
means not set
Definition: MooseTypes.h:550

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

◆ PatchUpdateType

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

Enumerator
Never 
Always 
Auto 
Iteration 

Definition at line 558 of file MooseTypes.h.

559 {
560  Never,
561  Always,
562  Auto,
563  Iteration
564 };

◆ PCSideType

Preconditioning side.

Enumerator
PCS_LEFT 
PCS_RIGHT 
PCS_SYMMETRIC 
PCS_DEFAULT 

Use whatever we have in PETSc.

Definition at line 419 of file MooseTypes.h.

420 {
421  PCS_LEFT,
422  PCS_RIGHT,
424  PCS_DEFAULT
425 };
Use whatever we have in PETSc.
Definition: MooseTypes.h:424

◆ RelationshipManagerType

enum Moose::RelationshipManagerType : unsigned char
strong

Main types of Relationship Managers.

Enumerator
DEFAULT 
GEOMETRIC 
ALGEBRAIC 
COUPLING 

Definition at line 569 of file MooseTypes.h.

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

443 {
444  ST_PJFNK,
445  ST_JFNK,
446  ST_NEWTON,
447  ST_FD,
448  ST_LINEAR
449 };
Full Newton Solve.
Definition: MooseTypes.h:446
Solving a linear problem.
Definition: MooseTypes.h:448
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:445
Use finite differences to compute Jacobian.
Definition: MooseTypes.h:447
Preconditioned Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:444

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

◆ VarFieldType

Enumerator
VAR_FIELD_STANDARD 
VAR_FIELD_SCALAR 
VAR_FIELD_VECTOR 
VAR_FIELD_ANY 

Definition at line 360 of file MooseTypes.h.

◆ VarKindType

Framework-wide stuff.

Enumerator
VAR_NONLINEAR 
VAR_AUXILIARY 
VAR_ANY 

Definition at line 353 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 483 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 73 of file Moose.C.

Referenced by associateSyntaxInner().

74 {
87  // clang-format off
88  /**************************/
89  /**** Register Actions ****/
90  /**************************/
91  registerMooseObjectTask("create_problem", Problem, false);
92  registerMooseObjectTask("setup_executioner", Executioner, false);
93 
94  // This task does not construct an object, but it needs all of the parameters that
95  // would normally be used to construct an object.
96  registerMooseObjectTask("determine_system_type", Executioner, true);
97 
98  registerMooseObjectTask("setup_mesh", MooseMesh, false);
99  registerMooseObjectTask("init_mesh", MooseMesh, false);
100  registerMooseObjectTask("add_mesh_modifier", MeshModifier, false);
101  registerMooseObjectTask("add_mesh_generator", MeshGenerator, false);
102 
103  registerMooseObjectTask("add_kernel", Kernel, false);
104  appendMooseObjectTask ("add_kernel", EigenKernel);
105  appendMooseObjectTask ("add_kernel", VectorKernel);
106 
107  registerMooseObjectTask("add_ad_kernel", ADKernel, false);
108 
109  registerMooseObjectTask("add_nodal_kernel", NodalKernel, false);
110 
111  registerMooseObjectTask("add_material", Material, false);
112  registerMooseObjectTask("add_ad_material", ADMaterial, false);
113  registerMooseObjectTask("add_bc", BoundaryCondition, false);
114  registerMooseObjectTask("add_function", Function, false);
115  registerMooseObjectTask("add_distribution", Distribution, false);
116  registerMooseObjectTask("add_sampler", Sampler, false);
117 
118  registerMooseObjectTask("add_aux_kernel", AuxKernel, false);
119  registerMooseObjectTask("add_elemental_field_variable", AuxKernel, false);
120 
121  registerMooseObjectTask("add_scalar_kernel", ScalarKernel, false);
122  registerMooseObjectTask("add_aux_scalar_kernel", AuxScalarKernel, false);
123  registerMooseObjectTask("add_dirac_kernel", DiracKernel, false);
124  registerMooseObjectTask("add_dg_kernel", DGKernel, false);
125  registerMooseObjectTask("add_interface_kernel", InterfaceKernel, false);
126  registerMooseObjectTask("add_constraint", Constraint, false);
127 
128  registerMooseObjectTask("add_ic", InitialCondition, false);
129  appendMooseObjectTask ("add_ic", ScalarInitialCondition);
130 
131  registerMooseObjectTask("add_damper", Damper, false);
132  registerMooseObjectTask("setup_predictor", Predictor, false);
133  registerMooseObjectTask("setup_time_stepper", TimeStepper, false);
134  registerMooseObjectTask("setup_time_integrator", TimeIntegrator, false);
135 
136  registerMooseObjectTask("add_preconditioning", MoosePreconditioner, false);
137  registerMooseObjectTask("add_field_split", Split, false);
138 
139  registerMooseObjectTask("add_user_object", UserObject, false);
140  appendMooseObjectTask ("add_user_object", Postprocessor);
141 
142  registerMooseObjectTask("add_postprocessor", Postprocessor, false);
143  registerMooseObjectTask("add_vector_postprocessor", VectorPostprocessor, false);
144 
145  registerMooseObjectTask("add_indicator", Indicator, false);
146  registerMooseObjectTask("add_marker", Marker, false);
147 
148  registerMooseObjectTask("add_multi_app", MultiApp, false);
149  registerMooseObjectTask("add_transfer", Transfer, false);
150 
151  registerMooseObjectTask("add_output", Output, false);
152 
153  registerMooseObjectTask("add_control", Control, false);
154  registerMooseObjectTask("add_partitioner", MoosePartitioner, false);
155 
156  // clang-format on
157 
158  registerTask("dynamic_object_registration", false);
159  registerTask("common_output", true);
160  registerTask("setup_recover_file_base", true);
161 
162  registerTask("add_bounds_vectors", false);
163  registerTask("add_periodic_bc", false);
164  registerTask("add_aux_variable", false);
165  registerTask("add_external_aux_variables", true);
166  registerTask("add_variable", false);
167 
168  registerTask("execute_mesh_modifiers", false);
169  registerTask("execute_mesh_generators", true);
170  registerTask("uniform_refine_mesh", false);
171  registerTask("prepare_mesh", false);
172  registerTask("add_geometric_rm", true);
173  registerTask("setup_mesh_complete", false); // calls prepare
174 
175  registerTask("init_displaced_problem", false);
176 
177  registerTask("add_algebraic_rm", true);
178  registerTask("init_problem", true);
179  registerTask("check_copy_nodal_vars", true);
180  registerTask("copy_nodal_vars", true);
181  registerTask("copy_nodal_aux_vars", true);
182  registerTask("setup_postprocessor_data", false);
183 
184  registerTask("setup_dampers", true);
185  registerTask("check_integrity", true);
186  registerTask("check_integrity_early", true);
187  registerTask("setup_quadrature", true);
188 
190  registerTask("no_action", false); // Used for Empty Action placeholders
191  registerTask("set_global_params", false);
192  registerTask("setup_adaptivity", false);
193  registerTask("meta_action", false);
194  registerTask("setup_residual_debug", false);
195  registerTask("setup_oversampling", false);
196  registerTask("deprecated_block", false);
197  registerTask("set_adaptivity_options", false);
198  registerTask("add_mortar_interface", false);
199 
200  // Dummy Actions (useful for sync points in the dependencies)
201  registerTask("setup_function_complete", false);
202  registerTask("setup_variable_complete", false);
203  registerTask("ready_to_init", true);
204 
205  // Output related actions
206  registerTask("add_output_aux_variables", true);
207  registerTask("check_output", true);
208 
209  registerTask("create_problem_default", true);
210  registerTask("create_problem_custom", false);
211  registerTask("create_problem_complete", false);
212 
213  // Deprecated tasks
214  registerTask("setup_material_output", false);
215  registerTask("setup_debug", false);
216 
217  /**************************/
218  /****** Dependencies ******/
219  /**************************/
229  syntax.addDependencySets("(meta_action)"
230  "(dynamic_object_registration)"
231  "(common_output)"
232  "(set_global_params)"
233  "(setup_recover_file_base)"
234  "(add_mesh_generator)"
235  "(execute_mesh_generators)"
236  "(check_copy_nodal_vars)"
237  "(setup_mesh)"
238  "(add_partitioner)"
239  "(add_geometric_rm)"
240  "(init_mesh)"
241  "(prepare_mesh)"
242  "(add_mesh_modifier)"
243  "(execute_mesh_modifiers)"
244  "(add_mortar_interface)"
245  "(uniform_refine_mesh)"
246  "(setup_mesh_complete)"
247  "(determine_system_type)"
248  "(create_problem)"
249  "(create_problem_custom)"
250  "(create_problem_default)"
251  "(create_problem_complete)"
252  "(setup_postprocessor_data)"
253  "(setup_time_integrator)"
254  "(setup_executioner)"
255  "(check_integrity_early)"
256  "(setup_predictor)"
257  "(init_displaced_problem)"
258  "(add_aux_variable, add_variable, add_elemental_field_variable,"
259  " add_external_aux_variables)"
260  "(setup_variable_complete)"
261  "(setup_quadrature)"
262  "(add_function)"
263  "(add_distribution)"
264  "(add_sampler)"
265  "(add_periodic_bc)"
266  "(add_user_object)"
267  "(setup_function_complete)"
268  "(setup_adaptivity)"
269  "(set_adaptivity_options)"
270  "(add_ic)"
271  "(add_constraint, add_field_split)"
272  "(add_preconditioning)"
273  "(setup_time_stepper)"
274  "(ready_to_init)"
275  "(setup_dampers)"
276  "(setup_residual_debug)"
277  "(add_bounds_vectors)"
278  "(add_multi_app)"
279  "(add_transfer)"
280  "(copy_nodal_vars, copy_nodal_aux_vars)"
281  "(add_material, add_ad_material)"
282  "(setup_material_output)" // DEPRECATED: Remove by 12/31/2018
283  "(add_output_aux_variables)"
284  "(add_algebraic_rm)"
285  "(init_problem)"
286  "(setup_debug)" // DEPRECATED: Remove by 12/31/2018
287  "(add_output)"
288  "(add_postprocessor)"
289  "(add_vector_postprocessor)" // MaterialVectorPostprocessor requires this
290  // to be after material objects are created.
291  "(add_aux_kernel, add_bc, add_damper, add_dirac_kernel, add_kernel,"
292  " add_ad_kernel, add_nodal_kernel, add_dg_kernel, add_interface_kernel,"
293  " add_scalar_kernel, add_aux_scalar_kernel, add_indicator, add_marker)"
294  "(add_control)"
295  "(check_output)"
296  "(check_integrity)");
297 }
Base class for function objects.
Definition: Function.h:41
Base class for split-based preconditioners.
Definition: Split.h:30
This is the base class for Samplers.
Definition: Sampler.h:41
Base class for predictors.
Definition: Predictor.h:34
This is a template class that implements the workhorse compute and computeNodal methods.
Base class for all Constraint types.
Definition: Constraint.h:39
Class that hold the whole problem being solved.
Definition: Problem.h:25
Definition: Marker.h:40
MeshModifiers are objects that can modify or add to an existing mesh.
Definition: MeshModifier.h:26
Base class for time stepping.
Definition: TimeStepper.h:27
All Distributions should inherit from this class.
Definition: Distribution.h:23
Base class for MOOSE preconditioners.
Based class for output objects.
Definition: Output.h:42
The DGKernel class is responsible for calculating the residuals for various physics on internal sides...
Definition: DGKernel.h:42
Base class for making kernels that work on auxiliary scalar variables.
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:72
Executioners are objects that do the actual work of solving your problem.
Definition: Executioner.h:37
Base class for all Postprocessors.
Definition: Postprocessor.h:30
The behavior of this kernel is controlled by one problem-wise global parameter eigen_on_current - boo...
Definition: EigenKernel.h:29
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:46
InterfaceKernel is responsible for interfacing physics across subdomains.
InitialConditions are objects that set the initial value of variables.
void addDependencySets(const std::string &action_sets)
Adds all dependencies in a single call.
Definition: Syntax.C:64
Materials compute MaterialProperties.
Definition: Material.h:47
Base class for creating new types of boundary conditions.
Base class for time integrators.
Base class for Control objects.
Definition: Control.h:38
Base class for MOOSE partitioner.
Base class for deriving dampers.
Definition: Damper.h:30
Definition: Kernel.h:21
ADMaterials compute ADMaterialProperties.
Definition: ADMaterial.h:20
Base class for creating new types of boundary conditions.
Definition: NodalKernel.h:49
A MultiApp represents one or more MOOSE applications that are running simultaneously.
Definition: MultiApp.h:57
Base class for Postprocessors that produce a vector of values.
MeshGenerators are objects that can modify or add to an existing mesh.
Definition: MeshGenerator.h:28
A DiracKernel is used when you need to add contributions to the residual by means of multiplying some...
Definition: DiracKernel.h:46
Base class for user-specific data.
Definition: UserObject.h:38
Base class for all Transfer objects.
Definition: Transfer.h:41

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

Referenced by MaterialVectorPostprocessor::sortVecs().

110 {
111  T tmp;
112  tmp.resize(container.size());
113  for (size_t i = 0; i < indices.size(); i++)
114  tmp[i] = container[indices[i]];
115  std::swap(tmp, container);
116 }
X_global swap(X_sys)

◆ assemble_matrix()

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

Definition at line 33 of file NonlinearEigenSystem.C.

Referenced by NonlinearEigenSystem::NonlinearEigenSystem().

34 {
35  EigenProblem * p = es.parameters.get<EigenProblem *>("_eigen_problem");
36  EigenSystem & eigen_system = es.get_system<EigenSystem>(system_name);
38 
39  // If it is a linear generalized eigenvalue problem,
40  // we assemble A and B together
41  if (!p->isNonlinearEigenvalueSolver() && eigen_system.generalized())
42  {
43  p->computeJacobianAB(*eigen_system.current_local_solution.get(),
44  *eigen_system.matrix_A,
45  *eigen_system.matrix_B,
46  eigen_nl.nonEigenMatrixTag(),
47  eigen_nl.eigenMatrixTag());
48  return;
49  }
50 
52  {
53  p->computeJacobianTag(*eigen_system.current_local_solution.get(),
54  *eigen_system.matrix_A,
55  eigen_nl.nonEigenMatrixTag());
56  }
57  else
58  {
59  Mat petsc_mat_A = static_cast<PetscMatrix<Number> &>(*eigen_system.matrix_A).mat();
60 
61  PetscObjectComposeFunction((PetscObject)petsc_mat_A,
62  "formJacobian",
64  PetscObjectComposeFunction((PetscObject)petsc_mat_A,
65  "formFunction",
67 
68  PetscObjectComposeFunction((PetscObject)petsc_mat_A,
69  "formFunctionAB",
71 
72  PetscContainer container;
73  PetscContainerCreate(eigen_system.comm().get(), &container);
74  PetscContainerSetPointer(container, p);
75  PetscObjectCompose((PetscObject)petsc_mat_A, "formJacobianCtx", nullptr);
76  PetscObjectCompose((PetscObject)petsc_mat_A, "formJacobianCtx", (PetscObject)container);
77  PetscObjectCompose((PetscObject)petsc_mat_A, "formFunctionCtx", nullptr);
78  PetscObjectCompose((PetscObject)petsc_mat_A, "formFunctionCtx", (PetscObject)container);
79  PetscContainerDestroy(&container);
80 
81  // Let libmesh do not close matrices before solve
82  eigen_system.eigen_solver->set_close_matrix_before_solve(false);
83  }
84  if (eigen_system.generalized())
85  {
86  if (eigen_system.matrix_B)
87  {
89  {
90  p->computeJacobianTag(*eigen_system.current_local_solution.get(),
91  *eigen_system.matrix_B,
92  eigen_nl.eigenMatrixTag());
93  }
94  else
95  {
96  Mat petsc_mat_B = static_cast<PetscMatrix<Number> &>(*eigen_system.matrix_B).mat();
97 
98  PetscObjectComposeFunction((PetscObject)petsc_mat_B,
99  "formJacobian",
101  PetscObjectComposeFunction((PetscObject)petsc_mat_B,
102  "formFunction",
104 
105  PetscContainer container;
106  PetscContainerCreate(eigen_system.comm().get(), &container);
107  PetscContainerSetPointer(container, p);
108  PetscObjectCompose((PetscObject)petsc_mat_B, "formFunctionCtx", nullptr);
109  PetscObjectCompose((PetscObject)petsc_mat_B, "formFunctionCtx", (PetscObject)container);
110  PetscObjectCompose((PetscObject)petsc_mat_B, "formJacobianCtx", nullptr);
111  PetscObjectCompose((PetscObject)petsc_mat_B, "formJacobianCtx", (PetscObject)container);
112  PetscContainerDestroy(&container);
113  }
114  }
115  else
116  mooseError("It is a generalized eigenvalue problem but matrix B is empty\n");
117  }
118 }
Nonlinear eigenvalue system to be solved.
virtual bool isNonlinearEigenvalueSolver()
Definition: EigenProblem.C:243
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
PetscErrorCode mooseSlepcEigenFormJacobianB(SNES snes, Vec x, Mat jac, Mat pc, void *ctx)
Definition: SlepcSupport.C:483
PetscErrorCode mooseSlepcEigenFormFunctionAB(SNES snes, Vec x, Vec Ax, Vec Bx, void *ctx)
Definition: SlepcSupport.C:538
PetscErrorCode mooseSlepcEigenFormFunctionA(SNES snes, Vec x, Vec r, void *ctx)
Definition: SlepcSupport.C:514
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:57
PetscErrorCode mooseSlepcEigenFormJacobianA(SNES snes, Vec x, Mat jac, Mat pc, void *ctx)
Definition: SlepcSupport.C:471
PetscErrorCode mooseSlepcEigenFormFunctionB(SNES snes, Vec x, Vec r, void *ctx)
Definition: SlepcSupport.C:526
Problem for solving eigenvalue problems.
Definition: EigenProblem.h:26
NonlinearEigenSystem & getNonlinearEigenSystem()
Definition: EigenProblem.h:45
virtual void computeJacobianAB(const NumericVector< Number > &soln, SparseMatrix< Number > &jacobianA, SparseMatrix< Number > &jacobianB, TagID tagA, TagID tagB)
Form two Jacobian matrices, whre each is associateed with one tag, through one element-loop.
Definition: EigenProblem.C:134
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:112

◆ associateSyntax()

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

Definition at line 514 of file Moose.C.

515 {
516  associateSyntaxInner(syntax, action_factory);
517  registerActions(syntax, action_factory);
518 }
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:328
void associateSyntaxInner(Syntax &syntax, ActionFactory &action_factory)
Definition: Moose.C:364

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

Referenced by associateSyntax(), and registerAll().

365 {
371  registerSyntaxTask("CopyNodalVarsAction", "Variables/*", "check_copy_nodal_vars");
372  registerSyntaxTask("CopyNodalVarsAction", "Variables/*", "copy_nodal_vars");
373  registerSyntaxTask("CopyNodalVarsAction", "AuxVariables/*", "check_copy_nodal_vars");
374  registerSyntaxTask("CopyNodalVarsAction", "AuxVariables/*", "copy_nodal_aux_vars");
375 
376  registerSyntaxTask("AddKernelAction", "Kernels/*", "add_kernel");
377  registerSyntaxTask("AddNodalKernelAction", "NodalKernels/*", "add_nodal_kernel");
378  registerSyntaxTask("AddKernelAction", "AuxKernels/*", "add_aux_kernel");
379  registerSyntaxTask("AddKernelAction", "Bounds/*", "add_aux_kernel");
380 
381  registerSyntaxTask("AddADKernelAction", "ADKernels/*", "add_ad_kernel");
382 
383  registerSyntaxTask("AddScalarKernelAction", "ScalarKernels/*", "add_scalar_kernel");
384  registerSyntaxTask("AddScalarKernelAction", "AuxScalarKernels/*", "add_aux_scalar_kernel");
385 
386  registerSyntaxTask("AddBCAction", "BCs/*", "add_bc");
387 
388  registerSyntax("CreateProblemAction", "Problem");
389  registerSyntax("DynamicObjectRegistrationAction", "Problem");
390  registerSyntax("SetupMeshAction", "Mesh");
391  registerSyntax("SetupMeshCompleteAction", "Mesh");
392  // registerSyntaxTask("SetupMeshCompleteAction", "Mesh", "prepare_mesh");
393  // registerSyntaxTask("SetupMeshCompleteAction", "Mesh", "setup_mesh_complete");
394  registerSyntax("CreateDisplacedProblemAction", "Mesh");
395  registerSyntax("AddMeshModifierAction", "MeshModifiers/*");
396  registerSyntax("AddMeshGeneratorAction", "MeshGenerators/*");
397  registerSyntax("AddMortarInterfaceAction", "Mesh/MortarInterfaces/*");
398 
399  registerSyntax("AddFunctionAction", "Functions/*");
400  syntax.registerSyntaxType("Functions/*", "FunctionName");
401 
402  registerSyntax("GlobalParamsAction", "GlobalParams");
403 
404  registerSyntax("AddDistributionAction", "Distributions/*");
405  registerSyntax("AddSamplerAction", "Samplers/*");
406 
407  registerSyntax("SetupDebugAction", "Debug");
408  registerSyntax("SetupResidualDebugAction", "Debug");
409 
411  registerSyntax("AddVariableAction", "Variables/*");
412  syntax.registerSyntaxType("Variables/*", "VariableName");
413  syntax.registerSyntaxType("Variables/*", "NonlinearVariableName");
414  // syntax.registerActionSyntax("AddVariableAction", "Variables/*", "add_variable");
415  // syntax.registerActionSyntax("AddVariableAction", "Variables/*", "add_ic");
416 
417  registerSyntax("AddICAction", "Variables/*/InitialCondition");
418 
419  registerSyntax("AddAuxVariableAction", "AuxVariables/*");
420  syntax.registerSyntaxType("AuxVariables/*", "VariableName");
421  syntax.registerSyntaxType("AuxVariables/*", "AuxVariableName");
422  // syntax.registerActionSyntax("AddAuxVariableAction", "AuxVariables/*", "add_aux_variable");
423  // syntax.registerActionSyntax("AddAuxVariableAction", "AuxVariables/*", "add_ic");
424 
425  registerSyntax("AddICAction", "AuxVariables/*/InitialCondition");
426 
427  registerSyntaxTask("EmptyAction", "BCs/Periodic", "no_action"); // placeholder
428  registerSyntax("AddPeriodicBCAction", "BCs/Periodic/*");
429 
430  registerSyntaxTask("AddInitialConditionAction", "ICs/*", "add_ic");
431 
432  registerSyntax("AddMaterialAction", "Materials/*");
433  registerSyntaxTask("AddADMaterialAction", "ADMaterials/*", "add_ad_material");
434 
435  registerSyntax("SetupPostprocessorDataAction", "Postprocessors/*");
436  registerSyntax("AddPostprocessorAction", "Postprocessors/*");
437  syntax.registerSyntaxType("Postprocessors/*", "PostprocessorName");
438  syntax.registerSyntaxType("Postprocessors/*", "UserObjectName");
439 
440  registerSyntax("AddVectorPostprocessorAction", "VectorPostprocessors/*");
441  syntax.registerSyntaxType("VectorPostprocessors/*", "VectorPostprocessorName");
442 
443  registerSyntax("AddDamperAction", "Dampers/*");
444 
445  registerSyntax("AddOutputAction", "Outputs/*");
446  registerSyntax("CommonOutputAction", "Outputs");
447  syntax.registerSyntaxType("Outputs/*", "OutputName");
448 
449  // Note: Preconditioner Actions will be built by this setup action
450  registerSyntax("SetupPreconditionerAction", "Preconditioning/*");
451  registerSyntax("AddFieldSplitAction", "Preconditioning/*/*");
452 
453  registerSyntax("CreateExecutionerAction", "Executioner");
454  registerSyntax("SetupTimeStepperAction", "Executioner/TimeStepper");
455  registerSyntax("SetupTimeIntegratorAction", "Executioner/TimeIntegrator");
456 
457  registerSyntax("SetupQuadratureAction", "Executioner/Quadrature");
458  registerSyntax("SetupPredictorAction", "Executioner/Predictor");
459 #ifdef LIBMESH_ENABLE_AMR
460  registerSyntax("AdaptivityAction", "Executioner/Adaptivity");
461 #endif
462 
463  registerSyntax("PartitionerAction", "Mesh/Partitioner");
464 
465  registerSyntax("AddDiracKernelAction", "DiracKernels/*");
466 
467  registerSyntax("AddDGKernelAction", "DGKernels/*");
468 
469  registerSyntax("AddInterfaceKernelAction", "InterfaceKernels/*");
470 
471  registerSyntax("AddConstraintAction", "Constraints/*");
472 
473  registerSyntax("AddUserObjectAction", "UserObjects/*");
474  syntax.registerSyntaxType("UserObjects/*", "UserObjectName");
475  registerSyntax("AddControlAction", "Controls/*");
476  registerSyntax("AddBoundsVectorsAction", "Bounds");
477 
478  registerSyntax("AddNodalNormalsAction", "NodalNormals");
479  // registerSyntaxTask("AddNodalNormalsAction", "NodalNormals", "add_aux_variable");
480  // registerSyntaxTask("AddNodalNormalsAction", "NodalNormals", "add_postprocessor");
481  // registerSyntaxTask("AddNodalNormalsAction", "NodalNormals", "add_user_object");
482 
483  // Indicator
484  registerSyntax("AddElementalFieldAction", "Adaptivity/Indicators/*");
485  registerSyntax("AddIndicatorAction", "Adaptivity/Indicators/*");
486  syntax.registerSyntaxType("Adaptivity/Indicators/*", "IndicatorName");
487 
488  // Marker
489  registerSyntax("AddElementalFieldAction", "Adaptivity/Markers/*");
490  registerSyntax("AddMarkerAction", "Adaptivity/Markers/*");
491  syntax.registerSyntaxType("Adaptivity/Markers/*", "MarkerName");
492 
493  // New Adaptivity System
494  registerSyntax("SetAdaptivityOptionsAction", "Adaptivity");
495 
496  // Deprecated Block
497  registerSyntax("DeprecatedBlockAction", "DeprecatedBlock");
498 
499  // Multi Apps
500  registerSyntax("AddMultiAppAction", "MultiApps/*");
501  syntax.registerSyntaxType("MultiApps/*", "MultiAppName");
502 
503  // Transfers
504  registerSyntax("AddTransferAction", "Transfers/*");
505 
506  // Material derivative test
507  registerSyntaxTask("EmptyAction", "Debug/MaterialDerivativeTest", "no_action"); // placeholder
508  registerSyntax("MaterialDerivativeTestAction", "Debug/MaterialDerivativeTest/*");
509 
510  addActionTypes(syntax);
511 }
void registerSyntaxType(const std::string &syntax, const std::string &type)
Register a type with a block.
Definition: Syntax.C:289
void addActionTypes(Syntax &syntax)
Definition: Moose.C:73

◆ colorConsole()

bool Moose::colorConsole ( )

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

Definition at line 542 of file Moose.C.

543 {
544  return _color_console;
545 }
static bool _color_console
Definition: Moose.C:539

◆ compute_bounds()

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

Definition at line 37 of file NonlinearSystem.C.

Referenced by NonlinearSystem::NonlinearSystem().

40 {
41  FEProblemBase * p =
42  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
43  p->computeBounds(sys, lower, upper);
44 }
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.
Definition: MooseObject.h:57

◆ compute_jacobian()

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

Definition at line 27 of file NonlinearSystem.C.

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

30 {
31  FEProblemBase * p =
32  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
33  p->computeJacobianSys(sys, soln, jacobian);
34 }
virtual void computeJacobianSys(NonlinearImplicitSystem &sys, const NumericVector< Number > &soln, SparseMatrix< Number > &jacobian)
Form a Jacobian matrix.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:57

◆ compute_nearnullspace()

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

Definition at line 64 of file NonlinearSystem.C.

Referenced by NonlinearSystem::NonlinearSystem().

65 {
66  FEProblemBase * p =
67  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
68  p->computeNearNullSpace(sys, sp);
69 }
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:57
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 47 of file NonlinearSystem.C.

Referenced by NonlinearSystem::NonlinearSystem().

48 {
49  FEProblemBase * p =
50  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
51  p->computeNullSpace(sys, sp);
52 }
virtual void computeNullSpace(NonlinearImplicitSystem &sys, std::vector< NumericVector< Number > *> &sp)
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:57

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

Referenced by NonlinearSystem::solve().

78 {
79  FEProblemBase * p =
80  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
82  sys, old_soln, search_direction, new_soln, changed_search_direction, changed_new_soln);
83 }
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:57
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)

◆ compute_transpose_nullspace()

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

Definition at line 55 of file NonlinearSystem.C.

Referenced by NonlinearSystem::NonlinearSystem().

57 {
58  FEProblemBase * p =
59  sys.get_equation_systems().parameters.get<FEProblemBase *>("_fe_problem_base");
60  p->computeTransposeNullSpace(sys, sp);
61 }
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:57
virtual void computeTransposeNullSpace(NonlinearImplicitSystem &sys, std::vector< NumericVector< Number > *> &sp)

◆ 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:28
void recursivelyFindElementsIntersectedByLine(const LineSegment &line_segment, const Elem *current_elem, int incoming_side, const Point &incoming_point, std::vector< Elem *> &intersected_elems, std::vector< LineSegment > &segments)
Recursively find all elements intersected by a line segment.
Definition: RayTracing.C:144

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

◆ findContactPoint()

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

Finds the closest point (called the contact point) on the master_elem on side "side" to the slave_point.

Parameters
p_infoThe penetration info object, contains master_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
slave_pointThe physical space coordinates of the slave node
contact_point_on_sidewhether or not the contact_point actually lies on that side of the element.

Definition at line 44 of file FindContactPoint.C.

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

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

◆ 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 24 of file ExecutablePath.C.

Referenced by SystemInfo::getInfo().

25 {
26  std::string exec_path;
27  char path[1024];
28 
29 #ifdef __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 #else // Linux with Proc
36  std::ostringstream oss;
37  oss << "/proc/" << getpid() << "/exe";
38  int ch = readlink(oss.str().c_str(), path, 1024);
39  if (ch != -1)
40  {
41  path[ch] = 0;
42  exec_path = path;
43  }
44 #endif
45 
46  // Now strip off the exeuctable to get the PATH
47  std::string::size_type t = exec_path.find_last_of("/");
48  exec_path = exec_path.substr(0, t) + "/";
49 
50  return exec_path;
51 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208

◆ indirectSort() [1/2]

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

Definition at line 69 of file IndirectSort.h.

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

70 {
71  // Space in b
72  initialize_indirect_sort(beg, end, b);
73 
74  // Typedef for less typing. Note: use of std::iterator_traits means this should work with
75  // naked pointers too...
76  typedef std::less<typename std::iterator_traits<RandomAccessIterator>::value_type>
77  LessThanComparator;
78 
79  // Construct comparator object
80  indirect_comparator<RandomAccessIterator, LessThanComparator> ic(beg, LessThanComparator());
81 
82  // Sort the indices, based on the data
83  std::sort(b.begin(), b.end(), ic);
84 }
void initialize_indirect_sort(RandomAccessIterator beg, RandomAccessIterator end, std::vector< size_t > &b)
Definition: IndirectSort.h:53

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

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

◆ initCoordinateSystemType()

void Moose::initCoordinateSystemType ( )

Definition at line 51 of file Conversion.C.

Referenced by stringToEnum< CoordinateSystemType >().

52 {
54  {
58  }
59 }
std::map< std::string, CoordinateSystemType > coordinate_system_type_to_enum
Definition: Conversion.C:24

◆ initEigenProlemType()

void Moose::initEigenProlemType ( )

Definition at line 91 of file Conversion.C.

Referenced by stringToEnum< EigenProblemType >().

92 {
93  if (eigen_problem_type_to_enum.empty())
94  {
100  eigen_problem_type_to_enum["POS_GEN_NON_HERMITIAN"] = EPT_POS_GEN_NON_HERMITIAN;
102  }
103 }
Generalized Non-Hermitian.
Definition: MooseTypes.h:475
Generalized Hermitian indefinite.
Definition: MooseTypes.h:474
std::map< std::string, EigenProblemType > eigen_problem_type_to_enum
Definition: Conversion.C:27
use whatever SLPEC has by default
Definition: MooseTypes.h:477
Generalized Non-Hermitian with positive (semi-)definite B.
Definition: MooseTypes.h:476
Non-Hermitian.
Definition: MooseTypes.h:472
Generalized Hermitian.
Definition: MooseTypes.h:473

◆ initEigenSolveType()

void Moose::initEigenSolveType ( )

Definition at line 75 of file Conversion.C.

Referenced by stringToEnum< EigenSolveType >().

76 {
77  if (eigen_solve_type_to_enum.empty())
78  {
82  eigen_solve_type_to_enum["JACOBI_DAVIDSON"] = EST_JACOBI_DAVIDSON;
83  eigen_solve_type_to_enum["NONLINEAR_POWER"] = EST_NONLINEAR_POWER;
84  eigen_solve_type_to_enum["MF_NONLINEAR_POWER"] = EST_MF_NONLINEAR_POWER;
85  eigen_solve_type_to_enum["MONOLITH_NEWTON"] = EST_MONOLITH_NEWTON;
86  eigen_solve_type_to_enum["MF_MONOLITH_NEWTON"] = EST_MF_MONOLITH_NEWTON;
87  }
88 }
Newton-based eigen solver.
Definition: MooseTypes.h:462
std::map< std::string, EigenSolveType > eigen_solve_type_to_enum
Definition: Conversion.C:26
Matrix-free Newton-based eigen solver.
Definition: MooseTypes.h:463
Matrix-free nonlinear inverse power.
Definition: MooseTypes.h:461
Power / Inverse / RQI.
Definition: MooseTypes.h:456
Krylov-Schur.
Definition: MooseTypes.h:458
Nonlinear inverse power.
Definition: MooseTypes.h:460
Jacobi-Davidson.
Definition: MooseTypes.h:459

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

Referenced by indirectSort().

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

◆ initLineSearchType()

void Moose::initLineSearchType ( )

Definition at line 125 of file Conversion.C.

Referenced by stringToEnum< LineSearchType >().

126 {
127  if (line_search_type_to_enum.empty())
128  {
132 #ifdef LIBMESH_HAVE_PETSC
133 #if PETSC_VERSION_LESS_THAN(3, 3, 0)
135  line_search_type_to_enum["QUADRATIC"] = LS_QUADRATIC;
136  line_search_type_to_enum["BASICNONORMS"] = LS_BASICNONORMS;
137 #else
143 #endif
144 #endif
145  }
146 }
std::map< std::string, LineSearchType > line_search_type_to_enum
Definition: Conversion.C:29

◆ initMffdType()

void Moose::initMffdType ( )

Definition at line 164 of file Conversion.C.

Referenced by stringToEnum< MffdType >().

165 {
166  if (mffd_type_to_enum.empty())
167  {
168  mffd_type_to_enum["DS"] = MFFD_DS;
169  mffd_type_to_enum["WP"] = MFFD_WP;
170  }
171 }
std::map< std::string, MffdType > mffd_type_to_enum
Definition: Conversion.C:31

◆ initQuadratureType()

void Moose::initQuadratureType ( )

Definition at line 35 of file Conversion.C.

Referenced by stringToEnum< QuadratureType >().

36 {
37  if (quadrature_type_to_enum.empty())
38  {
39  quadrature_type_to_enum["CLOUGH"] = QCLOUGH;
40  quadrature_type_to_enum["CONICAL"] = QCONICAL;
41  quadrature_type_to_enum["GAUSS"] = QGAUSS;
42  quadrature_type_to_enum["GRID"] = QGRID;
43  quadrature_type_to_enum["MONOMIAL"] = QMONOMIAL;
44  quadrature_type_to_enum["SIMPSON"] = QSIMPSON;
45  quadrature_type_to_enum["TRAP"] = QTRAP;
46  quadrature_type_to_enum["GAUSS_LOBATTO"] = QGAUSS_LOBATTO;
47  }
48 }
std::map< std::string, QuadratureType > quadrature_type_to_enum
Definition: Conversion.C:23

◆ initRMType()

void Moose::initRMType ( )

Definition at line 174 of file Conversion.C.

Referenced by stringToEnum< RelationshipManagerType >().

175 {
176  if (rm_type_to_enum.empty())
177  {
178  rm_type_to_enum["DEFAULT"] = RelationshipManagerType::DEFAULT;
179  rm_type_to_enum["GEOMETRIC"] = RelationshipManagerType::GEOMETRIC;
180  rm_type_to_enum["ALGEBRAIC"] = RelationshipManagerType::ALGEBRAIC;
181  rm_type_to_enum["COUPLING"] = RelationshipManagerType::COUPLING;
182  }
183 }
std::map< std::string, RelationshipManagerType > rm_type_to_enum
Definition: Conversion.C:32

◆ initSolveType()

void Moose::initSolveType ( )

Definition at line 62 of file Conversion.C.

Referenced by stringToEnum< SolveType >().

63 {
64  if (solve_type_to_enum.empty())
65  {
66  solve_type_to_enum["PJFNK"] = ST_PJFNK;
67  solve_type_to_enum["JFNK"] = ST_JFNK;
68  solve_type_to_enum["NEWTON"] = ST_NEWTON;
69  solve_type_to_enum["FD"] = ST_FD;
70  solve_type_to_enum["LINEAR"] = ST_LINEAR;
71  }
72 }
Full Newton Solve.
Definition: MooseTypes.h:446
Solving a linear problem.
Definition: MooseTypes.h:448
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:445
Use finite differences to compute Jacobian.
Definition: MooseTypes.h:447
Preconditioned Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:444
std::map< std::string, SolveType > solve_type_to_enum
Definition: Conversion.C:25

◆ initTimeIntegratorsType()

void Moose::initTimeIntegratorsType ( )

Definition at line 149 of file Conversion.C.

Referenced by stringToEnum< TimeIntegratorType >().

150 {
151  if (time_integrator_to_enum.empty())
152  {
153  time_integrator_to_enum["IMPLICIT_EULER"] = TI_IMPLICIT_EULER;
154  time_integrator_to_enum["EXPLICIT_EULER"] = TI_EXPLICIT_EULER;
155  time_integrator_to_enum["CRANK_NICOLSON"] = TI_CRANK_NICOLSON;
157  time_integrator_to_enum["EXPLICIT_MIDPOINT"] = TI_EXPLICIT_MIDPOINT;
158  time_integrator_to_enum["LSTABLE_DIRK2"] = TI_LSTABLE_DIRK2;
159  time_integrator_to_enum["EXPLICIT_TVDRK2"] = TI_EXPLICIT_TVD_RK_2;
160  }
161 }
std::map< std::string, TimeIntegratorType > time_integrator_to_enum
Definition: Conversion.C:30

◆ initWhichEigenPairs()

void Moose::initWhichEigenPairs ( )

Definition at line 106 of file Conversion.C.

Referenced by stringToEnum< WhichEigenPairs >().

107 {
108  if (which_eigen_pairs_to_enum.empty())
109  {
110  which_eigen_pairs_to_enum["LARGEST_MAGNITUDE"] = WEP_LARGEST_MAGNITUDE;
111  which_eigen_pairs_to_enum["SMALLEST_MAGNITUDE"] = WEP_SMALLEST_MAGNITUDE;
113  which_eigen_pairs_to_enum["SMALLEST_REAL"] = WEP_SMALLEST_REAL;
114  which_eigen_pairs_to_enum["LARGEST_IMAGINARY"] = WEP_LARGEST_IMAGINARY;
115  which_eigen_pairs_to_enum["SMALLEST_IMAGINARY"] = WEP_SMALLEST_IMAGINARY;
116  which_eigen_pairs_to_enum["TARGET_MAGNITUDE"] = WEP_TARGET_MAGNITUDE;
118  which_eigen_pairs_to_enum["TARGET_IMAGINARY"] = WEP_TARGET_IMAGINARY;
119  which_eigen_pairs_to_enum["ALL_EIGENVALUES"] = WEP_ALL_EIGENVALUES;
120  which_eigen_pairs_to_enum["SLEPC_DEFAULT"] = WEP_SLEPC_DEFAULT;
121  }
122 }
smallest magnitude
Definition: MooseTypes.h:486
std::map< std::string, WhichEigenPairs > which_eigen_pairs_to_enum
Definition: Conversion.C:28
target magnitude
Definition: MooseTypes.h:491
target imaginary
Definition: MooseTypes.h:493
smallest imaginary
Definition: MooseTypes.h:490
largest imaginary
Definition: MooseTypes.h:489
all eigenvalues
Definition: MooseTypes.h:494
use whatever we have in SLEPC
Definition: MooseTypes.h:495
largest magnitude
Definition: MooseTypes.h:485

◆ 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:66
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:28
void recursivelyFindElementsIntersectedByLine(const LineSegment &line_segment, const Elem *current_elem, int incoming_side, const Point &incoming_point, std::vector< Elem *> &intersected_elems, std::vector< LineSegment > &segments)
Recursively find all elements intersected by a line segment.
Definition: RayTracing.C: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 328 of file Moose.C.

Referenced by associateSyntax(), and registerAll().

329 {
330  mooseDeprecated("use registerAll instead of registerActions");
331  registerActions(syntax, action_factory, {"MooseApp"});
332 }
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:328
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:237

◆ registerActions() [2/2]

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

Definition at line 335 of file Moose.C.

338 {
339  Registry::registerActionsTo(action_factory, obj_labels);
340 
341  // TODO: Why is this here?
342  registerTask("finish_input_file_output", false);
343 }
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:85

◆ registerAll()

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

Register objects that are in MOOSE.

Definition at line 51 of file Moose.C.

Referenced by MooseApp::MooseApp().

52 {
53  registerObjects(f, {"MooseApp"});
54  associateSyntaxInner(s, af);
55  registerActions(s, af, {"MooseApp"});
57 }
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:328
void registerObjects(Factory &factory)
Definition: Moose.C:60
void registerExecFlags(Factory &factory)
Definition: Moose.C:346
void associateSyntaxInner(Syntax &syntax, ActionFactory &action_factory)
Definition: Moose.C:364

◆ registerExecFlags()

void Moose::registerExecFlags ( Factory factory)

Definition at line 346 of file Moose.C.

Referenced by registerAll(), and MooseApp::setupOptions().

347 {
348  registerExecFlag(EXEC_NONE);
349  registerExecFlag(EXEC_INITIAL);
350  registerExecFlag(EXEC_LINEAR);
351  registerExecFlag(EXEC_NONLINEAR);
352  registerExecFlag(EXEC_TIMESTEP_END);
353  registerExecFlag(EXEC_TIMESTEP_BEGIN);
354  registerExecFlag(EXEC_FINAL);
355  registerExecFlag(EXEC_FORCED);
356  registerExecFlag(EXEC_FAILED);
357  registerExecFlag(EXEC_CUSTOM);
358  registerExecFlag(EXEC_SUBDOMAIN);
359  registerExecFlag(EXEC_PRE_DISPLACE);
360  registerExecFlag(EXEC_SAME_AS_MULTIAPP);
361 }
const ExecFlagType EXEC_CUSTOM("CUSTOM", 0x100)
const ExecFlagType EXEC_LINEAR("LINEAR", 0x02)
const ExecFlagType EXEC_SUBDOMAIN("SUBDOMAIN", 0x200)
const ExecFlagType EXEC_NONE("NONE", 0x00)
const ExecFlagType EXEC_TIMESTEP_END("TIMESTEP_END", 0x08)
const ExecFlagType EXEC_INITIAL("INITIAL", 0x01)
const ExecFlagType EXEC_FINAL("FINAL", 0x20)
const ExecFlagType EXEC_TIMESTEP_BEGIN("TIMESTEP_BEGIN", 0x10)
const ExecFlagType EXEC_FORCED("FORCED", 0x40)
const ExecFlagType EXEC_PRE_DISPLACE("PRE_DISPLACE")
const ExecFlagType EXEC_NONLINEAR("NONLINEAR", 0x04)
const ExecFlagType EXEC_SAME_AS_MULTIAPP("SAME_AS_MULTIAPP")
const ExecFlagType EXEC_FAILED("FAILED", 0x80)

◆ registerObjects() [1/2]

void Moose::registerObjects ( Factory factory)

Definition at line 60 of file Moose.C.

Referenced by registerAll().

61 {
62  mooseDeprecated("use registerAll instead of registerObjects");
63  registerObjects(factory, {"MooseApp"});
64 }
void registerObjects(Factory &factory)
Definition: Moose.C:60
void mooseDeprecated(Args &&... args)
Emit a deprecated code/feature message with the given stringified, concatenated args.
Definition: MooseError.h:237

◆ registerObjects() [2/2]

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

Definition at line 67 of file Moose.C.

68 {
69  Registry::registerObjectsTo(factory, obj_labels);
70 }
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:52

◆ restrictPointToFace()

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

Definition at line 261 of file FindContactPoint.C.

Referenced by findContactPoint().

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

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

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

549 {
550  _color_console = (isatty(fileno(stdout)) || force) && use_color;
551  return _color_console;
552 }
static bool _color_console
Definition: Moose.C:539

◆ setSolverDefaults()

void Moose::setSolverDefaults ( FEProblemBase problem)

Definition at line 521 of file Moose.C.

Referenced by FEProblemBase::solve(), and DT2::step().

522 {
523 #ifdef LIBMESH_HAVE_PETSC
524  // May be a touch expensive to create a new DM every time, but probably safer to do it this way
526 #endif // LIBMESH_HAVE_PETSC
527 }
void petscSetDefaults(FEProblemBase &problem)
Sets the default options for PETSc.
Definition: PetscSupport.C:598

◆ 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:28
bool intersect(const Plane &pl, Point &intersect_p) const
Definition: LineSegment.C:64
bool contains_point(const Point &p) const
Determines whether a point is in a line segment or not.
Definition: LineSegment.C:57
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/6]

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

◆ stringify() [2/6]

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

Convert solve type into human readable string.

Definition at line 368 of file Conversion.C.

369 {
370  switch (t)
371  {
372  case ST_NEWTON:
373  return "NEWTON";
374  case ST_JFNK:
375  return "JFNK";
376  case ST_PJFNK:
377  return "Preconditioned JFNK";
378  case ST_FD:
379  return "FD";
380  case ST_LINEAR:
381  return "Linear";
382  }
383  return "";
384 }
Full Newton Solve.
Definition: MooseTypes.h:446
Solving a linear problem.
Definition: MooseTypes.h:448
Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:445
Use finite differences to compute Jacobian.
Definition: MooseTypes.h:447
Preconditioned Jacobian-Free Newton Krylov.
Definition: MooseTypes.h:444

◆ stringify() [3/6]

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

388 {
389  return s;
390 }

◆ stringify() [4/6]

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

Add pair stringify to support maps.

Definition at line 74 of file Conversion.h.

75 {
76  return stringify(p.first) + ':' + stringify(p.second);
77 }
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:94

◆ stringify() [5/6]

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

98 {
99  std::string str;
100  if (enclose_list_in_curly_braces)
101  str += "{";
102  const auto begin = c.begin();
103  const auto end = c.end();
104  for (auto i = begin; i != end; ++i)
105  str += (i != begin ? delim : "") + elem_encl + stringify(*i) + elem_encl;
106  if (enclose_list_in_curly_braces)
107  str += "}";
108  return str;
109 }
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:94

◆ stringify() [6/6]

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

Definition at line 350 of file Conversion.C.

351 {
352  switch (t)
353  {
354  case RelationshipManagerType::DEFAULT:
355  return "DEFAULT";
356  case RelationshipManagerType::GEOMETRIC:
357  return "GEOMETRIC";
358  case RelationshipManagerType::ALGEBRAIC:
359  return "ALGEBRAIC";
360  case RelationshipManagerType::COUPLING:
361  return "COUPLING";
362  default:
363  return "ERROR";
364  }
365 }

◆ stringifyExact()

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

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

Definition at line 393 of file Conversion.C.

394 {
395  // this or std::numeric_limits<T>::max_digits10
396  const unsigned int max_digits10 =
397  std::floor(std::numeric_limits<Real>::digits * std::log10(2) + 2);
398 
399  std::ostringstream os;
400  os << std::setprecision(max_digits10) << t;
401  return os.str();
402 }

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

216 {
218 
219  std::string upper(s);
220  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
221 
222  if (!coordinate_system_type_to_enum.count(upper))
223  mooseError("Unknown coordinate system type: ", upper);
224 
225  return coordinate_system_type_to_enum[upper];
226 }
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:208
void initCoordinateSystemType()
Definition: Conversion.C:51

◆ stringToEnum< EigenProblemType >()

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

Definition at line 260 of file Conversion.C.

261 {
263 
264  std::string upper(s);
265  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
266 
267  if (!eigen_problem_type_to_enum.count(upper))
268  mooseError("Unknown eigen problem type: ", upper);
269 
270  return eigen_problem_type_to_enum[upper];
271 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, EigenProblemType > eigen_problem_type_to_enum
Definition: Conversion.C:27
void initEigenProlemType()
Definition: Conversion.C:91

◆ stringToEnum< EigenSolveType >()

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

Definition at line 245 of file Conversion.C.

246 {
248 
249  std::string upper(s);
250  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
251 
252  if (!eigen_solve_type_to_enum.count(upper))
253  mooseError("Unknown eigen solve type: ", upper);
254 
255  return eigen_solve_type_to_enum[upper];
256 }
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:208
void initEigenSolveType()
Definition: Conversion.C:75

◆ stringToEnum< LineSearchType >()

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

Definition at line 290 of file Conversion.C.

291 {
293 
294  std::string upper(s);
295  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
296 
297  if (!line_search_type_to_enum.count(upper))
298  mooseError("Unknown line search type: ", upper);
299 
300  return line_search_type_to_enum[upper];
301 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
void initLineSearchType()
Definition: Conversion.C:125
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 320 of file Conversion.C.

321 {
322  initMffdType();
323 
324  std::string upper(s);
325  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
326 
327  if (!mffd_type_to_enum.count(upper))
328  mooseError("Unknown mffd type: ", upper);
329 
330  return mffd_type_to_enum[upper];
331 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
void initMffdType()
Definition: Conversion.C:164
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 202 of file Conversion.C.

203 {
204  std::string upper(s);
205  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
206 
207  if (upper.compare("AUTO") == 0)
208  return INVALID_ORDER;
209  else
210  return Utility::string_to_enum<Order>(upper);
211 }

◆ stringToEnum< QuadratureType >()

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

Definition at line 187 of file Conversion.C.

188 {
190 
191  std::string upper(s);
192  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
193 
194  if (!quadrature_type_to_enum.count(upper))
195  mooseError("Unknown quadrature type: ", upper);
196 
197  return quadrature_type_to_enum[upper];
198 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
void initQuadratureType()
Definition: Conversion.C:35
std::map< std::string, QuadratureType > quadrature_type_to_enum
Definition: Conversion.C:23

◆ stringToEnum< RelationshipManagerType >()

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

Definition at line 335 of file Conversion.C.

336 {
337  initRMType();
338 
339  std::string upper(s);
340  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
341 
342  if (!rm_type_to_enum.count(upper))
343  mooseError("Unknown RelationshipManager type: ", upper);
344 
345  return rm_type_to_enum[upper];
346 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, RelationshipManagerType > rm_type_to_enum
Definition: Conversion.C:32
void initRMType()
Definition: Conversion.C:174

◆ stringToEnum< SolveType >()

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

Definition at line 230 of file Conversion.C.

231 {
232  initSolveType();
233 
234  std::string upper(s);
235  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
236 
237  if (!solve_type_to_enum.count(upper))
238  mooseError("Unknown solve type: ", upper);
239 
240  return solve_type_to_enum[upper];
241 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
void initSolveType()
Definition: Conversion.C:62
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 305 of file Conversion.C.

306 {
308 
309  std::string upper(s);
310  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
311 
312  if (!time_integrator_to_enum.count(upper))
313  mooseError("Unknown time integrator: ", upper);
314 
315  return time_integrator_to_enum[upper];
316 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, TimeIntegratorType > time_integrator_to_enum
Definition: Conversion.C:30
void initTimeIntegratorsType()
Definition: Conversion.C:149

◆ stringToEnum< WhichEigenPairs >()

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

Definition at line 275 of file Conversion.C.

276 {
278 
279  std::string upper(s);
280  std::transform(upper.begin(), upper.end(), upper.begin(), ::toupper);
281 
282  if (!which_eigen_pairs_to_enum.count(upper))
283  mooseError("Unknown type of WhichEigenPairs: ", upper);
284 
285  return which_eigen_pairs_to_enum[upper];
286 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< std::string, WhichEigenPairs > which_eigen_pairs_to_enum
Definition: Conversion.C:28
void initWhichEigenPairs()
Definition: Conversion.C:106

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

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

531 {
532 #ifdef LIBMESH_HAVE_PETSC
533  MPI_Comm old_comm = PETSC_COMM_WORLD;
534  PETSC_COMM_WORLD = new_comm;
535  return old_comm;
536 #endif // LIBMESH_HAVE_PETSC
537 }

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

406 {
407  mooseAssert(pos.size() == LIBMESH_DIM, "Wrong array size while converting into a point");
408  return Point(pos[0], pos[1], pos[2]);
409 }

◆ 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 539 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 556 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() and mooseWarning(), should only be used with MOOSE unit.

Definition at line 558 of file Moose.C.

Referenced by moose::internal::mooseErrorRaw(), 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 554 of file Moose.C.

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

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

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

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

◆ EMPTY_BOUNDARY_IDS

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

Definition at line 324 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.

◆ 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

Definition at line 322 of file MooseTypes.h.

Referenced by MooseMesh::getBoundaryID().

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

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

Referenced by CheckOutputAction::checkPerfLogOutput(), PerflogDumper::execute(), PerformanceData::getValue(), NonlinearSystemBase::init(), Console::output(), MooseApp::setupOptions(), and Console::~Console().

◆ quadrature_type_to_enum

std::map<std::string, QuadratureType> Moose::quadrature_type_to_enum

Definition at line 23 of file Conversion.C.

Referenced by initQuadratureType(), and stringToEnum< QuadratureType >().

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

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