32 #include "libmesh/string_to_enum.h" 33 #include "libmesh/simple_range.h" 43 return std::string(spaces,
' ');
49 std::stringstream oss;
55 oss <<
"Input File(s):\n";
57 oss <<
" " << std::filesystem::absolute(entry).c_str() <<
"\n";
60 const auto & cl = std::as_const(*app.
commandLine());
65 std::stringstream args_oss;
66 for (
const auto & entry : cl_range)
67 if (!entry.hit_param && !entry.subapp_name && entry.name !=
"-i")
68 args_oss <<
" " << cl.formatEntry(entry) <<
"\n";
69 if (args_oss.str().size())
70 oss <<
"Command Line Argument(s):\n" << args_oss.str() <<
"\n";
72 std::stringstream input_args_oss;
73 for (
const auto & entry : cl_range)
74 if (entry.hit_param && !entry.subapp_name)
75 input_args_oss <<
" " << cl.formatEntry(entry) <<
"\n";
76 if (input_args_oss.str().size())
77 oss <<
"Command Line Input Argument(s):\n" << input_args_oss.str() <<
"\n";
80 if (checkpoints.size())
82 oss << std::left <<
"Checkpoint:\n";
87 oss << std::left <<
"Parallelism:\n" 89 <<
" Num Processors: " <<
static_cast<std::size_t
>(app.
n_processors()) <<
'\n' 99 std::stringstream oss;
104 const auto fe_backend = problem.
feBackend();
110 oss <<
" Parallel Type: " << (
mesh.isDistributedMesh() ?
"distributed" :
"replicated");
113 bool forced =
mesh.isParallelTypeForced();
114 bool pre_split =
mesh.isSplit();
115 oss << (forced || pre_split ?
" (" :
"") << (forced ?
"forced" :
"")
116 << (forced && pre_split ?
", " :
"") << (pre_split ?
"pre-split" :
"")
117 << (forced || pre_split ?
")" :
"");
135 dof_id_type min_nnodes = nnodes_local, max_nnodes = nnodes_local;
154 dof_id_type min_nelems = nelems_local, max_nelems = nelems_local;
158 oss << std::setw(
console_field_width) <<
" Min/Max/Avg:" << min_nelems <<
'/' << max_nelems
167 if (
mesh.maxPLevel() > 0)
169 <<
" Max p-Refinement Level: " <<
static_cast<std::size_t
>(
mesh.maxPLevel()) <<
'\n';
170 if (
mesh.maxHLevel() > 0)
172 <<
" Max h-Refinement Level: " <<
static_cast<std::size_t
>(
mesh.maxHLevel()) <<
'\n';
178 <<
" Num Subdomains: " <<
static_cast<std::size_t
>(
mesh.nSubdomains()) <<
'\n';
182 <<
" Num Partitions: " <<
static_cast<std::size_t
>(
mesh.nPartitions()) <<
'\n' 184 << (
mesh.isPartitionerForced() ?
" (forced) " :
"") <<
'\n';
185 if (
mesh.skipPartitioning())
187 else if (
mesh.skipNoncriticalPartitioning())
221 std::streampos begin_string_pos = oss.tellp();
222 std::streampos curr_string_pos = begin_string_pos;
228 if (vg_description.n_variables() > 1)
230 if (vg_description.n_variables() > 10)
234 for (
unsigned int vn = 0; vn < 5; vn++)
236 oss <<
"\"" << vg_description.
name(vn) <<
"\" ";
237 curr_string_pos = oss.tellp();
241 curr_string_pos = oss.tellp();
243 for (
unsigned int vn = vg_description.n_variables() - 5; vn < vg_description.n_variables();
246 oss <<
"\"" << vg_description.name(vn) <<
"\" ";
247 curr_string_pos = oss.tellp();
252 for (
unsigned int vn = 0; vn < vg_description.n_variables(); vn++)
254 oss <<
"\"" << vg_description.name(vn) <<
"\" ";
255 curr_string_pos = oss.tellp();
259 if (vg_description.n_variables() > 1)
264 begin_string_pos = oss.tellp();
265 curr_string_pos = begin_string_pos;
267 #ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS 271 << libMesh::Utility::enum_to_string<FEFamily>(
274 curr_string_pos = oss.tellp();
282 << libMesh::Utility::enum_to_string<FEFamily>(
285 << libMesh::Utility::enum_to_string<FEFamily>(
288 curr_string_pos = oss.tellp();
293 begin_string_pos = oss.tellp();
294 curr_string_pos = begin_string_pos;
299 << libMesh::Utility::enum_to_string<InfMapType>(
302 curr_string_pos = oss.tellp();
308 begin_string_pos = oss.tellp();
309 curr_string_pos = begin_string_pos;
313 #ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS 321 << Utility::enum_to_string<Order>(
325 curr_string_pos = oss.tellp();
328 oss <<
"\n" << std::endl;
337 std::stringstream oss;
346 std::stringstream oss;
354 std::stringstream oss;
358 if (info_strings.size())
360 for (
const auto & info_pair : info_strings)
364 << info_pair.second <<
'\n';
375 std::stringstream oss;
380 oss <<
"Execution Information:\n" 384 if (time_stepper !=
"")
387 if (!time_integrator_names.empty())
389 <<
" TimeIntegrator(s): " <<
MooseUtils::join(time_integrator_names,
" ") <<
'\n';
392 << std::string(
" Solver") +
404 std::vector<std::string> splits = {
""};
407 splits.push_back(
"fieldsplit_" +
split->name() +
"_");
409 for (
const std::string &
split : splits)
411 std::string pc_desc_split;
413 for (
const auto & entry : std::as_const(*app.
commandLine()).getEntries())
414 if (entry.name == prefix +
"pc_type" || entry.name == prefix +
"sub_pc_type" ||
415 entry.name == prefix +
"pc_hypre_type" || entry.name == prefix +
"pc_fieldsplit_type")
416 pc_desc_split += entry.value ? *entry.value +
" " :
"unspecified ";
418 if (!pc_desc_split.empty() && prefix.size() > 1)
419 pc_desc +=
"[" + prefix.substr(1, prefix.size() - 2) +
"]: ";
420 pc_desc += pc_desc_split;
425 if (!pc_desc.empty())
426 pc_desc +=
"(see input file for unoverridden options)";
432 if (!pc_desc.empty())
435 std::string mpc_desc;
443 mpc_desc += mpc->
getParam<std::string>(
"_type") +
" ";
444 if (mpc->
name().find(
"_moose_auto") != std::string::npos)
445 mpc_desc +=
"(auto) ";
449 if (!mpc_desc.empty())
458 std::stringstream oss;
463 for (
const auto &
out : outputs)
471 if (
out->isAdvanced())
474 for (
const auto & adv_it : adv_on)
475 if (execute_on != adv_it.second)
477 << adv_it.second <<
"\"" << std::endl;
487 std::stringstream oss;
491 oss <<
"Executioner/use_pre_smo_residual is set to true. The pre-SMO residual will be evaluated " 492 "at the beginning of each time step before executing objects that could modify the " 493 "solution, such as preset BCs, predictors, correctors, constraints, and certain user " 494 "objects. The pre-SMO residuals will be prefixed with * and will be used in the relative " 495 "convergence check.\n";
496 oss << COLOR_DEFAULT;
504 std::stringstream oss;
507 if (app.
parameters().
get<
bool>(
"use_legacy_material_output"))
509 oss << COLOR_RED <<
"LEGACY MODES ENABLED:" << COLOR_DEFAULT <<
'\n';
510 oss <<
" This application uses the legacy material output option: material properties are " 511 "output only on TIMESTEP_END, not INITIAL. To remove this message, set " 512 "'use_legacy_material_output' to false in this application. If there are gold output " 513 "files that contain material property output for which output occurs on INITIAL, then " 514 "these will generate diffs due to zero values being stored, and these tests should be " 516 << COLOR_DEFAULT << std::endl;
519 if (app.
parameters().
get<
bool>(
"use_legacy_initial_residual_evaluation_behavior"))
521 oss << COLOR_RED <<
"LEGACY MODES ENABLED:" << COLOR_DEFAULT <<
'\n';
522 oss <<
" This application uses the legacy initial residual evaluation behavior. The legacy " 523 "behavior performs an often times redundant residual evaluation before the solution " 524 "modifying objects are executed prior to the initial (0th nonlinear iteration) residual " 525 "evaluation. The new behavior skips that redundant residual evaluation unless the " 526 "parameter Executioner/use_pre_smo_residual is set to true. To remove this message and " 527 "enable the new behavior, set the parameter " 528 "'use_legacy_initial_residual_evaluation_behavior' to false in *App.C. Some tests that " 529 "rely on the side effects of the legacy behavior may fail/diff and should be " 531 << COLOR_DEFAULT << std::endl;
540 std::stringstream oss;
541 oss <<
"Data File Paths:\n";
543 oss <<
" " <<
name <<
": " << path <<
"\n";
544 return oss.str() +
"\n";
550 std::map<std::string, std::string> values;
553 const auto & params = object_name_params_pair.second;
554 for (
const auto & name_value_pair : *params)
556 const auto &
name = name_value_pair.first;
557 if (
const auto path = params->queryDataFileNamePath(
name))
558 if (params->getHitNode(
name))
559 values.emplace(params->paramFullpath(
name), path->path);
563 std::stringstream oss;
564 oss <<
"Data File Parameters:\n";
565 for (
const auto & [param,
value] : values)
566 oss <<
" " << param <<
" = " <<
value <<
"\n";
567 return oss.str() +
'\n';
571 insertNewline(std::stringstream & oss, std::streampos & begin, std::streampos & curr)
585 std::stringstream stream;
586 std::streampos start = stream.tellp();
588 std::streampos end = stream.tellp();
590 auto formatted_string = stream.str();
592 if (formatted_string.back() ==
'\n')
593 formatted_string.pop_back();
594 return formatted_string;
600 std::string object_names =
"";
604 std::vector<std::string> names;
605 names.reserve(objs.size());
606 for (
const auto & obj : objs)
608 mooseAssert(obj,
"Trying to print a null object");
609 names.push_back(obj->name());
std::string name(const ElemQuality q)
std::string indent(unsigned int spaces)
Create empty string for indenting.
const std::vector< NonlinearSystemName > & getNonlinearSystemNames() const
Moose::PetscSupport::PetscOptions & getPetscOptions()
Retrieve a writable reference the PETSc options (used by PetscSupport)
std::string join(Iterator begin, Iterator end, const std::string &delimiter)
Python-like join function for strings over an iterator range.
std::string mooseObjectVectorToString(const std::vector< MooseObject *> &objs, const std::string &sep=" ")
Routine to output the name of MooseObjects in a string.
std::string outputSystemInformationHelper(std::stringstream &oss, System &system)
MoosePreconditioner const * getPreconditioner() const
std::string toLower(const std::string &name)
Convert supplied string to lower case.
std::vector< std::pair< std::string, std::string > > getRelationshipManagerInfo() const
Returns the Relationship managers info suitable for printing.
virtual std::size_t numNonlinearSystems() const override
std::string outputExecutionInformation(const MooseApp &app, FEProblemBase &problem)
Output execution information.
std::string outputAuxiliarySystemInformation(FEProblemBase &problem)
Output the Auxiliary system information.
std::shared_ptr< CommandLine > commandLine() const
Get the command line.
bool isSolverSystemNonlinear(const unsigned int sys_num)
Check if the solver system is nonlinear.
InputParameterWarehouse & getInputParameterWarehouse()
Get the InputParameterWarehouse for MooseObjects.
const std::vector< SolverSystemName > & getSolverSystemNames() const
OrderWrapper radial_order
unsigned int n_variable_groups() const
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
unsigned int multiAppLevel() const
The MultiApp Level.
Base class for MOOSE-based applications.
std::vector< T * > getOutputs(const std::vector< OutputName > &names)
Return a vector of objects by names.
const Parallel::Communicator & comm() const
const std::string & name(unsigned int v) const
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
dof_id_type n_local_dofs() const
std::string outputOutputInformation(MooseApp &app)
Output the output information.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
const InputParameters & parameters()
Get the parameters of the object.
virtual const std::string & name() const
Get the name of the class.
static const unsigned int console_field_width
Width used for printing simulation information.
dof_id_type n_dofs() const
Base class for MOOSE preconditioners.
std::string outputMeshInformation(FEProblemBase &problem, bool verbose=true)
Output the mesh information.
Based class for output objects.
static const unsigned int console_line_length
Line length for printing simulation information.
processor_id_type n_processors() const
const std::vector< std::shared_ptr< T > > & getObjects(THREAD_ID tid=0) const
Retrieve complete vector to the all/block/boundary restricted objects for a given thread...
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
void min(const T &r, T &o, Request &req) const
void indentMessage(const std::string &prefix, std::string &message, const char *color=COLOR_CYAN, bool dont_indent_first_line=true, const std::string &post_prefix=": ")
Indents the supplied message given the prefix and color.
const SystemInfo * getSystemInfo() const
Get SystemInfo object.
std::string outputDataFilePaths()
Output the registered data paths for searching.
virtual std::string solverTypeString(unsigned int solver_sys_num=0)
Return solver type as a human readable string.
void insertNewline(std::stringstream &oss, std::streampos &begin, std::streampos &curr)
Helper function function for stringstream formatting.
std::string formatString(std::string message, const std::string &prefix)
Add new lines and prefixes to a string for pretty display in output NOTE: This makes a copy of the st...
std::string getInfo() const
SimpleRange< IndexType > as_range(const std::pair< IndexType, IndexType > &p)
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
const std::string & type() const
Get the type of this class.
std::string underscoreToCamelCase(const std::string &underscore_name, bool leading_upper_case)
Function for converting an underscore name to a camel case name.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
A helper warehouse class for storing the "execute_on" settings for the various output types...
const VariableGroup & variable_group(const unsigned int c) const
Executioners are objects that do the actual work of solving your problem.
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
std::string outputFrameworkInformation(const MooseApp &app)
Outputs framework information.
AuxiliarySystem & getAuxiliarySystem()
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
virtual Moose::FEBackend feBackend() const
void max(const T &r, T &o, Request &req) const
IntRange< T > make_range(T beg, T end)
virtual MooseMesh & mesh() override
SolverParams & solverParams(unsigned int solver_sys_num=0)
Get the solver parameters.
SolverSystem & getSolverSystem(unsigned int sys_num)
Get non-constant reference to a solver system.
MooseObjectWarehouseBase< Split > & getSplits()
Retrieves all splits.
dof_id_type n_local_constrained_dofs() const
const std::vector< std::string > & getInputFileNames() const
std::string outputPreSMOResidualInformation()
Output the information about pre-SMO residual evaluation.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
std::string outputDataFileParams(MooseApp &app)
Output the (param path = value) pairs for each DataFileName parameter.
virtual libMesh::System & system() override
Get the reference to the libMesh system.
std::string pc_description
Preconditioner description.
std::string outputLegacyInformation(MooseApp &app)
Output the legacy flag information.
virtual std::string getTimeStepperName() const
The name of the TimeStepper This is an empty string for non-Transient executioners.
std::stringstream checkpointInfo() const
Gathers and records information used later for console output.
processor_id_type processor_id() const
std::string outputRelationshipManagerInformation(const MooseApp &app)
Output action RelationshipManager information.
static const std::map< std::string, std::string > & getDataFilePaths()
Returns a map of all registered data file paths (name -> path)
OStreamProxy out(std::cout)
virtual std::size_t numSolverSystems() const override
const DofMap & get_dof_map() const
const VariableGroup & variable_group(unsigned int vg) const
virtual std::vector< std::string > getTimeIntegratorNames() const
The name of the TimeIntegrator This is an empty string for non-Transient executioners.
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
dof_id_type n_constrained_dofs() const
const FEType & type() const
std::string outputSolverSystemInformation(FEProblemBase &problem, const unsigned int solver_sys_num)
Output a solver system information.