www.mooseframework.org
Classes | Namespaces | Functions | Variables
Moose.h File Reference

Go to the source code of this file.

Classes

class  Moose::ScopedCommSwapper
 

Namespaces

 Moose
 

Functions

template<class M , class... Args>
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). More...
 
bool Moose::colorConsole ()
 Returns whether Console coloring is turned on (default: true). More...
 
bool Moose::setColorConsole (bool use_color, bool force=false)
 Turns color escape sequences on/off for info written to stdout. More...
 
void Moose::registerObjects (Factory &factory)
 Register objects that are in MOOSE. More...
 
void Moose::addActionTypes (Syntax &syntax)
 
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.b * Example: "setup_mesh" <-----——> SetupMeshAction <---—— \ [Mesh] / "setup_mesh_complete" <—> SetupMeshCompleteAction <-. More...
 
void Moose::setSolverDefaults (FEProblemBase &problem)
 
MPI_Comm Moose::swapLibMeshComm (MPI_Comm new_comm)
 Swap the libMesh MPI communicator out for ours. More...
 
void Moose::enableFPE (bool on=true)
 

Variables

PerfLog Moose::perf_log
 Perflog to be used by applications. More...
 
bool Moose::_trap_fpe = true
 Variable indicating whether we will enable FPE trapping for this run. More...
 
bool Moose::_warnings_are_errors = false
 Variable to toggle any warning into an error (includes deprecated code warnings) More...
 
bool Moose::_deprecated_is_error = false
 Variable to toggle only deprecated warnings as errors. More...
 
bool Moose::_throw_on_error = false
 Variable to turn on exceptions during mooseError() and mooseWarning(), should only be used with MOOSE unit. More...
 

Function Documentation

template<class M , class... Args>
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).

Parameters
mThe std::map
kThe key use to insert the pair
argsThe value to be inserted. This can be a moveable type but won't be moved if the insertion is successful.

Definition at line 66 of file Moose.h.

Referenced by Adaptivity::getErrorVector(), TableOutput::outputVectorPostprocessors(), and FEProblemBase::registerRandomInterface().

67 {
68  auto it = m.lower_bound(k);
69  if (it == m.end() || m.key_comp()(k, it->first))
70  {
71  return {m.emplace_hint(it,
72  std::piecewise_construct,
73  std::forward_as_tuple(k),
74  std::forward_as_tuple(std::forward<Args>(args)...)),
75  true};
76  }
77  return {it, false};
78 }
PetscInt m