13#include "libmesh/perf_log.h"
14#include "libmesh/libmesh_common.h"
23#define QUOTE(macro) stringifyName(macro)
24#define stringifyName(name) #name
35#ifdef LIBMESH_ENABLE_DEPRECATED
64static_assert(__cplusplus >= 201703L,
65 "MOOSE requires a C++17 compatible compiler (GCC >= 7.5.0, Clang >= 5.0.2). Please "
66 "update your compiler or, if compatible, add '-std=c++17' to your compiler flags "
67 "and try again. If using the MOOSE conda package, please attempt a MOOSE environment "
68 "update (using `mamba update moose-dev`). If this update is not successful, please "
69 "create a new MOOSE environment (see "
70 "https://mooseframework.inl.gov/getting_started/installation/"
71 "conda.html#uninstall-conda-moose-environment).");
81 (cond) bool __local_bool__ = (cond); \
82 Parallel::max<bool>(__local_bool__); \
89#define FORTRAN_CALL(name) name
91#define FORTRAN_CALL(name) name##_
101template <
class M,
class... Args>
102std::pair<typename M::iterator, bool>
105 auto it = m.lower_bound(k);
106 if (it == m.end() || m.key_comp()(k, it->first))
108 return {m.emplace_hint(it,
109 std::piecewise_construct,
110 std::forward_as_tuple(k),
111 std::forward_as_tuple(std::forward<Args>(args)...)),
149#ifdef LIBMESH_ENABLE_AMR
156static_assert(LIBMESH_DIM == 3,
157 "MOOSE must be built with a libmesh library compiled without --enable-1D-only "
158 "or --enable-2D-only");
165static constexpr std::size_t
dim = LIBMESH_DIM;
168inline constexpr std::size_t
invalid_size_t = std::numeric_limits<std::size_t>::max();
229#define COLOR_BLACK (Moose::colorConsole() ? XTERM_BLACK : "")
230#define COLOR_RED (Moose::colorConsole() ? XTERM_RED : "")
231#define COLOR_GREEN (Moose::colorConsole() ? XTERM_GREEN : "")
232#define COLOR_YELLOW (Moose::colorConsole() ? XTERM_YELLOW : "")
233#define COLOR_BLUE (Moose::colorConsole() ? XTERM_BLUE : "")
234#define COLOR_MAGENTA (Moose::colorConsole() ? XTERM_MAGENTA : "")
235#define COLOR_CYAN (Moose::colorConsole() ? XTERM_CYAN : "")
236#define COLOR_WHITE (Moose::colorConsole() ? XTERM_WHITE : "")
237#define COLOR_DEFAULT (Moose::colorConsole() ? XTERM_DEFAULT : "")
263 const std::set<std::string> & obj_labels);
358#ifndef LIBMESH_HAVE_PETSC
359#error PETSc has not been detected, please ensure your environment is set up properly then rerun the libmesh build script and try to compile MOOSE again.
366#ifdef MOOSE_MFEM_ENABLED
367#include "libmesh/ignore_warnings.h"
369#include "libmesh/restore_warnings.h"
371static_assert(std::string_view(QUOTE(METHOD)) ==
"dbg",
372 "MFEM was built in dbg mode, but not MOOSE. Try reinstalling "
373 "MFEM using the scripts/update_and_rebuild_mfem.sh script.");
375static_assert(std::string_view(QUOTE(METHOD)) !=
"dbg",
376 "MOOSE was built in dbg mode, but not MFEM. Try reinstalling "
377 "MFEM using the scripts/update_and_rebuild_mfem.sh script.");
void MooseMatView(libMesh::SparseMatrix< libMesh::Number > &mat)
const ExecFlagType EXEC_FORCED
const ExecFlagType EXEC_TRANSFER
const ExecFlagType EXEC_PRE_MULTIAPP_SETUP
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_END
const ExecFlagType EXEC_MULTISYSTEM_FIXED_POINT_ITERATION_END
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_CONVERGENCE
const ExecFlagType EXEC_SUBDOMAIN
const ExecFlagType EXEC_TIMESTEP_END
void MooseVecView(libMesh::NumericVector< libMesh::Number > &vector)
const ExecFlagType EXEC_TIMESTEP_BEGIN
const ExecFlagType EXEC_SAME_AS_MULTIAPP
const ExecFlagType EXEC_POSTCHECK
const ExecFlagType EXEC_ALWAYS
const ExecFlagType EXEC_CUSTOM
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_ITERATION_END
const ExecFlagType EXEC_POST_ADAPTIVITY
const ExecFlagType EXEC_LINEAR_CONVERGENCE
std::pair< typename M::iterator, bool > moose_try_emplace(M &m, const typename M::key_type &k, Args &&... args)
Function to mirror the behavior of the C++17 std::map::try_emplace() method (no hint).
const ExecFlagType EXEC_INITIAL
const ExecFlagType EXEC_MULTIAPP_FIXED_POINT_BEGIN
const ExecFlagType EXEC_LINEAR
const ExecFlagType EXEC_PRE_KERNELS
const ExecFlagType EXEC_NONLINEAR
const ExecFlagType EXEC_FAILED
const ExecFlagType EXEC_NONE
const ExecFlagType EXEC_FINAL
const ExecFlagType EXEC_NONLINEAR_CONVERGENCE
const ExecFlagType EXEC_PRE_DISPLACE
Specialized factory for generic Action System objects.
A MultiMooseEnum object to hold "execute_on" flags.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
Generic factory class for build all sorts of objects.
Class for containing MooseEnum item information.
This class provides an interface for common operations on field variables of both FE and FV types wit...
ScopedCommSwapper(MPI_Comm new_comm)
Swaps the current libmesh MPI communicator for new_comm.
void forceSwap()
Forcibly swap the currently swapped-out communicator back in to libmesh.
virtual ~ScopedCommSwapper()
Scoped helper for setting Moose::_deprecated_is_error during this scope.
~ScopedDeprecatedIsError()
Destructor, which sets Moose::_deprecated_is_error to what it was upon construction.
ScopedDeprecatedIsError()
Default constructor, which sets Moose::_deprecated_is_error = true.
const bool _deprecated_is_error_before
The value of Moose::_throw_on_error at construction.
Scoped helper for setting Moose::_throw_on_error during this scope.
~ScopedThrowOnError()
Destructor, which sets Moose::_throw_on_error to what it was upon construction.
const bool _throw_on_error_before
The value of Moose::_throw_on_error at construction.
ScopedThrowOnError()
Default constructor, which sets Moose::_throw_on_error = true.
Holding syntax for parsing input files.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
void setSolverDefaults(FEProblemBase &problem)
bool _deprecated_is_error
Variable to toggle only deprecated warnings as errors.
void registerObjects(Factory &factory, const std::set< std::string > &obj_labels)
bool _throw_on_error
Variable to turn on exceptions during mooseError(), should only be used within MOOSE unit tests or wh...
constexpr std::size_t invalid_size_t
Value for invalid size_t indices.
bool show_multiple
Set to false (the default) to display an error message only once for each error call code location (a...
void associateSyntax(Syntax &syntax, ActionFactory &action_factory)
bool setColorConsole(bool use_color, bool force=false)
Turns color escape sequences on/off for info written to stdout.
void registerActions(Syntax &syntax, ActionFactory &action_factory)
Multiple Action class can be associated with a single input file section, in which case all associate...
static constexpr std::size_t dim
This is the dimension of all vector and tensor datastructures used in MOOSE.
void registerAll(Factory &f, ActionFactory &af, Syntax &s)
Register objects that are in MOOSE.
ExecFlagEnum execute_flags
Storage for the registered execute flags.
volatile std::sig_atomic_t interrupt_signal_number
Used by the signal handler to determine if we should write a checkpoint file out at any point during ...
bool _throw_on_warning
Variable to turn on exceptions during mooseWarning(), should only be used in MOOSE unit tests.
bool _warnings_are_errors
Variable to toggle any warning into an error (includes deprecated code warnings)
bool colorConsole()
Returns whether Console coloring is turned on (default: true).
void addActionTypes(Syntax &syntax)
std::string hitMessagePrefix(const hit::Node &node)
Get the prefix to be associated with a hit node for a message.
libMesh::PerfLog perf_log
Perflog to be used by applications.
MPI_Comm swapLibMeshComm(MPI_Comm new_comm)
Swap the libMesh MPI communicator out for ours.
bool _trap_fpe
Variable indicating whether we will enable FPE trapping for this run.
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
OStreamProxy out(std::cout)
OStreamProxy err(std::cerr)
std::unique_ptr< T > UniquePtr