From eafd5a385072d8d7ad6229efca4bbc68049da4d6 Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Tue, 8 Dec 2015 11:15:39 +0000 Subject: [PATCH] ENH: Updated Info, Warning and Error messages --- .../magneticFoam/createFields.H | 2 +- .../conversion/tetgenToFoam/tetgenToFoam.C | 8 +- .../extrudeToRegionMesh/extrudeToRegionMesh.C | 16 +-- .../mesh/manipulation/checkMesh/checkTools.C | 4 +- .../redistributePar/redistributePar.C | 32 ++--- .../createZeroDirectory/boundaryTemplates.C | 125 ++---------------- .../createZeroDirectory/caseInfo.C | 41 ++---- .../createZeroDirectory/createZeroDirectory.C | 4 +- .../createZeroDirectory/solverTemplate.C | 36 +---- .../preProcessing/mapFieldsPar/mapFieldsPar.C | 2 +- .../surfaceBooleanFeatures.C | 18 +-- .../surface/surfaceCheck/surfaceCheck.C | 2 +- .../surfaceFeatureExtract.C | 10 +- .../surface/surfaceInflate/surfaceInflate.C | 7 +- .../searchableSurfaceModifier/cut.C | 10 +- .../searchableSurfaceModifier.C | 7 +- .../IOobjects/CompactIOList/CompactIOList.C | 22 +-- src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C | 2 +- .../functionObjectStateTemplates.C | 6 +- .../fields/Fields/Field/FieldMapper.H | 2 +- src/OpenFOAM/global/argList/argList.C | 2 +- .../mapDistribute/mapDistributeBase.C | 30 +---- .../mapDistributeBaseTemplates.C | 19 +-- .../mapDistribute/mapDistributePolyMesh.C | 2 +- ...allHeatFluxTemperatureFvPatchScalarField.C | 15 +-- .../schemes/DEShybrid/DEShybrid.H | 18 +-- .../DES/kOmegaSSTIDDES/kOmegaSSTIDDES.C | 7 +- .../fvMeshAdder/fvMeshAdderTemplates.C | 2 +- .../IOmapDistributePolyMesh.C | 12 +- .../fvMeshDistribute/fvMeshDistribute.C | 28 ++-- .../fvMeshDistributeTemplates.C | 3 +- .../displacement/displacementMotionSolver.C | 26 +--- .../polyTopoChange/addPatchCellLayer.C | 2 +- .../hexRef8/refinementHistory.C | 14 +- .../extendedEdgeMesh/extendedEdgeMesh.C | 9 +- ...IDControlInletVelocityFvPatchVectorField.C | 15 +-- .../displacementInterpolationMotionSolver.C | 2 +- .../motionInterpolation/motionInterpolation.C | 6 +- .../patchCorrectedInterpolation.C | 7 +- .../patchTransformedInterpolation.C | 7 +- ...irectionalPressureGradientExplicitSource.C | 48 +------ .../tabulatedNTUHeatTransfer.C | 36 +---- .../autoHexMeshDriver/autoLayerDriver.C | 4 +- .../autoHexMeshDriver/autoSnapDriver.C | 2 +- .../meshRefinement/meshRefinement.C | 34 ++--- .../meshRefinement/meshRefinementBaffles.C | 28 ++-- .../meshRefinement/meshRefinementGapRefine.C | 2 +- .../refinementSurfaces/refinementSurfaces.C | 29 ++-- .../autoHexMesh/shellSurfaces/shellSurfaces.C | 7 +- .../offsetSurface/offsetSurface.C | 4 +- .../cyclicPeriodicAMIPolyPatch.C | 36 ++--- .../algorithms/MeshWave/FaceCellWave.C | 18 +-- src/meshTools/regionSplit/regionSplit.C | 4 +- .../searchableSurface/subTriSurfaceMesh.C | 11 +- .../decompositionConstraint.C | 11 +- .../preserveBafflesConstraint.C | 7 +- .../field/fieldMinMax/fieldMinMax.C | 2 +- .../fieldValueDelta/fieldValueDelta.C | 7 +- .../nearWallFields/nearWallFieldsTemplates.C | 8 +- .../field/streamLine/streamLineBase.C | 10 +- .../field/valueAverage/valueAverage.C | 2 +- .../functionObjects/forces/forces/forces.C | 6 +- .../fieldVisualisationBase.C | 16 +-- .../functionObjectCloud.C | 11 +- .../functionObjectLine.C | 11 +- .../functionObjectSurface.C | 11 +- .../runTimePostProcessing/geometrySurface.C | 12 +- .../graphics/runTimePostProcessing/pathline.C | 14 +- .../runTimePostProcessing/pointData.C | 14 +- .../runTimePostProcessing.C | 8 +- .../runTimePostProcessingTemplates.C | 12 +- .../graphics/runTimePostProcessing/scene.C | 25 ++-- .../graphics/runTimePostProcessing/surface.C | 14 +- .../externalCoupledFunctionObject.C | 57 ++------ .../externalCoupledFunctionObjectTemplates.C | 34 +---- .../averageCondition/averageCondition.C | 2 +- .../equationInitialResidualCondition.C | 21 +-- .../equationMaxIterCondition.C | 16 +-- .../minMaxCondition/minMaxCondition.C | 2 +- .../runTimeCondition/runTimeConditionNew.C | 14 +- .../runTimeControl/runTimeControl.C | 4 +- .../DESModelRegions/DESModelRegions.C | 12 +- .../utilities/blendingFactor/blendingFactor.C | 2 +- .../utilities/fluxSummary/fluxSummary.C | 75 ++--------- .../utilities/pressureTools/pressureTools.C | 8 +- .../functionObjects/utilities/yPlus/yPlus.C | 6 +- .../utilities/yPlus/yPlusTemplates.C | 1 - .../cellVolumeWeight/cellVolumeWeightMethod.C | 4 +- .../correctedCellVolumeWeightMethod.C | 12 +- .../distributedWeightedFvPatchFieldMapper.H | 14 +- src/sampling/meshToMesh/meshToMeshTemplates.C | 24 +--- src/sampling/probes/probes.C | 4 +- .../sampledSurface/isoSurface/isoSurface.C | 8 +- ...emperatureCoupledMixedFvPatchScalarField.C | 25 +--- 94 files changed, 351 insertions(+), 1040 deletions(-) diff --git a/applications/solvers/electromagnetics/magneticFoam/createFields.H b/applications/solvers/electromagnetics/magneticFoam/createFields.H index 22d4008921..189ef5d105 100644 --- a/applications/solvers/electromagnetics/magneticFoam/createFields.H +++ b/applications/solvers/electromagnetics/magneticFoam/createFields.H @@ -58,7 +58,7 @@ if (magnetZonei == -1) { - FatalIOErrorIn(args.executable().c_str(), transportProperties) + FatalIOErrorInFunction(transportProperties) << "Cannot find faceZone for magnet " << magnets[i].name() << exit(FatalIOError); } diff --git a/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C b/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C index 2a4de9c57b..c3baad3458 100644 --- a/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C +++ b/applications/utilities/mesh/conversion/tetgenToFoam/tetgenToFoam.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -225,7 +225,7 @@ int main(int argc, char *argv[]) } if (pointI != nNodes) { - FatalIOErrorIn(args.executable().c_str(), nodeStream) + FatalIOErrorInFunction(nodeStream) << "Only " << pointI << " nodes present instead of " << nNodes << " from header." << exit(FatalIOError); } @@ -258,7 +258,7 @@ int main(int argc, char *argv[]) if (nPtsPerTet != 4) { - FatalIOErrorIn(args.executable().c_str(), eleStream) + FatalIOErrorInFunction(eleStream) << "Cannot handle tets with " << nPtsPerTet << " points per tetrahedron in .ele file" << endl << "Can only handle tetrahedra with four points" @@ -377,7 +377,7 @@ int main(int argc, char *argv[]) if (nFaceAttr != 1) { - FatalIOErrorIn(args.executable().c_str(), faceStream) + FatalIOErrorInFunction(faceStream) << "Expect boundary markers to be" << " present in .face file." << endl << "This is the second number in the header which is now:" diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index ff0837e690..1174444fe0 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -1523,7 +1523,7 @@ int main(int argc, char *argv[]) // Check if (dict.found("faceSets")) { - FatalIOErrorIn(args.executable().c_str(), dict) + FatalIOErrorInFunction(dict) << "Please supply faces to extrude either through 'faceZones'" << " or 'faceSets' entry. Found both." << exit(FatalIOError); @@ -1567,7 +1567,7 @@ int main(int argc, char *argv[]) if (shellRegionName == regionName) { - FatalIOErrorIn(args.executable().c_str(), dict) + FatalIOErrorInFunction(dict) << "Cannot extrude into same region as mesh." << endl << "Mesh region : " << regionName << endl << "Shell region : " << shellRegionName @@ -1693,7 +1693,7 @@ int main(int argc, char *argv[]) meshZoneID[i] = faceZones.findZoneID(zoneNames[i]); if (meshZoneID[i] == -1) { - FatalIOErrorIn(args.executable().c_str(), dict) + FatalIOErrorInFunction(dict) << "Cannot find zone " << zoneNames[i] << endl << "Valid zones are " << faceZones.names() << exit(FatalIOError); @@ -1740,7 +1740,7 @@ int main(int argc, char *argv[]) zoneShadowIDs[i] = faceZones.findZoneID(zoneShadowNames[i]); if (zoneShadowIDs[i] == -1) { - FatalIOErrorIn(args.executable().c_str(), dict) + FatalIOErrorInFunction(dict) << "Cannot find zone " << zoneShadowNames[i] << endl << "Valid zones are " << faceZones.names() << exit(FatalIOError); @@ -1803,7 +1803,7 @@ int main(int argc, char *argv[]) label faceI = iter.key(); if (mesh.isInternalFace(faceI)) { - FatalIOErrorIn(args.executable().c_str(), dict) + FatalIOErrorInFunction(dict) << "faceSet " << fz.name() << "contains internal faces." << " This is not permitted." @@ -1843,7 +1843,7 @@ int main(int argc, char *argv[]) if (nExtrudeFaces != nShadowFaces) { - FatalIOErrorIn(args.executable().c_str(), dict) + FatalIOErrorInFunction(dict) << "Extruded faces " << nExtrudeFaces << endl << "is different from shadow faces. " << nShadowFaces << "This is not permitted " << endl @@ -1863,7 +1863,7 @@ int main(int argc, char *argv[]) label faceI = iter.key(); if (mesh.isInternalFace(faceI)) { - FatalIOErrorIn(args.executable().c_str(), dict) + FatalIOErrorInFunction(dict) << "faceSet " << fz.name() << "contains internal faces." << " This is not permitted." diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTools.C b/applications/utilities/mesh/manipulation/checkMesh/checkTools.C index 49ef732525..249fe6b90d 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTools.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTools.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -60,7 +60,7 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology) if (returnReduce(mesh.nInternalPoints(), minOp