32 #include "libmesh/string_to_enum.h" 33 #include "libmesh/simple_range.h" 43 return std::string(spaces,
' ');
49 std::stringstream oss;
54 oss <<
"Input File(s):\n";
56 oss <<
" " << std::filesystem::absolute(entry).c_str() <<
"\n";
59 const auto & cl = std::as_const(*app.
commandLine());
64 std::stringstream args_oss;
65 for (
const auto & entry : cl_range)
66 if (!entry.hit_param && !entry.subapp_name && entry.name !=
"-i")
67 args_oss <<
" " << cl.formatEntry(entry) <<
"\n";
68 if (args_oss.str().size())
69 oss <<
"Command Line Argument(s):\n" << args_oss.str() <<
"\n";
71 std::stringstream input_args_oss;
72 for (
const auto & entry : cl_range)
73 if (entry.hit_param && !entry.subapp_name)
74 input_args_oss <<
" " << cl.formatEntry(entry) <<
"\n";
75 if (input_args_oss.str().size())
76 oss <<
"Command Line Input Argument(s):\n" << input_args_oss.str() <<
"\n";
79 if (checkpoints.size())
81 oss << std::left <<
"Checkpoint:\n";
86 oss << std::left <<
"Parallelism:\n" 88 <<
" Num Processors: " <<
static_cast<std::size_t
>(app.
n_processors()) <<
'\n' 98 std::stringstream oss;
103 const auto fe_backend = problem.
feBackend();
109 oss <<
" Parallel Type: " << (
mesh.isDistributedMesh() ?
"distributed" :
"replicated");
112 bool forced =
mesh.isParallelTypeForced();
113 bool pre_split =
mesh.isSplit();
114 oss << (forced || pre_split ?
" (" :
"") << (forced ?
"forced" :
"")
115 << (forced && pre_split ?
", " :
"") << (pre_split ?
"pre-split" :
"")
116 << (forced || pre_split ?
")" :
"");
134 dof_id_type min_nnodes = nnodes_local, max_nnodes = nnodes_local;
153 dof_id_type min_nelems = nelems_local, max_nelems = nelems_local;
157 oss << std::setw(
console_field_width) <<
" Min/Max/Avg:" << min_nelems <<
'/' << max_nelems
166 if (
mesh.maxPLevel() > 0)
168 <<
" Max p-Refinement Level: " <<
static_cast<std::size_t
>(
mesh.maxPLevel()) <<
'\n';
169 if (
mesh.maxHLevel() > 0)
171 <<
" Max h-Refinement Level: " <<
static_cast<std::size_t
>(
mesh.maxHLevel()) <<
'\n';
177 <<
" Num Subdomains: " <<
static_cast<std::size_t
>(
mesh.nSubdomains()) <<
'\n';
181 <<
" Num Partitions: " <<
static_cast<std::size_t
>(
mesh.nPartitions()) <<
'\n' 183 << (
mesh.isPartitionerForced() ?
" (forced) " :
"") <<
'\n';
184 if (
mesh.skipPartitioning())
186 else if (
mesh.skipNoncriticalPartitioning())
220 std::streampos begin_string_pos = oss.tellp();
221 std::streampos curr_string_pos = begin_string_pos;
227 if (vg_description.n_variables() > 1)
229 if (vg_description.n_variables() > 10)
233 for (
unsigned int vn = 0; vn < 5; vn++)
235 oss <<
"\"" << vg_description.
name(vn) <<
"\" ";
236 curr_string_pos = oss.tellp();
240 curr_string_pos = oss.tellp();
242 for (
unsigned int vn = vg_description.n_variables() - 5; vn < vg_description.n_variables();
245 oss <<
"\"" << vg_description.name(vn) <<
"\" ";
246 curr_string_pos = oss.tellp();
251 for (
unsigned int vn = 0; vn < vg_description.n_variables(); vn++)
253 oss <<
"\"" << vg_description.name(vn) <<
"\" ";
254 curr_string_pos = oss.tellp();
258 if (vg_description.n_variables() > 1)
263 begin_string_pos = oss.tellp();
264 curr_string_pos = begin_string_pos;
266 #ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS 270 << libMesh::Utility::enum_to_string<FEFamily>(
273 curr_string_pos = oss.tellp();
281 << libMesh::Utility::enum_to_string<FEFamily>(
284 << libMesh::Utility::enum_to_string<FEFamily>(
287 curr_string_pos = oss.tellp();
292 begin_string_pos = oss.tellp();
293 curr_string_pos = begin_string_pos;
298 << libMesh::Utility::enum_to_string<InfMapType>(
301 curr_string_pos = oss.tellp();
307 begin_string_pos = oss.tellp();
308 curr_string_pos = begin_string_pos;
312 #ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS 320 << Utility::enum_to_string<Order>(
324 curr_string_pos = oss.tellp();
327 oss <<
"\n" << std::endl;
336 std::stringstream oss;
345 std::stringstream oss;
353 std::stringstream oss;
357 if (info_strings.size())
359 for (
const auto & info_pair : info_strings)
363 << info_pair.second <<
'\n';
374 std::stringstream oss;
379 oss <<
"Execution Information:\n" 383 if (time_stepper !=
"")
386 if (!time_integrator_names.empty())
388 <<
" TimeIntegrator(s): " <<
MooseUtils::join(time_integrator_names,
" ") <<
'\n';
391 << std::string(
" Solver") +
403 std::vector<std::string> splits = {
""};
406 splits.push_back(
"fieldsplit_" +
split->name() +
"_");
408 for (
const std::string &
split : splits)
410 std::string pc_desc_split;
412 for (
const auto & entry : std::as_const(*app.
commandLine()).getEntries())
413 if (entry.name == prefix +
"pc_type" || entry.name == prefix +
"sub_pc_type" ||
414 entry.name == prefix +
"pc_hypre_type" || entry.name == prefix +
"pc_fieldsplit_type")
415 pc_desc_split += entry.value ? *entry.value +
" " :
"unspecified ";
417 if (!pc_desc_split.empty() && prefix.size() > 1)
418 pc_desc +=
"[" + prefix.substr(1, prefix.size() - 2) +
"]: ";
419 pc_desc += pc_desc_split;
424 if (!pc_desc.empty())
425 pc_desc +=
"(see input file for unoverridden options)";
431 if (!pc_desc.empty())
434 std::string mpc_desc;
442 mpc_desc += mpc->
type() +
" ";
443 if (mpc->
name().find(
"_moose_auto") != std::string::npos)
444 mpc_desc +=
"(auto) ";
448 if (!mpc_desc.empty())
457 std::stringstream oss;
462 for (
const auto &
out : outputs)
470 if (
out->isAdvanced())
473 for (
const auto & adv_it : adv_on)
474 if (execute_on != adv_it.second)
476 << adv_it.second <<
"\"" << std::endl;
486 std::stringstream oss;
490 oss <<
"Executioner/use_pre_smo_residual is set to true. The pre-SMO residual will be evaluated " 491 "at the beginning of each time step before executing objects that could modify the " 492 "solution, such as preset BCs, predictors, correctors, constraints, and certain user " 493 "objects. The pre-SMO residuals will be prefixed with * and will be used in the relative " 494 "convergence check.\n";
495 oss << COLOR_DEFAULT;
503 std::stringstream oss;
506 if (app.
parameters().
get<
bool>(
"use_legacy_material_output"))
508 oss << COLOR_RED <<
"LEGACY MODES ENABLED:" << COLOR_DEFAULT <<
'\n';
509 oss <<
" This application uses the legacy material output option: material properties are " 510 "output only on TIMESTEP_END, not INITIAL. To remove this message, set " 511 "'use_legacy_material_output' to false in this application. If there are gold output " 512 "files that contain material property output for which output occurs on INITIAL, then " 513 "these will generate diffs due to zero values being stored, and these tests should be " 515 << COLOR_DEFAULT << std::endl;
518 if (app.
parameters().
get<
bool>(
"use_legacy_initial_residual_evaluation_behavior"))
520 oss << COLOR_RED <<
"LEGACY MODES ENABLED:" << COLOR_DEFAULT <<
'\n';
521 oss <<
" This application uses the legacy initial residual evaluation behavior. The legacy " 522 "behavior performs an often times redundant residual evaluation before the solution " 523 "modifying objects are executed prior to the initial (0th nonlinear iteration) residual " 524 "evaluation. The new behavior skips that redundant residual evaluation unless the " 525 "parameter Executioner/use_pre_smo_residual is set to true. To remove this message and " 526 "enable the new behavior, set the parameter " 527 "'use_legacy_initial_residual_evaluation_behavior' to false in *App.C. Some tests that " 528 "rely on the side effects of the legacy behavior may fail/diff and should be " 530 << COLOR_DEFAULT << std::endl;
539 std::stringstream oss;
540 oss <<
"Data File Paths:\n";
542 oss <<
" " <<
name <<
": " << path <<
"\n";
543 return oss.str() +
"\n";
549 std::map<std::string, std::string> values;
552 const auto & params = object_name_params_pair.second;
553 for (
const auto & name_value_pair : *params)
555 const auto &
name = name_value_pair.first;
556 if (
const auto path = params->queryDataFileNamePath(
name))
557 if (params->getHitNode(
name))
558 values.emplace(params->paramFullpath(
name), path->path);
562 std::stringstream oss;
563 oss <<
"Data File Parameters:\n";
564 for (
const auto & [param,
value] : values)
565 oss <<
" " << param <<
" = " <<
value <<
"\n";
566 return oss.str() +
'\n';
570 insertNewline(std::stringstream & oss, std::streampos & begin, std::streampos & curr)
584 std::stringstream stream;
585 std::streampos start = stream.tellp();
587 std::streampos end = stream.tellp();
589 auto formatted_string = stream.str();
591 if (formatted_string.back() ==
'\n')
592 formatted_string.pop_back();
593 return formatted_string;
599 std::string object_names =
"";
603 std::vector<std::string> names;
604 names.reserve(objs.size());
605 for (
const auto & obj : objs)
607 mooseAssert(obj,
"Trying to print a null object");
608 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
const InputParameters & parameters() const
Get the parameters of the object.
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.
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::string & name() const
Get the name of the class.
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.
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.
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
const SystemInfo & getSystemInfo() const
Get SystemInfo object.
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.