25 #include "libmesh/string_to_enum.h" 33 return std::string(spaces,
' ');
39 std::stringstream oss;
45 oss << std::left <<
"Parallelism:\n" 47 <<
" Num Processors: " <<
static_cast<std::size_t
>(app.
n_processors()) <<
'\n' 57 std::stringstream oss;
66 bool pre_split = moose_mesh.
isSplit();
69 oss <<
"\nMesh: " <<
'\n' 71 <<
" Parallel Type: " << (moose_mesh.
isDistributedMesh() ?
"distributed" :
"replicated")
72 << (forced || pre_split ?
" (" :
"")
73 << (forced ?
"forced" :
"")
74 << (forced && pre_split ?
", " :
"")
75 << (pre_split ?
"pre-split" :
"")
76 << (forced || pre_split ?
")" :
"")
84 if (
mesh.n_processors() > 1)
91 dof_id_type min_nnodes = nnodes_local, max_nnodes = nnodes_local;
92 mesh.comm().min(min_nnodes);
93 mesh.comm().max(max_nnodes);
94 if (
mesh.processor_id() == 0)
96 <<
'/' << nnodes /
mesh.n_processors() <<
'\n';
101 if (
mesh.n_processors() > 1)
108 dof_id_type min_nelems = nelems_local, max_nelems = nelems_local;
109 mesh.comm().min(min_nelems);
110 mesh.comm().max(max_nelems);
111 if (
mesh.processor_id() == 0)
112 oss << std::setw(
console_field_width) <<
" Min/Max/Avg:" << min_nelems <<
'/' << max_nelems
113 <<
'/' << nelems /
mesh.n_processors() <<
'\n';
122 <<
" Num Subdomains: " <<
static_cast<std::size_t
>(
mesh.n_subdomains()) <<
'\n';
123 if (
mesh.n_processors() > 1)
126 <<
" Num Partitions: " <<
static_cast<std::size_t
>(
mesh.n_partitions()) <<
'\n' 129 if (
mesh.skip_partitioning())
131 else if (
mesh.skip_noncritical_partitioning())
157 if (system.n_constrained_dofs())
160 <<
" Num Constrained DOFs: " << system.n_constrained_dofs() <<
'\n' 162 <<
" Local Constrained DOFs: " << system.n_local_constrained_dofs() <<
'\n';
165 std::streampos begin_string_pos = oss.tellp();
166 std::streampos curr_string_pos = begin_string_pos;
168 for (
unsigned int vg = 0; vg < system.n_variable_groups(); vg++)
170 const VariableGroup & vg_description(system.variable_group(vg));
172 if (vg_description.n_variables() > 1)
174 if (vg_description.n_variables() > 10)
178 for (
unsigned int vn = 0; vn < 5; vn++)
180 oss <<
"\"" << vg_description.name(vn) <<
"\" ";
181 curr_string_pos = oss.tellp();
185 curr_string_pos = oss.tellp();
187 for (
unsigned int vn = vg_description.n_variables() - 5; vn < vg_description.n_variables();
190 oss <<
"\"" << vg_description.name(vn) <<
"\" ";
191 curr_string_pos = oss.tellp();
196 for (
unsigned int vn = 0; vn < vg_description.n_variables(); vn++)
198 oss <<
"\"" << vg_description.name(vn) <<
"\" ";
199 curr_string_pos = oss.tellp();
203 if (vg_description.n_variables() > 1)
208 begin_string_pos = oss.tellp();
209 curr_string_pos = begin_string_pos;
211 #ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS 212 for (
unsigned int vg = 0; vg < system.n_variable_groups(); vg++)
215 << libMesh::Utility::enum_to_string<FEFamily>(
216 system.get_dof_map().variable_group(vg).type().family)
218 curr_string_pos = oss.tellp();
223 for (
unsigned int vg = 0; vg < system.n_variable_groups(); vg++)
226 << libMesh::Utility::enum_to_string<FEFamily>(
227 system.get_dof_map().variable_group(vg).type().family)
229 << libMesh::Utility::enum_to_string<FEFamily>(
230 system.get_dof_map().variable_group(vg).type().radial_family)
232 curr_string_pos = oss.tellp();
237 begin_string_pos = oss.tellp();
238 curr_string_pos = begin_string_pos;
240 for (
unsigned int vg = 0; vg < system.n_variable_groups(); vg++)
243 << libMesh::Utility::enum_to_string<InfMapType>(
244 system.get_dof_map().variable_group(vg).type().inf_map)
246 curr_string_pos = oss.tellp();
252 begin_string_pos = oss.tellp();
253 curr_string_pos = begin_string_pos;
255 for (
unsigned int vg = 0; vg < system.n_variable_groups(); vg++)
257 #ifndef LIBMESH_ENABLE_INFINITE_ELEMENTS 259 << Utility::enum_to_string<Order>(system.get_dof_map().variable_group(vg).type().order)
263 << Utility::enum_to_string<Order>(system.get_dof_map().variable_group(vg).type().order)
265 << Utility::enum_to_string<Order>(
266 system.get_dof_map().variable_group(vg).type().radial_order)
269 curr_string_pos = oss.tellp();
272 oss <<
"\n" << std::endl;
281 std::stringstream oss;
290 std::stringstream oss;
298 std::stringstream oss;
302 if (info_strings.size())
304 for (
const auto & info_pair : info_strings)
308 << info_pair.second <<
'\n';
319 std::stringstream oss;
324 oss <<
"Execution Information:\n" 329 if (time_stepper !=
"")
332 if (time_integrator !=
"")
338 if (!pc_desc.empty())
347 <<
" MOOSE Preconditioner" +
349 << mpc->
getParam<std::string>(
"_type");
350 if (mpc->
name() ==
"_moose_auto")
363 std::stringstream oss;
368 for (
const auto &
out : outputs)
376 if (
out->isAdvanced())
379 for (
const auto & adv_it : adv_on)
380 if (execute_on != adv_it.second)
382 <<
"\"" << adv_it.second <<
"\"" << std::endl;
392 std::stringstream oss;
395 if (app.
parameters().
get<
bool>(
"use_legacy_material_output"))
397 oss << COLOR_RED <<
"LEGACY MODES ENABLED:" << COLOR_DEFAULT <<
'\n';
398 oss <<
" This application uses the legacy material output option: material properties are " 399 "output only on TIMESTEP_END, not INITIAL. To remove this message, set " 400 "'use_legacy_material_output' to false in this application. If there are gold output " 401 "files that contain material property output for which output occurs on INITIAL, then " 402 "these will generate diffs due to zero values being stored, and these tests should be " 404 << COLOR_DEFAULT << std::endl;
411 insertNewline(std::stringstream & oss, std::streampos & begin, std::streampos & curr)
425 std::stringstream stream;
426 std::streampos start = stream.tellp();
428 std::streampos end = stream.tellp();
430 auto formatted_string = stream.str();
432 if (formatted_string.back() ==
'\n')
433 formatted_string.pop_back();
434 return formatted_string;
440 std::string object_names =
"";
444 std::vector<std::string> names;
445 names.reserve(objs.size());
446 for (
const auto & obj : objs)
448 mooseAssert(obj,
"Trying to print a null object");
449 names.push_back(obj->name());
std::string indent(unsigned int spaces)
Create empty string for indenting.
Moose::PetscSupport::PetscOptions & getPetscOptions()
Retrieve a writable reference the PETSc options (used by PetscSupport)
std::string mooseObjectVectorToString(const std::vector< MooseObject *> &objs, const std::string &sep=" ")
Routine to output the name of MooseObjects in a string.
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.
InputParameters & parameters()
Get the parameters of the object.
bool isDistributedMesh() const
Returns the final Mesh distribution type.
Base class for MOOSE-based applications.
std::vector< T * > getOutputs(const std::vector< OutputName > &names)
Return a vector of objects by names.
std::string outputOutputInformation(MooseApp &app)
Output the output information.
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
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.
std::string outputSystemInformationHelper(System &system)
Output system information.
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
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
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.
void insertNewline(std::stringstream &oss, std::streampos &begin, std::streampos &curr)
Helper function function for stringstream formatting.
bool isPartitionerForced() const
Tell the user if the partitioner was overriden for any reason.
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
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
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...
Executioners are objects that do the actual work of solving your problem.
NonlinearSystemBase & getNonlinearSystemBase(const unsigned int sys_num)
virtual std::string solverTypeString()
Return solver type as a human readable string.
std::string outputFrameworkInformation(const MooseApp &app)
Outputs framework information.
AuxiliarySystem & getAuxiliarySystem()
std::string demangle(const char *name)
Executioner * getExecutioner() const
Retrieve the Executioner for this App.
virtual System & system() override
Get the reference to the libMesh system.
virtual System & system() override
Get the reference to the libMesh system.
IntRange< T > make_range(T beg, T end)
virtual MooseMesh & mesh() override
bool isParallelTypeForced() const
Tell the user if the distribution was overriden for any reason.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
const MooseEnum & partitionerName() const
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::string outputRelationshipManagerInformation(const MooseApp &app)
Output action RelationshipManager information.
std::string join(const T &strings, const std::string &delimiter)
Python like join function for strings.
OutputWarehouse & getOutputWarehouse()
Get the OutputWarehouse objects.
virtual std::string getTimeIntegratorName() const
The name of the TimeIntegrator This is an empty string for non-Transient executioners.
std::string outputNonlinearSystemInformation(FEProblemBase &problem, const unsigned int nl_sys_num)
Output the Nonlinear system information.