From 05ffb6a6ff64a90bb3f0a11da3dfedfee792556c Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 5 Apr 2023 17:14:24 +0100 Subject: [PATCH] Info: Use nl rather than "\n..." to ensure region-prefixed printing --- applications/solvers/foamMultiRun/foamMultiRun.C | 2 +- applications/solvers/foamRun/foamRun.C | 2 +- etc/codeTemplates/source/_TemplateApp.C | 2 +- src/OpenFOAM/containers/Lists/PackedList/PackedList.H | 4 ++-- src/OpenFOAM/global/argList/argList.C | 6 +++--- .../general/include/readGravitationalAcceleration.H | 2 +- .../parcel/clouds/Templates/MomentumCloud/MomentumCloud.C | 2 +- src/radiationModels/radiationModels/viewFactor/viewFactor.C | 4 ++-- .../momentumSurfaceFilm/momentumSurfaceFilm.C | 5 +++-- src/surfaceFilmModels/surfaceFilm/surfaceFilm.C | 2 +- src/thermophysicalModels/ignition/ignitionIO.C | 6 +++--- 11 files changed, 19 insertions(+), 18 deletions(-) diff --git a/applications/solvers/foamMultiRun/foamMultiRun.C b/applications/solvers/foamMultiRun/foamMultiRun.C index 3ceff44f74..8285df69d0 100644 --- a/applications/solvers/foamMultiRun/foamMultiRun.C +++ b/applications/solvers/foamMultiRun/foamMultiRun.C @@ -108,7 +108,7 @@ int main(int argc, char *argv[]) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - Info<< "\nStarting time loop\n" << endl; + Info<< nl << "Starting time loop\n" << endl; while (pimple.run(runTime)) { diff --git a/applications/solvers/foamRun/foamRun.C b/applications/solvers/foamRun/foamRun.C index 7b8f42d9f1..0857d21a6a 100644 --- a/applications/solvers/foamRun/foamRun.C +++ b/applications/solvers/foamRun/foamRun.C @@ -119,7 +119,7 @@ int main(int argc, char *argv[]) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - Info<< "\nStarting time loop\n" << endl; + Info<< nl << "Starting time loop\n" << endl; while (pimple.run(runTime)) { diff --git a/etc/codeTemplates/source/_TemplateApp.C b/etc/codeTemplates/source/_TemplateApp.C index d2f875c6b7..e052543de8 100644 --- a/etc/codeTemplates/source/_TemplateApp.C +++ b/etc/codeTemplates/source/_TemplateApp.C @@ -43,7 +43,7 @@ int main(int argc, char *argv[]) // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - Info<< "\nEnd\n" << endl; + Info<< nl << "End" << nl << endl; return 0; } diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedList.H b/src/OpenFOAM/containers/Lists/PackedList/PackedList.H index f46dc6832a..11b715f4af 100644 --- a/src/OpenFOAM/containers/Lists/PackedList/PackedList.H +++ b/src/OpenFOAM/containers/Lists/PackedList/PackedList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -67,7 +67,7 @@ Description For example, \code list.resize(4); - Info<< list[10] << "\n"; // print zero, but doesn't adjust list + Info<< list[10] << nl; // print zero, but doesn't adjust list list[8] = 1; \endcode diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index 9c5f42516c..f59c4fccf2 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -1237,14 +1237,14 @@ void Foam::argList::printNotes() const void Foam::argList::printUsage() const { - Info<< "\nUsage: " << executable_ << " [OPTIONS]"; + Info<< nl << "Usage: " << executable_ << " [OPTIONS]"; forAllConstIter(SLList, validArgs, iter) { Info<< " <" << iter().c_str() << '>'; } - Info<< "\noptions:\n"; + Info<< nl << "options:" << nl; wordList opts = validOptions.sortedToc(); forAll(opts, optI) diff --git a/src/finiteVolume/cfdTools/general/include/readGravitationalAcceleration.H b/src/finiteVolume/cfdTools/general/include/readGravitationalAcceleration.H index 1be4dc52f5..7c813845ef 100644 --- a/src/finiteVolume/cfdTools/general/include/readGravitationalAcceleration.H +++ b/src/finiteVolume/cfdTools/general/include/readGravitationalAcceleration.H @@ -1,4 +1,4 @@ - Info<< "\nReading g" << endl; + Info<< nl << "Reading g" << endl; uniformDimensionedVectorField g ( IOobject diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C index 5dd8d04f5b..93425dd830 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C @@ -637,7 +637,7 @@ void Foam::MomentumCloud::preEvolve() // with topology change due to lazy evaluation of valid mesh dimensions label nGeometricD = this->mesh().nGeometricD(); - Info<< endl << "Solving " << nGeometricD << "-D cloud " << this->name() + Info<< nl << "Solving " << nGeometricD << "-D cloud " << this->name() << endl; this->dispersion().cacheFields(true); diff --git a/src/radiationModels/radiationModels/viewFactor/viewFactor.C b/src/radiationModels/radiationModels/viewFactor/viewFactor.C index 6483d0bcaf..6b55b6d5e9 100644 --- a/src/radiationModels/radiationModels/viewFactor/viewFactor.C +++ b/src/radiationModels/radiationModels/viewFactor/viewFactor.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -551,7 +551,7 @@ void Foam::radiationModels::viewFactor::calculate() } } - Info<< "\nSolving view factor equations..." << endl; + Info<< nl << "Solving view factor equations..." << endl; // Negative coming into the fluid LUsolve(C, q); diff --git a/src/surfaceFilmModels/momentumSurfaceFilm/momentumSurfaceFilm.C b/src/surfaceFilmModels/momentumSurfaceFilm/momentumSurfaceFilm.C index af45981fdf..302bade74c 100644 --- a/src/surfaceFilmModels/momentumSurfaceFilm/momentumSurfaceFilm.C +++ b/src/surfaceFilmModels/momentumSurfaceFilm/momentumSurfaceFilm.C @@ -894,7 +894,8 @@ void Foam::momentumSurfaceFilm::addSources ) { DebugInFunction - << "\nSurface film: " << type() << ": adding to film source:" << nl + << nl + << "Surface film: " << type() << ": adding to film source:" << nl << " mass = " << massSource << nl << " momentum = " << momentumSource << nl << " pressure = " << pressureSource << endl; @@ -1018,7 +1019,7 @@ Foam::momentumSurfaceFilm::primaryMomentumTrans() const void Foam::momentumSurfaceFilm::info() { - Info<< "\nSurface film: " << type() << endl; + Info<< nl << "Surface film: " << type() << endl; const scalarField& deltaInternal = delta_; const vectorField& Uinternal = U_; diff --git a/src/surfaceFilmModels/surfaceFilm/surfaceFilm.C b/src/surfaceFilmModels/surfaceFilm/surfaceFilm.C index 057d1837c1..8b48f0c35d 100644 --- a/src/surfaceFilmModels/surfaceFilm/surfaceFilm.C +++ b/src/surfaceFilmModels/surfaceFilm/surfaceFilm.C @@ -348,7 +348,7 @@ Foam::surfaceFilm::passivePatchIDs() const void Foam::surfaceFilm::evolve() { - Info<< "\nEvolving " << modelType_ << " for film " + Info<< nl << "Evolving " << modelType_ << " for film " << mesh_.name() << endl; preEvolveFilm(); diff --git a/src/thermophysicalModels/ignition/ignitionIO.C b/src/thermophysicalModels/ignition/ignitionIO.C index 631901e752..321db856ae 100644 --- a/src/thermophysicalModels/ignition/ignitionIO.C +++ b/src/thermophysicalModels/ignition/ignitionIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,11 +45,11 @@ Foam::ignition::ignition { if (ignite_) { - Info<< "\nIgnition on" << endl; + Info<< nl << "Ignition on" << endl; } else { - Info<< "\nIgnition switched off" << endl; + Info<< nl << "Ignition switched off" << endl; } }