From a4ab3f61dbefd05b9507844cee3dbfcd508dca2d Mon Sep 17 00:00:00 2001 From: Henry Weller <http://cfd.direct> Date: Sun, 8 Nov 2015 12:23:52 +0000 Subject: [PATCH] src/OpenFOAM: Update ...ErrorIn -> ...ErrorInFunction Avoids the clutter and maintenance effort associated with providing the function signature string. --- .../dynamicIndexedOctree.C | 54 ++++----- .../dynamicIndexedOctree.H | 6 +- .../algorithms/indexedOctree/indexedOctree.C | 54 ++++----- .../algorithms/indexedOctree/indexedOctree.H | 6 +- .../algorithms/indexedOctree/labelBits.H | 8 +- .../Circulators/Circulator/CirculatorI.H | 7 +- .../ConstCirculator/ConstCirculatorI.H | 7 +- .../DictionaryBase/DictionaryBase.C | 16 +-- .../PtrListDictionary/PtrListDictionary.C | 20 +--- .../HashTables/HashPtrTable/HashPtrTable.C | 9 +- .../HashTables/HashTable/HashTable.C | 9 +- .../HashTables/HashTable/HashTableI.H | 8 +- .../StaticHashTable/StaticHashTable.C | 21 ++-- .../StaticHashTable/StaticHashTableI.H | 10 +- .../StaticHashTable/StaticHashTableIO.C | 17 +-- .../containers/Identifiers/Keyed/KeyedI.H | 7 +- .../linkTypes/DLListBase/DLListBase.C | 4 +- .../linkTypes/DLListBase/DLListBaseI.H | 10 +- .../linkTypes/SLListBase/SLListBase.C | 4 +- .../linkTypes/SLListBase/SLListBaseI.H | 10 +- .../Lists/BiIndirectList/BiIndirectListI.H | 4 +- .../Lists/CompactListList/CompactListList.C | 8 +- .../Lists/CompactListList/CompactListListI.H | 8 +- .../Lists/Distribution/Distribution.C | 9 +- .../Lists/DynamicList/DynamicListI.H | 22 ++-- .../containers/Lists/FixedList/FixedListI.H | 6 +- .../containers/Lists/Histogram/Histogram.C | 4 +- src/OpenFOAM/containers/Lists/List/List.C | 8 +- src/OpenFOAM/containers/Lists/List/ListI.H | 8 +- .../containers/Lists/ListOps/ListOps.C | 4 +- .../Lists/ListOps/ListOpsTemplates.C | 6 +- .../containers/Lists/PackedList/PackedListI.H | 20 +--- .../containers/Lists/PtrList/PtrList.C | 14 +-- .../containers/Lists/PtrList/PtrListI.H | 4 +- .../Lists/UIndirectList/UIndirectListI.H | 6 +- src/OpenFOAM/containers/Lists/UList/UList.C | 4 +- src/OpenFOAM/containers/Lists/UList/UListI.H | 10 +- .../containers/Lists/UPtrList/UPtrList.C | 8 +- .../containers/Lists/UPtrList/UPtrListI.H | 6 +- src/OpenFOAM/containers/NamedEnum/NamedEnum.C | 10 +- src/OpenFOAM/db/IOobject/IOobject.C | 39 +------ .../db/IOobjects/IOPtrList/IOPtrList.C | 4 +- src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C | 8 +- src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C | 6 +- .../db/IOstreams/Pstreams/PstreamBuffers.C | 10 +- .../db/IOstreams/Pstreams/UIPstream.C | 2 +- .../db/IOstreams/Pstreams/UOPstream.C | 4 +- src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C | 9 +- .../IOstreams/Pstreams/UPstreamCommsStruct.C | 4 +- src/OpenFOAM/db/IOstreams/Pstreams/exchange.C | 16 +-- .../db/IOstreams/Pstreams/gatherScatterList.C | 16 +-- src/OpenFOAM/db/Time/findInstance.C | 26 ++--- src/OpenFOAM/db/dictionary/entry/entry.C | 4 +- .../functionEntry/functionEntry.C | 14 +-- .../primitiveEntry/primitiveEntry.C | 10 +- .../dynamicLibrary/dynamicCode/dynamicCode.C | 71 ++++-------- src/OpenFOAM/db/error/CocoParserErrors.H | 10 +- src/OpenFOAM/db/error/messageStream.C | 2 +- src/OpenFOAM/db/error/messageStream.H | 26 ++--- .../functionObject/functionObject.C | 16 +-- .../functionObjectFile/functionObjectFile.C | 15 +-- .../outputFilterOutputControl.C | 4 +- .../objectRegistry/objectRegistryTemplates.C | 14 +-- src/OpenFOAM/db/regIOobject/regIOobject.C | 6 +- src/OpenFOAM/db/regIOobject/regIOobjectI.H | 10 +- src/OpenFOAM/db/regIOobject/regIOobjectRead.C | 8 +- src/OpenFOAM/db/typeInfo/typeInfo.H | 6 +- src/OpenFOAM/dimensionSet/dimensionSet.C | 24 ++-- .../dimensionedScalar/dimensionedScalar.C | 6 +- .../dimensionedType/dimensionedType.C | 8 +- .../DimensionedField/DimensionedField.C | 24 ++-- .../DimensionedScalarField.C | 14 +-- .../FieldFields/FieldField/FieldField.C | 27 +---- .../Fields/DynamicField/DynamicFieldI.H | 22 ++-- src/OpenFOAM/fields/Fields/Field/Field.C | 30 ++--- src/OpenFOAM/fields/Fields/Field/FieldM.H | 15 +-- .../fields/Fields/Field/FieldMapper.H | 8 +- .../Fields/transformList/transformList.C | 20 ++-- .../GeometricField/GeometricBoundaryField.C | 34 +----- .../GeometricField/GeometricField.C | 45 +++----- .../GeometricScalarField.C | 14 +-- src/OpenFOAM/fields/ReadFields/ReadFields.C | 18 +-- .../basic/value/valuePointPatchField.C | 17 +-- .../constraint/cyclic/cyclicPointPatchField.C | 22 +--- .../constraint/empty/emptyPointPatchField.C | 22 +--- .../symmetry/symmetryPointPatchField.C | 22 +--- .../symmetryPlanePointPatchField.C | 22 +--- .../constraint/wedge/wedgePointPatchField.C | 22 +--- .../pointPatchField/pointPatchField.C | 58 +++------- .../pointPatchField/pointPatchFieldNew.C | 37 ++---- src/OpenFOAM/global/JobInfo/JobInfo.C | 10 +- src/OpenFOAM/graph/graph.C | 20 ++-- .../interpolation2DTable.C | 103 ++++------------- .../interpolationLookUpTable.C | 59 +++------- .../interpolationTable/interpolationTable.C | 104 +++++------------ .../tableReaders/csv/csvTableReader.C | 14 +-- .../tableReaders/tableReader.C | 8 +- .../interpolationWeights.C | 11 +- .../linearInterpolationWeights.C | 8 +- .../PatchToPatchInterpolate.C | 16 +-- .../PatchToPatchInterpolation.H | 8 +- .../PrimitivePatchInterpolation.C | 35 ++---- .../uniformInterpolationTable.C | 22 ++-- .../matrices/LUscalarMatrix/LUscalarMatrix.C | 2 +- .../LUscalarMatrix/procLduInterface.C | 9 +- .../matrices/LduMatrix/LduMatrix/LduMatrix.C | 26 ++--- .../LduMatrix/LduMatrix/LduMatrixOperations.C | 24 ++-- .../LduMatrixUpdateMatrixInterfaces.C | 6 +- src/OpenFOAM/matrices/Matrix/Matrix.C | 49 +++----- src/OpenFOAM/matrices/Matrix/MatrixI.H | 10 +- .../matrices/SquareMatrix/SquareMatrixI.H | 15 +-- .../SymmetricSquareMatrixI.H | 16 +-- .../lduMatrix/lduAddressing/lduAddressing.C | 14 +-- .../processorLduInterfaceTemplates.C | 8 +- .../matrices/lduMatrix/lduMatrix/lduMatrix.C | 8 +- .../lduMatrix/lduMatrix/lduMatrixTemplates.C | 2 +- .../lduMatrixUpdateMatrixInterfaces.C | 6 +- .../GAMGAgglomerateLduAddressing.C | 13 +-- .../GAMGAgglomeration/GAMGAgglomeration.C | 21 +--- .../GAMGAgglomerationTemplates.C | 18 +-- .../GAMGProcAgglomeration.C | 9 +- .../manualGAMGProcAgglomeration.C | 16 +-- .../lduMatrix/solvers/GAMG/GAMGSolver.C | 14 +-- .../GAMG/GAMGSolverAgglomerateMatrix.C | 4 +- .../GAMGInterfaceFieldNew.C | 17 +-- .../interfaces/GAMGInterface/GAMGInterface.C | 14 +-- .../GAMGInterface/GAMGInterfaceNew.C | 18 +-- .../matrices/scalarMatrices/scalarMatrices.C | 49 ++------ .../scalarMatrices/scalarMatricesTemplates.C | 11 +- .../matrices/simpleMatrix/simpleMatrix.C | 8 +- src/OpenFOAM/memory/autoPtr/autoPtrI.H | 10 +- src/OpenFOAM/memory/tmp/tmpI.H | 22 ++-- .../Identifiers/patch/coupleGroupIdentifier.C | 50 +++----- .../meshes/ProcessorTopology/commSchedule.C | 9 +- .../meshes/lduMesh/lduPrimitiveMesh.C | 72 ++++-------- .../meshShapes/cellMatcher/cellMatcher.C | 17 +-- .../meshShapes/cellModeller/cellModeller.C | 8 +- src/OpenFOAM/meshes/meshShapes/face/face.C | 7 +- .../meshes/meshShapes/tetCell/tetCellI.H | 27 ++--- .../pointMesh/pointMeshMapper/MapPointField.H | 12 +- .../pointMesh/pointMeshMapper/pointMapper.C | 24 ++-- .../pointMeshMapper/pointPatchMapper.C | 26 ++--- .../facePointPatch/facePointPatchNew.C | 9 +- .../polyMesh/globalMeshData/globalIndex.C | 11 +- .../polyMesh/globalMeshData/globalIndexI.H | 6 +- .../globalMeshData/globalIndexTemplates.C | 10 +- .../polyMesh/globalMeshData/globalMeshData.C | 12 +- .../globalMeshData/globalMeshDataTemplates.C | 4 +- .../mapPolyMesh/cellMapper/cellMapper.C | 32 +++-- .../mapPolyMesh/faceMapper/faceMapper.C | 28 ++--- .../mapPolyMesh/mapDistribute/mapDistribute.C | 31 ++--- .../mapDistribute/mapDistributePolyMesh.C | 4 +- .../mapDistribute/mapDistributeTemplates.C | 17 +-- .../meshes/polyMesh/mapPolyMesh/mapPolyMesh.C | 7 +- .../meshes/polyMesh/mapPolyMesh/mapPolyMesh.H | 8 +- .../polyBoundaryMesh/polyBoundaryMesh.C | 69 ++++------- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 109 ++++-------------- .../polyMesh/polyMeshCheck/polyMeshCheck.C | 30 ++--- .../meshes/polyMesh/polyMeshFromShapeMesh.C | 55 +++------ src/OpenFOAM/meshes/polyMesh/polyMeshIO.C | 7 +- .../meshes/polyMesh/polyMeshInitMesh.C | 8 +- .../polyMeshTetDecomposition.C | 39 ++----- .../constraint/cyclic/cyclicPolyPatch.C | 67 ++++------- .../constraint/cyclic/cyclicPolyPatch.H | 6 +- .../constraint/oldCyclic/oldCyclicPolyPatch.C | 33 ++---- .../constraint/processor/processorPolyPatch.C | 33 ++---- .../processorCyclicPolyPatch.C | 4 +- .../processorCyclicPolyPatch.H | 6 +- .../symmetryPlane/symmetryPlanePolyPatch.C | 4 +- .../constraint/wedge/wedgePolyPatch.C | 11 +- .../polyPatches/polyPatch/polyPatchNew.C | 13 +-- .../meshes/polyMesh/syncTools/syncTools.C | 9 +- .../polyMesh/syncTools/syncToolsTemplates.C | 106 +++++------------ .../meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C | 26 ++--- .../meshes/polyMesh/zones/faceZone/faceZone.C | 15 +-- .../meshes/polyMesh/zones/zone/zone.C | 18 +-- .../PatchTools/PatchToolsEdgeOwner.C | 7 +- .../PatchTools/PatchToolsSearch.C | 15 +-- .../PrimitivePatch/PrimitivePatchAddressing.C | 16 +-- .../PrimitivePatch/PrimitivePatchBdryPoints.C | 9 +- .../PrimitivePatch/PrimitivePatchCheck.C | 7 +- .../PrimitivePatch/PrimitivePatchEdgeLoops.C | 9 +- .../PrimitivePatchLocalPointOrder.C | 9 +- .../PrimitivePatch/PrimitivePatchMeshData.C | 44 +++---- .../PrimitivePatchPointAddressing.C | 16 +-- .../PrimitivePatchProjectPoints.C | 18 +-- .../meshes/primitiveMesh/primitiveMesh.C | 9 +- .../primitiveMeshCalcCellShapes.C | 4 +- .../primitiveMesh/primitiveMeshCellCells.C | 6 +- .../primitiveMeshCellCentresAndVols.C | 4 +- .../primitiveMesh/primitiveMeshCellEdges.C | 6 +- .../primitiveMesh/primitiveMeshCellPoints.C | 4 +- .../meshes/primitiveMesh/primitiveMeshCells.C | 4 +- .../primitiveMeshCheck/primitiveMeshCheck.C | 16 +-- .../primitiveMesh/primitiveMeshEdgeCells.C | 4 +- .../primitiveMesh/primitiveMeshEdgeFaces.C | 4 +- .../meshes/primitiveMesh/primitiveMeshEdges.C | 15 +-- .../primitiveMeshFaceCentresAndAreas.C | 4 +- .../primitiveMesh/primitiveMeshPointCells.C | 6 +- .../primitiveMesh/primitiveMeshPointPoints.C | 8 +- .../primitiveMesh/primitivePatch/patchZones.C | 8 +- .../primitiveMesh/primitivePatch/walkPatch.C | 6 +- .../primitiveShapes/objectHit/PointHit.H | 6 +- .../primitiveShapes/objectHit/PointIndexHit.H | 4 +- .../meshes/primitiveShapes/plane/plane.C | 36 ++---- .../tetrahedron/tetrahedronI.H | 6 +- .../primitiveShapes/triangle/intersection.H | 7 +- .../meshes/treeBoundBox/treeBoundBox.C | 21 ++-- src/OpenFOAM/primitives/Pair/Pair.H | 6 +- .../primitives/Tensor2D/tensor2D/tensor2D.C | 4 +- .../primitives/VectorSpace/VectorSpaceI.H | 29 ++--- src/OpenFOAM/primitives/bools/Switch/Switch.C | 4 +- .../primitives/functions/DataEntry/CSV/CSV.C | 10 +- .../DataEntry/DataEntry/DataEntryNew.C | 2 +- .../PolynomialEntry/PolynomialEntry.C | 28 ++--- .../functions/DataEntry/Table/TableBase.C | 46 ++------ .../functions/Polynomial/Polynomial.C | 20 ++-- .../functions/Polynomial/polynomialFunction.C | 30 ++--- .../globalIndexAndTransform.C | 28 ++--- .../globalIndexAndTransformI.H | 76 ++---------- src/OpenFOAM/primitives/ints/label/label.C | 4 +- src/OpenFOAM/primitives/ints/uLabel/uLabel.C | 4 +- .../primitives/strings/stringOps/stringOps.C | 26 +---- 223 files changed, 1269 insertions(+), 2689 deletions(-) diff --git a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.C b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.C index 92b29325104..922a62415f3 100644 --- a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.C +++ b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -208,7 +208,7 @@ Foam::dynamicIndexedOctree<Type>::divide || bb.min()[2] >= bb.max()[2] ) { - FatalErrorIn("dynamicIndexedOctree<Type>::divide(..)") + FatalErrorInFunction << "Badly formed bounding box:" << bb << abort(FatalError); } @@ -436,11 +436,8 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType { // Empty node. Cannot have 'mixed' as its type since not divided // up and has no items inside it. - FatalErrorIn - ( - "dynamicIndexedOctree<Type>::getVolumeType" - "(const label, const point&)" - ) << "Sample:" << sample << " node:" << nodeI + FatalErrorInFunction + << "Sample:" << sample << " node:" << nodeI << " with bb:" << nodes_[nodeI].bb_ << nl << "Empty subnode has invalid volume type MIXED." << abort(FatalError); @@ -450,11 +447,8 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType } else { - FatalErrorIn - ( - "dynamicIndexedOctree<Type>::getVolumeType" - "(const label, const point&)" - ) << "Sample:" << sample << " at node:" << nodeI + FatalErrorInFunction + << "Sample:" << sample << " at node:" << nodeI << " octant:" << octant << " with bb:" << nod.bb_.subBbox(octant) << nl << "Node has invalid volume type " << octantType @@ -708,7 +702,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint { if (pushInside != bb.contains(perturbedPt)) { - FatalErrorIn("dynamicIndexedOctree<Type>::pushPoint(..)") + FatalErrorInFunction << "pushed point:" << pt << " to:" << perturbedPt << " wanted side:" << pushInside @@ -743,7 +737,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint if (faceID == 0) { - FatalErrorIn("dynamicIndexedOctree<Type>::pushPoint(..)") + FatalErrorInFunction << abort(FatalError); } @@ -820,7 +814,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPoint { if (pushInside != bb.contains(perturbedPt)) { - FatalErrorIn("dynamicIndexedOctree<Type>::pushPoint(..)") + FatalErrorInFunction << "pushed point:" << pt << " on face:" << faceString(faceID) << " to:" << perturbedPt << " wanted side:" << pushInside @@ -849,7 +843,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace { if (bb.posBits(pt) != 0) { - FatalErrorIn("dynamicIndexedOctree<Type>::pushPointIntoFace(..)") + FatalErrorInFunction << " bb:" << bb << endl << "does not contain point " << pt << abort(FatalError); } @@ -971,7 +965,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace { if (faceID != bb.faceBits(facePoint)) { - FatalErrorIn("dynamicIndexedOctree<Type>::pushPointIntoFace(..)") + FatalErrorInFunction << "Pushed point from " << pt << " on face:" << ptFaceID << " of bb:" << bb << endl << "onto " << facePoint @@ -982,7 +976,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace } if (bb.posBits(facePoint) != 0) { - FatalErrorIn("dynamicIndexedOctree<Type>::pushPointIntoFace(..)") + FatalErrorInFunction << " bb:" << bb << endl << "does not contain perturbed point " << facePoint << abort(FatalError); @@ -1086,7 +1080,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace // // if (nFaces == 0 || nFaces == 1 || nFaces > 3) // { -// FatalErrorIn("dynamicIndexedOctree<Type>::checkMultipleFaces(..)") +// FatalErrorInFunction // << "Problem : nFaces:" << nFaces << abort(FatalError); // } // @@ -1119,7 +1113,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace // // if (maxIndex == -1) // { -// FatalErrorIn("dynamicIndexedOctree<Type>::checkMultipleFaces(..)") +// FatalErrorInFunction // << "Problem maxIndex:" << maxIndex << " inproducts:" << inproducts // << abort(FatalError); // } @@ -1179,7 +1173,7 @@ Foam::point Foam::dynamicIndexedOctree<Type>::pushPointIntoFace // { // if (faceID != bb.faceBits(faceHitInfo.rawPoint())) // { -// FatalErrorIn("dynamicIndexedOctree<Type>::checkMultipleFaces(..)") +// FatalErrorInFunction // << "Pushed point from " << oldPoint // << " on face:" << oldFaceID << " of bb:" << bb << endl // << "onto " << faceHitInfo.rawPoint() @@ -1229,7 +1223,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToParent if (parentOctant == 255) { - FatalErrorIn("walkToParent(..)") + FatalErrorInFunction << "Problem: no parent found for octant:" << octant << " node:" << nodeI << abort(FatalError); @@ -1426,7 +1420,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour if (!subBb.contains(facePoint)) { - FatalErrorIn("dynamicIndexedOctree<Type>::walkToNeighbour(..)") + FatalErrorInFunction << "When searching for " << facePoint << " ended up in node:" << nodeI << " octant:" << octant @@ -1455,7 +1449,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour if (nodeI == oldNodeI && octant == oldOctant) { - FatalErrorIn("dynamicIndexedOctree<Type>::walkToNeighbour(..)") + FatalErrorInFunction << "Did not go to neighbour when searching for " << facePoint << endl << " starting from face:" << faceString(faceID) @@ -1467,7 +1461,7 @@ bool Foam::dynamicIndexedOctree<Type>::walkToNeighbour if (!subBb.contains(facePoint)) { - FatalErrorIn("dynamicIndexedOctree<Type>::walkToNeighbour(..)") + FatalErrorInFunction << "When searching for " << facePoint << " ended up in node:" << nodeI << " octant:" << octant @@ -1555,7 +1549,7 @@ void Foam::dynamicIndexedOctree<Type>::traverseNode if (octantBb.posBits(start) != 0) { - FatalErrorIn("dynamicIndexedOctree<Type>::traverseNode(..)") + FatalErrorInFunction << "Node:" << nodeI << " octant:" << octant << " bb:" << octantBb << endl << "does not contain point " << start << abort(FatalError); @@ -1863,7 +1857,7 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine } if (debug) { - FatalErrorIn("dynamicIndexedOctree<Type>::findLine(..)") + FatalErrorInFunction << "Got stuck in loop raytracing from:" << treeStart << " to:" << treeEnd << endl << "inside top box:" << subBbox(startNodeI, startOctant) @@ -1871,7 +1865,7 @@ Foam::pointIndexHit Foam::dynamicIndexedOctree<Type>::findLine } else { - WarningIn("dynamicIndexedOctree<Type>::findLine(..)") + WarningInFunction << "Got stuck in loop raytracing from:" << treeStart << " to:" << treeEnd << endl << "inside top box:" << subBbox(startNodeI, startOctant) @@ -2493,7 +2487,7 @@ Foam::labelBits Foam::dynamicIndexedOctree<Type>::findNode { if (!nod.bb_.contains(sample)) { - FatalErrorIn("findNode(..)") + FatalErrorInFunction << "Cannot find " << sample << " in node " << nodeI << abort(FatalError); } @@ -2627,7 +2621,7 @@ Foam::volumeType Foam::dynamicIndexedOctree<Type>::getVolumeType } else { - FatalErrorIn("getVolumeType") << abort(FatalError); + FatalErrorInFunction << abort(FatalError); } } diff --git a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H index ccb929f188f..3c1d969c46f 100644 --- a/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H +++ b/src/OpenFOAM/algorithms/dynamicIndexedOctree/dynamicIndexedOctree.H @@ -472,7 +472,7 @@ public: { if (nodes_.empty()) { - FatalErrorIn("dynamicIndexedOctree<Type>::bb() const") + FatalErrorInFunction << "Tree is empty" << abort(FatalError); } return nodes_[0].bb_; @@ -500,7 +500,7 @@ public: { if (!isContent(i)) { - FatalErrorIn("getContent(const label)") + FatalErrorInFunction << abort(FatalError); } return -i.val()-1; @@ -510,7 +510,7 @@ public: { if (!isNode(i)) { - FatalErrorIn("getNode(const label)") + FatalErrorInFunction << abort(FatalError); } return i.val() - 1; diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C index 541a008d6ba..9706ffc52fc 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -182,7 +182,7 @@ Foam::indexedOctree<Type>::divide || bb.min()[2] >= bb.max()[2] ) { - FatalErrorIn("indexedOctree<Type>::divide(..)") + FatalErrorInFunction << "Badly formed bounding box:" << bb << abort(FatalError); } @@ -456,11 +456,8 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType { // Empty node. Cannot have 'mixed' as its type since not divided // up and has no items inside it. - FatalErrorIn - ( - "indexedOctree<Type>::getVolumeType" - "(const label, const point&)" - ) << "Sample:" << sample << " node:" << nodeI + FatalErrorInFunction + << "Sample:" << sample << " node:" << nodeI << " with bb:" << nodes_[nodeI].bb_ << nl << "Empty subnode has invalid volume type MIXED." << abort(FatalError); @@ -470,11 +467,8 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType } else { - FatalErrorIn - ( - "indexedOctree<Type>::getVolumeType" - "(const label, const point&)" - ) << "Sample:" << sample << " at node:" << nodeI + FatalErrorInFunction + << "Sample:" << sample << " at node:" << nodeI << " octant:" << octant << " with bb:" << nod.bb_.subBbox(octant) << nl << "Node has invalid volume type " << octantType @@ -739,7 +733,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint { if (pushInside != bb.contains(perturbedPt)) { - FatalErrorIn("indexedOctree<Type>::pushPoint(..)") + FatalErrorInFunction << "pushed point:" << pt << " to:" << perturbedPt << " wanted side:" << pushInside @@ -774,7 +768,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint if (faceID == 0) { - FatalErrorIn("indexedOctree<Type>::pushPoint(..)") + FatalErrorInFunction << abort(FatalError); } @@ -851,7 +845,7 @@ Foam::point Foam::indexedOctree<Type>::pushPoint { if (pushInside != bb.contains(perturbedPt)) { - FatalErrorIn("indexedOctree<Type>::pushPoint(..)") + FatalErrorInFunction << "pushed point:" << pt << " on face:" << faceString(faceID) << " to:" << perturbedPt << " wanted side:" << pushInside @@ -880,7 +874,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace { if (bb.posBits(pt) != 0) { - FatalErrorIn("indexedOctree<Type>::pushPointIntoFace(..)") + FatalErrorInFunction << " bb:" << bb << endl << "does not contain point " << pt << abort(FatalError); } @@ -1002,7 +996,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace { if (faceID != bb.faceBits(facePoint)) { - FatalErrorIn("indexedOctree<Type>::pushPointIntoFace(..)") + FatalErrorInFunction << "Pushed point from " << pt << " on face:" << ptFaceID << " of bb:" << bb << endl << "onto " << facePoint @@ -1013,7 +1007,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace } if (bb.posBits(facePoint) != 0) { - FatalErrorIn("indexedOctree<Type>::pushPointIntoFace(..)") + FatalErrorInFunction << " bb:" << bb << endl << "does not contain perturbed point " << facePoint << abort(FatalError); @@ -1117,7 +1111,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace // // if (nFaces == 0 || nFaces == 1 || nFaces > 3) // { -// FatalErrorIn("indexedOctree<Type>::checkMultipleFaces(..)") +// FatalErrorInFunction // << "Problem : nFaces:" << nFaces << abort(FatalError); // } // @@ -1150,7 +1144,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace // // if (maxIndex == -1) // { -// FatalErrorIn("indexedOctree<Type>::checkMultipleFaces(..)") +// FatalErrorInFunction // << "Problem maxIndex:" << maxIndex << " inproducts:" << inproducts // << abort(FatalError); // } @@ -1210,7 +1204,7 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace // { // if (faceID != bb.faceBits(faceHitInfo.rawPoint())) // { -// FatalErrorIn("indexedOctree<Type>::checkMultipleFaces(..)") +// FatalErrorInFunction // << "Pushed point from " << oldPoint // << " on face:" << oldFaceID << " of bb:" << bb << endl // << "onto " << faceHitInfo.rawPoint() @@ -1260,7 +1254,7 @@ bool Foam::indexedOctree<Type>::walkToParent if (parentOctant == 255) { - FatalErrorIn("walkToParent(..)") + FatalErrorInFunction << "Problem: no parent found for octant:" << octant << " node:" << nodeI << abort(FatalError); @@ -1457,7 +1451,7 @@ bool Foam::indexedOctree<Type>::walkToNeighbour if (!subBb.contains(facePoint)) { - FatalErrorIn("indexedOctree<Type>::walkToNeighbour(..)") + FatalErrorInFunction << "When searching for " << facePoint << " ended up in node:" << nodeI << " octant:" << octant @@ -1486,7 +1480,7 @@ bool Foam::indexedOctree<Type>::walkToNeighbour if (nodeI == oldNodeI && octant == oldOctant) { - FatalErrorIn("indexedOctree<Type>::walkToNeighbour(..)") + FatalErrorInFunction << "Did not go to neighbour when searching for " << facePoint << endl << " starting from face:" << faceString(faceID) @@ -1498,7 +1492,7 @@ bool Foam::indexedOctree<Type>::walkToNeighbour if (!subBb.contains(facePoint)) { - FatalErrorIn("indexedOctree<Type>::walkToNeighbour(..)") + FatalErrorInFunction << "When searching for " << facePoint << " ended up in node:" << nodeI << " octant:" << octant @@ -1589,7 +1583,7 @@ void Foam::indexedOctree<Type>::traverseNode if (octantBb.posBits(start) != 0) { - FatalErrorIn("indexedOctree<Type>::traverseNode(..)") + FatalErrorInFunction << "Node:" << nodeI << " octant:" << octant << " bb:" << octantBb << endl << "does not contain point " << start << abort(FatalError); @@ -1897,7 +1891,7 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLine } if (debug) { - FatalErrorIn("indexedOctree<Type>::findLine(..)") + FatalErrorInFunction << "Got stuck in loop raytracing from:" << treeStart << " to:" << treeEnd << endl << "inside top box:" << subBbox(startNodeI, startOctant) @@ -1905,7 +1899,7 @@ Foam::pointIndexHit Foam::indexedOctree<Type>::findLine } else { - WarningIn("indexedOctree<Type>::findLine(..)") + WarningInFunction << "Got stuck in loop raytracing from:" << treeStart << " to:" << treeEnd << endl << "inside top box:" << subBbox(startNodeI, startOctant) @@ -2799,7 +2793,7 @@ Foam::labelBits Foam::indexedOctree<Type>::findNode { if (!nod.bb_.contains(sample)) { - FatalErrorIn("findNode(..)") + FatalErrorInFunction << "Cannot find " << sample << " in node " << nodeI << abort(FatalError); } @@ -2937,7 +2931,7 @@ Foam::volumeType Foam::indexedOctree<Type>::getVolumeType } else { - FatalErrorIn("getVolumeType") << abort(FatalError); + FatalErrorInFunction << abort(FatalError); } } diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H index 96abc1a43fa..e111d4f4af7 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.H @@ -470,7 +470,7 @@ public: { if (nodes_.empty()) { - FatalErrorIn("indexedOctree<Type>::bb() const") + FatalErrorInFunction << "Tree is empty" << abort(FatalError); } return nodes_[0].bb_; @@ -498,7 +498,7 @@ public: { if (!isContent(i)) { - FatalErrorIn("getContent(const label)") + FatalErrorInFunction << abort(FatalError); } return -i.val()-1; @@ -508,7 +508,7 @@ public: { if (!isNode(i)) { - FatalErrorIn("getNode(const label)") + FatalErrorInFunction << abort(FatalError); } return i.val() - 1; diff --git a/src/OpenFOAM/algorithms/indexedOctree/labelBits.H b/src/OpenFOAM/algorithms/indexedOctree/labelBits.H index 757fd73621e..b2a8907e3ce 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/labelBits.H +++ b/src/OpenFOAM/algorithms/indexedOctree/labelBits.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,10 +60,8 @@ class labelBits # ifdef FULLDEBUG if (bits > 7 || (((val<<3)>>3) != val)) { - FatalErrorIn - ( - "labelBits::pack(const label, const direction)" - ) << "Direction " << bits << " outside range 0..7" + FatalErrorInFunction + << "Direction " << bits << " outside range 0..7" << " or value " << val << " negative or larger than " << label(8*sizeof(label)-3) << " bit representation" << abort(FatalError); diff --git a/src/OpenFOAM/containers/Circulators/Circulator/CirculatorI.H b/src/OpenFOAM/containers/Circulators/Circulator/CirculatorI.H index aca31c0d631..65c6ce1deeb 100644 --- a/src/OpenFOAM/containers/Circulators/Circulator/CirculatorI.H +++ b/src/OpenFOAM/containers/Circulators/Circulator/CirculatorI.H @@ -171,11 +171,8 @@ void Foam::Circulator<ContainerType>::operator= // Check for assignment to self if (this == &rhs) { - FatalErrorIn - ( - "Foam::Circulator<ContainerType>::operator=" - "(const Foam::Circulator<ContainerType>&)" - ) << "Attempted assignment to self" + FatalErrorInFunction + << "Attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/containers/Circulators/ConstCirculator/ConstCirculatorI.H b/src/OpenFOAM/containers/Circulators/ConstCirculator/ConstCirculatorI.H index 30d66bba2a8..bd51a2e4d56 100644 --- a/src/OpenFOAM/containers/Circulators/ConstCirculator/ConstCirculatorI.H +++ b/src/OpenFOAM/containers/Circulators/ConstCirculator/ConstCirculatorI.H @@ -174,11 +174,8 @@ void Foam::ConstCirculator<ContainerType>::operator= // Check for assignment to self if (this == &rhs) { - FatalErrorIn - ( - "Foam::ConstCirculator<ContainerType>::operator=" - "(const Foam::ConstCirculator<ContainerType>&)" - ) << "Attempted assignment to self" + FatalErrorInFunction + << "Attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C index 3227e13b21d..8ddb9e062d4 100644 --- a/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C +++ b/src/OpenFOAM/containers/Dictionaries/DictionaryBase/DictionaryBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -141,10 +141,8 @@ const T* Foam::DictionaryBase<IDLListType, T>::lookup(const word& keyword) const if (iter == hashedTs_.end()) { - FatalErrorIn - ( - "DictionaryBase<IDLListType, T>::lookup(const word&) const" - ) << keyword << " is undefined" + FatalErrorInFunction + << keyword << " is undefined" << exit(FatalError); } @@ -160,10 +158,8 @@ T* Foam::DictionaryBase<IDLListType, T>::lookup(const word& keyword) if (iter == hashedTs_.end()) { - FatalErrorIn - ( - "DictionaryBase<IDLListType, T>::lookup(const word&)" - ) << keyword << " is undefined" + FatalErrorInFunction + << keyword << " is undefined" << exit(FatalError); } @@ -260,7 +256,7 @@ void Foam::DictionaryBase<IDLListType, T>::operator= // Check for assignment to self if (this == &dict) { - FatalErrorIn("DictionaryBase::operator=(const DictionaryBase&)") + FatalErrorInFunction << "attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/containers/Dictionaries/PtrListDictionary/PtrListDictionary.C b/src/OpenFOAM/containers/Dictionaries/PtrListDictionary/PtrListDictionary.C index dae34e82fe2..71c4abf52de 100644 --- a/src/OpenFOAM/containers/Dictionaries/PtrListDictionary/PtrListDictionary.C +++ b/src/OpenFOAM/containers/Dictionaries/PtrListDictionary/PtrListDictionary.C @@ -70,10 +70,8 @@ inline Foam::autoPtr<T> Foam::PtrListDictionary<T>::set { if (!DictionaryBase<PtrList<T>, T>::hashedTs_.insert(key, ptr)) { - FatalErrorIn - ( - "PtrListDictionary<T>::set(const label i, const word& key, T* ptr)" - ) << "Cannot insert with key '" << key << "' into hash-table" + FatalErrorInFunction + << "Cannot insert with key '" << key << "' into hash-table" << abort(FatalError); } return PtrList<T>::set(i, ptr); @@ -91,11 +89,8 @@ inline Foam::autoPtr<T> Foam::PtrListDictionary<T>::set T* ptr = aptr.ptr(); if (!DictionaryBase<PtrList<T>, T>::hashedTs_.insert(key, ptr)) { - FatalErrorIn - ( - "PtrListDictionary<T>::" - "set(const label i, const word& key, autoPtr<T>& aptr)" - ) << "Cannot insert with key '" << key << "' into hash-table" + FatalErrorInFunction + << "Cannot insert with key '" << key << "' into hash-table" << abort(FatalError); } return PtrList<T>::set(i, ptr); @@ -113,11 +108,8 @@ inline Foam::autoPtr<T> Foam::PtrListDictionary<T>::set T* ptr = t.ptr(); if (!DictionaryBase<PtrList<T>, T>::hashedTs_.insert(key, ptr)) { - FatalErrorIn - ( - "PtrListDictionary<T>::" - "set(const label i, const word& key, tmp<T>& t)" - ) << "Cannot insert with key '" << key << "' into hash-table" + FatalErrorInFunction + << "Cannot insert with key '" << key << "' into hash-table" << abort(FatalError); } return PtrList<T>::set(i, ptr); diff --git a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.C b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.C index 3b53b1dfa66..4f6ad375ab9 100644 --- a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.C +++ b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -121,11 +121,8 @@ void Foam::HashPtrTable<T, Key, Hash>::operator= // Check for assignment to self if (this == &rhs) { - FatalErrorIn - ( - "HashPtrTable<T, Key, Hash>::operator=" - "(const HashPtrTable<T, Key, Hash>&)" - ) << "attempted assignment to self" + FatalErrorInFunction + << "attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C index 87457c15f78..2ebab1e3a9d 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -546,11 +546,8 @@ void Foam::HashTable<T, Key, Hash>::operator= // Check for assignment to self if (this == &rhs) { - FatalErrorIn - ( - "HashTable<T, Key, Hash>::operator=" - "(const HashTable<T, Key, Hash>&)" - ) << "attempted assignment to self" + FatalErrorInFunction + << "attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H index 9fb7041f0f0..9839015f02a 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -114,8 +114,7 @@ inline T& Foam::HashTable<T, Key, Hash>::operator[](const Key& key) if (iter == this->end()) { - FatalErrorIn("HashTable<T, Key, Hash>::operator[](const Key&)") - << key << " not found in table. Valid entries: " + FatalErrorInFunction << toc() << exit(FatalError); } @@ -131,8 +130,7 @@ inline const T& Foam::HashTable<T, Key, Hash>::operator[](const Key& key) const if (iter == this->cend()) { - FatalErrorIn("HashTable<T, Key, Hash>::operator[](const Key&) const") - << key << " not found in table. Valid entries: " + FatalErrorInFunction << toc() << exit(FatalError); } diff --git a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C index da859652eb0..2b1dacbc39c 100644 --- a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C +++ b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTable.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -71,10 +71,8 @@ Foam::StaticHashTable<T, Key, Hash>::StaticHashTable(const label size) { if (size < 1) { - FatalErrorIn - ( - "StaticHashTable<T, Key, Hash>::StaticHashTable(const label size)" - ) << "Illegal size " << size << " for StaticHashTable." + FatalErrorInFunction + << "Illegal size " << size << " for StaticHashTable." << " Minimum size is 1" << abort(FatalError); } } @@ -406,10 +404,8 @@ void Foam::StaticHashTable<T, Key, Hash>::resize(const label sz) if (newSize < 1) { - FatalErrorIn - ( - "StaticHashTable<T, Key, Hash>::resize(const label)" - ) << "Illegal size " << newSize << " for StaticHashTable." + FatalErrorInFunction + << "Illegal size " << newSize << " for StaticHashTable." << " Minimum size is 1" << abort(FatalError); } @@ -486,11 +482,8 @@ void Foam::StaticHashTable<T, Key, Hash>::operator= // Check for assignment to self if (this == &rhs) { - FatalErrorIn - ( - "StaticHashTable<T, Key, Hash>::operator=" - "(const StaticHashTable<T, Key, Hash>&)" - ) << "attempted assignment to self" + FatalErrorInFunction + << "attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableI.H b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableI.H index a7b7af46794..49f84be2b48 100644 --- a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableI.H +++ b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,8 +94,7 @@ inline T& Foam::StaticHashTable<T, Key, Hash>::operator[](const Key& key) if (iter == end()) { - FatalErrorIn("StaticHashTable<T, Key, Hash>::operator[](const Key&)") - << key << " not found in table. Valid entries: " + FatalErrorInFunction << toc() << exit(FatalError); } @@ -114,10 +113,7 @@ inline const T& Foam::StaticHashTable<T, Key, Hash>::operator[] if (iter == cend()) { - FatalErrorIn - ( - "StaticHashTable<T, Key, Hash>::operator[](const Key&) const" - ) << key << " not found in table. Valid entries: " + FatalErrorInFunction << toc() << exit(FatalError); } diff --git a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableIO.C b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableIO.C index 1164214dfec..7e4b3832611 100644 --- a/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableIO.C +++ b/src/OpenFOAM/containers/HashTables/StaticHashTable/StaticHashTableIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,10 +45,8 @@ Foam::StaticHashTable<T, Key, Hash>::StaticHashTable { if (size < 1) { - FatalErrorIn - ( - "StaticHashTable<T, Key, Hash>::StaticHashTable(const label size)" - ) << "Illegal size " << size << " for StaticHashTable." + FatalErrorInFunction + << "Illegal size " << size << " for StaticHashTable." << " Minimum size is 1" << abort(FatalError); } @@ -142,9 +140,8 @@ Foam::Istream& Foam::operator>>(Istream& is, StaticHashTable<T, Key, Hash>& L) } else { - FatalIOErrorIn + FatalIOErrorInFunction ( - "operator>>(Istream&, StaticHashTable<T, Key, Hash>&)", is ) << "incorrect first token, '(', found " << firstToken.info() << exit(FatalIOError); @@ -158,9 +155,8 @@ Foam::Istream& Foam::operator>>(Istream& is, StaticHashTable<T, Key, Hash>& L) { if (firstToken.pToken() != token::BEGIN_LIST) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "operator>>(Istream&, StaticHashTable<T, Key, Hash>&)", is ) << "incorrect first token, '(', found " << firstToken.info() << exit(FatalIOError); @@ -196,9 +192,8 @@ Foam::Istream& Foam::operator>>(Istream& is, StaticHashTable<T, Key, Hash>& L) } else { - FatalIOErrorIn + FatalIOErrorInFunction ( - "operator>>(Istream&, StaticHashTable<T, Key, Hash>&)", is ) << "incorrect first token, expected <int> or '(', found " << firstToken.info() diff --git a/src/OpenFOAM/containers/Identifiers/Keyed/KeyedI.H b/src/OpenFOAM/containers/Identifiers/Keyed/KeyedI.H index f7b74ec8a60..ed5edf6c8f9 100644 --- a/src/OpenFOAM/containers/Identifiers/Keyed/KeyedI.H +++ b/src/OpenFOAM/containers/Identifiers/Keyed/KeyedI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,10 +94,7 @@ Foam::Keyed<T>::createList(const List<T>& lst, const labelUList& keys) { if (lst.size() != keys.size()) { - FatalErrorIn - ( - "Foam::Keyed<T>::createList(const List<T>&, const labelUList&)" - ) + FatalErrorInFunction << "size mismatch adding keys to a list:" << nl << "List has size " << lst.size() << " and keys has size " << keys.size() << nl diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.C b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.C index 9d9b50904b6..e8e6b721c3f 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.C +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -178,7 +178,7 @@ Foam::DLListBase::link* Foam::DLListBase::removeHead() if (!first_) { - FatalErrorIn("void DLListBase::removeHead()") + FatalErrorInFunction << "remove from empty list" << abort(FatalError); } diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H index fd33c5efacf..c13482d30a2 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,7 +91,7 @@ Foam::DLListBase::first() { if (!nElmts_) { - FatalErrorIn("DLListBase::first()") + FatalErrorInFunction << "list is empty" << abort(FatalError); } @@ -104,7 +104,7 @@ Foam::DLListBase::first() const { if (!nElmts_) { - FatalErrorIn("DLListBase::first() const") + FatalErrorInFunction << "list is empty" << abort(FatalError); } @@ -117,7 +117,7 @@ Foam::DLListBase::last() { if (!nElmts_) { - FatalErrorIn("DLListBase::last()") + FatalErrorInFunction << "list is empty" << abort(FatalError); } @@ -130,7 +130,7 @@ Foam::DLListBase::last() const { if (!nElmts_) { - FatalErrorIn("DLListBase::last() const") + FatalErrorInFunction << "list is empty" << abort(FatalError); } diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.C b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.C index f2302413550..c314cdc7528 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.C +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,7 +81,7 @@ Foam::SLListBase::link* Foam::SLListBase::removeHead() if (last_ == 0) { - FatalErrorIn("SLListBase::remove()") + FatalErrorInFunction << "remove from empty list" << abort(FatalError); } diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H index 432b183253b..21a2fa020cd 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -81,7 +81,7 @@ Foam::SLListBase::first() { if (!nElmts_) { - FatalErrorIn("SLListBase::first()") + FatalErrorInFunction << "list is empty" << abort(FatalError); } @@ -94,7 +94,7 @@ Foam::SLListBase::first() const { if (!nElmts_) { - FatalErrorIn("SLListBase::first() const") + FatalErrorInFunction << "list is empty" << abort(FatalError); } @@ -107,7 +107,7 @@ Foam::SLListBase::last() { if (!nElmts_) { - FatalErrorIn("SLListBase::last()") + FatalErrorInFunction << "list is empty" << abort(FatalError); } @@ -120,7 +120,7 @@ Foam::SLListBase::last() const { if (!nElmts_) { - FatalErrorIn("SLListBase::last() const") + FatalErrorInFunction << "list is empty" << abort(FatalError); } diff --git a/src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectListI.H b/src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectListI.H index 88eae210a59..dcf70d41a5a 100644 --- a/src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectListI.H +++ b/src/OpenFOAM/containers/Lists/BiIndirectList/BiIndirectListI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -178,7 +178,7 @@ inline void Foam::BiIndirectList<T>::operator=(const UList<T>& ae) { if (addressing_.size() != ae.size()) { - FatalErrorIn("BiIndirectList<T>::operator=(const UList<T>&)") + FatalErrorInFunction << "Addressing and list of addressed elements " "have different sizes: " << addressing_.size() << " " << ae.size() diff --git a/src/OpenFOAM/containers/Lists/CompactListList/CompactListList.C b/src/OpenFOAM/containers/Lists/CompactListList/CompactListList.C index 258aaae9da2..4e18ee61761 100644 --- a/src/OpenFOAM/containers/Lists/CompactListList/CompactListList.C +++ b/src/OpenFOAM/containers/Lists/CompactListList/CompactListList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -139,10 +139,8 @@ void Foam::CompactListList<T, Container>::setSize(const label nRows) } else if (nRows > size()) { - FatalErrorIn - ( - "CompactListList<T, Container>::setSize(const label nRows)" - ) << "Cannot be used to extend the list from " << offsets_.size() + FatalErrorInFunction + << "Cannot be used to extend the list from " << offsets_.size() << " to " << nRows << nl << " Please use one of the other setSize member functions" << abort(FatalError); diff --git a/src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H b/src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H index 346aba37c86..c426fd151cc 100644 --- a/src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H +++ b/src/OpenFOAM/containers/Lists/CompactListList/CompactListListI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -144,10 +144,8 @@ const { if (i < 0 || i >= m_.size()) { - FatalErrorIn - ( - "CompactListList<T, Container>::whichRow(const label) const" - ) << "Index " << i << " outside 0.." << m_.size() + FatalErrorInFunction + << "Index " << i << " outside 0.." << m_.size() << abort(FatalError); } diff --git a/src/OpenFOAM/containers/Lists/Distribution/Distribution.C b/src/OpenFOAM/containers/Lists/Distribution/Distribution.C index 89f0969826a..7e8e1715562 100644 --- a/src/OpenFOAM/containers/Lists/Distribution/Distribution.C +++ b/src/OpenFOAM/containers/Lists/Distribution/Distribution.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -565,11 +565,8 @@ void Foam::Distribution<Type>::operator= // Check for assignment to self if (this == &rhs) { - FatalErrorIn - ( - "Foam::Distribution<Type>::operator=" - "(const Foam::Distribution<Type>&)" - ) << "Attempted assignment to self" + FatalErrorInFunction + << "Attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H index 25dfb0ad99c..c6ed4d1569a 100644 --- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H +++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicListI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -328,11 +328,8 @@ Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::append { if (this == &lst) { - FatalErrorIn - ( - "DynamicList<T, SizeInc, SizeMult, SizeDiv>::append" - "(const UList<T>&)" - ) << "attempted appending to self" << abort(FatalError); + FatalErrorInFunction + << "attempted appending to self" << abort(FatalError); } label nextFree = List<T>::size(); @@ -371,10 +368,8 @@ inline T Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::remove() if (elemI < 0) { - FatalErrorIn - ( - "Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::remove()" - ) << "List is empty" << abort(FatalError); + FatalErrorInFunction + << "List is empty" << abort(FatalError); } const T& val = List<T>::operator[](elemI); @@ -420,11 +415,8 @@ inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator= { if (this == &lst) { - FatalErrorIn - ( - "DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=" - "(const DynamicList<T, SizeInc, SizeMult, SizeDiv>&)" - ) << "attempted assignment to self" << abort(FatalError); + FatalErrorInFunction + << "attempted assignment to self" << abort(FatalError); } if (capacity_ >= lst.size()) diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H index 87bd7b856a4..053a4e4e6d5 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H @@ -131,7 +131,7 @@ inline void Foam::FixedList<T, Size>::checkStart(const label start) const { if (start < 0 || (start && unsigned(start) >= Size)) { - FatalErrorIn("FixedList<T, Size>::checkStart(const label)") + FatalErrorInFunction << "start " << start << " out of range 0 ... " << (Size-1) << abort(FatalError); } @@ -144,7 +144,7 @@ inline void Foam::FixedList<T, Size>::checkSize(const label size) const { if (size < 0 || unsigned(size) > Size) { - FatalErrorIn("FixedList<T, Size>::checkSize(const label)") + FatalErrorInFunction << "size " << size << " out of range 0 ... " << (Size) << abort(FatalError); } @@ -158,7 +158,7 @@ inline void Foam::FixedList<T, Size>::checkIndex(const label i) const { if (i < 0 || unsigned(i) >= Size) { - FatalErrorIn("FixedList<T, Size>::checkIndex(const label)") + FatalErrorInFunction << "index " << i << " out of range 0 ... " << (Size-1) << abort(FatalError); } diff --git a/src/OpenFOAM/containers/Lists/Histogram/Histogram.C b/src/OpenFOAM/containers/Lists/Histogram/Histogram.C index 12d3fbb076e..d5c13760692 100644 --- a/src/OpenFOAM/containers/Lists/Histogram/Histogram.C +++ b/src/OpenFOAM/containers/Lists/Histogram/Histogram.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,7 +34,7 @@ void Foam::Histogram<List>::count(const List& bins, const List& l) { if (bins.size() < 2) { - FatalErrorIn("Histogram<List>::count(const List&, const List&)") + FatalErrorInFunction << "Should have at least two values in bins. Now:" << bins << exit(FatalError); } diff --git a/src/OpenFOAM/containers/Lists/List/List.C b/src/OpenFOAM/containers/Lists/List/List.C index 0ba40cc10f4..e184284d823 100644 --- a/src/OpenFOAM/containers/Lists/List/List.C +++ b/src/OpenFOAM/containers/Lists/List/List.C @@ -46,7 +46,7 @@ Foam::List<T>::List(const label s) { if (this->size_ < 0) { - FatalErrorIn("List<T>::List(const label size)") + FatalErrorInFunction << "bad size " << this->size_ << abort(FatalError); } @@ -66,7 +66,7 @@ Foam::List<T>::List(const label s, const T& a) { if (this->size_ < 0) { - FatalErrorIn("List<T>::List(const label size, const T&)") + FatalErrorInFunction << "bad size " << this->size_ << abort(FatalError); } @@ -319,7 +319,7 @@ void Foam::List<T>::setSize(const label newSize) { if (newSize < 0) { - FatalErrorIn("List<T>::setSize(const label)") + FatalErrorInFunction << "bad set size " << newSize << abort(FatalError); } @@ -462,7 +462,7 @@ void Foam::List<T>::operator=(const List<T>& a) { if (this == &a) { - FatalErrorIn("List<T>::operator=(const List<T>&)") + FatalErrorInFunction << "attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/containers/Lists/List/ListI.H b/src/OpenFOAM/containers/Lists/List/ListI.H index 12201169134..f304da6e218 100644 --- a/src/OpenFOAM/containers/Lists/List/ListI.H +++ b/src/OpenFOAM/containers/Lists/List/ListI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,10 +105,8 @@ inline void Foam::List<T>::append(const UList<T>& lst) { if (this == &lst) { - FatalErrorIn - ( - "List<T>::append(const UList<T>&)" - ) << "attempted appending to self" << abort(FatalError); + FatalErrorInFunction + << "attempted appending to self" << abort(FatalError); } label nextFree = this->size(); diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOps.C b/src/OpenFOAM/containers/Lists/ListOps/ListOps.C index 18c086f6f0e..78c9cbbf3ee 100644 --- a/src/OpenFOAM/containers/Lists/ListOps/ListOps.C +++ b/src/OpenFOAM/containers/Lists/ListOps/ListOps.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,7 +49,7 @@ Foam::labelList Foam::invert { if (inverse[newPos] >= 0) { - FatalErrorIn("invert(const label, const labelUList&)") + FatalErrorInFunction << "Map is not one-to-one. At index " << i << " element " << newPos << " has already occurred before" << nl << "Please use invertOneToMany instead" diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C b/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C index 29ea6505512..7421eabbce3 100644 --- a/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C +++ b/src/OpenFOAM/containers/Lists/ListOps/ListOpsTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -296,7 +296,7 @@ ListType Foam::subset // select must at least cover the list range if (select.size() < lst.size()) { - FatalErrorIn("subset(const UList<T>&, const T&, const ListType&)") + FatalErrorInFunction << "select is of size " << select.size() << "; but it must index a list of size " << lst.size() << abort(FatalError); @@ -332,7 +332,7 @@ void Foam::inplaceSubset // select must at least cover the list range if (select.size() < lst.size()) { - FatalErrorIn("inplaceSubset(const UList<T>&, const T&, ListType&)") + FatalErrorInFunction << "select is of size " << select.size() << "; but it must index a list of size " << lst.size() << abort(FatalError); diff --git a/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H b/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H index 303b3125be6..01f21e37adf 100644 --- a/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H +++ b/src/OpenFOAM/containers/Lists/PackedList/PackedListI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,11 +107,7 @@ inline unsigned int Foam::PackedList<nBits>::readValue(Istream& is) if (val > max_value()) { - FatalIOErrorIn - ( - "PackedList<nBits>::readValue(Istream&)", - is - ) + FatalIOErrorInFunction(is) << "Out-of-range value " << val << " for PackedList<" << nBits << ">. Maximum permitted value is " << max_value() << "." << exit(FatalIOError); @@ -133,11 +129,7 @@ inline void Foam::PackedList<nBits>::setPair(Istream& is) if (val > max_value()) { - FatalIOErrorIn - ( - "PackedList<nBits>::setPair(Istream&)", - is - ) + FatalIOErrorInFunction(is) << "Out-of-range value " << val << " for PackedList<" << nBits << "> at index " << ind << ". Maximum permitted value is " << max_value() << "." @@ -1053,10 +1045,8 @@ inline unsigned int Foam::PackedList<nBits>::remove() { if (!size_) { - FatalErrorIn - ( - "Foam::PackedList<nBits>::remove()" - ) << "List is empty" << abort(FatalError); + FatalErrorInFunction + << "List is empty" << abort(FatalError); } label elemI = size_ - 1; diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrList.C b/src/OpenFOAM/containers/Lists/PtrList/PtrList.C index ab4eb844a44..db29382769a 100644 --- a/src/OpenFOAM/containers/Lists/PtrList/PtrList.C +++ b/src/OpenFOAM/containers/Lists/PtrList/PtrList.C @@ -143,7 +143,7 @@ void Foam::PtrList<T>::setSize(const label newSize) { if (newSize < 0) { - FatalErrorIn("PtrList<T>::setSize(const label)") + FatalErrorInFunction << "bad set size " << newSize << " for type " << typeid(T).name() << abort(FatalError); @@ -209,7 +209,7 @@ void Foam::PtrList<T>::reorder(const labelUList& oldToNew) { if (oldToNew.size() != size()) { - FatalErrorIn("PtrList<T>::reorder(const labelUList&)") + FatalErrorInFunction << "Size of map (" << oldToNew.size() << ") not equal to list size (" << size() << ") for type " << typeid(T).name() @@ -224,7 +224,7 @@ void Foam::PtrList<T>::reorder(const labelUList& oldToNew) if (newI < 0 || newI >= size()) { - FatalErrorIn("PtrList<T>::reorder(const labelUList&)") + FatalErrorInFunction << "Illegal index " << newI << nl << "Valid indices are 0.." << size()-1 << " for type " << typeid(T).name() @@ -233,7 +233,7 @@ void Foam::PtrList<T>::reorder(const labelUList& oldToNew) if (newPtrs_[newI]) { - FatalErrorIn("PtrList<T>::reorder(const labelUList&)") + FatalErrorInFunction << "reorder map is not unique; element " << newI << " already set for type " << typeid(T).name() << abort(FatalError); @@ -245,7 +245,7 @@ void Foam::PtrList<T>::reorder(const labelUList& oldToNew) { if (!newPtrs_[i]) { - FatalErrorIn("PtrList<T>::reorder(const labelUList&)") + FatalErrorInFunction << "Element " << i << " not set after reordering with type " << typeid(T).name() << nl << abort(FatalError); } @@ -262,7 +262,7 @@ Foam::PtrList<T>& Foam::PtrList<T>::operator=(const PtrList<T>& a) { if (this == &a) { - FatalErrorIn("PtrList<T>::operator=(const PtrList<T>&)") + FatalErrorInFunction << "attempted assignment to self for type " << typeid(T).name() << abort(FatalError); } @@ -285,7 +285,7 @@ Foam::PtrList<T>& Foam::PtrList<T>::operator=(const PtrList<T>& a) } else { - FatalErrorIn("PtrList::operator=(const PtrList<T>&)") + FatalErrorInFunction << "bad size: " << a.size() << " for type " << typeid(T).name() << abort(FatalError); diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H b/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H index a2970eb3614..c9065e8c46b 100644 --- a/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H +++ b/src/OpenFOAM/containers/Lists/PtrList/PtrListI.H @@ -155,7 +155,7 @@ inline const T& Foam::PtrList<T>::operator[](const label i) const { if (!ptrs_[i]) { - FatalErrorIn("PtrList::operator[] const") + FatalErrorInFunction << "hanging pointer of type " << typeid(T).name() << " at index " << i << " (size " << size() @@ -172,7 +172,7 @@ inline T& Foam::PtrList<T>::operator[](const label i) { if (!ptrs_[i]) { - FatalErrorIn("PtrList::operator[]") + FatalErrorInFunction << "hanging pointer of type " << typeid(T).name() << " at index " << i << " (size " << size() diff --git a/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListI.H b/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListI.H index 62276afd42d..c26efd9ac74 100644 --- a/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListI.H +++ b/src/OpenFOAM/containers/Lists/UIndirectList/UIndirectListI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -130,7 +130,7 @@ inline void Foam::UIndirectList<T>::operator=(const UList<T>& ae) { if (addressing_.size() != ae.size()) { - FatalErrorIn("UIndirectList<T>::operator=(const UList<T>&)") + FatalErrorInFunction << "Addressing and list of addressed elements " "have different sizes: " << addressing_.size() << " " << ae.size() @@ -149,7 +149,7 @@ inline void Foam::UIndirectList<T>::operator=(const UIndirectList<T>& ae) { if (addressing_.size() != ae.size()) { - FatalErrorIn("UIndirectList<T>::operator=(const UIndirectList<T>&)") + FatalErrorInFunction << "Addressing and list of addressed elements " "have different sizes: " << addressing_.size() << " " << ae.size() diff --git a/src/OpenFOAM/containers/Lists/UList/UList.C b/src/OpenFOAM/containers/Lists/UList/UList.C index c22f774f9f1..2bbe09038ac 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.C +++ b/src/OpenFOAM/containers/Lists/UList/UList.C @@ -38,7 +38,7 @@ void Foam::UList<T>::assign(const UList<T>& a) { if (a.size_ != this->size_) { - FatalErrorIn("UList<T>::assign(const UList<T>&)") + FatalErrorInFunction << "ULists have different sizes: " << this->size_ << " " << a.size_ << abort(FatalError); @@ -93,7 +93,7 @@ std::streamsize Foam::UList<T>::byteSize() const { if (!contiguous<T>()) { - FatalErrorIn("UList<T>::byteSize()") + FatalErrorInFunction << "Cannot return the binary size of a list of " "non-primitive elements" << abort(FatalError); diff --git a/src/OpenFOAM/containers/Lists/UList/UListI.H b/src/OpenFOAM/containers/Lists/UList/UListI.H index 815c9aafcdb..aaf526d636c 100644 --- a/src/OpenFOAM/containers/Lists/UList/UListI.H +++ b/src/OpenFOAM/containers/Lists/UList/UListI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,7 +74,7 @@ inline void Foam::UList<T>::checkStart(const label start) const { if (start<0 || (start && start>=size_)) { - FatalErrorIn("UList<T>::checkStart(const label)") + FatalErrorInFunction << "start " << start << " out of range 0 ... " << max(size_-1, 0) << abort(FatalError); } @@ -87,7 +87,7 @@ inline void Foam::UList<T>::checkSize(const label size) const { if (size<0 || size>size_) { - FatalErrorIn("UList<T>::checkSize(const label)") + FatalErrorInFunction << "size " << size << " out of range 0 ... " << size_ << abort(FatalError); } @@ -100,13 +100,13 @@ inline void Foam::UList<T>::checkIndex(const label i) const { if (!size_) { - FatalErrorIn("UList<T>::checkIndex(const label)") + FatalErrorInFunction << "attempt to access element from zero sized list" << abort(FatalError); } else if (i<0 || i>=size_) { - FatalErrorIn("UList<T>::checkIndex(const label)") + FatalErrorInFunction << "index " << i << " out of range 0 ... " << size_-1 << abort(FatalError); } diff --git a/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C b/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C index cc54117f8b9..139877c409e 100644 --- a/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C +++ b/src/OpenFOAM/containers/Lists/UPtrList/UPtrList.C @@ -104,7 +104,7 @@ void Foam::UPtrList<T>::reorder(const labelUList& oldToNew) { if (oldToNew.size() != size()) { - FatalErrorIn("UPtrList<T>::reorder(const labelUList&)") + FatalErrorInFunction << "Size of map (" << oldToNew.size() << ") not equal to list size (" << size() << ")." << abort(FatalError); @@ -118,7 +118,7 @@ void Foam::UPtrList<T>::reorder(const labelUList& oldToNew) if (newI < 0 || newI >= size()) { - FatalErrorIn("UPtrList<T>::reorder(const labelUList&)") + FatalErrorInFunction << "Illegal index " << newI << nl << "Valid indices are 0.." << size()-1 << abort(FatalError); @@ -126,7 +126,7 @@ void Foam::UPtrList<T>::reorder(const labelUList& oldToNew) if (newPtrs_[newI]) { - FatalErrorIn("UPtrList<T>::reorder(const labelUList&)") + FatalErrorInFunction << "reorder map is not unique; element " << newI << " already set." << abort(FatalError); } @@ -137,7 +137,7 @@ void Foam::UPtrList<T>::reorder(const labelUList& oldToNew) { if (!newPtrs_[i]) { - FatalErrorIn("UPtrList<T>::reorder(const labelUList&)") + FatalErrorInFunction << "Element " << i << " not set after reordering." << nl << abort(FatalError); } diff --git a/src/OpenFOAM/containers/Lists/UPtrList/UPtrListI.H b/src/OpenFOAM/containers/Lists/UPtrList/UPtrListI.H index 38bb4309314..2f69d169299 100644 --- a/src/OpenFOAM/containers/Lists/UPtrList/UPtrListI.H +++ b/src/OpenFOAM/containers/Lists/UPtrList/UPtrListI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -106,7 +106,7 @@ inline const T& Foam::UPtrList<T>::operator[](const label i) const { if (!ptrs_[i]) { - FatalErrorIn("UPtrList::operator[] const") + FatalErrorInFunction << "hanging pointer at index " << i << " (size " << size() << "), cannot dereference" @@ -122,7 +122,7 @@ inline T& Foam::UPtrList<T>::operator[](const label i) { if (!ptrs_[i]) { - FatalErrorIn("UPtrList::operator[]") + FatalErrorInFunction << "hanging pointer at index " << i << " (size " << size() << "), cannot dereference" diff --git a/src/OpenFOAM/containers/NamedEnum/NamedEnum.C b/src/OpenFOAM/containers/NamedEnum/NamedEnum.C index 825ef0d6c87..ba5bd4999dc 100644 --- a/src/OpenFOAM/containers/NamedEnum/NamedEnum.C +++ b/src/OpenFOAM/containers/NamedEnum/NamedEnum.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ Foam::NamedEnum<Enum, nEnum>::NamedEnum() goodNames[i] = names[i]; } - FatalErrorIn("NamedEnum<Enum, nEnum>::NamedEnum()") + FatalErrorInFunction << "Illegal enumeration name at position " << enumI << endl << "after entries " << goodNames << ".\n" << "Possibly your NamedEnum<Enum, nEnum>::names array" @@ -66,10 +66,8 @@ Enum Foam::NamedEnum<Enum, nEnum>::read(Istream& is) const if (iter == HashTable<int>::end()) { - FatalIOErrorIn - ( - "NamedEnum<Enum, nEnum>::read(Istream&) const", is - ) << name << " is not in enumeration: " + FatalIOErrorInFunction(is) + << name << " is not in enumeration: " << sortedToc() << exit(FatalIOError); } diff --git a/src/OpenFOAM/db/IOobject/IOobject.C b/src/OpenFOAM/db/IOobject/IOobject.C index 090aea0a017..7f4c315da4d 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.C +++ b/src/OpenFOAM/db/IOobject/IOobject.C @@ -52,16 +52,8 @@ bool Foam::IOobject::fileNameComponents // called with directory if (isDir(path)) { - WarningIn - ( - "IOobject::fileNameComponents" - "(" - "const fileName&, " - "fileName&, " - "fileName&, " - "word&" - ")" - ) << " called with directory: " << path << endl; + WarningInFunction + << " called with directory: " << path << endl; return false; } @@ -105,16 +97,7 @@ bool Foam::IOobject::fileNameComponents // Check for valid (and stripped) name, regardless of the debug level if (name.empty() || string::stripInvalid<word>(name)) { - WarningIn - ( - "IOobject::fileNameComponents" - "(" - "const fileName&, " - "fileName&, " - "fileName&, " - "word&" - ")" - ) + WarningInFunction << "has invalid word for name: \"" << name << "\"\nwhile processing path: " << path << endl; @@ -210,17 +193,7 @@ Foam::IOobject::IOobject { if (!fileNameComponents(path, instance_, local_, name_)) { - FatalErrorIn - ( - "IOobject::IOobject" - "(" - "const fileName&, " - "const objectRegistry&, " - "readOption, " - "writeOption, " - "bool" - ")" - ) + FatalErrorInFunction << " invalid path specification" << exit(FatalError); } @@ -447,7 +420,7 @@ bool Foam::IOobject::headerOk() { if (objectRegistry::debug) { - IOWarningIn("IOobject::headerOk()", (*isPtr)) + IOWarningInFunction((*isPtr)) << "failed to read header of file " << objectPath() << endl; } @@ -466,7 +439,7 @@ void Foam::IOobject::setBad(const string& s) { if (objState_ != GOOD) { - FatalErrorIn("IOobject::setBad(const string&)") + FatalErrorInFunction << "recurrent failure for object " << s << exit(FatalError); } diff --git a/src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C b/src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C index 651684f4370..a002e62b2b6 100644 --- a/src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C +++ b/src/OpenFOAM/db/IOobjects/IOPtrList/IOPtrList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,7 +76,7 @@ Foam::IOPtrList<T>::IOPtrList(const IOobject& io, const label s) { if (io.readOpt() != IOobject::NO_READ) { - FatalErrorIn("IOPtrList<T>::IOPtrList(const IOobject&, const label)") + FatalErrorInFunction << "NO_READ must be set if specifying size" << nl << exit(FatalError); } diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C b/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C index 3c62255d97a..cb78b012891 100644 --- a/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C +++ b/src/OpenFOAM/db/IOstreams/Fstreams/IFstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -138,7 +138,7 @@ std::istream& Foam::IFstream::stdStream() { if (!ifPtr_) { - FatalErrorIn("IFstream::stdStream()") + FatalErrorInFunction << "No stream allocated" << abort(FatalError); } return *ifPtr_; @@ -149,7 +149,7 @@ const std::istream& Foam::IFstream::stdStream() const { if (!ifPtr_) { - FatalErrorIn("IFstream::stdStream() const") + FatalErrorInFunction << "No stream allocated" << abort(FatalError); } return *ifPtr_; @@ -178,7 +178,7 @@ Foam::IFstream& Foam::IFstream::operator()() const } else { - FatalIOErrorIn("IFstream::operator()", *this) + FatalIOErrorInFunction(*this) << "file " << pathname_ << " does not exist" << exit(FatalIOError); } diff --git a/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C b/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C index 1a09b7f4739..5e9734d9156 100644 --- a/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C +++ b/src/OpenFOAM/db/IOstreams/Fstreams/OFstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,7 +134,7 @@ std::ostream& Foam::OFstream::stdStream() { if (!ofPtr_) { - FatalErrorIn("OFstream::stdStream()") + FatalErrorInFunction << "No stream allocated." << abort(FatalError); } return *ofPtr_; @@ -145,7 +145,7 @@ const std::ostream& Foam::OFstream::stdStream() const { if (!ofPtr_) { - FatalErrorIn("OFstreamAllocator::stdStream() const") + FatalErrorInFunction << "No stream allocated." << abort(FatalError); } return *ofPtr_; diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C index dfb60891d6c..f6ab958e7c1 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/PstreamBuffers.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,7 +66,7 @@ Foam::PstreamBuffers::~PstreamBuffers() { if (recvBufPos_[procI] < recvBuf_[procI].size()) { - FatalErrorIn("PstreamBuffers::~PstreamBuffers()") + FatalErrorInFunction << "Message from processor " << procI << " not fully consumed. messageSize:" << recvBuf_[procI].size() << " bytes of which only " << recvBufPos_[procI] @@ -117,10 +117,8 @@ void Foam::PstreamBuffers::finishedSends(labelListList& sizes, const bool block) } else { - FatalErrorIn - ( - "PstreamBuffers::finishedSends(labelListList&, const bool)" - ) << "Obtaining sizes not supported in " + FatalErrorInFunction + << "Obtaining sizes not supported in " << UPstream::commsTypeNames[commsType_] << endl << " since transfers already in progress. Use non-blocking instead." << exit(FatalError); diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C index cd3fc4610f7..5707d2d5c96 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C @@ -317,7 +317,7 @@ Foam::Istream& Foam::UIPstream::read(char* data, std::streamsize count) { if (format() != BINARY) { - FatalErrorIn("UIPstream::read(char*, std::streamsize)") + FatalErrorInFunction << "stream format not binary" << Foam::abort(FatalError); } diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C index e0aaf02bcba..0671d69eca1 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C @@ -144,7 +144,7 @@ Foam::UOPstream::~UOPstream() ) ) { - FatalErrorIn("UOPstream::~UOPstream()") + FatalErrorInFunction << "Failed sending outgoing message of size " << sendBuf_.size() << " to processor " << toProcNo_ << Foam::abort(FatalError); @@ -290,7 +290,7 @@ Foam::Ostream& Foam::UOPstream::write(const char* data, std::streamsize count) { if (format() != BINARY) { - FatalErrorIn("Ostream::write(const char*, std::streamsize)") + FatalErrorInFunction << "stream format not binary" << Foam::abort(FatalError); } diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C index a721eb2a055..7249823d02e 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C @@ -65,7 +65,7 @@ void Foam::UPstream::setParRun(const label nProcs) label comm = allocateCommunicator(-1, identity(nProcs), true); if (comm != UPstream::worldComm) { - FatalErrorIn("UPstream::setParRun(const label)") + FatalErrorInFunction << "problem : comm:" << comm << " UPstream::worldComm:" << UPstream::worldComm << Foam::exit(FatalError); @@ -269,11 +269,8 @@ Foam::label Foam::UPstream::allocateCommunicator // Enforce incremental order (so index is rank in next communicator) if (i >= 1 && subRanks[i] <= subRanks[i-1]) { - FatalErrorIn - ( - "UPstream::allocateCommunicator" - "(const label, const labelList&, const bool)" - ) << "subranks not sorted : " << subRanks + FatalErrorInFunction + << "subranks not sorted : " << subRanks << " when allocating subcommunicator from parent " << parentIndex << Foam::abort(FatalError); diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstreamCommsStruct.C b/src/OpenFOAM/db/IOstreams/Pstreams/UPstreamCommsStruct.C index b2686ef947a..e5412a4ae7b 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstreamCommsStruct.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstreamCommsStruct.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,7 +83,7 @@ Foam::UPstream::commsStruct::commsStruct } if (notI != allNotBelow_.size()) { - FatalErrorIn("commsStruct") << "problem!" << Foam::abort(FatalError); + FatalErrorInFunction << "problem!" << Foam::abort(FatalError); } } diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/exchange.C b/src/OpenFOAM/db/IOstreams/Pstreams/exchange.C index ddc39244f6f..a3aff129811 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/exchange.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/exchange.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,18 +46,14 @@ void Foam::Pstream::exchange { if (!contiguous<T>()) { - FatalErrorIn - ( - "Pstream::exchange(..)" - ) << "Continuous data only." << sizeof(T) << Foam::abort(FatalError); + FatalErrorInFunction + << "Continuous data only." << sizeof(T) << Foam::abort(FatalError); } if (sendBufs.size() != UPstream::nProcs(comm)) { - FatalErrorIn - ( - "Pstream::exchange(..)" - ) << "Size of list:" << sendBufs.size() + FatalErrorInFunction + << "Size of list:" << sendBufs.size() << " does not equal the number of processors:" << UPstream::nProcs(comm) << Foam::abort(FatalError); @@ -123,7 +119,7 @@ void Foam::Pstream::exchange ) ) { - FatalErrorIn("Pstream::exchange(..)") + FatalErrorInFunction << "Cannot send outgoing message. " << "to:" << procI << " nBytes:" << label(sendBufs[procI].size()*sizeof(T)) diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/gatherScatterList.C b/src/OpenFOAM/db/IOstreams/Pstreams/gatherScatterList.C index 3b3133b4951..a016eee530f 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/gatherScatterList.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/gatherScatterList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,11 +57,8 @@ void Pstream::gatherList { if (Values.size() != UPstream::nProcs(comm)) { - FatalErrorIn - ( - "UPstream::gatherList(const List<UPstream::commsStruct>&" - ", List<T>)" - ) << "Size of list:" << Values.size() + FatalErrorInFunction + << "Size of list:" << Values.size() << " does not equal the number of processors:" << UPstream::nProcs(comm) << Foam::abort(FatalError); @@ -216,11 +213,8 @@ void Pstream::scatterList { if (Values.size() != UPstream::nProcs(comm)) { - FatalErrorIn - ( - "UPstream::scatterList(const List<UPstream::commsStruct>&" - ", List<T>)" - ) << "Size of list:" << Values.size() + FatalErrorInFunction + << "Size of list:" << Values.size() << " does not equal the number of processors:" << UPstream::nProcs(comm) << Foam::abort(FatalError); diff --git a/src/OpenFOAM/db/Time/findInstance.C b/src/OpenFOAM/db/Time/findInstance.C index 556de4c98b5..e12b9beca2f 100644 --- a/src/OpenFOAM/db/Time/findInstance.C +++ b/src/OpenFOAM/db/Time/findInstance.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,24 +134,16 @@ Foam::word Foam::Time::findInstance { if (name.empty()) { - FatalErrorIn - ( - "Time::findInstance" - "(const fileName&, const word&" - ", const IOobject::readOption, const word&)" - ) << "Cannot find directory " + FatalErrorInFunction + << "Cannot find directory " << dir << " in times " << timeName() << " down to " << stopInstance << exit(FatalError); } else { - FatalErrorIn - ( - "Time::findInstance" - "(const fileName&, const word&" - ", const IOobject::readOption, const word&)" - ) << "Cannot find file \"" << name << "\" in directory " + FatalErrorInFunction + << "Cannot find file \"" << name << "\" in directory " << dir << " in times " << timeName() << " down to " << stopInstance << exit(FatalError); @@ -195,12 +187,8 @@ Foam::word Foam::Time::findInstance if (rOpt == IOobject::MUST_READ || rOpt == IOobject::MUST_READ_IF_MODIFIED) { - FatalErrorIn - ( - "Time::findInstance" - "(const fileName&, const word&" - ", const IOobject::readOption, const word&)" - ) << "Cannot find file \"" << name << "\" in directory " + FatalErrorInFunction + << "Cannot find file \"" << name << "\" in directory " << dir << " in times " << timeName() << " down to " << constant() << exit(FatalError); diff --git a/src/OpenFOAM/db/dictionary/entry/entry.C b/src/OpenFOAM/db/dictionary/entry/entry.C index 5c12f922317..991a51f1a10 100644 --- a/src/OpenFOAM/db/dictionary/entry/entry.C +++ b/src/OpenFOAM/db/dictionary/entry/entry.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,7 +64,7 @@ void Foam::entry::operator=(const entry& e) // check for assignment to self if (this == &e) { - FatalErrorIn("entry::operator=(const entry&)") + FatalErrorInFunction << "attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C index a5378601e75..a758de39a4c 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.C @@ -76,11 +76,8 @@ bool Foam::functionEntry::execute if (mfIter == executedictionaryIstreamMemberFunctionTablePtr_->end()) { - FatalErrorIn - ( - "functionEntry::execute" - "(const word& functionName, dictionary& parentDict, Istream&)" - ) << "Unknown functionEntry '" << functionName + FatalErrorInFunction + << "Unknown functionEntry '" << functionName << "' in " << is.name() << " near line " << is.lineNumber() << nl << nl << "Valid functionEntries are :" << endl @@ -122,11 +119,8 @@ bool Foam::functionEntry::execute if (mfIter == executeprimitiveEntryIstreamMemberFunctionTablePtr_->end()) { - FatalErrorIn - ( - "functionEntry::execute" - "(const word&, const dictionary&, primitiveEntry&, Istream&)" - ) << "Unknown functionEntry '" << functionName + FatalErrorInFunction + << "Unknown functionEntry '" << functionName << "' in " << is.name() << " near line " << is.lineNumber() << nl << nl << "Valid functionEntries are :" << endl diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C index d605ddc0010..5e4d15eb089 100644 --- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C +++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -88,10 +88,8 @@ bool Foam::primitiveEntry::expandVariable if (envStr.empty()) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "primitiveEntry::expandVariable" - "(const string&, const dictionary&", dict ) << "Illegal dictionary entry or environment variable name " << varName << endl << "Valid dictionary entries are " @@ -188,7 +186,7 @@ Foam::ITstream& Foam::primitiveEntry::stream() const const Foam::dictionary& Foam::primitiveEntry::dict() const { - FatalErrorIn("const dictionary& primitiveEntry::dict() const") + FatalErrorInFunction << "Attempt to return primitive entry " << info() << " as a sub-dictionary" << abort(FatalError); @@ -199,7 +197,7 @@ const Foam::dictionary& Foam::primitiveEntry::dict() const Foam::dictionary& Foam::primitiveEntry::dict() { - FatalErrorIn("const dictionary& primitiveEntry::dict()") + FatalErrorInFunction << "Attempt to return primitive entry " << info() << " as a sub-dictionary" << abort(FatalError); diff --git a/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCode.C b/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCode.C index 2f975771b89..04932fceea3 100644 --- a/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCode.C +++ b/src/OpenFOAM/db/dynamicLibrary/dynamicCode/dynamicCode.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,11 +61,8 @@ void Foam::dynamicCode::checkSecurity { if (isAdministrator()) { - FatalIOErrorIn - ( - title, - dict - ) << "This code should not be executed by someone with administrator" + FatalIOErrorInFunction(dict) + << "This code should not be executed by someone with administrator" << " rights due to security reasons." << nl << "(it writes a shared library which then gets loaded " << "using dlopen)" @@ -74,11 +71,8 @@ void Foam::dynamicCode::checkSecurity if (!allowSystemOperations) { - FatalIOErrorIn - ( - title, - dict - ) << "Loading a shared library using case-supplied code is not" + FatalIOErrorInFunction(dict) + << "Loading a shared library using case-supplied code is not" << " enabled by default" << nl << "because of security issues. If you trust the code you can" << " enable this" << nl @@ -115,21 +109,15 @@ void Foam::dynamicCode::copyAndFilter { if (!is.good()) { - FatalErrorIn - ( - "dynamicCode::copyAndFilter()" - " const" - ) << "Failed opening for reading " << is.name() + FatalErrorInFunction + << "Failed opening for reading " << is.name() << exit(FatalError); } if (!os.good()) { - FatalErrorIn - ( - "dynamicCode::copyAndFilter()" - " const" - ) << "Failed writing " << os.name() + FatalErrorInFunction + << "Failed writing " << os.name() << exit(FatalError); } @@ -226,11 +214,8 @@ bool Foam::dynamicCode::createMakeFiles() const //Info<< "Writing to " << dstFile << endl; if (!os.good()) { - FatalErrorIn - ( - "dynamicCode::createMakeFiles()" - " const" - ) << "Failed writing " << dstFile + FatalErrorInFunction + << "Failed writing " << dstFile << exit(FatalError); } @@ -266,11 +251,8 @@ bool Foam::dynamicCode::createMakeOptions() const //Info<< "Writing to " << dstFile << endl; if (!os.good()) { - FatalErrorIn - ( - "dynamicCode::createMakeOptions()" - " const" - ) << "Failed writing " << dstFile + FatalErrorInFunction + << "Failed writing " << dstFile << exit(FatalError); } @@ -432,10 +414,8 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const if (!badFiles.empty()) { - FatalErrorIn - ( - "dynamicCode::copyFilesContents(..)" - ) << "Could not find the code template(s): " + FatalErrorInFunction + << "Could not find the code template(s): " << badFiles << nl << "Under the $" << codeTemplateEnvName << " directory or via via the ~OpenFOAM/" @@ -461,11 +441,8 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const //Info<< "Reading from " << is.name() << endl; if (!is.good()) { - FatalErrorIn - ( - "dynamicCode::copyFilesContents(const fileName&)" - " const" - ) << "Failed opening " << srcFile + FatalErrorInFunction + << "Failed opening " << srcFile << exit(FatalError); } @@ -473,11 +450,8 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const //Info<< "Writing to " << dstFile.name() << endl; if (!os.good()) { - FatalErrorIn - ( - "dynamicCode::copyFilesContents(const fileName&)" - " const" - ) << "Failed writing " << dstFile + FatalErrorInFunction + << "Failed writing " << dstFile << exit(FatalError); } @@ -499,11 +473,8 @@ bool Foam::dynamicCode::copyOrCreateFiles(const bool verbose) const //Info<< "Writing to " << createFiles_[fileI].first() << endl; if (!os.good()) { - FatalErrorIn - ( - "dynamicCode::copyOrCreateFiles()" - " const" - ) << "Failed writing " << dstFile + FatalErrorInFunction + << "Failed writing " << dstFile << exit(FatalError); } os.writeQuoted(createFiles_[fileI].second(), false) << nl; diff --git a/src/OpenFOAM/db/error/CocoParserErrors.H b/src/OpenFOAM/db/error/CocoParserErrors.H index 7f41672075f..d693f4efdee 100644 --- a/src/OpenFOAM/db/error/CocoParserErrors.H +++ b/src/OpenFOAM/db/error/CocoParserErrors.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,14 +91,14 @@ public: //- Handle a general warning 'msg' virtual void Warning(const StringClass& msg) { - WarningIn(name_) + WarningInFunction << msg << endl; } //- Handle a general warning 'msg' virtual void Warning(int line, int col, const StringClass& msg) { - WarningIn(name_) + WarningInFunction <<"line " << line << " col " << col << ": " << msg << endl; } @@ -106,7 +106,7 @@ public: //- Handle general error 'msg' (eg, a semantic error) virtual void Error(int line, int col, const StringClass& msg) { - FatalErrorIn(name_) + FatalErrorInFunction << "line " << line << " col " << col <<": " << msg << endl << exit(FatalError); } @@ -114,7 +114,7 @@ public: //- Handle general error 'msg' (eg, a semantic error) virtual void Error(const StringClass& msg) { - FatalErrorIn(name_) + FatalErrorInFunction << msg << endl << exit(FatalError); } diff --git a/src/OpenFOAM/db/error/messageStream.C b/src/OpenFOAM/db/error/messageStream.C index 3f738e42809..90d196ac6ef 100644 --- a/src/OpenFOAM/db/error/messageStream.C +++ b/src/OpenFOAM/db/error/messageStream.C @@ -217,7 +217,7 @@ Foam::messageStream::operator Foam::OSstream&() if (errorCount_ >= maxErrors_) { - FatalErrorIn("messageStream::operator OSstream&()") + FatalErrorInFunction << "Too many errors" << abort(FatalError); } diff --git a/src/OpenFOAM/db/error/messageStream.H b/src/OpenFOAM/db/error/messageStream.H index b3e42f1ca85..c16e811d480 100644 --- a/src/OpenFOAM/db/error/messageStream.H +++ b/src/OpenFOAM/db/error/messageStream.H @@ -230,19 +230,19 @@ extern messageStream Info; //- Report an error message using Foam::SeriousError // for functionName in file __FILE__ at line __LINE__ -#define SeriousErrorIn(fn) \ - ::Foam::SeriousError((fn), __FILE__, __LINE__) +#define SeriousErrorIn(functionName) \ + ::Foam::SeriousError((functionName), __FILE__, __LINE__) //- Report an error message using Foam::SeriousError // for FUNCTION_NAME in file __FILE__ at line __LINE__ -#define SeriousErrorInFunction(fn) SeriousErrorIn(FUNCTION_NAME) +#define SeriousErrorInFunction SeriousErrorIn(FUNCTION_NAME) //- Report an IO error message using Foam::SeriousError // for functionName in file __FILE__ at line __LINE__ // for a particular IOstream -#define SeriousIOErrorIn(fn, ios) \ - ::Foam::SeriousError((fn), __FILE__, __LINE__, ios) +#define SeriousIOErrorIn(functionName, ios) \ + ::Foam::SeriousError((functionName), __FILE__, __LINE__, ios) //- Report an IO error message using Foam::SeriousError // for FUNCTION_NAME in file __FILE__ at line __LINE__ @@ -252,8 +252,8 @@ extern messageStream Info; //- Report a warning using Foam::Warning // for functionName in file __FILE__ at line __LINE__ -#define WarningIn(fn) \ - ::Foam::Warning((fn), __FILE__, __LINE__) +#define WarningIn(functionName) \ + ::Foam::Warning((functionName), __FILE__, __LINE__) //- Report a warning using Foam::Warning // for FUNCTION_NAME in file __FILE__ at line __LINE__ @@ -263,8 +263,8 @@ extern messageStream Info; //- Report an IO warning using Foam::Warning // for functionName in file __FILE__ at line __LINE__ // for a particular IOstream -#define IOWarningIn(fn, ios) \ - ::Foam::Warning((fn), __FILE__, __LINE__, (ios)) +#define IOWarningIn(functionName, ios) \ + ::Foam::Warning((functionName), __FILE__, __LINE__, (ios)) //- Report an IO warning using Foam::Warning // for FUNCTION_NAME in file __FILE__ at line __LINE__ @@ -274,8 +274,8 @@ extern messageStream Info; //- Report a information message using Foam::Info // for functionName in file __FILE__ at line __LINE__ -#define InfoIn(fn) \ - ::Foam::Info((fn), __FILE__, __LINE__) +#define InfoIn(functionName) \ + ::Foam::Info((functionName), __FILE__, __LINE__) //- Report a information message using Foam::Info // for FUNCTION_NAME in file __FILE__ at line __LINE__ @@ -285,8 +285,8 @@ extern messageStream Info; //- Report an IO information message using Foam::Info // for functionName in file __FILE__ at line __LINE__ // for a particular IOstream -#define IOInfoIn(fn, ios) \ - ::Foam::Info((fn), __FILE__, __LINE__, (ios)) +#define IOInfoIn(functionName, ios) \ + ::Foam::Info((functionName), __FILE__, __LINE__, (ios)) //- Report an IO information message using Foam::Info // for FUNCTION_NAME in file __FILE__ at line __LINE__ diff --git a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C index 2cb5bd0cd19..b6a2a8b192a 100644 --- a/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C +++ b/src/OpenFOAM/db/functionObjects/functionObject/functionObject.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,11 +70,8 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New if (!dictionaryConstructorTablePtr_) { - FatalErrorIn - ( - "functionObject::New" - "(const word& name, const Time&, const dictionary&)" - ) << "Unknown function type " + FatalErrorInFunction + << "Unknown function type " << functionType << nl << nl << "Table of functionObjects is empty" << endl << exit(FatalError); @@ -85,11 +82,8 @@ Foam::autoPtr<Foam::functionObject> Foam::functionObject::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn - ( - "functionObject::New" - "(const word& name, const Time&, const dictionary&)" - ) << "Unknown function type " + FatalErrorInFunction + << "Unknown function type " << functionType << nl << nl << "Valid functions are : " << nl << dictionaryConstructorTablePtr_->sortedToc() << endl diff --git a/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C b/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C index 847747964d6..d7806ab7532 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectFile/functionObjectFile.C @@ -240,21 +240,21 @@ Foam::OFstream& Foam::functionObjectFile::file() { if (!Pstream::master()) { - FatalErrorIn("Foam::OFstream& Foam::functionObjectFile::file()") + FatalErrorInFunction << "Request for file() can only be done by the master process" << abort(FatalError); } if (filePtrs_.size() != 1) { - WarningIn("Foam::Ostream& Foam::functionObjectFile::file()") + WarningInFunction << "Requested single file, but multiple files are present" << endl; } if (!filePtrs_.set(0)) { - FatalErrorIn("Foam::OFstream& Foam::functionObjectFile::file()") + FatalErrorInFunction << "File pointer at index " << 0 << " not allocated" << abort(FatalError); } @@ -267,7 +267,7 @@ Foam::PtrList<Foam::OFstream>& Foam::functionObjectFile::files() { if (!Pstream::master()) { - FatalErrorIn("Foam::OFstream& Foam::functionObjectFile::files()") + FatalErrorInFunction << "Request for files() can only be done by the master process" << abort(FatalError); } @@ -280,17 +280,14 @@ Foam::OFstream& Foam::functionObjectFile::file(const label i) { if (!Pstream::master()) { - FatalErrorIn - ( - "Foam::OFstream& Foam::functionObjectFile::file(const label)" - ) + FatalErrorInFunction << "Request for file(i) can only be done by the master process" << abort(FatalError); } if (!filePtrs_.set(i)) { - FatalErrorIn("Foam::OFstream& Foam::functionObjectFile::file()") + FatalErrorInFunction << "File pointer at index " << i << " not allocated" << abort(FatalError); } diff --git a/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C index 5ddb9d564ba..aca9841ebcc 100644 --- a/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C +++ b/src/OpenFOAM/db/functionObjects/outputFilterOutputControl/outputFilterOutputControl.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -204,7 +204,7 @@ bool Foam::outputFilterOutputControl::output() default: { // this error should not actually be possible - FatalErrorIn("bool Foam::outputFilterOutputControl::output()") + FatalErrorInFunction << "Undefined output control: " << outputControlNames_[outputControl_] << nl << abort(FatalError); diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C b/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C index 4123c643ad1..0c26009482e 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C +++ b/src/OpenFOAM/db/objectRegistry/objectRegistryTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -175,10 +175,8 @@ const Type& Foam::objectRegistry::lookupObject(const word& name) const return *vpsiPtr_; } - FatalErrorIn - ( - "objectRegistry::lookupObject<Type>(const word&) const" - ) << nl + FatalErrorInFunction + << nl << " lookup of " << name << " from objectRegistry " << this->name() << " successful\n but it is not a " << Type::typeName @@ -192,10 +190,8 @@ const Type& Foam::objectRegistry::lookupObject(const word& name) const return parent_.lookupObject<Type>(name); } - FatalErrorIn - ( - "objectRegistry::lookupObject<Type>(const word&) const" - ) << nl + FatalErrorInFunction + << nl << " request for " << Type::typeName << " " << name << " from objectRegistry " << this->name() << " failed\n available objects of type " << Type::typeName diff --git a/src/OpenFOAM/db/regIOobject/regIOobject.C b/src/OpenFOAM/db/regIOobject/regIOobject.C index 3a14d5968ec..c3f86da318f 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobject.C +++ b/src/OpenFOAM/db/regIOobject/regIOobject.C @@ -261,7 +261,7 @@ bool Foam::regIOobject::checkIn() { if (watchIndex_ != -1) { - FatalErrorIn("regIOobject::checkIn()") + FatalErrorInFunction << "Object " << objectPath() << " already watched with index " << watchIndex_ << abort(FatalError); @@ -285,7 +285,7 @@ bool Foam::regIOobject::checkIn() { // for ease of finding where attempted duplicate check-in // originated - FatalErrorIn("regIOobject::checkIn()") + FatalErrorInFunction << "failed to register object " << objectPath() << " the name already exists in the objectRegistry" << endl << "Contents:" << db().sortedToc() @@ -293,7 +293,7 @@ bool Foam::regIOobject::checkIn() } else { - WarningIn("regIOobject::checkIn()") + WarningInFunction << "failed to register object " << objectPath() << " the name already exists in the objectRegistry" << endl; diff --git a/src/OpenFOAM/db/regIOobject/regIOobjectI.H b/src/OpenFOAM/db/regIOobject/regIOobjectI.H index 2808763aeb0..ced5ee48657 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobjectI.H +++ b/src/OpenFOAM/db/regIOobject/regIOobjectI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,7 @@ inline Type& Foam::regIOobject::store(Type* tPtr) { if (!tPtr) { - FatalErrorIn("Type& regIOobject::store(Type*)") + FatalErrorInFunction << "object deallocated" << abort(FatalError); } @@ -60,10 +60,8 @@ inline Type& Foam::regIOobject::store(autoPtr<Type>& atPtr) if (!tPtr) { - FatalErrorIn - ( - "Type& regIOobject::store(autoPtr<Type>&)" - ) << "object deallocated" + FatalErrorInFunction + << "object deallocated" << abort(FatalError); } diff --git a/src/OpenFOAM/db/regIOobject/regIOobjectRead.C b/src/OpenFOAM/db/regIOobject/regIOobjectRead.C index bc950e518f2..10ec6269747 100644 --- a/src/OpenFOAM/db/regIOobject/regIOobjectRead.C +++ b/src/OpenFOAM/db/regIOobject/regIOobjectRead.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ Foam::Istream& Foam::regIOobject::readStream() if (readOpt() == NO_READ) { - FatalErrorIn("regIOobject::readStream()") + FatalErrorInFunction << "NO_READ specified for read-constructor of object " << name() << " of class " << headerClassName() << abort(FatalError); @@ -92,7 +92,7 @@ Foam::Istream& Foam::regIOobject::readStream() } else if (!readHeader(*isPtr_)) { - FatalIOErrorIn("regIOobject::readStream()", *isPtr_) + FatalIOErrorInFunction(*isPtr_) << "problem while reading header for object " << name() << exit(FatalIOError); } @@ -133,7 +133,7 @@ Foam::Istream& Foam::regIOobject::readStream(const word& expectName) && headerClassName() != "dictionary" ) { - FatalIOErrorIn("regIOobject::readStream(const word&)", *isPtr_) + FatalIOErrorInFunction(*isPtr_) << "unexpected class name " << headerClassName() << " expected " << expectName << endl << " while reading object " << name() diff --git a/src/OpenFOAM/db/typeInfo/typeInfo.H b/src/OpenFOAM/db/typeInfo/typeInfo.H index 00981e36057..bd437b4d799 100644 --- a/src/OpenFOAM/db/typeInfo/typeInfo.H +++ b/src/OpenFOAM/db/typeInfo/typeInfo.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -90,7 +90,7 @@ inline To& dynamicCast(From& r) } catch (std::bad_cast) { - FatalErrorIn("dynamicCast<To>(From&)") + FatalErrorInFunction << "Attempt to cast type " << typeid(r).name() << " to type " << typeid(To).name() << abort(FatalError); @@ -111,7 +111,7 @@ inline To& refCast(From& r) } catch (std::bad_cast) { - FatalErrorIn("refCast<To>(From&)") + FatalErrorInFunction << "Attempt to cast type " << r.type() << " to type " << To::typeName << abort(FatalError); diff --git a/src/OpenFOAM/dimensionSet/dimensionSet.C b/src/OpenFOAM/dimensionSet/dimensionSet.C index c289689ce97..11279746aa2 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSet.C +++ b/src/OpenFOAM/dimensionSet/dimensionSet.C @@ -168,7 +168,7 @@ bool Foam::dimensionSet::operator=(const dimensionSet& ds) const { if (dimensionSet::debug && *this != ds) { - FatalErrorIn("dimensionSet::operator=(const dimensionSet&) const") + FatalErrorInFunction << "Different dimensions for =" << endl << " dimensions : " << *this << " = " << ds << endl << abort(FatalError); @@ -182,7 +182,7 @@ bool Foam::dimensionSet::operator+=(const dimensionSet& ds) const { if (dimensionSet::debug && *this != ds) { - FatalErrorIn("dimensionSet::operator+=(const dimensionSet&) const") + FatalErrorInFunction << "Different dimensions for +=" << endl << " dimensions : " << *this << " = " << ds << endl << abort(FatalError); @@ -196,7 +196,7 @@ bool Foam::dimensionSet::operator-=(const dimensionSet& ds) const { if (dimensionSet::debug && *this != ds) { - FatalErrorIn("dimensionSet::operator-=(const dimensionSet&) const") + FatalErrorInFunction << "Different dimensions for -=" << endl << " dimensions : " << *this << " = " << ds << endl << abort(FatalError); @@ -228,7 +228,7 @@ Foam::dimensionSet Foam::max(const dimensionSet& ds1, const dimensionSet& ds2) { if (dimensionSet::debug && ds1 != ds2) { - FatalErrorIn("max(const dimensionSet&, const dimensionSet&)") + FatalErrorInFunction << "Arguments of max have different dimensions" << endl << " dimensions : " << ds1 << " and " << ds2 << endl << abort(FatalError); @@ -242,7 +242,7 @@ Foam::dimensionSet Foam::min(const dimensionSet& ds1, const dimensionSet& ds2) { if (dimensionSet::debug && ds1 != ds2) { - FatalErrorIn("min(const dimensionSet&, const dimensionSet&)") + FatalErrorInFunction << "Arguments of min have different dimensions" << endl << " dimensions : " << ds1 << " and " << ds2 << endl << abort(FatalError); @@ -297,7 +297,7 @@ Foam::dimensionSet Foam::pow { if (dimensionSet::debug && !dS.dimensions().dimensionless()) { - FatalErrorIn("pow(const dimensionSet&, const dimensionedScalar&)") + FatalErrorInFunction << "Exponent of pow is not dimensionless" << abort(FatalError); } @@ -330,7 +330,7 @@ Foam::dimensionSet Foam::pow && !ds.dimensionless() ) { - FatalErrorIn("pow(const dimensionedScalar&, const dimensionSet&)") + FatalErrorInFunction << "Argument or exponent of pow not dimensionless" << endl << abort(FatalError); } @@ -439,7 +439,7 @@ Foam::dimensionSet Foam::trans(const dimensionSet& ds) { if (dimensionSet::debug && !ds.dimensionless()) { - FatalErrorIn("trans(const dimensionSet&)") + FatalErrorInFunction << "Argument of trancendental function not dimensionless" << abort(FatalError); } @@ -452,7 +452,7 @@ Foam::dimensionSet Foam::atan2(const dimensionSet& ds1, const dimensionSet& ds2) { if (dimensionSet::debug && ds1 != ds2) { - FatalErrorIn("atan2(const dimensionSet&, const dimensionSet&)") + FatalErrorInFunction << "Arguments of atan2 have different dimensions" << endl << " dimensions : " << ds1 << " and " << ds2 << endl << abort(FatalError); @@ -486,8 +486,7 @@ Foam::dimensionSet Foam::operator+ if (dimensionSet::debug && ds1 != ds2) { - FatalErrorIn - ("operator+(const dimensionSet&, const dimensionSet&)") + FatalErrorInFunction << "LHS and RHS of + have different dimensions" << endl << " dimensions : " << ds1 << " + " << ds2 << endl << abort(FatalError); @@ -507,8 +506,7 @@ Foam::dimensionSet Foam::operator- if (dimensionSet::debug && ds1 != ds2) { - FatalErrorIn - ("operator-(const dimensionSet&, const dimensionSet&)") + FatalErrorInFunction << "LHS and RHS of - have different dimensions" << endl << " dimensions : " << ds1 << " - " << ds2 << endl << abort(FatalError); diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.C b/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.C index fee971a8e85..57d9e6c450b 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.C +++ b/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.C @@ -236,7 +236,7 @@ dimensionedScalar func(const dimensionedScalar& ds) \ { \ if (!ds.dimensions().dimensionless()) \ { \ - FatalErrorIn(#func "(const dimensionedScalar& ds)") \ + FatalErrorInFunction \ << "ds not dimensionless" \ << abort(FatalError); \ } \ @@ -280,14 +280,14 @@ dimensionedScalar func(const int n, const dimensionedScalar& ds) \ { \ if (!ds.dimensions().dimensionless()) \ { \ - FatalErrorIn(#func "(const int n, const dimensionedScalar& ds)") \ + FatalErrorInFunction \ << "ds not dimensionless" \ << abort(FatalError); \ } \ \ return dimensionedScalar \ ( \ - #func "(" + name(n) + ',' + ds.name() + ')', \ + #func "(" + name(n) + ',' + ds.name() + ')', \ dimless, \ ::func(n, ds.value()) \ ); \ diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C index fdb38737a5b..03ee76d7c98 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C +++ b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.C @@ -54,10 +54,8 @@ void Foam::dimensioned<Type>::initialize(Istream& is) if (dims != dimensions_) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "dimensioned<Type>::dimensioned" - "(const word&, const dimensionSet&, Istream&)", is ) << "The dimensions " << dims << " provided do not match the required dimensions " @@ -537,7 +535,7 @@ Foam::dimensioned<Type> Foam::max { if (dt1.dimensions() != dt2.dimensions()) { - FatalErrorIn("max(const dimensioned<Type>&, const dimensioned<Type>&)") + FatalErrorInFunction << "dimensions of arguments are not equal" << abort(FatalError); } @@ -560,7 +558,7 @@ Foam::dimensioned<Type> Foam::min { if (dt1.dimensions() != dt2.dimensions()) { - FatalErrorIn("min(const dimensioned<Type>&, const dimensioned<Type>&)") + FatalErrorInFunction << "dimensions of arguments are not equal" << abort(FatalError); } diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C index a33942e9b9d..3c3abf215d9 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.C @@ -37,7 +37,7 @@ namespace Foam #define checkField(df1, df2, op) \ if (&(df1).mesh() != &(df2).mesh()) \ { \ - FatalErrorIn("checkField(df1, df2, op)") \ + FatalErrorInFunction \ << "different mesh for fields " \ << (df1).name() << " and " << (df2).name() \ << " during operatrion " << op \ @@ -63,12 +63,8 @@ DimensionedField<Type, GeoMesh>::DimensionedField { if (field.size() && field.size() != GeoMesh::size(mesh)) { - FatalErrorIn - ( - "DimensionedField<Type, GeoMesh>::DimensionedField" - "(const IOobject& io,const Mesh& mesh, " - "const dimensionSet& dims, const Field<Type>& field)" - ) << "size of field = " << field.size() + FatalErrorInFunction + << "size of field = " << field.size() << " is not the same as the size of mesh = " << GeoMesh::size(mesh) << abort(FatalError); @@ -433,11 +429,8 @@ void DimensionedField<Type, GeoMesh>::operator= // Check for assignment to self if (this == &df) { - FatalErrorIn - ( - "DimensionedField<Type, GeoMesh>::operator=" - "(const DimensionedField<Type, GeoMesh>&)" - ) << "attempted assignment to self" + FatalErrorInFunction + << "attempted assignment to self" << abort(FatalError); } @@ -459,11 +452,8 @@ void DimensionedField<Type, GeoMesh>::operator= // Check for assignment to self if (this == &df) { - FatalErrorIn - ( - "DimensionedField<Type, GeoMesh>::operator=" - "(const tmp<DimensionedField<Type, GeoMesh> >&)" - ) << "attempted assignment to self" + FatalErrorInFunction + << "attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C index 019991ea994..8d1429f5005 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedScalarField/DimensionedScalarField.C @@ -678,11 +678,8 @@ tmp<DimensionedField<scalar, GeoMesh> > func \ { \ if (!dsf.dimensions().dimensionless()) \ { \ - FatalErrorIn \ - ( \ - #func"(const int n, " \ - "const DimensionedField<scalar, GeoMesh>& dsf)" \ - ) << "dsf not dimensionless" \ + FatalErrorInFunction \ + << "dsf not dimensionless" \ << abort(FatalError); \ } \ \ @@ -717,11 +714,8 @@ tmp<DimensionedField<scalar, GeoMesh> > func \ \ if (!dsf.dimensions().dimensionless()) \ { \ - FatalErrorIn \ - ( \ - #func"(const int n, " \ - "const tmp<DimensionedField<scalar, GeoMesh> >& dsf)" \ - ) << " : dsf not dimensionless" \ + FatalErrorInFunction \ + << " : dsf not dimensionless" \ << abort(FatalError); \ } \ \ diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C b/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C index c6faf4a7da8..6042b204488 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.C @@ -45,11 +45,7 @@ void checkFields { if (f1.size() != f2.size()) { - FatalErrorIn - ( - "checkFields(const FieldField<Field, Type1>&, " - "const FieldField<Field, Type2>&, const char* op)" - ) << " incompatible fields" + FatalErrorInFunction << " FieldField<" << pTraits<Type1>::typeName << "> f1(" << f1.size() << ')' << " and FieldField<" << pTraits<Type2>::typeName @@ -70,13 +66,7 @@ void checkFields { if (f1.size() != f2.size() || f1.size() != f3.size()) { - FatalErrorIn - ( - "checkFields(const FieldField<Field, Type1>&, " - "const FieldField<Field, Type2>&, " - "const FieldField<Field, Type3>&, " - "const char* op)" - ) << " incompatible fields" + FatalErrorInFunction << " FieldField<" << pTraits<Type1>::typeName << "> f1(" << f1.size() << ')' << ", FieldField<" <<pTraits<Type2>::typeName @@ -297,11 +287,8 @@ void FieldField<Field, Type>::operator=(const FieldField<Field, Type>& f) { if (this == &f) { - FatalErrorIn - ( - "FieldField<Field, Type>::" - "operator=(const FieldField<Field, Type>&)" - ) << "attempted assignment to self" + FatalErrorInFunction + << "attempted assignment to self" << abort(FatalError); } @@ -317,10 +304,8 @@ void FieldField<Field, Type>::operator=(const tmp<FieldField>& tf) { if (this == &(tf())) { - FatalErrorIn - ( - "FieldField<Field, Type>::operator=(const tmp<FieldField>&)" - ) << "attempted assignment to self" + FatalErrorInFunction + << "attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H b/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H index b028cc6d977..f185163e3a8 100644 --- a/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H +++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicFieldI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -339,11 +339,8 @@ Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::append { if (this == &lst) { - FatalErrorIn - ( - "DynamicField<T, SizeInc, SizeMult, SizeDiv>::append" - "(const UList<T>&)" - ) << "attempted appending to self" << abort(FatalError); + FatalErrorInFunction + << "attempted appending to self" << abort(FatalError); } label nextFree = List<T>::size(); @@ -364,10 +361,8 @@ inline T Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::remove() if (elemI < 0) { - FatalErrorIn - ( - "Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::remove()" - ) << "List is empty" << abort(FatalError); + FatalErrorInFunction + << "List is empty" << abort(FatalError); } const T& val = List<T>::operator[](elemI); @@ -413,11 +408,8 @@ inline void Foam::DynamicField<T, SizeInc, SizeMult, SizeDiv>::operator= { if (this == &lst) { - FatalErrorIn - ( - "DynamicField<T, SizeInc, SizeMult, SizeDiv>::operator=" - "(const DynamicField<T, SizeInc, SizeMult, SizeDiv>&)" - ) << "attempted assignment to self" << abort(FatalError); + FatalErrorInFunction + << "attempted assignment to self" << abort(FatalError); } if (capacity_ >= lst.size()) diff --git a/src/OpenFOAM/fields/Fields/Field/Field.C b/src/OpenFOAM/fields/Fields/Field/Field.C index 48fcaacac07..f629bc4187e 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.C +++ b/src/OpenFOAM/fields/Fields/Field/Field.C @@ -275,10 +275,8 @@ Foam::Field<Type>::Field is >> static_cast<List<Type>&>(*this); if (this->size() != s) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "Field<Type>::Field" - "(const word& keyword, const dictionary&, const label)", dict ) << "size " << this->size() << " is not equal to the given value of " << s @@ -287,10 +285,8 @@ Foam::Field<Type>::Field } else { - FatalIOErrorIn + FatalIOErrorInFunction ( - "Field<Type>::Field" - "(const word& keyword, const dictionary&, const label)", dict ) << "expected keyword 'uniform' or 'nonuniform', found " << firstToken.wordToken() @@ -301,10 +297,8 @@ Foam::Field<Type>::Field { if (is.version() == 2.0) { - IOWarningIn + IOWarningInFunction ( - "Field<Type>::Field" - "(const word& keyword, const dictionary&, const label)", dict ) << "expected keyword 'uniform' or 'nonuniform', " "assuming deprecated Field format from " @@ -317,10 +311,8 @@ Foam::Field<Type>::Field } else { - FatalIOErrorIn + FatalIOErrorInFunction ( - "Field<Type>::Field" - "(const word& keyword, const dictionary&, const label)", dict ) << "expected keyword 'uniform' or 'nonuniform', found " << firstToken.info() @@ -398,15 +390,7 @@ void Foam::Field<Type>::map if (mapWeights.size() != mapAddressing.size()) { - FatalErrorIn - ( - "void Field<Type>::map\n" - "(\n" - " const UList<Type>& mapF,\n" - " const labelListList& mapAddressing,\n" - " const scalarListList& mapWeights\n" - ")" - ) << "Weights and addressing map have different sizes. Weights size: " + FatalErrorInFunction << mapWeights.size() << " map size: " << mapAddressing.size() << abort(FatalError); } @@ -673,7 +657,7 @@ void Foam::Field<Type>::operator=(const Field<Type>& rhs) { if (this == &rhs) { - FatalErrorIn("Field<Type>::operator=(const Field<Type>&)") + FatalErrorInFunction << "attempted assignment to self" << abort(FatalError); } @@ -701,7 +685,7 @@ void Foam::Field<Type>::operator=(const tmp<Field>& rhs) { if (this == &(rhs())) { - FatalErrorIn("Field<Type>::operator=(const tmp<Field>&)") + FatalErrorInFunction << "attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/fields/Fields/Field/FieldM.H b/src/OpenFOAM/fields/Fields/Field/FieldM.H index d44d72506af..ff3861d4e7c 100644 --- a/src/OpenFOAM/fields/Fields/Field/FieldM.H +++ b/src/OpenFOAM/fields/Fields/Field/FieldM.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,11 +53,7 @@ void checkFields { if (f1.size() != f2.size()) { - FatalErrorIn - ( - "checkFields(const UList<Type1>&, " - "const UList<Type2>&, const char*)" - ) << " incompatible fields" + FatalErrorInFunction << " Field<"<<pTraits<Type1>::typeName<<"> f1("<<f1.size()<<')' << " and Field<"<<pTraits<Type2>::typeName<<"> f2("<<f2.size()<<')' << endl << " for operation " << op @@ -76,12 +72,7 @@ void checkFields { if (f1.size() != f2.size() || f1.size() != f3.size()) { - FatalErrorIn - ( - "checkFields(const UList<Type1>&, " - "const UList<Type2>&, const UList<Type3>&, " - "const char*)" - ) << " incompatible fields" + FatalErrorInFunction << " Field<"<<pTraits<Type1>::typeName<<"> f1("<<f1.size()<<')' << ", Field<"<<pTraits<Type2>::typeName<<"> f2("<<f2.size()<<')' << " and Field<"<<pTraits<Type3>::typeName<<"> f3("<<f3.size()<<')' diff --git a/src/OpenFOAM/fields/Fields/Field/FieldMapper.H b/src/OpenFOAM/fields/Fields/Field/FieldMapper.H index f463f97c576..69414c5b3e9 100644 --- a/src/OpenFOAM/fields/Fields/Field/FieldMapper.H +++ b/src/OpenFOAM/fields/Fields/Field/FieldMapper.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,7 +70,7 @@ public: virtual const labelUList& directAddressing() const { - FatalErrorIn("FieldMapper::directAddressing() const") + FatalErrorInFunction << "attempt to access null direct addressing" << abort(FatalError); @@ -79,7 +79,7 @@ public: virtual const labelListList& addressing() const { - FatalErrorIn("FieldMapper::addressing() const") + FatalErrorInFunction << "attempt to access null interpolation addressing" << abort(FatalError); @@ -88,7 +88,7 @@ public: virtual const scalarListList& weights() const { - FatalErrorIn("FieldMapper::weights() const") + FatalErrorInFunction << "attempt to access null interpolation weights" << abort(FatalError); diff --git a/src/OpenFOAM/fields/Fields/transformList/transformList.C b/src/OpenFOAM/fields/Fields/transformList/transformList.C index f962d68990b..87f8c05cc12 100644 --- a/src/OpenFOAM/fields/Fields/transformList/transformList.C +++ b/src/OpenFOAM/fields/Fields/transformList/transformList.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,10 +74,8 @@ void Foam::transformList(const tensorField& rotTensor, UList<T>& field) } else { - FatalErrorIn - ( - "transformList(const tensorField&, UList<T>&)" - ) << "Sizes of field and transformation not equal. field:" + FatalErrorInFunction + << "Sizes of field and transformation not equal. field:" << field.size() << " transformation:" << rotTensor.size() << abort(FatalError); } @@ -106,10 +104,8 @@ void Foam::transformList(const tensorField& rotTensor, Map<T>& field) } else { - FatalErrorIn - ( - "transformList(const tensorField&, Map<T>&)" - ) << "Multiple transformation tensors not supported. field:" + FatalErrorInFunction + << "Multiple transformation tensors not supported. field:" << field.size() << " transformation:" << rotTensor.size() << abort(FatalError); } @@ -138,10 +134,8 @@ void Foam::transformList(const tensorField& rotTensor, EdgeMap<T>& field) } else { - FatalErrorIn - ( - "transformList(const tensorField&, EdgeMap<T>&)" - ) << "Multiple transformation tensors not supported. field:" + FatalErrorInFunction + << "Multiple transformation tensors not supported. field:" << field.size() << " transformation:" << rotTensor.size() << abort(FatalError); } diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C index e331062c4da..da522ae4264 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricBoundaryField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -180,14 +180,8 @@ readField { if (bmesh_[patchi].type() == cyclicPolyPatch::typeName) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "GeometricField<Type, PatchField, GeoMesh>::" - "GeometricBoundaryField::readField" - "(" - "const DimensionedField<Type, GeoMesh>&, " - "const dictionary&" - ")", dict ) << "Cannot find patchField entry for cyclic " << bmesh_[patchi].name() << endl @@ -197,14 +191,8 @@ readField } else { - FatalIOErrorIn + FatalIOErrorInFunction ( - "GeometricField<Type, PatchField, GeoMesh>::" - "GeometricBoundaryField::readField" - "(" - "const DimensionedField<Type, GeoMesh>&, " - "const dictionary&" - ")", dict ) << "Cannot find patchField entry for " << bmesh_[patchi].name() << exit(FatalIOError); @@ -298,18 +286,8 @@ GeometricBoundaryField || (constraintTypes.size() && (constraintTypes.size() != this->size())) ) { - FatalErrorIn - ( - "GeometricField<Type, PatchField, GeoMesh>::" - "GeometricBoundaryField::" - "GeometricBoundaryField" - "(" - "const BoundaryMesh&, " - "const DimensionedField<Type>&, " - "const wordList&, " - "const wordList&" - ")" - ) << "Incorrect number of patch type specifications given" << nl + FatalErrorInFunction + << "Incorrect number of patch type specifications given" << nl << " Number of patches in mesh = " << bmesh.size() << " number of patch type specifications = " << patchFieldTypes.size() @@ -542,7 +520,7 @@ evaluate() } else { - FatalErrorIn("GeometricBoundaryField::evaluate()") + FatalErrorInFunction << "Unsuported communications type " << Pstream::commsTypeNames[Pstream::defaultCommsType] << exit(FatalError); diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C index d18f24e19fb..b516b8ba7b5 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C @@ -34,7 +34,7 @@ License #define checkField(gf1, gf2, op) \ if ((gf1).mesh() != (gf2).mesh()) \ { \ - FatalErrorIn("checkField(gf1, gf2, op)") \ + FatalErrorInFunction \ << "different mesh for fields " \ << (gf1).name() << " and " << (gf2).name() \ << " during operatrion " << op \ @@ -114,12 +114,8 @@ bool Foam::GeometricField<Type, PatchField, GeoMesh>::readIfPresent() // Check compatibility between field and mesh if (this->size() != GeoMesh::size(this->mesh())) { - FatalIOErrorIn - ( - "GeometricField<Type, PatchField, GeoMesh>::" - "readIfPresent()", - this->readStream(typeName) - ) << " number of field elements = " << this->size() + FatalIOErrorInFunction(this->readStream(typeName)) + << " number of field elements = " << this->size() << " number of mesh elements = " << GeoMesh::size(this->mesh()) << exit(FatalIOError); @@ -334,12 +330,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField if (this->size() != GeoMesh::size(this->mesh())) { - FatalIOErrorIn - ( - "GeometricField<Type, PatchField, GeoMesh>::GeometricField" - "(const IOobject&, const Mesh&)", - this->readStream(typeName) - ) << " number of field elements = " << this->size() + FatalIOErrorInFunction(this->readStream(typeName)) + << " number of field elements = " << this->size() << " number of mesh elements = " << GeoMesh::size(this->mesh()) << exit(FatalIOError); } @@ -375,11 +367,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField if (this->size() != GeoMesh::size(this->mesh())) { - FatalErrorIn - ( - "GeometricField<Type, PatchField, GeoMesh>::GeometricField" - "(const IOobject&, const Mesh&, const dictionary&)" - ) << " number of field elements = " << this->size() + FatalErrorInFunction + << " number of field elements = " << this->size() << " number of mesh elements = " << GeoMesh::size(this->mesh()) << exit(FatalIOError); } @@ -833,10 +822,8 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::prevIter() const { if (!fieldPrevIterPtr_) { - FatalErrorIn - ( - "GeometricField<Type, PatchField, GeoMesh>::prevIter() const" - ) << "previous iteration field" << endl << this->info() << endl + FatalErrorInFunction + << "previous iteration field" << endl << this->info() << endl << " not stored." << " Use field.storePrevIter() at start of iteration." << abort(FatalError); @@ -1092,11 +1079,8 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator= { if (this == &gf) { - FatalErrorIn - ( - "GeometricField<Type, PatchField, GeoMesh>::operator=" - "(const GeometricField<Type, PatchField, GeoMesh>&)" - ) << "attempted assignment to self" + FatalErrorInFunction + << "attempted assignment to self" << abort(FatalError); } @@ -1117,11 +1101,8 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator= { if (this == &(tgf())) { - FatalErrorIn - ( - "GeometricField<Type, PatchField, GeoMesh>::operator=" - "(const tmp<GeometricField<Type, PatchField, GeoMesh> >&)" - ) << "attempted assignment to self" + FatalErrorInFunction + << "attempted assignment to self" << abort(FatalError); } diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C index eb160c0e74c..cb34740ca3e 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C +++ b/src/OpenFOAM/fields/GeometricFields/GeometricScalarField/GeometricScalarField.C @@ -814,11 +814,8 @@ tmp<GeometricField<scalar, PatchField, GeoMesh> > func \ { \ if (!gsf.dimensions().dimensionless()) \ { \ - FatalErrorIn \ - ( \ - #func"(const int n, " \ - "const GeometricField<scalar, PatchField, GeoMesh>& gsf)" \ - ) << "gsf not dimensionless" \ + FatalErrorInFunction \ + << "gsf not dimensionless" \ << abort(FatalError); \ } \ \ @@ -855,11 +852,8 @@ tmp<GeometricField<scalar, PatchField, GeoMesh> > func \ \ if (!gsf.dimensions().dimensionless()) \ { \ - FatalErrorIn \ - ( \ - #func"(const int n, " \ - "const tmp<GeometricField<scalar, PatchField, GeoMesh> >& gsf)" \ - ) << " : gsf not dimensionless" \ + FatalErrorInFunction \ + << " : gsf not dimensionless" \ << abort(FatalError); \ } \ \ diff --git a/src/OpenFOAM/fields/ReadFields/ReadFields.C b/src/OpenFOAM/fields/ReadFields/ReadFields.C index a679082b417..ab7779f28a4 100644 --- a/src/OpenFOAM/fields/ReadFields/ReadFields.C +++ b/src/OpenFOAM/fields/ReadFields/ReadFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,12 +62,8 @@ Foam::wordList Foam::ReadFields if (iter == localNamesSet.end()) { - FatalErrorIn - ( - "ReadFields<class GeoField, class Mesh>" - "(const Mesh&, const IOobjectList&, PtrList<GeoField>&" - ", const bool)" - ) << "Fields not synchronised across processors." << endl + FatalErrorInFunction + << "Fields not synchronised across processors." << endl << "Master has fields " << masterNames << " processor " << Pstream::myProcNo() << " has fields " << localNames << exit(FatalError); @@ -80,12 +76,8 @@ Foam::wordList Foam::ReadFields forAllConstIter(HashSet<word>, localNamesSet, iter) { - FatalErrorIn - ( - "ReadFields<class GeoField, class Mesh>" - "(const Mesh&, const IOobjectList&, PtrList<GeoField>&" - ", const bool)" - ) << "Fields not synchronised across processors." << endl + FatalErrorInFunction + << "Fields not synchronised across processors." << endl << "Master has fields " << masterNames << " processor " << Pstream::myProcNo() << " has fields " << localNames << exit(FatalError); diff --git a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C index 6f5c7ef2673..747e3daa7f5 100644 --- a/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/basic/value/valuePointPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,10 +33,8 @@ void Foam::valuePointPatchField<Type>::checkFieldSize() const { if (this->size() != this->patch().size()) { - FatalErrorIn - ( - "void valuePointPatchField<Type>::checkField() const" - ) << "field does not correspond to patch. " << endl + FatalErrorInFunction + << "field does not correspond to patch. " << endl << "Field size: " << size() << " patch size: " << this->patch().size() << abort(FatalError); @@ -83,15 +81,8 @@ Foam::valuePointPatchField<Type>::valuePointPatchField } else { - FatalIOErrorIn + FatalIOErrorInFunction ( - "pointPatchField<Type>::pointPatchField" - "(" - "const fvPatch& p," - "const DimensionedField<Type, pointMesh>& iF," - "const dictionary& dict," - "const bool valueRequired" - ")", dict ) << "Essential entry 'value' missing" << exit(FatalIOError); diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C index 4bc09945265..1ebadbb40cb 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclic/cyclicPointPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,14 +55,8 @@ Foam::cyclicPointPatchField<Type>::cyclicPointPatchField { if (!isType<cyclicPointPatch>(p)) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "cyclicPointPatchField<Type>::cyclicPointPatchField\n" - "(\n" - " const pointPatch& p,\n" - " const Field<Type>& field,\n" - " const dictionary& dict\n" - ")\n", dict ) << "patch " << this->patch().index() << " not cyclic type. " << "Patch type = " << p.type() @@ -85,16 +79,8 @@ Foam::cyclicPointPatchField<Type>::cyclicPointPatchField { if (!isType<cyclicPointPatch>(this->patch())) { - FatalErrorIn - ( - "cyclicPointPatchField<Type>::cyclicPointPatchField\n" - "(\n" - " const cyclicPointPatchField<Type>& ptf,\n" - " const pointPatch& p,\n" - " const DimensionedField<Type, pointMesh>& iF,\n" - " const pointPatchFieldMapper& mapper\n" - ")\n" - ) << "Field type does not correspond to patch type for patch " + FatalErrorInFunction + << "Field type does not correspond to patch type for patch " << this->patch().index() << "." << endl << "Field type: " << typeName << endl << "Patch type: " << this->patch().type() diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/empty/emptyPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/empty/emptyPointPatchField.C index 41f97055aea..6435a72c12d 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/empty/emptyPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/empty/emptyPointPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,14 +55,8 @@ emptyPointPatchField<Type>::emptyPointPatchField { if (!isType<emptyPointPatch>(p)) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "emptyPointPatchField<Type>::emptyPointPatchField\n" - "(\n" - " const pointPatch& p,\n" - " const Field<Type>& field,\n" - " const dictionary& dict\n" - ")\n", dict ) << "patch " << this->patch().index() << " not empty type. " << "Patch type = " << p.type() @@ -84,16 +78,8 @@ emptyPointPatchField<Type>::emptyPointPatchField { if (!isType<emptyPointPatch>(this->patch())) { - FatalErrorIn - ( - "emptyPointPatchField<Type>::emptyPointPatchField\n" - "(\n" - " const emptyPointPatchField<Type>& ptf,\n" - " const pointPatch& p,\n" - " const DimensionedField<Type, pointMesh>& iF,\n" - " const pointPatchFieldMapper& mapper\n" - ")\n" - ) << "Field type does not correspond to patch type for patch " + FatalErrorInFunction + << "Field type does not correspond to patch type for patch " << this->patch().index() << "." << endl << "Field type: " << typeName << endl << "Patch type: " << this->patch().type() diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetry/symmetryPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetry/symmetryPointPatchField.C index 8e321d65486..4e11109261e 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetry/symmetryPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetry/symmetryPointPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,14 +55,8 @@ symmetryPointPatchField<Type>::symmetryPointPatchField { if (!isType<symmetryPointPatch>(p)) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "symmetryPointPatchField<Type>::symmetryPointPatchField\n" - "(\n" - " const pointPatch& p,\n" - " const Field<Type>& field,\n" - " const dictionary& dict\n" - ")\n", dict ) << "patch " << this->patch().index() << " not symmetry type. " << "Patch type = " << p.type() @@ -84,16 +78,8 @@ symmetryPointPatchField<Type>::symmetryPointPatchField { if (!isType<symmetryPointPatch>(this->patch())) { - FatalErrorIn - ( - "symmetryPointPatchField<Type>::symmetryPointPatchField\n" - "(\n" - " const symmetryPointPatchField<Type>& ptf,\n" - " const pointPatch& p,\n" - " const DimensionedField<Type, pointMesh>& iF,\n" - " const pointPatchFieldMapper& mapper\n" - ")\n" - ) << "Field type does not correspond to patch type for patch " + FatalErrorInFunction + << "Field type does not correspond to patch type for patch " << this->patch().index() << "." << endl << "Field type: " << typeName << endl << "Patch type: " << this->patch().type() diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.C index b91c965e92e..c988248e2ea 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,14 +57,8 @@ symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField { if (!isType<symmetryPlanePointPatch>(p)) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField\n" - "(\n" - " const pointPatch& p,\n" - " const Field<Type>& field,\n" - " const dictionary& dict\n" - ")\n", dict ) << "patch " << this->patch().index() << " not symmetry type. " << "Patch type = " << p.type() @@ -87,16 +81,8 @@ symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField { if (!isType<symmetryPlanePointPatch>(this->patch())) { - FatalErrorIn - ( - "symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField\n" - "(\n" - " const symmetryPlanePointPatchField<Type>& ptf,\n" - " const pointPatch& p,\n" - " const DimensionedField<Type, pointMesh>& iF,\n" - " const pointPatchFieldMapper& mapper\n" - ")\n" - ) << "Field type does not correspond to patch type for patch " + FatalErrorInFunction + << "Field type does not correspond to patch type for patch " << this->patch().index() << "." << endl << "Field type: " << typeName << endl << "Patch type: " << this->patch().type() diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.C index 447c7771cd3..52e55ef0ccf 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/wedge/wedgePointPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,14 +52,8 @@ Foam::wedgePointPatchField<Type>::wedgePointPatchField { if (!isType<wedgePointPatch>(p)) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "wedgePointPatchField<Type>::wedgePointPatchField\n" - "(\n" - " const pointPatch& p,\n" - " const Field<Type>& field,\n" - " const dictionary& dict\n" - ")\n", dict ) << "patch " << this->patch().index() << " not wedge type. " << "Patch type = " << p.type() @@ -81,16 +75,8 @@ Foam::wedgePointPatchField<Type>::wedgePointPatchField { if (!isType<wedgePointPatch>(this->patch())) { - FatalErrorIn - ( - "wedgePointPatchField<Type>::wedgePointPatchField\n" - "(\n" - " const wedgePointPatchField<Type>& ptf,\n" - " const pointPatch& p,\n" - " const DimensionedField<Type, pointMesh>& iF,\n" - " const pointPatchFieldMapper& mapper\n" - ")\n" - ) << "Field type does not correspond to patch type for patch " + FatalErrorInFunction + << "Field type does not correspond to patch type for patch " << this->patch().index() << "." << endl << "Field type: " << typeName << endl << "Patch type: " << this->patch().type() diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C index be4b10dfd8f..64daf799fd1 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -146,12 +146,8 @@ tmp<Field<Type1> > pointPatchField<Type>::patchInternalField // Check size if (iF.size() != internalField().size()) { - FatalErrorIn - ( - "tmp<Field<Type1> > pointPatchField<" - "Type>::" - "patchInternalField(const Field<Type1>& iF) const" - ) << "given internal field does not correspond to the mesh. " + FatalErrorInFunction + << "given internal field does not correspond to the mesh. " << "Field size: " << iF.size() << " mesh size: " << internalField().size() << abort(FatalError); @@ -183,12 +179,8 @@ void pointPatchField<Type>::addToInternalField // Check size if (iF.size() != internalField().size()) { - FatalErrorIn - ( - "void pointPatchField<Type>::" - "addToInternalField(" - "Field<Type1>& iF, const Field<Type1>& iF) const" - ) << "given internal field does not correspond to the mesh. " + FatalErrorInFunction + << "given internal field does not correspond to the mesh. " << "Field size: " << iF.size() << " mesh size: " << internalField().size() << abort(FatalError); @@ -196,12 +188,8 @@ void pointPatchField<Type>::addToInternalField if (pF.size() != size()) { - FatalErrorIn - ( - "void pointPatchField<Type>::" - "addToInternalField(" - "Field<Type1>& iF, const Field<Type1>& iF) const" - ) << "given patch field does not correspond to the mesh. " + FatalErrorInFunction + << "given patch field does not correspond to the mesh. " << "Field size: " << pF.size() << " mesh size: " << size() << abort(FatalError); @@ -229,12 +217,8 @@ void pointPatchField<Type>::addToInternalField // Check size if (iF.size() != internalField().size()) { - FatalErrorIn - ( - "void pointPatchField<Type>::" - "addToInternalField(" - "Field<Type1>& iF, const Field<Type1>& iF, const labelList&) const" - ) << "given internal field does not correspond to the mesh. " + FatalErrorInFunction + << "given internal field does not correspond to the mesh. " << "Field size: " << iF.size() << " mesh size: " << internalField().size() << abort(FatalError); @@ -242,12 +226,8 @@ void pointPatchField<Type>::addToInternalField if (pF.size() != size()) { - FatalErrorIn - ( - "void pointPatchField<Type>::" - "addToInternalField(" - "Field<Type1>& iF, const Field<Type1>& iF, const labelList&) const" - ) << "given patch field does not correspond to the mesh. " + FatalErrorInFunction + << "given patch field does not correspond to the mesh. " << "Field size: " << pF.size() << " mesh size: " << size() << abort(FatalError); @@ -276,12 +256,8 @@ void pointPatchField<Type>::setInInternalField // Check size if (iF.size() != internalField().size()) { - FatalErrorIn - ( - "void pointPatchField<Type>::" - "setInInternalField(" - "Field<Type1>& iF, const Field<Type1>& iF) const" - ) << "given internal field does not correspond to the mesh. " + FatalErrorInFunction + << "given internal field does not correspond to the mesh. " << "Field size: " << iF.size() << " mesh size: " << internalField().size() << abort(FatalError); @@ -289,12 +265,8 @@ void pointPatchField<Type>::setInInternalField if (pF.size() != meshPoints.size()) { - FatalErrorIn - ( - "void pointPatchField<Type>::" - "setInInternalField(" - "Field<Type1>& iF, const Field<Type1>& iF) const" - ) << "given patch field does not correspond to the meshPoints. " + FatalErrorInFunction + << "given patch field does not correspond to the meshPoints. " << "Field size: " << pF.size() << " meshPoints size: " << size() << abort(FatalError); diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C index 50a2105deed..25f955bbcea 100644 --- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C +++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchFieldNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield |2011 OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,11 +48,8 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New if (cstrIter == pointPatchConstructorTablePtr_->end()) { - FatalErrorIn - ( - "PointPatchField<Type>::New" - "(const word&, const word&, const pointPatch&, const Field<Type>&)" - ) << "Unknown patchFieldType type " + FatalErrorInFunction + << "Unknown patchFieldType type " << patchFieldType << nl << nl << "Valid patchField types are :" << endl << pointPatchConstructorTablePtr_->sortedToc() @@ -75,12 +72,8 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New if (patchTypeCstrIter == pointPatchConstructorTablePtr_->end()) { - FatalErrorIn - ( - "PointPatchField<Type>::New" - "(const word&, const word&" - ", const pointPatch&, const Field<Type>&)" - ) << "inconsistent patch and patchField types for \n" + FatalErrorInFunction + << "inconsistent patch and patchField types for \n" << " patch type " << p.type() << " and patchField type " << patchFieldType << exit(FatalError); @@ -143,10 +136,8 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "PointPatchField<Type>::" - "New(const pointPatch&, const Field<Type>&, const dictionary&)", dict ) << "Unknown patchField type " << patchFieldType << " for patch type " << p.type() << nl << nl @@ -178,10 +169,8 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New if (patchTypeCstrIter == dictionaryConstructorTablePtr_->end()) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "PointPatchField<Type>const pointPatch&, " - "const Field<Type>&, const dictionary&)", dict ) << "inconsistent patch and patchField types for \n" << " patch type " << p.type() @@ -223,16 +212,8 @@ Foam::autoPtr<Foam::pointPatchField<Type> > Foam::pointPatchField<Type>::New if (cstrIter == patchMapperConstructorTablePtr_->end()) { - FatalErrorIn - ( - "PointPatchField<Type>::New" - "(" - "const pointPatchField<Type>&, " - "const pointPatch&, " - "const DimensionedField<Type, pointMesh>&, " - "const pointPatchFieldMapper&" - ")" - ) << "Unknown patchField type " + FatalErrorInFunction + << "Unknown patchField type " << ptf.type() << nl << nl << "Valid patchField types are :" << endl << patchMapperConstructorTablePtr_->sortedToc() diff --git a/src/OpenFOAM/global/JobInfo/JobInfo.C b/src/OpenFOAM/global/JobInfo/JobInfo.C index 1857d92c8d9..a37ae7613af 100644 --- a/src/OpenFOAM/global/JobInfo/JobInfo.C +++ b/src/OpenFOAM/global/JobInfo/JobInfo.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,21 +59,21 @@ Foam::JobInfo::JobInfo() if (baseDir.empty()) { - FatalErrorIn("JobInfo::JobInfo()") + FatalErrorInFunction << "Cannot get JobInfo directory $FOAM_JOB_DIR" << Foam::exit(FatalError); } if (!isDir(runningDir) && !mkDir(runningDir)) { - FatalErrorIn("JobInfo::JobInfo()") + FatalErrorInFunction << "Cannot make JobInfo directory " << runningDir << Foam::exit(FatalError); } if (!isDir(finishedDir) && !mkDir(finishedDir)) { - FatalErrorIn("JobInfo::JobInfo()") + FatalErrorInFunction << "Cannot make JobInfo directory " << finishedDir << Foam::exit(FatalError); } @@ -125,7 +125,7 @@ void Foam::JobInfo::write() const { if (!write(OFstream(runningJobPath_)())) { - FatalErrorIn("JobInfo::write() const") + FatalErrorInFunction << "Failed to write to JobInfo file " << runningJobPath_ << Foam::exit(FatalError); diff --git a/src/OpenFOAM/graph/graph.C b/src/OpenFOAM/graph/graph.C index 0ec122dcc32..a7698a20f45 100644 --- a/src/OpenFOAM/graph/graph.C +++ b/src/OpenFOAM/graph/graph.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -138,7 +138,7 @@ const Foam::scalarField& Foam::graph::y() const { if (size() != 1) { - FatalErrorIn("const scalarField& graph::y() const") + FatalErrorInFunction << "y field requested for graph containing " << size() << "ys" << exit(FatalError); } @@ -151,7 +151,7 @@ Foam::scalarField& Foam::graph::y() { if (size() != 1) { - FatalErrorIn("scalarField& graph::y()") + FatalErrorInFunction << "y field requested for graph containing " << size() << "ys" << exit(FatalError); } @@ -167,10 +167,8 @@ Foam::autoPtr<Foam::graph::writer> Foam::graph::writer::New { if (!wordConstructorTablePtr_) { - FatalErrorIn - ( - "graph::writer::New(const word&)" - ) << "Graph writer table is empty" + FatalErrorInFunction + << "Graph writer table is empty" << exit(FatalError); } @@ -179,10 +177,8 @@ Foam::autoPtr<Foam::graph::writer> Foam::graph::writer::New if (cstrIter == wordConstructorTablePtr_->end()) { - FatalErrorIn - ( - "graph::writer::New(const word&)" - ) << "Unknown graph format " << graphFormat + FatalErrorInFunction + << "Unknown graph format " << graphFormat << endl << endl << "Valid graph formats are : " << endl << wordConstructorTablePtr_->sortedToc() @@ -240,7 +236,7 @@ void Foam::graph::write(const fileName& pName, const word& format) const } else { - WarningIn("graph::write(const word& format, const fileName& dir)") + WarningInFunction << "Could not open graph file " << graphFile.name() << endl; } diff --git a/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C b/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C index 98dd6f524a6..cfe912888bc 100644 --- a/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C +++ b/src/OpenFOAM/interpolations/interpolation2DTable/interpolation2DTable.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,10 +39,8 @@ void Foam::interpolation2DTable<Type>::readTable() if (this->empty()) { - FatalErrorIn - ( - "Foam::interpolation2DTable<Type>::readTable()" - ) << "table read from " << fName << " is empty" << nl + FatalErrorInFunction + << "table read from " << fName << " is empty" << nl << exit(FatalError); } @@ -136,28 +134,16 @@ Type Foam::interpolation2DTable<Type>::interpolateValue { case interpolation2DTable::ERROR: { - FatalErrorIn - ( - "Foam::interpolation2DTable<Type>::interpolateValue" - "(" - "List<Tuple2<scalar, Type> >&, " - "const scalar" - ")" - ) << "value (" << lookupValue << ") less than lower " + FatalErrorInFunction + << "value (" << lookupValue << ") less than lower " << "bound (" << minLimit << ")" << nl << exit(FatalError); break; } case interpolation2DTable::WARN: { - WarningIn - ( - "Foam::interpolation2DTable<Type>::interpolateValue" - "(" - "List<Tuple2<scalar, Type> >&, " - "const scalar" - ")" - ) << "value (" << lookupValue << ") less than lower " + WarningInFunction + << "value (" << lookupValue << ") less than lower " << "bound (" << minLimit << ")" << nl << " Continuing with the first entry" << endl; @@ -176,28 +162,16 @@ Type Foam::interpolation2DTable<Type>::interpolateValue { case interpolation2DTable::ERROR: { - FatalErrorIn - ( - "Foam::interpolation2DTable<Type>::interpolateValue" - "(" - "List<Tuple2<scalar, Type> >&, " - "const scalar" - ")" - ) << "value (" << lookupValue << ") greater than upper " + FatalErrorInFunction + << "value (" << lookupValue << ") greater than upper " << "bound (" << maxLimit << ")" << nl << exit(FatalError); break; } case interpolation2DTable::WARN: { - WarningIn - ( - "Foam::interpolation2DTable<Type>::interpolateValue" - "(" - "List<Tuple2<scalar, Type> >&, " - "const scalar" - ")" - ) << "value (" << lookupValue << ") greater than upper " + WarningInFunction + << "value (" << lookupValue << ") greater than upper " << "bound (" << maxLimit << ")" << nl << " Continuing with the last entry" << endl; @@ -267,28 +241,15 @@ Foam::label Foam::interpolation2DTable<Type>::Xi { case interpolation2DTable::ERROR: { - FatalErrorIn - ( - "Foam::label Foam::interpolation2DTable<Type>::Xi" - "(" - "const BinaryOp&, " - "const scalar, " - "const bool" - ") const" - ) << "value (" << valueX << ") out of bounds" + FatalErrorInFunction + << "value (" << valueX << ") out of bounds" << exit(FatalError); break; } case interpolation2DTable::WARN: { - WarningIn - ( - "Foam::label Foam::interpolation2DTable<Type>::Xi" - "(" - "const BinaryOp&, " - "const scalar, " - "const bool" - ) << "value (" << valueX << ") out of bounds" + WarningInFunction + << "value (" << valueX << ") out of bounds" << endl; // fall-through to 'CLAMP' } @@ -298,15 +259,7 @@ Foam::label Foam::interpolation2DTable<Type>::Xi } default: { - FatalErrorIn - ( - "Foam::label Foam::interpolation2DTable<Type>::Xi" - "(" - "const BinaryOp&, " - "const scalar, " - "const bool" - ") const" - ) + FatalErrorInFunction << "Un-handled enumeration " << boundsHandling_ << abort(FatalError); } @@ -352,14 +305,7 @@ Type Foam::interpolation2DTable<Type>::operator() if (nX == 0) { - WarningIn - ( - "Type Foam::interpolation2DTable<Type>::operator()" - "(" - "const scalar, " - "const scalar" - ") const" - ) + WarningInFunction << "cannot interpolate a zero-sized table - returning zero" << endl; return pTraits<Type>::zero; @@ -450,13 +396,8 @@ Foam::interpolation2DTable<Type>::wordToBoundsHandling } else { - WarningIn - ( - "Foam::interpolation2DTable<Type>::wordToBoundsHandling" - "(" - " const word&" - ")" - ) << "bad outOfBounds specifier " << bound << " using 'warn'" << endl; + WarningInFunction + << "bad outOfBounds specifier " << bound << " using 'warn'" << endl; return interpolation2DTable::WARN; } @@ -491,10 +432,8 @@ void Foam::interpolation2DTable<Type>::checkOrder() const // avoid duplicate values (divide-by-zero error) if (currValue <= prevValue) { - FatalErrorIn - ( - "Foam::interpolation2DTable<Type>::checkOrder() const" - ) << "out-of-order value: " + FatalErrorInFunction + << "out-of-order value: " << currValue << " at index " << i << nl << exit(FatalError); } diff --git a/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.C b/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.C index 8159b62c9e8..a0ee1691880 100644 --- a/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.C +++ b/src/OpenFOAM/interpolations/interpolationLookUpTable/interpolationLookUpTable.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -217,10 +217,8 @@ void Foam::interpolationLookUpTable<Type>::readTable if (this->size() == 0) { - FatalErrorIn - ( - "Foam::interpolationLookUpTable<Type>::readTable()" - ) << "table is empty" << nl << exit(FatalError); + FatalErrorInFunction + << "table is empty" << nl << exit(FatalError); } } @@ -324,10 +322,8 @@ void Foam::interpolationLookUpTable<Type>::check() const // avoid duplicate values (divide-by-zero error) if (currValue <= prevValue) { - FatalErrorIn - ( - "Foam::interpolationLookUpTable<Type>::checkOrder() const" - ) << "out-of-order value: " << currValue + FatalErrorInFunction + << "out-of-order value: " << currValue << " at index " << index << nl << exit(FatalError); } prevValue = currValue; @@ -366,10 +362,8 @@ void Foam::interpolationLookUpTable<Type>::write if (this->size() == 0) { - FatalErrorIn - ( - "Foam::interpolationTable<Type>::write()" - ) << "table is empty" << nl << exit(FatalError); + FatalErrorInFunction + << "table is empty" << nl << exit(FatalError); } os.writeKeyword("values") << *this << token::END_STATEMENT << nl; @@ -386,24 +380,18 @@ Foam::interpolationLookUpTable<Type>::operator[](const label i) if (n <= 1) { - FatalErrorIn - ( - "Foam::interpolationLookUpTable<Type>::operator[](const label)" - ) << "table has (" << n << ") columns" << nl << exit(FatalError); + FatalErrorInFunction + << "table has (" << n << ") columns" << nl << exit(FatalError); } else if (i < 0) { - FatalErrorIn - ( - "Foam::interpolationLookUpTable<Type>::operator[](const label)" - ) << "index (" << i << ") underflow" << nl << exit(FatalError); + FatalErrorInFunction + << "index (" << i << ") underflow" << nl << exit(FatalError); } else if (i >= n) { - FatalErrorIn - ( - "Foam::interpolationLookUpTable<Type>::operator[](const label)" - ) << "index (" << i << ") overflow" << nl << exit(FatalError); + FatalErrorInFunction + << "index (" << i << ") overflow" << nl << exit(FatalError); } return List<scalarField>::operator[](i); @@ -418,27 +406,18 @@ Foam::interpolationLookUpTable<Type>::operator[](const label i) const if (n <= 1) { - FatalErrorIn - ( - "Foam::interpolationLookUpTable<Type>::operator[]" - "(const label) const" - ) << "table has (" << n << ") columns" << nl << exit(FatalError); + FatalErrorInFunction + << "table has (" << n << ") columns" << nl << exit(FatalError); } else if (i < 0) { - FatalErrorIn - ( - "Foam::interpolationLookUpTable<Type>::operator[]" - "(const label) const" - ) << "index (" << i << ") underflow" << nl << exit(FatalError); + FatalErrorInFunction + << "index (" << i << ") underflow" << nl << exit(FatalError); } else if (i >= n) { - FatalErrorIn - ( - "Foam::interpolationLookUpTable<Type>::operator[]" - "(const label) const" - ) << "index (" << i << ") overflow" << nl + FatalErrorInFunction + << "index (" << i << ") overflow" << nl << exit(FatalError); } diff --git a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C index 5e890954981..4fd0b074832 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C +++ b/src/OpenFOAM/interpolations/interpolationTable/interpolationTable.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,10 +43,8 @@ void Foam::interpolationTable<Type>::readTable() if (this->empty()) { - FatalErrorIn - ( - "Foam::interpolationTable<Type>::readTable()" - ) << "table read from " << fName << " is empty" << nl + FatalErrorInFunction + << "table read from " << fName << " is empty" << nl << exit(FatalError); } @@ -183,10 +181,8 @@ Foam::interpolationTable<Type>::wordToBoundsHandling } else { - WarningIn - ( - "Foam::interpolationTable<Type>::wordToBoundsHandling(const word&)" - ) << "bad outOfBounds specifier " << bound << " using 'warn'" << endl; + WarningInFunction + << "bad outOfBounds specifier " << bound << " using 'warn'" << endl; return interpolationTable::WARN; } @@ -220,10 +216,8 @@ void Foam::interpolationTable<Type>::check() const // avoid duplicate values (divide-by-zero error) if (currValue <= prevValue) { - FatalErrorIn - ( - "Foam::interpolationTable<Type>::checkOrder() const" - ) << "out-of-order value: " + FatalErrorInFunction + << "out-of-order value: " << currValue << " at index " << i << nl << exit(FatalError); } @@ -267,21 +261,15 @@ Type Foam::interpolationTable<Type>::rateOfChange(const scalar value) const { case interpolationTable::ERROR: { - FatalErrorIn - ( - "Foam::interpolationTable<Type>::operator[]" - "(const scalar) const" - ) << "value (" << lookupValue << ") underflow" << nl + FatalErrorInFunction + << "value (" << lookupValue << ") underflow" << nl << exit(FatalError); break; } case interpolationTable::WARN: { - WarningIn - ( - "Foam::interpolationTable<Type>::operator[]" - "(const scalar) const" - ) << "value (" << lookupValue << ") underflow" << nl + WarningInFunction + << "value (" << lookupValue << ") underflow" << nl << " Zero rate of change." << endl; // fall-through to 'CLAMP' @@ -306,21 +294,15 @@ Type Foam::interpolationTable<Type>::rateOfChange(const scalar value) const { case interpolationTable::ERROR: { - FatalErrorIn - ( - "Foam::interpolationTable<Type>::operator[]" - "(const label) const" - ) << "value (" << lookupValue << ") overflow" << nl + FatalErrorInFunction + << "value (" << lookupValue << ") overflow" << nl << exit(FatalError); break; } case interpolationTable::WARN: { - WarningIn - ( - "Foam::interpolationTable<Type>::operator[]" - "(const label) const" - ) << "value (" << lookupValue << ") overflow" << nl + WarningInFunction + << "value (" << lookupValue << ") overflow" << nl << " Zero rate of change." << endl; // fall-through to 'CLAMP' @@ -421,21 +403,15 @@ Foam::interpolationTable<Type>::operator[](const label i) const { case interpolationTable::ERROR: { - FatalErrorIn - ( - "Foam::interpolationTable<Type>::operator[]" - "(const label) const" - ) << "index (" << ii << ") underflow" << nl + FatalErrorInFunction + << "index (" << ii << ") underflow" << nl << exit(FatalError); break; } case interpolationTable::WARN: { - WarningIn - ( - "Foam::interpolationTable<Type>::operator[]" - "(const label) const" - ) << "index (" << ii << ") underflow" << nl + WarningInFunction + << "index (" << ii << ") underflow" << nl << " Continuing with the first entry" << endl; // fall-through to 'CLAMP' @@ -461,21 +437,15 @@ Foam::interpolationTable<Type>::operator[](const label i) const { case interpolationTable::ERROR: { - FatalErrorIn - ( - "Foam::interpolationTable<Type>::operator[]" - "(const label) const" - ) << "index (" << ii << ") overflow" << nl + FatalErrorInFunction + << "index (" << ii << ") overflow" << nl << exit(FatalError); break; } case interpolationTable::WARN: { - WarningIn - ( - "Foam::interpolationTable<Type>::operator[]" - "(const label) const" - ) << "index (" << ii << ") overflow" << nl + WarningInFunction + << "index (" << ii << ") overflow" << nl << " Continuing with the last entry" << endl; // fall-through to 'CLAMP' @@ -520,21 +490,15 @@ Type Foam::interpolationTable<Type>::operator()(const scalar value) const { case interpolationTable::ERROR: { - FatalErrorIn - ( - "Foam::interpolationTable<Type>::operator[]" - "(const scalar) const" - ) << "value (" << lookupValue << ") underflow" << nl + FatalErrorInFunction + << "value (" << lookupValue << ") underflow" << nl << exit(FatalError); break; } case interpolationTable::WARN: { - WarningIn - ( - "Foam::interpolationTable<Type>::operator[]" - "(const scalar) const" - ) << "value (" << lookupValue << ") underflow" << nl + WarningInFunction + << "value (" << lookupValue << ") underflow" << nl << " Continuing with the first entry" << endl; // fall-through to 'CLAMP' @@ -559,21 +523,15 @@ Type Foam::interpolationTable<Type>::operator()(const scalar value) const { case interpolationTable::ERROR: { - FatalErrorIn - ( - "Foam::interpolationTable<Type>::operator[]" - "(const label) const" - ) << "value (" << lookupValue << ") overflow" << nl + FatalErrorInFunction + << "value (" << lookupValue << ") overflow" << nl << exit(FatalError); break; } case interpolationTable::WARN: { - WarningIn - ( - "Foam::interpolationTable<Type>::operator[]" - "(const label) const" - ) << "value (" << lookupValue << ") overflow" << nl + WarningInFunction + << "value (" << lookupValue << ") overflow" << nl << " Continuing with the last entry" << endl; // fall-through to 'CLAMP' diff --git a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/csv/csvTableReader.C b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/csv/csvTableReader.C index dff79beefd3..8f544c0709b 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/csv/csvTableReader.C +++ b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/csv/csvTableReader.C @@ -40,7 +40,7 @@ Foam::csvTableReader<Type>::csvTableReader(const dictionary& dict) { if (componentColumns_.size() != pTraits<Type>::nComponents) { - FatalErrorIn("csvTableReader<Type>::csvTableReader(const dictionary&)") + FatalErrorInFunction << componentColumns_ << " does not have the expected length " << pTraits<Type>::nComponents << endl << exit(FatalError); @@ -65,10 +65,8 @@ namespace Foam { if (componentColumns_[0] >= splitted.size()) { - FatalErrorIn - ( - "csvTableReader<scalar>::readValue(const List<string>&)" - ) << "No column " << componentColumns_[0] << " in " + FatalErrorInFunction + << "No column " << componentColumns_[0] << " in " << splitted << endl << exit(FatalError); } @@ -86,10 +84,8 @@ namespace Foam { if (componentColumns_[i] >= splitted.size()) { - FatalErrorIn - ( - "csvTableReader<Type>::readValue(const List<string>&)" - ) << "No column " << componentColumns_[i] << " in " + FatalErrorInFunction + << "No column " << componentColumns_[i] << " in " << splitted << endl << exit(FatalError); } diff --git a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C index b33ee3eae2c..cd27159ec64 100644 --- a/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C +++ b/src/OpenFOAM/interpolations/interpolationTable/tableReaders/tableReader.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,10 +45,8 @@ Foam::autoPtr<Foam::tableReader<Type> > Foam::tableReader<Type>::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn - ( - "tableReader::New(const dictionary&)" - ) << "Unknown reader type " << readerType + FatalErrorInFunction + << "Unknown reader type " << readerType << nl << nl << "Valid reader types : " << nl << dictionaryConstructorTablePtr_->sortedToc() diff --git a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C index 779f134de37..39bfb0bcc3f 100644 --- a/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C +++ b/src/OpenFOAM/interpolations/interpolationWeights/interpolationWeights/interpolationWeights.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -59,7 +59,7 @@ autoPtr<interpolationWeights> interpolationWeights::New { if (debug) { - InfoIn("interpolationWeights::New") + InfoInFunction << "Selecting interpolationWeights " << type << endl; } @@ -69,11 +69,8 @@ autoPtr<interpolationWeights> interpolationWeights::New if (cstrIter == wordConstructorTablePtr_->end()) { - FatalErrorIn - ( - "interpolationWeights::New(const word&, " - "const scalarField&)" - ) << "Unknown interpolationWeights type " + FatalErrorInFunction + << "Unknown interpolationWeights type " << type << endl << endl << "Valid interpolationWeights types are :" << endl diff --git a/src/OpenFOAM/interpolations/interpolationWeights/linearInterpolationWeights/linearInterpolationWeights.C b/src/OpenFOAM/interpolations/interpolationWeights/linearInterpolationWeights/linearInterpolationWeights.C index 89497fba376..0e40660fd8e 100644 --- a/src/OpenFOAM/interpolations/interpolationWeights/linearInterpolationWeights/linearInterpolationWeights.C +++ b/src/OpenFOAM/interpolations/interpolationWeights/linearInterpolationWeights/linearInterpolationWeights.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,7 +58,7 @@ Foam::Pair<Foam::scalar> linearInterpolationWeights::integrationWeights if (s < -SMALL || s > 1+SMALL) { - FatalErrorIn("linearInterpolationWeights::integrationWeights(..)") + FatalErrorInFunction << "Value " << t << " outside range " << samples_[i] << " .. " << samples_[i+1] << exit(FatalError); @@ -161,7 +161,7 @@ bool linearInterpolationWeights::integrationWeights { if (t2 < t1-VSMALL) { - FatalErrorIn("linearInterpolationWeights::integrationWeights(..)") + FatalErrorInFunction << "Integration should be in positive direction." << " t1:" << t1 << " t2:" << t2 << exit(FatalError); @@ -177,7 +177,7 @@ bool linearInterpolationWeights::integrationWeights // For now just fail if any outside table if (i1 == -1 || i2 == samples_.size()-1) { - FatalErrorIn("linearInterpolationWeights::integrationWeights(..)") + FatalErrorInFunction << "Integrating outside table " << samples_[0] << ".." << samples_.last() << " not implemented." << " t1:" << t1 << " t2:" << t2 << exit(FatalError); diff --git a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolate.C b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolate.C index 8431a2ec0e0..b4242b23056 100644 --- a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolate.C +++ b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,11 +44,8 @@ PatchToPatchInterpolation<FromPatch, ToPatch>::pointInterpolate { if (pf.size() != fromPatch_.nPoints()) { - FatalErrorIn - ( - "PatchToPatchInterpolation::pointInterpolate" - "(const Field<Type> pf)" - ) << "given field does not correspond to patch. Patch size: " + FatalErrorInFunction + << "given field does not correspond to patch. Patch size: " << fromPatch_.nPoints() << " field size: " << pf.size() << abort(FatalError); } @@ -116,11 +113,8 @@ PatchToPatchInterpolation<FromPatch, ToPatch>::faceInterpolate { if (ff.size() != fromPatch_.size()) { - FatalErrorIn - ( - "PatchToPatchInterpolation::faceInterpolate" - "(const Field<Type> ff)" - ) << "given field does not correspond to patch. Patch size: " + FatalErrorInFunction + << "given field does not correspond to patch. Patch size: " << fromPatch_.size() << " field size: " << ff.size() << abort(FatalError); } diff --git a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.H b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.H index 4da75b1d198..b8b282fa826 100644 --- a/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.H +++ b/src/OpenFOAM/interpolations/patchToPatchInterpolation/PatchToPatchInterpolation.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -174,11 +174,7 @@ public: { if (t < -VSMALL) { - FatalErrorIn - ( - "scalar PatchToPatchInterpolation::" - "setProjectionTol(const scalar t)" - ) << "Negative projection tolerance. This is not allowed." + FatalErrorInFunction << abort(FatalError); } diff --git a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C index 6f09c755d04..bfd3b4a6d6d 100644 --- a/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C +++ b/src/OpenFOAM/interpolations/primitivePatchInterpolation/PrimitivePatchInterpolation.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,10 +52,8 @@ void PrimitivePatchInterpolation<Patch>::makeFaceToPointWeights() const { if (faceToPointWeightsPtr_) { - FatalErrorIn - ( - "PrimitivePatchInterpolation<Patch>::makeFaceToPointWeights() const" - ) << "Face-to-edge weights already calculated" + FatalErrorInFunction + << "Face-to-edge weights already calculated" << abort(FatalError); } @@ -110,10 +108,8 @@ void PrimitivePatchInterpolation<Patch>::makeFaceToEdgeWeights() const { if (faceToEdgeWeightsPtr_) { - FatalErrorIn - ( - "PrimitivePatchInterpolation<Patch>::makeFaceToEdgeWeights() const" - ) << "Face-to-edge weights already calculated" + FatalErrorInFunction + << "Face-to-edge weights already calculated" << abort(FatalError); } @@ -182,11 +178,8 @@ tmp<Field<Type> > PrimitivePatchInterpolation<Patch>::faceToPointInterpolate // Check size of the given field if (ff.size() != patch_.size()) { - FatalErrorIn - ( - "tmp<Field<Type> > PrimitivePatchInterpolation::" - "faceToPointInterpolate(const Field<Type> ff)" - ) << "given field does not correspond to patch. Patch size: " + FatalErrorInFunction + << "given field does not correspond to patch. Patch size: " << patch_.size() << " field size: " << ff.size() << abort(FatalError); } @@ -241,11 +234,8 @@ tmp<Field<Type> > PrimitivePatchInterpolation<Patch>::pointToFaceInterpolate { if (pf.size() != patch_.nPoints()) { - FatalErrorIn - ( - "tmp<Field<Type> > PrimitivePatchInterpolation::" - "pointToFaceInterpolate(const Field<Type> pf)" - ) << "given field does not correspond to patch. Patch size: " + FatalErrorInFunction + << "given field does not correspond to patch. Patch size: " << patch_.nPoints() << " field size: " << pf.size() << abort(FatalError); } @@ -302,11 +292,8 @@ tmp<Field<Type> > PrimitivePatchInterpolation<Patch>::faceToEdgeInterpolate // Check size of the given field if (pf.size() != patch_.size()) { - FatalErrorIn - ( - "tmp<Field<Type> > PrimitivePatchInterpolation::" - "faceToEdgeInterpolate(const Field<Type> ff)" - ) << "given field does not correspond to patch. Patch size: " + FatalErrorInFunction + << "given field does not correspond to patch. Patch size: " << patch_.size() << " field size: " << pf.size() << abort(FatalError); } diff --git a/src/OpenFOAM/interpolations/uniformInterpolationTable/uniformInterpolationTable.C b/src/OpenFOAM/interpolations/uniformInterpolationTable/uniformInterpolationTable.C index e150c64c6a0..3ceb1a19ed1 100644 --- a/src/OpenFOAM/interpolations/uniformInterpolationTable/uniformInterpolationTable.C +++ b/src/OpenFOAM/interpolations/uniformInterpolationTable/uniformInterpolationTable.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,7 @@ void Foam::uniformInterpolationTable<Type>::checkTable() const { if (size() < 2) { - FatalErrorIn("uniformInterpolationTable<Type>::checkTable()") + FatalErrorInFunction << "Table " << name() << ": must have at least 2 values." << nl << "Table size = " << size() << nl << " min, interval width = " << x0_ << ", " << dx_ << nl @@ -149,20 +149,16 @@ Type Foam::uniformInterpolationTable<Type>::interpolate(scalar x) const { if (x < x0_) { - FatalErrorIn - ( - "uniformInterpolationTable<Type>::interpolate(scalar x)" - ) << "Supplied value is less than minimum table value:" << nl + FatalErrorInFunction + << "Supplied value is less than minimum table value:" << nl << "xMin=" << x0_ << ", xMax=" << xMax() << ", x=" << x << nl << exit(FatalError); } if (x > xMax()) { - FatalErrorIn - ( - "uniformInterpolationTable<Type>::interpolate(scalar x)" - ) << "Supplied value is greater than maximum table value:" << nl + FatalErrorInFunction + << "Supplied value is greater than maximum table value:" << nl << "xMin=" << x0_ << ", xMax=" << xMax() << ", x=" << x << nl << exit(FatalError); } @@ -204,10 +200,8 @@ Type Foam::uniformInterpolationTable<Type>::interpolateLog10 } else { - FatalErrorIn - ( - "uniformInterpolationTable<Type>::interpolateLog10(scalar x)" - ) << "Table " << name() << nl + FatalErrorInFunction + << "Table " << name() << nl << "Supplied value must be greater than 0 when in log10 mode" << nl << "x=" << x << nl << exit(FatalError); } diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C b/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C index 5179b5ca3c0..b5e37d441ba 100644 --- a/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C +++ b/src/OpenFOAM/matrices/LUscalarMatrix/LUscalarMatrix.C @@ -352,7 +352,7 @@ void Foam::LUscalarMatrix::convert if (neiInterfacei == -1) { - FatalErrorIn("LUscalarMatrix::convert") << exit(FatalError); + FatalErrorInFunction << exit(FatalError); } const procLduInterface& neiInterface = diff --git a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C index 23ee38b3924..32fabd34291 100644 --- a/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C +++ b/src/OpenFOAM/matrices/LUscalarMatrix/procLduInterface.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,11 +58,8 @@ Foam::procLduInterface::procLduInterface } else { - FatalErrorIn - ( - "procLduInterface::procLduInterface" - "(const lduInterfaceField&, const scalarField&" - ) << "Unknown lduInterface type " + FatalErrorInFunction + << "Unknown lduInterface type " << interface.interface().type() << exit(FatalError); } diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.C index fb131308b37..8c3d6a79c2a 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrix.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -261,10 +261,8 @@ const Foam::Field<DType>& Foam::LduMatrix<Type, DType, LUType>::diag() const { if (!diagPtr_) { - FatalErrorIn - ( - "const Field<DType>& LduMatrix<Type, DType, LUType>::diag() const" - ) << "diagPtr_ unallocated" + FatalErrorInFunction + << "diagPtr_ unallocated" << abort(FatalError); } @@ -277,10 +275,8 @@ const Foam::Field<LUType>& Foam::LduMatrix<Type, DType, LUType>::upper() const { if (!lowerPtr_ && !upperPtr_) { - FatalErrorIn - ( - "const Field<LUType>& LduMatrix<Type, DType, LUType>::upper() const" - ) << "lowerPtr_ or upperPtr_ unallocated" + FatalErrorInFunction + << "lowerPtr_ or upperPtr_ unallocated" << abort(FatalError); } @@ -300,10 +296,8 @@ const Foam::Field<LUType>& Foam::LduMatrix<Type, DType, LUType>::lower() const { if (!lowerPtr_ && !upperPtr_) { - FatalErrorIn - ( - "const Field<LUType>& LduMatrix<Type, DType, LUType>::lower() const" - ) << "lowerPtr_ or upperPtr_ unallocated" + FatalErrorInFunction + << "lowerPtr_ or upperPtr_ unallocated" << abort(FatalError); } @@ -323,10 +317,8 @@ const Foam::Field<Type>& Foam::LduMatrix<Type, DType, LUType>::source() const { if (!sourcePtr_) { - FatalErrorIn - ( - "const Field<Type>& LduMatrix<Type, DType, LUType>::source() const" - ) << "sourcePtr_ unallocated" + FatalErrorInFunction + << "sourcePtr_ unallocated" << abort(FatalError); } diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C index 321f1f71f86..3685bbe20d2 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixOperations.C @@ -168,10 +168,8 @@ void Foam::LduMatrix<Type, DType, LUType>::operator=(const LduMatrix& A) { if (this == &A) { - FatalErrorIn - ( - "LduMatrix<Type, DType, LUType>::operator=(const LduMatrix&)" - ) << "attempted assignment to self" + FatalErrorInFunction + << "attempted assignment to self" << abort(FatalError); } @@ -305,10 +303,8 @@ void Foam::LduMatrix<Type, DType, LUType>::operator+=(const LduMatrix& A) } else { - FatalErrorIn - ( - "LduMatrix<Type, DType, LUType>::operator+=(const LduMatrix& A)" - ) << "Unknown matrix type combination" + FatalErrorInFunction + << "Unknown matrix type combination" << abort(FatalError); } @@ -384,10 +380,8 @@ void Foam::LduMatrix<Type, DType, LUType>::operator-=(const LduMatrix& A) } else { - FatalErrorIn - ( - "LduMatrix<Type, DType, LUType>::operator-=(const LduMatrix& A)" - ) << "Unknown matrix type combination" + FatalErrorInFunction + << "Unknown matrix type combination" << abort(FatalError); } @@ -433,10 +427,8 @@ void Foam::LduMatrix<Type, DType, LUType>::operator*= } } - FatalErrorIn - ( - "LduMatrix<Type, DType, LUType>::operator*=(const scalarField& sf)" - ) << "Scaling a matrix by scalarField is not currently supported\n" + FatalErrorInFunction + << "Scaling a matrix by scalarField is not currently supported\n" "because scaling interfacesUpper_ and interfacesLower_ " "require special transfers" << abort(FatalError); diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixUpdateMatrixInterfaces.C b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixUpdateMatrixInterfaces.C index d3d8de20a01..b068e474815 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixUpdateMatrixInterfaces.C +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/LduMatrixUpdateMatrixInterfaces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,7 +85,7 @@ void Foam::LduMatrix<Type, DType, LUType>::initMatrixInterfaces } else { - FatalErrorIn("LduMatrix<Type, DType, LUType>::initMatrixInterfaces") + FatalErrorInFunction << "Unsuported communications type " << Pstream::commsTypeNames[Pstream::defaultCommsType] << exit(FatalError); @@ -189,7 +189,7 @@ void Foam::LduMatrix<Type, DType, LUType>::updateMatrixInterfaces } else { - FatalErrorIn("LduMatrix<Type, DType, LUType>::updateMatrixInterfaces") + FatalErrorInFunction << "Unsuported communications type " << Pstream::commsTypeNames[Pstream::defaultCommsType] << exit(FatalError); diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.C b/src/OpenFOAM/matrices/Matrix/Matrix.C index 0f4abf36984..ec6aba8a09a 100644 --- a/src/OpenFOAM/matrices/Matrix/Matrix.C +++ b/src/OpenFOAM/matrices/Matrix/Matrix.C @@ -67,7 +67,7 @@ Foam::Matrix<Form, Type>::Matrix(const label n, const label m) { if (n_ < 0 || m_ < 0) { - FatalErrorIn("Matrix<Form, Type>::Matrix(const label n, const label m)") + FatalErrorInFunction << "bad n, m " << n_ << ", " << m_ << abort(FatalError); } @@ -85,10 +85,8 @@ Foam::Matrix<Form, Type>::Matrix(const label n, const label m, const Type& a) { if (n_ < 0 || m_ < 0) { - FatalErrorIn - ( - "Matrix<Form, Type>::Matrix(const label n, const label m, const T&)" - ) << "bad n, m " << n_ << ", " << m_ + FatalErrorInFunction + << "bad n, m " << n_ << ", " << m_ << abort(FatalError); } @@ -202,7 +200,7 @@ void Foam::Matrix<Form, Type>::operator=(const Matrix<Form, Type>& a) { if (this == &a) { - FatalErrorIn("Matrix<Form, Type>::operator=(const Matrix<Form, Type>&)") + FatalErrorInFunction << "attempted assignment to self" << abort(FatalError); } @@ -253,7 +251,7 @@ const Type& Foam::max(const Matrix<Form, Type>& a) } else { - FatalErrorIn("max(const Matrix<Form, Type>&)") + FatalErrorInFunction << "matrix is empty" << abort(FatalError); @@ -285,7 +283,7 @@ const Type& Foam::min(const Matrix<Form, Type>& a) } else { - FatalErrorIn("min(const Matrix<Form, Type>&)") + FatalErrorInFunction << "matrix is empty" << abort(FatalError); @@ -323,22 +321,16 @@ Form Foam::operator+(const Matrix<Form, Type>& a, const Matrix<Form, Type>& b) { if (a.n() != b.n()) { - FatalErrorIn - ( - "Matrix<Form, Type>::operator+" - "(const Matrix<Form, Type>&, const Matrix<Form, Type>&)" - ) << "attempted add matrices with different number of rows: " + FatalErrorInFunction + << "attempted add matrices with different number of rows: " << a.n() << ", " << b.n() << abort(FatalError); } if (a.m() != b.m()) { - FatalErrorIn - ( - "Matrix<Form, Type>::operator+" - "(const Matrix<Form, Type>&, const Matrix<Form, Type>&)" - ) << "attempted add matrices with different number of columns: " + FatalErrorInFunction + << "attempted add matrices with different number of columns: " << a.m() << ", " << b.m() << abort(FatalError); } @@ -364,22 +356,16 @@ Form Foam::operator-(const Matrix<Form, Type>& a, const Matrix<Form, Type>& b) { if (a.n() != b.n()) { - FatalErrorIn - ( - "Matrix<Form, Type>::operator-" - "(const Matrix<Form, Type>&, const Matrix<Form, Type>&)" - ) << "attempted add matrices with different number of rows: " + FatalErrorInFunction + << "attempted add matrices with different number of rows: " << a.n() << ", " << b.n() << abort(FatalError); } if (a.m() != b.m()) { - FatalErrorIn - ( - "Matrix<Form, Type>::operator-" - "(const Matrix<Form, Type>&, const Matrix<Form, Type>&)" - ) << "attempted add matrices with different number of columns: " + FatalErrorInFunction + << "attempted add matrices with different number of columns: " << a.m() << ", " << b.m() << abort(FatalError); } @@ -426,11 +412,8 @@ Form Foam::operator*(const Matrix<Form, Type>& a, const Matrix<Form, Type>& b) { if (a.m() != b.n()) { - FatalErrorIn - ( - "Matrix<Form, Type>::operator*" - "(const Matrix<Form, Type>&, const Matrix<Form, Type>&)" - ) << "attempted to multiply incompatible matrices:" << nl + FatalErrorInFunction + << "attempted to multiply incompatible matrices:" << nl << "Matrix A : " << a.n() << " rows, " << a.m() << " columns" << nl << "Matrix B : " << b.n() << " rows, " << b.m() << " columns" << nl << "In order to multiply matrices, columns of A must equal " diff --git a/src/OpenFOAM/matrices/Matrix/MatrixI.H b/src/OpenFOAM/matrices/Matrix/MatrixI.H index 5b99b0d094a..ccffa5c3db5 100644 --- a/src/OpenFOAM/matrices/Matrix/MatrixI.H +++ b/src/OpenFOAM/matrices/Matrix/MatrixI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,13 +78,13 @@ inline void Foam::Matrix<Form, Type>::checki(const label i) const { if (!n_) { - FatalErrorIn("Matrix<Form, Type>::checki(const label)") + FatalErrorInFunction << "attempt to access element from zero sized row" << abort(FatalError); } else if (i<0 || i>=n_) { - FatalErrorIn("Matrix<Form, Type>::checki(const label)") + FatalErrorInFunction << "index " << i << " out of range 0 ... " << n_-1 << abort(FatalError); } @@ -96,13 +96,13 @@ inline void Foam::Matrix<Form, Type>::checkj(const label j) const { if (!m_) { - FatalErrorIn("Matrix<Form, Type>::checkj(const label)") + FatalErrorInFunction << "attempt to access element from zero sized column" << abort(FatalError); } else if (j<0 || j>=m_) { - FatalErrorIn("Matrix<Form, Type>::checkj(const label)") + FatalErrorInFunction << "index " << j << " out of range 0 ... " << m_-1 << abort(FatalError); } diff --git a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrixI.H b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrixI.H index aed773e4646..243d31904e3 100644 --- a/src/OpenFOAM/matrices/SquareMatrix/SquareMatrixI.H +++ b/src/OpenFOAM/matrices/SquareMatrix/SquareMatrixI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,10 +44,8 @@ inline Foam::SquareMatrix<Type>::SquareMatrix(const label m, const label n) { if (m != n) { - FatalErrorIn - ( - "SquareMatrix<Type>::SquareMatrix(const label m, const label n)" - ) << "m != n for constructing a square matrix" << exit(FatalError); + FatalErrorInFunction + << "m != n for constructing a square matrix" << exit(FatalError); } } @@ -63,11 +61,8 @@ inline Foam::SquareMatrix<Type>::SquareMatrix { if (m != n) { - FatalErrorIn - ( - "SquareMatrix<Type>::SquareMatrix" - "(const label m, const label n, const Type&)" - ) << "m != n for constructing a square matrix" << exit(FatalError); + FatalErrorInFunction + << "m != n for constructing a square matrix" << exit(FatalError); } } diff --git a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H index 1dee0ab9d08..b067cc2669b 100644 --- a/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H +++ b/src/OpenFOAM/matrices/SymmetricSquareMatrix/SymmetricSquareMatrixI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -50,11 +50,8 @@ inline Foam::SymmetricSquareMatrix<Type>::SymmetricSquareMatrix { if (m != n) { - FatalErrorIn - ( - "SymmetricSquareMatrix<Type>::SymmetricSquareMatrix" - "(const label m, const label n)" - ) << "m != n for constructing a symmetric square matrix" + FatalErrorInFunction + << "m != n for constructing a symmetric square matrix" << exit(FatalError); } } @@ -72,11 +69,8 @@ inline Foam::SymmetricSquareMatrix<Type>::SymmetricSquareMatrix { if (m != n) { - FatalErrorIn - ( - "SymmetricSquareMatrix<Type>::SymmetricSquareMatrix" - "(const label m, const label n, const Type&)" - ) << "m != n for constructing a symmetric square matrix" + FatalErrorInFunction + << "m != n for constructing a symmetric square matrix" << exit(FatalError); } } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.C b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.C index 401a3cfa760..b7cb0153c50 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduAddressing.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,7 @@ void Foam::lduAddressing::calcLosort() const { if (losortPtr_) { - FatalErrorIn("lduAddressing::calcLosort() const") + FatalErrorInFunction << "losort already calculated" << abort(FatalError); } @@ -94,7 +94,7 @@ void Foam::lduAddressing::calcOwnerStart() const { if (ownerStartPtr_) { - FatalErrorIn("lduAddressing::calcOwnerStart() const") + FatalErrorInFunction << "owner start already calculated" << abort(FatalError); } @@ -131,7 +131,7 @@ void Foam::lduAddressing::calcLosortStart() const { if (losortStartPtr_) { - FatalErrorIn("lduAddressing::calcLosortStart() const") + FatalErrorInFunction << "losort start already calculated" << abort(FatalError); } @@ -238,10 +238,8 @@ Foam::label Foam::lduAddressing::triIndex(const label a, const label b) const // If neighbour has not been found, something has gone seriously // wrong with the addressing mechanism - FatalErrorIn - ( - "lduAddressing::triIndex(const label owner, const label nbr) const" - ) << "neighbour " << nbr << " not found for owner " << own << ". " + FatalErrorInFunction + << "neighbour " << nbr << " not found for owner " << own << ". " << "Problem with addressing" << abort(FatalError); diff --git a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C index c0ca614a131..645c1de157e 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduAddressing/lduInterface/processorLduInterfaceTemplates.C @@ -79,7 +79,7 @@ void Foam::processorLduInterface::send } else { - FatalErrorIn("processorLduInterface::send") + FatalErrorInFunction << "Unsupported communications type " << commsType << exit(FatalError); } @@ -111,7 +111,7 @@ void Foam::processorLduInterface::receive } else { - FatalErrorIn("processorLduInterface::receive") + FatalErrorInFunction << "Unsupported communications type " << commsType << exit(FatalError); } @@ -196,7 +196,7 @@ void Foam::processorLduInterface::compressedSend } else { - FatalErrorIn("processorLduInterface::compressedSend") + FatalErrorInFunction << "Unsupported communications type " << commsType << exit(FatalError); } @@ -238,7 +238,7 @@ void Foam::processorLduInterface::compressedReceive } else if (commsType != Pstream::nonBlocking) { - FatalErrorIn("processorLduInterface::compressedReceive") + FatalErrorInFunction << "Unsupported communications type " << commsType << exit(FatalError); } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C index b8bc5c930c5..1f22e238e0b 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrix.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -260,7 +260,7 @@ const Foam::scalarField& Foam::lduMatrix::lower() const { if (!lowerPtr_ && !upperPtr_) { - FatalErrorIn("lduMatrix::lower() const") + FatalErrorInFunction << "lowerPtr_ or upperPtr_ unallocated" << abort(FatalError); } @@ -280,7 +280,7 @@ const Foam::scalarField& Foam::lduMatrix::diag() const { if (!diagPtr_) { - FatalErrorIn("const scalarField& lduMatrix::diag() const") + FatalErrorInFunction << "diagPtr_ unallocated" << abort(FatalError); } @@ -293,7 +293,7 @@ const Foam::scalarField& Foam::lduMatrix::upper() const { if (!lowerPtr_ && !upperPtr_) { - FatalErrorIn("lduMatrix::upper() const") + FatalErrorInFunction << "lowerPtr_ or upperPtr_ unallocated" << abort(FatalError); } diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C index afa02c02314..a473b2d6371 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixTemplates.C @@ -100,7 +100,7 @@ Foam::lduMatrix::faceH(const Field<Type>& psi) const } else { - FatalErrorIn("lduMatrix::faceH(const Field<Type>& psi) const") + FatalErrorInFunction << "Cannot calculate faceH" " the matrix does not have any off-diagonal coefficients." << exit(FatalError); diff --git a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixUpdateMatrixInterfaces.C b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixUpdateMatrixInterfaces.C index f40b23dc873..36db4b5f0fc 100644 --- a/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixUpdateMatrixInterfaces.C +++ b/src/OpenFOAM/matrices/lduMatrix/lduMatrix/lduMatrixUpdateMatrixInterfaces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,7 +85,7 @@ void Foam::lduMatrix::initMatrixInterfaces } else { - FatalErrorIn("lduMatrix::initMatrixInterfaces(..)") + FatalErrorInFunction << "Unsuported communications type " << Pstream::commsTypeNames[Pstream::defaultCommsType] << exit(FatalError); @@ -258,7 +258,7 @@ void Foam::lduMatrix::updateMatrixInterfaces } else { - FatalErrorIn("lduMatrix::updateMatrixInterfaces(..)") + FatalErrorInFunction << "Unsuported communications type " << Pstream::commsTypeNames[Pstream::defaultCommsType] << exit(FatalError); diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C index ce076177ed8..eb640e20100 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerateLduAddressing.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,17 +47,14 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing if (min(restrictMap) == -1) { - FatalErrorIn("GAMGAgglomeration::agglomerateLduAddressing") + FatalErrorInFunction << "min(restrictMap) == -1" << exit(FatalError); } if (restrictMap.size() != fineMeshAddr.size()) { - FatalErrorIn - ( - "GAMGAgglomeration::agglomerateLduAddressing" - "(const label fineLevelIndex)" - ) << "restrict map does not correspond to fine level. " << endl + FatalErrorInFunction + << "restrict map does not correspond to fine level. " << endl << " Sizes: restrictMap: " << restrictMap.size() << " nEqns: " << fineMeshAddr.size() << abort(FatalError); @@ -232,7 +229,7 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing } else { - FatalErrorIn("GAMGAgglomeration::agglomerateLduAddressing(..)") + FatalErrorInFunction << "problem." << " fineFacei:" << fineFacei << " rmUpperAddr:" << rmUpperAddr diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C index 6f5e4649afd..076bca07df7 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomeration.C @@ -302,11 +302,8 @@ const Foam::GAMGAgglomeration& Foam::GAMGAgglomeration::New if (cstrIter == lduMeshConstructorTablePtr_->end()) { - FatalErrorIn - ( - "GAMGAgglomeration::New" - "(const lduMesh& mesh, const dictionary& controlDict)" - ) << "Unknown GAMGAgglomeration type " + FatalErrorInFunction + << "Unknown GAMGAgglomeration type " << agglomeratorType << ".\n" << "Valid matrix GAMGAgglomeration types are :" << lduMatrixConstructorTablePtr_->sortedToc() << endl @@ -406,12 +403,8 @@ Foam::autoPtr<Foam::GAMGAgglomeration> Foam::GAMGAgglomeration::New if (cstrIter == geometryConstructorTablePtr_->end()) { - FatalErrorIn - ( - "GAMGAgglomeration::New" - "(const lduMesh& mesh, const scalarField&" - ", const vectorField&, const dictionary& controlDict)" - ) << "Unknown GAMGAgglomeration type " + FatalErrorInFunction + << "Unknown GAMGAgglomeration type " << agglomeratorType << ".\n" << "Valid geometric GAMGAgglomeration types are :" << geometryConstructorTablePtr_->sortedToc() @@ -581,10 +574,8 @@ bool Foam::GAMGAgglomeration::checkRestriction { if (fineAddressing.size() != restrict.size()) { - FatalErrorIn - ( - "checkRestriction(..)" - ) << "nCells:" << fineAddressing.size() + FatalErrorInFunction + << "nCells:" << fineAddressing.size() << " agglom:" << restrict.size() << abort(FatalError); } diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerationTemplates.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerationTemplates.C index e5d45cf24a6..645fee617d2 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerationTemplates.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGAgglomerations/GAMGAgglomeration/GAMGAgglomerationTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -103,12 +103,8 @@ void Foam::GAMGAgglomeration::restrictField if (!procAgglom && ff.size() != fineToCoarse.size()) { - FatalErrorIn - ( - "void GAMGAgglomeration::restrictField" - "(Field<Type>& cf, const Field<Type>& ff, " - "const label fineLevelIndex) const" - ) << "field does not correspond to level " << fineLevelIndex + FatalErrorInFunction + << "field does not correspond to level " << fineLevelIndex << " sizes: field = " << ff.size() << " level = " << fineToCoarse.size() << abort(FatalError); @@ -150,12 +146,8 @@ void Foam::GAMGAgglomeration::restrictFaceField if (ff.size() != fineToCoarse.size()) { - FatalErrorIn - ( - "void GAMGAgglomeration::restrictFaceField" - "(Field<Type>& cf, const Field<Type>& ff, " - "const label fineLevelIndex) const" - ) << "field does not correspond to level " << fineLevelIndex + FatalErrorInFunction + << "field does not correspond to level " << fineLevelIndex << " sizes: field = " << ff.size() << " level = " << fineToCoarse.size() << abort(FatalError); diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C index 1e34da34b3d..9233d11cfc3 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/GAMGProcAgglomeration/GAMGProcAgglomeration.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -369,11 +369,8 @@ Foam::autoPtr<Foam::GAMGProcAgglomeration> Foam::GAMGProcAgglomeration::New if (cstrIter == GAMGAgglomerationConstructorTablePtr_->end()) { - FatalErrorIn - ( - "GAMGProcAgglomeration::New(const word&, GAMGAgglomeration&" - ", const dictionary&) " - ) << "Unknown GAMGProcAgglomeration type " + FatalErrorInFunction + << "Unknown GAMGProcAgglomeration type " << type << " for GAMGAgglomeration " << agglom.type() << nl << nl << "Valid GAMGProcAgglomeration types are :" << endl << GAMGAgglomerationConstructorTablePtr_->sortedToc() diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/manualGAMGProcAgglomeration/manualGAMGProcAgglomeration.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/manualGAMGProcAgglomeration/manualGAMGProcAgglomeration.C index c67ce2b18b9..4c64f2dbfae 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/manualGAMGProcAgglomeration/manualGAMGProcAgglomeration.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGProcAgglomerations/manualGAMGProcAgglomeration/manualGAMGProcAgglomeration.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,7 +91,7 @@ bool Foam::manualGAMGProcAgglomeration::agglomerate() if (fineLevelIndex >= agglom_.size()) { - WarningIn("manualGAMGProcAgglomeration::agglomerate()") + WarningInFunction << "Ignoring specification for level " << fineLevelIndex << " since outside agglomeration." << endl; @@ -141,10 +141,8 @@ bool Foam::manualGAMGProcAgglomeration::agglomerate() if (masterIndex == -1) { - FatalErrorIn - ( - "manualGAMGProcAgglomeration::agglomerate()" - ) << "At level " << fineLevelIndex + FatalErrorInFunction + << "At level " << fineLevelIndex << " the master processor " << coarseToMaster[coarseI] << " is not in the cluster " @@ -165,10 +163,8 @@ bool Foam::manualGAMGProcAgglomeration::agglomerate() // Check that we've done all processors if (findIndex(procAgglomMap, -1) != -1) { - FatalErrorIn - ( - "manualGAMGProcAgglomeration::agglomerate()" - ) << "At level " << fineLevelIndex + FatalErrorInFunction + << "At level " << fineLevelIndex << " processor " << findIndex(procAgglomMap, -1) << " is not in any cluster" diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolver.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolver.C index 6538689b267..a30b67c76a9 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolver.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolver.C @@ -276,18 +276,8 @@ Foam::GAMGSolver::GAMGSolver } else { - FatalErrorIn - ( - "GAMGSolver::GAMGSolver" - "(" - "const word& fieldName," - "const lduMatrix& matrix," - "const FieldField<Field, scalar>& interfaceBouCoeffs," - "const FieldField<Field, scalar>& interfaceIntCoeffs," - "const lduInterfaceFieldPtrsList& interfaces," - "const dictionary& solverControls" - ")" - ) << "No coarse levels created, either matrix too small for GAMG" + FatalErrorInFunction + << "No coarse levels created, either matrix too small for GAMG" " or nCellsInCoarsestLevel too large.\n" " Either choose another solver of reduce " "nCellsInCoarsestLevel." diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverAgglomerateMatrix.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverAgglomerateMatrix.C index 1e096b2958e..d848394675c 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverAgglomerateMatrix.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/GAMGSolverAgglomerateMatrix.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -664,7 +664,7 @@ void Foam::GAMGSolver::procAgglomerateMatrix label allFaceI = map[i]; if (allFaceI < 0) { - FatalErrorIn("GAMGSolver::GAMGSolver()") + FatalErrorInFunction << "problem." << abort(FatalError); } allBou[allFaceI] = procBou[i]; diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C index 0407aa6051f..2a69e4dd00e 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaceFields/GAMGInterfaceField/GAMGInterfaceFieldNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,12 +40,8 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New if (cstrIter == lduInterfaceFieldConstructorTablePtr_->end()) { - FatalErrorIn - ( - "GAMGInterfaceField::New" - "(const GAMGInterface& GAMGCp, " - "const lduInterfaceField& fineInterface)" - ) << "Unknown GAMGInterfaceField type " + FatalErrorInFunction + << "Unknown GAMGInterfaceField type " << coupleType << nl << "Valid GAMGInterfaceField types are :" << lduInterfaceFieldConstructorTablePtr_->sortedToc() @@ -70,11 +66,8 @@ Foam::autoPtr<Foam::GAMGInterfaceField> Foam::GAMGInterfaceField::New if (cstrIter == lduInterfaceConstructorTablePtr_->end()) { - FatalErrorIn - ( - "GAMGInterfaceField::New" - "(const word&, const GAMGInterface&, const bool, const int)" - ) << "Unknown GAMGInterfaceField type " + FatalErrorInFunction + << "Unknown GAMGInterfaceField type " << coupleType << nl << "Valid GAMGInterfaceField types are :" << lduInterfaceConstructorTablePtr_->sortedToc() diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.C index 5e4065fcf3d..cd30d03c75d 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterface.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -85,20 +85,16 @@ Foam::tmp<Foam::scalarField> Foam::GAMGInterface::agglomerateCoeffs if (fineCoeffs.size() != faceRestrictAddressing_.size()) { - FatalErrorIn - ( - "GAMGInterface::agglomerateCoeffs(const scalarField&) const" - ) << "Size of coefficients " << fineCoeffs.size() + FatalErrorInFunction + << "Size of coefficients " << fineCoeffs.size() << " does not correspond to the size of the restriction " << faceRestrictAddressing_.size() << abort(FatalError); } if (debug && max(faceRestrictAddressing_) > size()) { - FatalErrorIn - ( - "GAMGInterface::agglomerateCoeffs(const scalarField&) const" - ) << "Face restrict addressing addresses outside of coarse interface" + FatalErrorInFunction + << "Face restrict addressing addresses outside of coarse interface" << " size. Max addressing:" << max(faceRestrictAddressing_) << " coarse size:" << size() << abort(FatalError); diff --git a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C index db7a362419c..5130ad12f84 100644 --- a/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C +++ b/src/OpenFOAM/matrices/lduMatrix/solvers/GAMG/interfaces/GAMGInterface/GAMGInterfaceNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,13 +48,8 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New if (cstrIter == lduInterfaceConstructorTablePtr_->end()) { - FatalErrorIn - ( - "GAMGInterface::New" - "(const lduInterface& fineInterface, " - "const labelField& localRestrictAddressing, " - "const labelField& neighbourRestrictAddressing)" - ) << "Unknown GAMGInterface type " << coupleType << ".\n" + FatalErrorInFunction + << "Unknown GAMGInterface type " << coupleType << ".\n" << "Valid GAMGInterface types are :" << lduInterfaceConstructorTablePtr_->sortedToc() << exit(FatalError); @@ -89,11 +84,8 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New if (cstrIter == IstreamConstructorTablePtr_->end()) { - FatalErrorIn - ( - "GAMGInterface::New" - "(const word&, const label, const lduInterfacePtrsList&, Istream&)" - ) << "Unknown GAMGInterface type " << coupleType << ".\n" + FatalErrorInFunction + << "Unknown GAMGInterface type " << coupleType << ".\n" << "Valid GAMGInterface types are :" << IstreamConstructorTablePtr_->sortedToc() << exit(FatalError); diff --git a/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C b/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C index 6db54a50da1..46f4a3ee1d6 100644 --- a/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C +++ b/src/OpenFOAM/matrices/scalarMatrices/scalarMatrices.C @@ -66,11 +66,8 @@ void Foam::LUDecompose if (largestCoeff == 0.0) { - FatalErrorIn - ( - "LUdecompose" - "(scalarSquareMatrix& matrix, labelList& rowIndices)" - ) << "Singular matrix" << exit(FatalError); + FatalErrorInFunction + << "Singular matrix" << exit(FatalError); } vv[i] = 1.0/largestCoeff; @@ -187,7 +184,7 @@ void Foam::LUDecompose(scalarSymmetricSquareMatrix& matrix) if (d < 0.0) { - FatalErrorIn("Foam::LUDecompose(scalarSymmetricSquareMatrix&)") + FatalErrorInFunction << "Matrix is not symmetric positive-definite. Unable to " << "decompose." << abort(FatalError); @@ -210,28 +207,16 @@ void Foam::multiply { if (A.m() != B.n()) { - FatalErrorIn - ( - "multiply(" - "const scalarRectangularMatrix& A, " - "const scalarRectangularMatrix& B, " - "const scalarRectangularMatrix& C, " - "scalarRectangularMatrix& answer)" - ) << "A and B must have identical inner dimensions but A.m = " + FatalErrorInFunction + << "A and B must have identical inner dimensions but A.m = " << A.m() << " and B.n = " << B.n() << abort(FatalError); } if (B.m() != C.n()) { - FatalErrorIn - ( - "multiply(" - "const scalarRectangularMatrix& A, " - "const scalarRectangularMatrix& B, " - "const scalarRectangularMatrix& C, " - "scalarRectangularMatrix& answer)" - ) << "B and C must have identical inner dimensions but B.m = " + FatalErrorInFunction + << "B and C must have identical inner dimensions but B.m = " << B.m() << " and C.n = " << C.n() << abort(FatalError); } @@ -266,28 +251,16 @@ void Foam::multiply { if (A.m() != B.size()) { - FatalErrorIn - ( - "multiply(" - "const scalarRectangularMatrix& A, " - "const DiagonalMatrix<scalar>& B, " - "const scalarRectangularMatrix& C, " - "scalarRectangularMatrix& answer)" - ) << "A and B must have identical inner dimensions but A.m = " + FatalErrorInFunction + << "A and B must have identical inner dimensions but A.m = " << A.m() << " and B.n = " << B.size() << abort(FatalError); } if (B.size() != C.n()) { - FatalErrorIn - ( - "multiply(" - "const scalarRectangularMatrix& A, " - "const DiagonalMatrix<scalar>& B, " - "const scalarRectangularMatrix& C, " - "scalarRectangularMatrix& answer)" - ) << "B and C must have identical inner dimensions but B.m = " + FatalErrorInFunction + << "B and C must have identical inner dimensions but B.m = " << B.size() << " and C.n = " << C.n() << abort(FatalError); } diff --git a/src/OpenFOAM/matrices/scalarMatrices/scalarMatricesTemplates.C b/src/OpenFOAM/matrices/scalarMatrices/scalarMatricesTemplates.C index fbf8db2685a..5f70c83b91e 100644 --- a/src/OpenFOAM/matrices/scalarMatrices/scalarMatricesTemplates.C +++ b/src/OpenFOAM/matrices/scalarMatrices/scalarMatricesTemplates.C @@ -68,7 +68,7 @@ void Foam::solve // Check that the system of equations isn't singular if (mag(tmpMatrix[i][i]) < 1e-20) { - FatalErrorIn("solve(scalarSquareMatrix&, Field<Type>& sourceSol)") + FatalErrorInFunction << "Singular Matrix" << exit(FatalError); } @@ -245,13 +245,8 @@ void Foam::multiply { if (A.m() != B.n()) { - FatalErrorIn - ( - "multiply(" - "Matrix<Form, Type>& answer " - "const Matrix<Form, Type>& A, " - "const Matrix<Form, Type>& B)" - ) << "A and B must have identical inner dimensions but A.m = " + FatalErrorInFunction + << "A and B must have identical inner dimensions but A.m = " << A.m() << " and B.n = " << B.n() << abort(FatalError); } diff --git a/src/OpenFOAM/matrices/simpleMatrix/simpleMatrix.C b/src/OpenFOAM/matrices/simpleMatrix/simpleMatrix.C index e9cb483fdd3..727db535d5b 100644 --- a/src/OpenFOAM/matrices/simpleMatrix/simpleMatrix.C +++ b/src/OpenFOAM/matrices/simpleMatrix/simpleMatrix.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -101,21 +101,21 @@ void Foam::simpleMatrix<Type>::operator=(const simpleMatrix<Type>& m) { if (this == &m) { - FatalErrorIn("simpleMatrix<Type>::operator=(const simpleMatrix<Type>&)") + FatalErrorInFunction << "Attempted assignment to self" << abort(FatalError); } if (n() != m.n()) { - FatalErrorIn("simpleMatrix<Type>::operator=(const simpleMatrix<Type>&)") + FatalErrorInFunction << "Different size matrices" << abort(FatalError); } if (source_.size() != m.source_.size()) { - FatalErrorIn("simpleMatrix<Type>::operator=(const simpleMatrix<Type>&)") + FatalErrorInFunction << "Different size source vectors" << abort(FatalError); } diff --git a/src/OpenFOAM/memory/autoPtr/autoPtrI.H b/src/OpenFOAM/memory/autoPtr/autoPtrI.H index 3557ffc49b2..961456e5b89 100644 --- a/src/OpenFOAM/memory/autoPtr/autoPtrI.H +++ b/src/OpenFOAM/memory/autoPtr/autoPtrI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,7 +100,7 @@ inline void Foam::autoPtr<T>::set(T* p) { if (ptr_) { - FatalErrorIn("void Foam::autoPtr<T>::set(T*)") + FatalErrorInFunction << "object of type " << typeid(T).name() << " already allocated" << abort(FatalError); @@ -136,7 +136,7 @@ inline T& Foam::autoPtr<T>::operator()() { if (!ptr_) { - FatalErrorIn("T& Foam::autoPtr<T>::operator()()") + FatalErrorInFunction << "object of type " << typeid(T).name() << " is not allocated" << abort(FatalError); @@ -151,7 +151,7 @@ inline const T& Foam::autoPtr<T>::operator()() const { if (!ptr_) { - FatalErrorIn("const T& Foam::autoPtr<T>::operator()() const") + FatalErrorInFunction << "object of type " << typeid(T).name() << " is not allocated" << abort(FatalError); @@ -173,7 +173,7 @@ inline T* Foam::autoPtr<T>::operator->() { if (!ptr_) { - FatalErrorIn("Foam::autoPtr<T>::operator->()") + FatalErrorInFunction << "object of type " << typeid(T).name() << " is not allocated" << abort(FatalError); diff --git a/src/OpenFOAM/memory/tmp/tmpI.H b/src/OpenFOAM/memory/tmp/tmpI.H index ad34bb4b17f..e289a06ca02 100644 --- a/src/OpenFOAM/memory/tmp/tmpI.H +++ b/src/OpenFOAM/memory/tmp/tmpI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,7 +61,7 @@ inline Foam::tmp<T>::tmp(const tmp<T>& t) } else { - FatalErrorIn("Foam::tmp<T>::tmp(const tmp<T>&)") + FatalErrorInFunction << "attempted copy of a deallocated temporary" << " of type " << typeid(T).name() << abort(FatalError); @@ -91,10 +91,8 @@ inline Foam::tmp<T>::tmp(const tmp<T>& t, bool allowTransfer) } else { - FatalErrorIn - ( - "Foam::tmp<T>::tmp(const tmp<T>&, bool allowTransfer)" - ) << "attempted copy of a deallocated temporary" + FatalErrorInFunction + << "attempted copy of a deallocated temporary" << " of type " << typeid(T).name() << abort(FatalError); } @@ -151,7 +149,7 @@ inline T* Foam::tmp<T>::ptr() const { if (!ptr_) { - FatalErrorIn("Foam::tmp<T>::ptr() const") + FatalErrorInFunction << "temporary of type " << typeid(T).name() << " deallocated" << abort(FatalError); } @@ -190,7 +188,7 @@ inline T& Foam::tmp<T>::operator()() { if (!ptr_) { - FatalErrorIn("T& Foam::tmp<T>::operator()()") + FatalErrorInFunction << "temporary of type " << typeid(T).name() << " deallocated" << abort(FatalError); } @@ -219,7 +217,7 @@ inline const T& Foam::tmp<T>::operator()() const { if (!ptr_) { - FatalErrorIn("const T& Foam::tmp<T>::operator()() const") + FatalErrorInFunction << "temporary of type " << typeid(T).name() << " deallocated" << abort(FatalError); } @@ -247,7 +245,7 @@ inline T* Foam::tmp<T>::operator->() { if (!ptr_) { - FatalErrorIn("Foam::tmp<T>::operator->()") + FatalErrorInFunction << "temporary of type " << typeid(T).name() << " deallocated" << abort(FatalError); } @@ -295,7 +293,7 @@ inline void Foam::tmp<T>::operator=(const tmp<T>& t) } else { - FatalErrorIn("Foam::tmp<T>::operator=(const tmp<T>&)") + FatalErrorInFunction << "attempted copy of a deallocated temporary" << " of type " << typeid(T).name() << abort(FatalError); @@ -303,7 +301,7 @@ inline void Foam::tmp<T>::operator=(const tmp<T>& t) } else { - FatalErrorIn("Foam::tmp<T>::operator=(const tmp<T>&)") + FatalErrorInFunction << "attempted to assign to a const reference to constant object" << " of type " << typeid(T).name() << abort(FatalError); diff --git a/src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifier.C b/src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifier.C index e520c539616..bf01fe7be95 100644 --- a/src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifier.C +++ b/src/OpenFOAM/meshes/Identifiers/patch/coupleGroupIdentifier.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,10 +39,8 @@ Foam::label Foam::coupleGroupIdentifier::findOtherPatchID if (!valid()) { - FatalErrorIn - ( - "coupleGroupIdentifier::findOtherPatchID(const polyPatch&) const" - ) << "Invalid coupleGroup patch group" + FatalErrorInFunction + << "Invalid coupleGroup patch group" << " on patch " << thisPatch.name() << " in region " << pbm.mesh().name() << exit(FatalError); @@ -56,11 +54,8 @@ Foam::label Foam::coupleGroupIdentifier::findOtherPatchID if (&mesh == &thisPatch.boundaryMesh().mesh()) { // thisPatch should be in patchGroup - FatalErrorIn - ( - "coupleGroupIdentifier::findOtherPatchID" - "(const polyMesh&, const polyPatch&) const" - ) << "Patch " << thisPatch.name() + FatalErrorInFunction + << "Patch " << thisPatch.name() << " should be in patchGroup " << name() << " in region " << pbm.mesh().name() << exit(FatalError); @@ -76,11 +71,8 @@ Foam::label Foam::coupleGroupIdentifier::findOtherPatchID { if (patchIDs.size() > 2 || patchIDs.size() == 0) { - FatalErrorIn - ( - "coupleGroupIdentifier::findOtherPatchID" - "(const polyMesh&, const polyPatch&) const" - ) << "Couple patchGroup " << name() + FatalErrorInFunction + << "Couple patchGroup " << name() << " with contents " << patchIDs << " not of size < 2" << " on patch " << thisPatch.name() @@ -94,11 +86,8 @@ Foam::label Foam::coupleGroupIdentifier::findOtherPatchID if (index == -1) { - FatalErrorIn - ( - "coupleGroupIdentifier::findOtherPatchID" - "(const polyMesh&, const polyPatch&) const" - ) << "Couple patchGroup " << name() + FatalErrorInFunction + << "Couple patchGroup " << name() << " with contents " << patchIDs << " does not contain patch " << thisPatch.name() << " in region " << pbm.mesh().name() @@ -122,11 +111,8 @@ Foam::label Foam::coupleGroupIdentifier::findOtherPatchID { if (patchIDs.size() != 1) { - FatalErrorIn - ( - "coupleGroupIdentifier::findOtherPatchID" - "(const polyMesh&, const polyPatch&) const" - ) << "Couple patchGroup " << name() + FatalErrorInFunction + << "Couple patchGroup " << name() << " with contents " << patchIDs << " in region " << mesh.name() << " should only contain a single patch" @@ -199,11 +185,8 @@ Foam::label Foam::coupleGroupIdentifier::findOtherPatchID { if (otherPatchID != -1) { - FatalErrorIn - ( - "coupleGroupIdentifier::findOtherPatchID" - "(const polyPatch&, word&) const" - ) << "Couple patchGroup " << name() + FatalErrorInFunction + << "Couple patchGroup " << name() << " should be present on only two patches" << " in any of the meshes in " << meshSet.sortedToc() << endl @@ -223,11 +206,8 @@ Foam::label Foam::coupleGroupIdentifier::findOtherPatchID if (otherPatchID == -1) { - FatalErrorIn - ( - "coupleGroupIdentifier::findOtherPatchID" - "(const polyPatch&, word&) const" - ) << "Couple patchGroup " << name() + FatalErrorInFunction + << "Couple patchGroup " << name() << " not found in any of the other meshes " << meshSet.sortedToc() << " on patch " << thisPatch.name() << " region " << thisMesh.name() diff --git a/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.C b/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.C index d285ca5ae4e..ca625a2a882 100644 --- a/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.C +++ b/src/OpenFOAM/meshes/ProcessorTopology/commSchedule.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -82,11 +82,8 @@ Foam::commSchedule::commSchedule if (proc0 < 0 || proc0 >= nProcs || proc1 < 0 || proc1 >= nProcs) { - FatalErrorIn - ( - "commSchedule::commSchedule" - "(const label, const List<labelPair>&)" - ) << "Illegal processor " << comms[commI] << abort(FatalError); + FatalErrorInFunction + << "Illegal processor " << comms[commI] << abort(FatalError); } procToComms[proc0].append(commI); diff --git a/src/OpenFOAM/meshes/lduMesh/lduPrimitiveMesh.C b/src/OpenFOAM/meshes/lduMesh/lduPrimitiveMesh.C index 2563ff14bbb..13731a858b4 100644 --- a/src/OpenFOAM/meshes/lduMesh/lduPrimitiveMesh.C +++ b/src/OpenFOAM/meshes/lduMesh/lduPrimitiveMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,21 +68,15 @@ void Foam::lduPrimitiveMesh::checkUpperTriangular { if (u[faceI] < l[faceI]) { - FatalErrorIn - ( - "checkUpperTriangular" - "(const label, const labelUList&, const labelUList&)" - ) << "Reversed face. Problem at face " << faceI + FatalErrorInFunction + << "Reversed face. Problem at face " << faceI << " l:" << l[faceI] << " u:" << u[faceI] << abort(FatalError); } if (l[faceI] < 0 || u[faceI] < 0 || u[faceI] >= size) { - FatalErrorIn - ( - "checkUpperTriangular" - "(const label, const labelUList&, const labelUList&)" - ) << "Illegal cell label. Problem at face " << faceI + FatalErrorInFunction + << "Illegal cell label. Problem at face " << faceI << " l:" << l[faceI] << " u:" << u[faceI] << abort(FatalError); } @@ -92,11 +86,8 @@ void Foam::lduPrimitiveMesh::checkUpperTriangular { if (l[faceI-1] > l[faceI]) { - FatalErrorIn - ( - "checkUpperTriangular" - "(const label, const labelUList&, const labelUList&)" - ) << "Lower not in incremental cell order." + FatalErrorInFunction + << "Lower not in incremental cell order." << " Problem at face " << faceI << " l:" << l[faceI] << " u:" << u[faceI] << " previous l:" << l[faceI-1] @@ -107,11 +98,8 @@ void Foam::lduPrimitiveMesh::checkUpperTriangular // Same cell. if (u[faceI-1] > u[faceI]) { - FatalErrorIn - ( - "checkUpperTriangular" - "(const label, const labelUList&, const labelUList&)" - ) << "Upper not in incremental cell order." + FatalErrorInFunction + << "Upper not in incremental cell order." << " Problem at face " << faceI << " l:" << l[faceI] << " u:" << u[faceI] << " previous u:" << u[faceI-1] @@ -151,7 +139,7 @@ Foam::labelList Foam::lduPrimitiveMesh::upperTriOrder { if (upper[faceI] < lower[faceI]) { - FatalErrorIn("lduPrimitiveMesh::upperTriOrder(..)") + FatalErrorInFunction << "Problem at face:" << faceI << " lower:" << lower[faceI] << " upper:" << upper[faceI] @@ -309,10 +297,8 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh { if (otherMeshes[i].comm() != currentComm) { - WarningIn - ( - "lduPrimitiveMesh::lduPrimitiveMesh(..)" - ) << "Communicator " << otherMeshes[i].comm() + WarningInFunction + << "Communicator " << otherMeshes[i].comm() << " at index " << i << " differs from that of predecessor " << currentComm @@ -337,10 +323,8 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh { if (procAgglomMap[procIDs[i]] != procAgglomMap[procIDs[0]]) { - FatalErrorIn - ( - "lduPrimitiveMesh::lduPrimitiveMesh(..)" - ) << "Processor " << procIDs[i] + FatalErrorInFunction + << "Processor " << procIDs[i] << " agglomerates to " << procAgglomMap[procIDs[i]] << " whereas other processors " << procIDs << " agglomerate to " @@ -423,7 +407,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh if (agglom0 != myAgglom && agglom1 != myAgglom) { - FatalErrorIn("lduPrimitiveMesh::lduPrimitiveMesh(..)") + FatalErrorInFunction << "At mesh from processor " << procIDs[procMeshI] << " have interface " << intI << " with myProcNo:" << pldui.myProcNo() @@ -501,7 +485,7 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh else { // Still external (non proc) interface - FatalErrorIn("lduPrimitiveMesh::lduPrimitiveMesh(..)") + FatalErrorInFunction << "At mesh from processor " << procIDs[procMeshI] << " have interface " << intI << " of unhandled type " << interfaces[intI].type() @@ -691,10 +675,8 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh if (nbrIntI == -1) { - FatalErrorIn - ( - "lduPrimitiveMesh::lduPrimitiveMesh(..)" - ) << "elems:" << elems << abort(FatalError); + FatalErrorInFunction + << "elems:" << elems << abort(FatalError); } @@ -713,10 +695,8 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh if (faceCells.size() != nbrFaceCells.size()) { - FatalErrorIn - ( - "lduPrimitiveMesh::lduPrimitiveMesh(..)" - ) << "faceCells:" << faceCells + FatalErrorInFunction + << "faceCells:" << faceCells << " nbrFaceCells:" << nbrFaceCells << abort(FatalError); } @@ -915,10 +895,8 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh { if (iter.key()[1] == myAgglom) { - FatalErrorIn - ( - "lduPrimitiveMesh::lduPrimitiveMesh(..)" - ) << "problem procEdge:" << iter.key() + FatalErrorInFunction + << "problem procEdge:" << iter.key() << exit(FatalError); } @@ -928,10 +906,8 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh { if (iter.key()[1] != myAgglom) { - FatalErrorIn - ( - "lduPrimitiveMesh::lduPrimitiveMesh(..)" - ) << "problem procEdge:" << iter.key() + FatalErrorInFunction + << "problem procEdge:" << iter.key() << exit(FatalError); } diff --git a/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C b/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C index f94aef37f99..5d7ff59ba89 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C +++ b/src/OpenFOAM/meshes/meshShapes/cellMatcher/cellMatcher.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -174,11 +174,8 @@ void Foam::cellMatcher::calcEdgeAddressing(const label numVert) } else { - FatalErrorIn - ( - "calcEdgeAddressing" - "(const faceList&, const label)" - ) << "edgeFaces_ full at entry:" << key1 + FatalErrorInFunction + << "edgeFaces_ full at entry:" << key1 << " for edge " << start << " " << end << abort(FatalError); } @@ -239,12 +236,8 @@ Foam::label Foam::cellMatcher::otherFace } else { - FatalErrorIn - ( - "otherFace" - "(const label, const labelList&, const label, const label, " - "const label)" - ) << "edgeFaces_ does not contain:" << localFaceI + FatalErrorInFunction + << "edgeFaces_ does not contain:" << localFaceI << " for edge " << v0 << " " << v1 << " at key " << key << " edgeFaces_[key, key+1]:" << edgeFaces_[key] << " , " << edgeFaces_[key+1] diff --git a/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.C b/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.C index b3c1f1eaad4..c43aa0abaf6 100644 --- a/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.C +++ b/src/OpenFOAM/meshes/meshShapes/cellModeller/cellModeller.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,7 +34,7 @@ Foam::cellModeller::cellModeller() { if (modelPtrs_.size()) { - FatalErrorIn("cellModeller::cellModeller(const fileName&)") + FatalErrorInFunction << "attempt to re-construct cellModeller when it already exists" << exit(FatalError); } @@ -56,7 +56,7 @@ Foam::cellModeller::cellModeller() { if (modelPtrs_[models_[i].index()]) { - FatalErrorIn("cellModeller::cellModeller(const fileName&)") + FatalErrorInFunction << "more than one model share the index " << models_[i].index() << exit(FatalError); @@ -66,7 +66,7 @@ Foam::cellModeller::cellModeller() if (modelDictionary_.found(models_[i].name())) { - FatalErrorIn("cellModeller::cellModeller(const fileName&)") + FatalErrorInFunction << "more than one model share the name " << models_[i].name() << exit(FatalError); diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.C b/src/OpenFOAM/meshes/meshShapes/face/face.C index 30847ce3ca6..b4dd451c90b 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.C +++ b/src/OpenFOAM/meshes/meshShapes/face/face.C @@ -135,12 +135,7 @@ Foam::label Foam::face::split if (size() <= 2) { - FatalErrorIn - ( - "face::split" - "(const face::splitMode, const pointField&, label&, label&" - ", faceList&, faceList&)" - ) + FatalErrorInFunction << "Serious problem: asked to split a face with < 3 vertices" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/meshShapes/tetCell/tetCellI.H b/src/OpenFOAM/meshes/meshShapes/tetCell/tetCellI.H index d777156ee3b..218fa12e9b8 100644 --- a/src/OpenFOAM/meshes/meshShapes/tetCell/tetCellI.H +++ b/src/OpenFOAM/meshes/meshShapes/tetCell/tetCellI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,7 +73,7 @@ inline Foam::triFace Foam::tetCell::face(const label faceI) const # ifdef FULLDEBUG if (faceI >= 4) { - FatalErrorIn("tetCell::face(const label faceI) const") + FatalErrorInFunction << "index out of range 0 -> 3. faceI = " << faceI << abort(FatalError); } @@ -98,11 +98,8 @@ inline Foam::label Foam::tetCell::edgeFace(const label edgeI) const # ifdef FULLDEBUG if (edgeI >= 6) { - FatalErrorIn - ( - "tetCell::edgeFace(const label edgeI)" - "const" - ) << "edge index out of range 0 -> 5. edgeI = " << edgeI + FatalErrorInFunction + << "edge index out of range 0 -> 5. edgeI = " << edgeI << abort(FatalError); } # endif @@ -132,21 +129,15 @@ inline Foam::label Foam::tetCell::edgeAdjacentFace # ifdef FULLDEBUG if (faceI >= 4) { - FatalErrorIn - ( - "tetCell::edgeAdjacentFace(const label edgeI, const label faceI)" - "const" - ) << "face index out of range 0 -> 3. faceI = " << faceI + FatalErrorInFunction + << "face index out of range 0 -> 3. faceI = " << faceI << abort(FatalError); } if (edgeI >= 6) { - FatalErrorIn - ( - "tetCell::edgeAdjacentFace(const label edgeI, const label faceI)" - "const" - ) << "edge index out of range 0 -> 5. edgeI = " << edgeI + FatalErrorInFunction + << "edge index out of range 0 -> 5. edgeI = " << edgeI << abort(FatalError); } # endif @@ -166,7 +157,7 @@ inline Foam::edge Foam::tetCell::tetEdge(const label edgeI) const # ifdef FULLDEBUG if (edgeI >= 6) { - FatalErrorIn("tetCell::tetEdge(const label edgeI) const") + FatalErrorInFunction << "index out of range 0 -> 5. edgeI = " << edgeI << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/MapPointField.H b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/MapPointField.H index bb824c0f57c..8248e5e09cb 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/MapPointField.H +++ b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/MapPointField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -69,14 +69,8 @@ void MapInternalField<Type, MeshMapper, pointMesh>::operator() { if (field.size() != mapper.pointMap().sizeBeforeMapping()) { - FatalErrorIn - ( - "void MapInternalField<Type, MeshMapper, pointMesh>::operator()\n" - "(\n" - " Field<Type>& field,\n" - " const MeshMapper& mapper\n" - ") const" - ) << "Incompatible size before mapping. Field size: " << field.size() + FatalErrorInFunction + << "Incompatible size before mapping. Field size: " << field.size() << " map size: " << mapper.pointMap().sizeBeforeMapping() << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C index b598acf072c..51eaab0d25b 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C +++ b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointMapper.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ void Foam::pointMapper::calcAddressing() const || insertedPointLabelsPtr_ ) { - FatalErrorIn("void pointMapper::calcAddressing() const") + FatalErrorInFunction << "Addressing already calculated." << abort(FatalError); } @@ -98,7 +98,7 @@ void Foam::pointMapper::calcAddressing() const if (addr[pointI].size()) { - FatalErrorIn("void pointMapper::calcAddressing() const") + FatalErrorInFunction << "Master point " << pointI << " mapped from points " << mo << " already destination of mapping." << abort(FatalError); @@ -237,10 +237,8 @@ const Foam::labelUList& Foam::pointMapper::directAddressing() const { if (!direct()) { - FatalErrorIn - ( - "const labelUList& pointMapper::directAddressing() const" - ) << "Requested direct addressing for an interpolative mapper." + FatalErrorInFunction + << "Requested direct addressing for an interpolative mapper." << abort(FatalError); } @@ -265,10 +263,8 @@ const Foam::labelListList& Foam::pointMapper::addressing() const { if (direct()) { - FatalErrorIn - ( - "const labelListList& pointMapper::addressing() const" - ) << "Requested interpolative addressing for a direct mapper." + FatalErrorInFunction + << "Requested interpolative addressing for a direct mapper." << abort(FatalError); } @@ -285,10 +281,8 @@ const Foam::scalarListList& Foam::pointMapper::weights() const { if (direct()) { - FatalErrorIn - ( - "const scalarListList& pointMapper::weights() const" - ) << "Requested interpolative weights for a direct mapper." + FatalErrorInFunction + << "Requested interpolative weights for a direct mapper." << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C index 624897bc098..1732a7ba0c0 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C +++ b/src/OpenFOAM/meshes/pointMesh/pointMeshMapper/pointPatchMapper.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,10 +40,8 @@ void Foam::pointPatchMapper::calcAddressing() const || weightsPtr_ ) { - FatalErrorIn - ( - "void pointPatchMapper::calcAddressing() const" - ) << "Addressing already calculated" + FatalErrorInFunction + << "Addressing already calculated" << abort(FatalError); } @@ -150,10 +148,8 @@ const Foam::labelUList& Foam::pointPatchMapper::directAddressing() const { if (!direct()) { - FatalErrorIn - ( - "const labelUList& pointPatchMapper::directAddressing() const" - ) << "Requested direct addressing for an interpolative mapper." + FatalErrorInFunction + << "Requested direct addressing for an interpolative mapper." << abort(FatalError); } @@ -170,10 +166,8 @@ const Foam::labelListList& Foam::pointPatchMapper::addressing() const { if (direct()) { - FatalErrorIn - ( - "const labelListList& pointPatchMapper::addressing() const" - ) << "Requested interpolative addressing for a direct mapper." + FatalErrorInFunction + << "Requested interpolative addressing for a direct mapper." << abort(FatalError); } @@ -190,10 +184,8 @@ const Foam::scalarListList& Foam::pointPatchMapper::weights() const { if (direct()) { - FatalErrorIn - ( - "const scalarListList& pointPatchMapper::weights() const" - ) << "Requested interpolative weights for a direct mapper." + FatalErrorInFunction + << "Requested interpolative weights for a direct mapper." << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C index 073733e5f6f..b5a1b29dc9a 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/facePointPatch/facePointPatchNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -46,11 +46,8 @@ Foam::autoPtr<Foam::facePointPatch> Foam::facePointPatch::New if (cstrIter == polyPatchConstructorTablePtr_->end()) { - FatalErrorIn - ( - "facePointPatch::New(const polyPatch&, " - "const pointBoundaryMesh&) : " - ) << "Unknown facePointPatch type " + FatalErrorInFunction + << "Unknown facePointPatch type " << patch.type() << nl << nl << "Valid facePointPatch types are :" << endl diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C index 3d6a6fc025c..b8dc8896ca3 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,11 +54,8 @@ Foam::globalIndex::globalIndex if (offset < oldOffset) { - FatalErrorIn - ( - "globalIndex::globalIndex" - "(const label, const int, const label, const bool)" - ) << "Overflow : sum of sizes " << localSizes + FatalErrorInFunction + << "Overflow : sum of sizes " << localSizes << " exceeds capability of label (" << labelMax << "). Please recompile with larger datatype for label." << exit(FatalError); @@ -86,7 +83,7 @@ Foam::globalIndex::globalIndex(const label localSize) if (offset < oldOffset) { - FatalErrorIn("globalIndex::globalIndex(const label)") + FatalErrorInFunction << "Overflow : sum of sizes " << localSizes << " exceeds capability of label (" << labelMax << "). Please recompile with larger datatype for label." diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H index e194d995a86..bd71c2c9470 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -105,7 +105,7 @@ const if (localI < 0 || i >= offsets_[procI+1]) { - FatalErrorIn("globalIndex::toLocal(const label, const label)") + FatalErrorInFunction << "Global " << i << " does not belong on processor " << procI << endl << "Offsets:" << offsets_ << abort(FatalError); @@ -124,7 +124,7 @@ inline Foam::label Foam::globalIndex::whichProcID(const label i) const { if (i < 0 || i >= size()) { - FatalErrorIn("globalIndex::whichProcID(const label)") + FatalErrorInFunction << "Global " << i << " does not belong on any processor." << " Offsets:" << offsets_ << abort(FatalError); diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C index 08435991eeb..5532969f369 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndexTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,7 +84,7 @@ void Foam::globalIndex::gather if (!contiguous<Type>()) { - FatalErrorIn("globalIndex::gather(..)") + FatalErrorInFunction << "nonBlocking not supported for non-contiguous data" << exit(FatalError); } @@ -146,7 +146,7 @@ void Foam::globalIndex::gather if (!contiguous<Type>()) { - FatalErrorIn("globalIndex::gather(..)") + FatalErrorInFunction << "nonBlocking not supported for non-contiguous data" << exit(FatalError); } @@ -252,7 +252,7 @@ void Foam::globalIndex::scatter if (!contiguous<Type>()) { - FatalErrorIn("globalIndex::scatter(..)") + FatalErrorInFunction << "nonBlocking not supported for non-contiguous data" << exit(FatalError); } @@ -319,7 +319,7 @@ void Foam::globalIndex::scatter if (!contiguous<Type>()) { - FatalErrorIn("globalIndex::scatter(..)") + FatalErrorInFunction << "nonBlocking not supported for non-contiguous data" << exit(FatalError); } diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C index 5cf963fff3c..6db74800937 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshData.C @@ -140,7 +140,7 @@ void Foam::globalMeshData::calcSharedPoints() const || sharedPointAddrPtr_.valid() ) { - FatalErrorIn("globalMeshData::calcSharedPoints()") + FatalErrorInFunction << "Shared point addressing already done" << abort(FatalError); } @@ -307,7 +307,7 @@ void Foam::globalMeshData::calcSharedEdges() const || sharedEdgeAddrPtr_.valid() ) { - FatalErrorIn("globalMeshData::calcSharedEdges()") + FatalErrorInFunction << "Shared edge addressing already done" << abort(FatalError); } @@ -845,7 +845,7 @@ Foam::label Foam::globalMeshData::findTransform if (remoteTransformI == -1 || localTransformI == -1) { - FatalErrorIn("globalMeshData::findTransform(..)") + FatalErrorInFunction << "Problem. Cannot find " << remotePoint << " or " << localPoint << " " << coupledPatch().localPoints()[localPoint] @@ -1177,10 +1177,8 @@ void Foam::globalMeshData::calcGlobalEdgeOrientation() const ); if (stat == 0) { - FatalErrorIn - ( - "globalMeshData::calcGlobalEdgeOrientation() const" - ) << "problem : my edge:" << e + FatalErrorInFunction + << "problem : my edge:" << e << " in master points:" << masterE << " v.s. masterEdgeVerts:" << masterEdgeVerts[edgeI] << exit(FatalError); diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshDataTemplates.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshDataTemplates.C index 664dffd55f4..01ed808f25f 100644 --- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshDataTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalMeshDataTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -177,7 +177,7 @@ void Foam::globalMeshData::syncPointData { if (pointData.size() != mesh_.nPoints()) { - FatalErrorIn("globalMeshData::syncPointData(..)") + FatalErrorInFunction << "Number of elements in data:" << pointData.size() << " differs from number of points in mesh:" << mesh_.nPoints() << abort(FatalError); diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C index 84dfacf47c5..ed8f78c259c 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/cellMapper/cellMapper.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,7 +40,7 @@ void Foam::cellMapper::calcAddressing() const || insertedCellLabelsPtr_ ) { - FatalErrorIn("void cellMapper::calcAddressing() const") + FatalErrorInFunction << "Addressing already calculated." << abort(FatalError); } @@ -94,7 +94,7 @@ void Foam::cellMapper::calcAddressing() const if (addr[cellI].size()) { - FatalErrorIn("void cellMapper::calcAddressing() const") + FatalErrorInFunction << "Master cell " << cellI << " mapped from point cells " << mo << " already destination of mapping." << abort(FatalError); @@ -116,7 +116,7 @@ void Foam::cellMapper::calcAddressing() const if (addr[cellI].size()) { - FatalErrorIn("void cellMapper::calcAddressing() const") + FatalErrorInFunction << "Master cell " << cellI << " mapped from edge cells " << mo << " already destination of mapping." << abort(FatalError); @@ -138,7 +138,7 @@ void Foam::cellMapper::calcAddressing() const if (addr[cellI].size()) { - FatalErrorIn("void cellMapper::calcAddressing() const") + FatalErrorInFunction << "Master cell " << cellI << " mapped from face cells " << mo << " already destination of mapping." << abort(FatalError); @@ -162,7 +162,7 @@ void Foam::cellMapper::calcAddressing() const if (addr[cellI].size()) { - FatalErrorIn("void cellMapper::calcAddressing() const") + FatalErrorInFunction << "Master cell " << cellI << " mapped from cell cells " << mo << " already destination of mapping." @@ -181,7 +181,7 @@ void Foam::cellMapper::calcAddressing() const if (V.size() != sizeBeforeMapping()) { - FatalErrorIn("void cellMapper::calcAddressing() const") + FatalErrorInFunction << "cellVolumes size " << V.size() << " is not the old number of cells " << sizeBeforeMapping() << ". Are your cellVolumes already mapped?" @@ -390,10 +390,8 @@ const Foam::labelUList& Foam::cellMapper::directAddressing() const { if (!direct()) { - FatalErrorIn - ( - "const labelUList& cellMapper::directAddressing() const" - ) << "Requested direct addressing for an interpolative mapper." + FatalErrorInFunction + << "Requested direct addressing for an interpolative mapper." << abort(FatalError); } @@ -418,10 +416,8 @@ const Foam::labelListList& Foam::cellMapper::addressing() const { if (direct()) { - FatalErrorIn - ( - "const labelListList& cellMapper::addressing() const" - ) << "Requested interpolative addressing for a direct mapper." + FatalErrorInFunction + << "Requested interpolative addressing for a direct mapper." << abort(FatalError); } @@ -438,10 +434,8 @@ const Foam::scalarListList& Foam::cellMapper::weights() const { if (direct()) { - FatalErrorIn - ( - "const scalarListList& cellMapper::weights() const" - ) << "Requested interpolative weights for a direct mapper." + FatalErrorInFunction + << "Requested interpolative weights for a direct mapper." << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C index 803e523d41d..71ca27fa851 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/faceMapper/faceMapper.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,7 +40,7 @@ void Foam::faceMapper::calcAddressing() const || insertedFaceLabelsPtr_ ) { - FatalErrorIn("void faceMapper::calcAddressing() const") + FatalErrorInFunction << "Addressing already calculated." << abort(FatalError); } @@ -94,7 +94,7 @@ void Foam::faceMapper::calcAddressing() const if (addr[faceI].size()) { - FatalErrorIn("void faceMapper::calcAddressing() const") + FatalErrorInFunction << "Master face " << faceI << " mapped from point faces " << mo << " already destination of mapping." << abort(FatalError); @@ -116,7 +116,7 @@ void Foam::faceMapper::calcAddressing() const if (addr[faceI].size()) { - FatalErrorIn("void faceMapper::calcAddressing() const") + FatalErrorInFunction << "Master face " << faceI << " mapped from edge faces " << mo << " already destination of mapping." << abort(FatalError); @@ -138,7 +138,7 @@ void Foam::faceMapper::calcAddressing() const if (addr[faceI].size()) { - FatalErrorIn("void faceMapper::calcAddressing() const") + FatalErrorInFunction << "Master face " << faceI << " mapped from face faces " << mo << " already destination of mapping." << abort(FatalError); @@ -303,10 +303,8 @@ const Foam::labelUList& Foam::faceMapper::directAddressing() const { if (!direct()) { - FatalErrorIn - ( - "const labelUList& faceMapper::directAddressing() const" - ) << "Requested direct addressing for an interpolative mapper." + FatalErrorInFunction + << "Requested direct addressing for an interpolative mapper." << abort(FatalError); } @@ -331,10 +329,8 @@ const Foam::labelListList& Foam::faceMapper::addressing() const { if (direct()) { - FatalErrorIn - ( - "const labelListList& faceMapper::addressing() const" - ) << "Requested interpolative addressing for a direct mapper." + FatalErrorInFunction + << "Requested interpolative addressing for a direct mapper." << abort(FatalError); } @@ -351,10 +347,8 @@ const Foam::scalarListList& Foam::faceMapper::weights() const { if (direct()) { - FatalErrorIn - ( - "const scalarListList& faceMapper::weights() const" - ) << "Requested interpolative weights for a direct mapper." + FatalErrorInFunction + << "Requested interpolative weights for a direct mapper." << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C index 8feeefcffe2..c7d93e6d9c0 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -285,19 +285,8 @@ void Foam::mapDistribute::checkReceivedSize { if (receivedSize != expectedSize) { - FatalErrorIn - ( - "template<class T>\n" - "void mapDistribute::distribute\n" - "(\n" - " const Pstream::commsTypes commsType,\n" - " const List<labelPair>& schedule,\n" - " const label constructSize,\n" - " const labelListList& subMap,\n" - " const labelListList& constructMap,\n" - " List<T>& field\n" - ")\n" - ) << "Expected from processor " << procI + FatalErrorInFunction + << "Expected from processor " << procI << " " << expectedSize << " but received " << receivedSize << " elements." << abort(FatalError); @@ -341,7 +330,7 @@ void Foam::mapDistribute::printLayout(Ostream& os) const { if (minIndex[procI] != offset) { - FatalErrorIn("mapDistribute::printLayout(..)") + FatalErrorInFunction << "offset:" << offset << " procI:" << procI << " minIndex:" << minIndex[procI] @@ -700,10 +689,8 @@ Foam::mapDistribute::mapDistribute { if (sendProcs.size() != recvProcs.size()) { - FatalErrorIn - ( - "mapDistribute::mapDistribute(const labelList&, const labelList&)" - ) << "The send and receive data is not the same length. sendProcs:" + FatalErrorInFunction + << "The send and receive data is not the same length. sendProcs:" << sendProcs.size() << " recvProcs:" << recvProcs.size() << abort(FatalError); } @@ -1326,10 +1313,8 @@ void Foam::mapDistribute::operator=(const mapDistribute& rhs) // Check for assignment to self if (this == &rhs) { - FatalErrorIn - ( - "Foam::mapDistribute::operator=(const Foam::mapDistribute&)" - ) << "Attempted assignment to self" + FatalErrorInFunction + << "Attempted assignment to self" << abort(FatalError); } constructSize_ = rhs.constructSize_; diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.C index 0dc63bdb577..8df3c0a211a 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributePolyMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,7 @@ void Foam::mapDistributePolyMesh::calcPatchSizes() if (min(oldPatchSizes_) < 0) { - FatalErrorIn("mapDistributePolyMesh::calcPatchSizes()") + FatalErrorInFunction << "Calculated negative old patch size:" << oldPatchSizes_ << nl << "Error in mapping data" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeTemplates.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeTemplates.C index 577af21ed12..becc4a77ce9 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistributeTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -374,7 +374,7 @@ void Foam::mapDistribute::distribute } else { - FatalErrorIn("mapDistribute::distribute(..)") + FatalErrorInFunction << "Unknown communication schedule " << commsType << abort(FatalError); } @@ -721,7 +721,7 @@ void Foam::mapDistribute::distribute } else { - FatalErrorIn("mapDistribute::distribute(..)") + FatalErrorInFunction << "Unknown communication schedule " << commsType << abort(FatalError); } @@ -767,15 +767,8 @@ void Foam::mapDistribute::receive(PstreamBuffers& pBufs, List<T>& field) const if (recvField.size() != map.size()) { - FatalErrorIn - ( - "template<class T>\n" - "void mapDistribute::receive\n" - "(\n" - " PstreamBuffers&,\n" - " List<T>&\n" - ")\n" - ) << "Expected from processor " << domain + FatalErrorInFunction + << "Expected from processor " << domain << " " << map.size() << " but received " << recvField.size() << " elements." << abort(FatalError); diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C index 85e69b02dc3..ddf90970ff7 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -106,8 +106,7 @@ Foam::mapPolyMesh::mapPolyMesh { if (min(oldPatchSizes_) < 0) { - FatalErrorIn("mapPolyMesh::mapPolyMesh(...)") - << "Calculated negative old patch size. Error in mapping data" + FatalErrorInFunction << abort(FatalError); } } @@ -195,7 +194,7 @@ Foam::mapPolyMesh::mapPolyMesh { if (min(oldPatchSizes_) < 0) { - FatalErrorIn("mapPolyMesh::mapPolyMesh(...)") + FatalErrorInFunction << "Calculated negative old patch size." << " Error in mapping data" << abort(FatalError); diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.H index e21ff4c736c..e81de98eb79 100644 --- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapPolyMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -484,7 +484,7 @@ public: } else { - FatalErrorIn("mergedPoint(const label) const") + FatalErrorInFunction << "old point label " << oldPointI << " has reverseMap " << i << endl << "Only call mergedPoint for removed points." @@ -515,7 +515,7 @@ public: } else { - FatalErrorIn("mergedFace(const label) const") + FatalErrorInFunction << "old face label " << oldFaceI << " has reverseMap " << i << endl << "Only call mergedFace for removed faces." @@ -546,7 +546,7 @@ public: } else { - FatalErrorIn("mergedCell(const label) const") + FatalErrorInFunction << "old cell label " << oldCellI << " has reverseMap " << i << endl << "Only call mergedCell for removed cells." diff --git a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C index 1e104b4602e..f3311f26e4b 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyBoundaryMesh/polyBoundaryMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,14 +61,8 @@ Foam::polyBoundaryMesh::polyBoundaryMesh { if (readOpt() == IOobject::MUST_READ_IF_MODIFIED) { - WarningIn - ( - "polyBoundaryMesh::polyBoundaryMesh\n" - "(\n" - " const IOobject&,\n" - " const polyMesh&\n" - ")" - ) << "Specified IOobject::MUST_READ_IF_MODIFIED but class" + WarningInFunction + << "Specified IOobject::MUST_READ_IF_MODIFIED but class" << " does not support automatic rereading." << endl; } @@ -143,15 +137,8 @@ Foam::polyBoundaryMesh::polyBoundaryMesh if (readOpt() == IOobject::MUST_READ_IF_MODIFIED) { - WarningIn - ( - "polyBoundaryMesh::polyBoundaryMesh\n" - "(\n" - " const IOobject&,\n" - " const polyMesh&\n" - " const polyPatchList&\n" - ")" - ) << "Specified IOobject::MUST_READ_IF_MODIFIED but class" + WarningInFunction + << "Specified IOobject::MUST_READ_IF_MODIFIED but class" << " does not support automatic rereading." << endl; } @@ -281,7 +268,7 @@ Foam::polyBoundaryMesh::neighbourEdges() const { if (Pstream::parRun()) { - WarningIn("polyBoundaryMesh::neighbourEdges() const") + WarningInFunction << "Neighbour edge addressing not correct across parallel" << " boundaries." << endl; } @@ -371,7 +358,7 @@ Foam::polyBoundaryMesh::neighbourEdges() const if (pointsToEdge.size()) { - FatalErrorIn("polyBoundaryMesh::neighbourEdges() const") + FatalErrorInFunction << "Not all boundary edges of patches match up." << nl << "Is the outside of your mesh multiply connected?" << abort(FatalError); @@ -392,7 +379,7 @@ Foam::polyBoundaryMesh::neighbourEdges() const label edgeI = pp.nInternalEdges() + i; const edge& e = pp.edges()[edgeI]; - FatalErrorIn("polyBoundaryMesh::neighbourEdges() const") + FatalErrorInFunction << "Not all boundary edges of patches match up." << nl << "Edge " << edgeI << " on patch " << pp.name() << " end points " << pp.localPoints()[e[0]] << ' ' @@ -458,7 +445,7 @@ Foam::polyBoundaryMesh::groupPatchIDs() const if (findPatchID(name) != -1) { - WarningIn("polyBoundaryMesh::groupPatchIDs() const") + WarningInFunction << "Patch " << bm[patchI].name() << " specifies a group " << name << " which is also a patch name." @@ -725,10 +712,8 @@ Foam::label Foam::polyBoundaryMesh::whichPatch(const label faceIndex) const } else if (faceIndex >= mesh().nFaces()) { - FatalErrorIn - ( - "polyBoundaryMesh::whichPatch(const label faceIndex) const" - ) << "given label " << faceIndex + FatalErrorInFunction + << "given label " << faceIndex << " greater than the number of geometric faces " << mesh().nFaces() << abort(FatalError); } @@ -749,10 +734,8 @@ Foam::label Foam::polyBoundaryMesh::whichPatch(const label faceIndex) const } // If not in any of above, it is trouble! - FatalErrorIn - ( - "label polyBoundaryMesh::whichPatch(const label faceIndex) const" - ) << "Cannot find face " << faceIndex << " in any of the patches " + FatalErrorInFunction + << "Cannot find face " << faceIndex << " in any of the patches " << names() << nl << "It seems your patches are not consistent with the mesh :" << " internalFaces:" << mesh().nInternalFaces() @@ -808,22 +791,16 @@ Foam::labelHashSet Foam::polyBoundaryMesh::patchSet if (groupIDs.empty() && warnNotFound) { - WarningIn - ( - "polyBoundaryMesh::patchSet" - "(const wordReList&, const bool, const bool) const" - ) << "Cannot find any patch or group names matching " + WarningInFunction + << "Cannot find any patch or group names matching " << patchName << endl; } } else if (warnNotFound) { - WarningIn - ( - "polyBoundaryMesh::patchSet" - "(const wordReList&, const bool, const bool) const" - ) << "Cannot find any patch names matching " << patchName + WarningInFunction + << "Cannot find any patch names matching " << patchName << endl; } } @@ -1187,10 +1164,8 @@ const Foam::polyPatch& Foam::polyBoundaryMesh::operator[] if (patchI < 0) { - FatalErrorIn - ( - "polyBoundaryMesh::operator[](const word&) const" - ) << "Patch named " << patchName << " not found." << nl + FatalErrorInFunction + << "Patch named " << patchName << " not found." << nl << "Available patch names: " << names() << endl << abort(FatalError); } @@ -1208,10 +1183,8 @@ Foam::polyPatch& Foam::polyBoundaryMesh::operator[] if (patchI < 0) { - FatalErrorIn - ( - "polyBoundaryMesh::operator[](const word&)" - ) << "Patch named " << patchName << " not found." << nl + FatalErrorInFunction + << "Patch named " << patchName << " not found." << nl << "Available patch names: " << names() << endl << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index 67ae5db9b34..5df8ef5fd7e 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -304,12 +304,12 @@ Foam::polyMesh::polyMesh(const IOobject& io) // Warn if global empty mesh if (returnReduce(nPoints(), sumOp<label>()) == 0) { - WarningIn("polyMesh(const IOobject&)") + WarningInFunction << "no points in mesh" << endl; } if (returnReduce(nCells(), sumOp<label>()) == 0) { - WarningIn("polyMesh(const IOobject&)") + WarningInFunction << "no cells in mesh" << endl; } @@ -458,16 +458,8 @@ Foam::polyMesh::polyMesh if (min(curFace) < 0 || max(curFace) > points_.size()) { - FatalErrorIn - ( - "polyMesh::polyMesh\n" - "(\n" - " const IOobject& io,\n" - " const pointField& points,\n" - " const faceList& faces,\n" - " const cellList& cells\n" - ")\n" - ) << "Face " << facei << "contains vertex labels out of range: " + FatalErrorInFunction + << "Face " << facei << "contains vertex labels out of range: " << curFace << " Max point index = " << points_.size() << abort(FatalError); } @@ -617,16 +609,8 @@ Foam::polyMesh::polyMesh if (min(curFace) < 0 || max(curFace) > points_.size()) { - FatalErrorIn - ( - "polyMesh::polyMesh\n" - "(\n" - " const IOobject&,\n" - " const Xfer<pointField>&,\n" - " const Xfer<faceList>&,\n" - " const Xfer<cellList>&\n" - ")\n" - ) << "Face " << facei << "contains vertex labels out of range: " + FatalErrorInFunction + << "Face " << facei << "contains vertex labels out of range: " << curFace << " Max point index = " << points_.size() << abort(FatalError); } @@ -642,16 +626,8 @@ Foam::polyMesh::polyMesh if (min(curCell) < 0 || max(curCell) > faces_.size()) { - FatalErrorIn - ( - "polyMesh::polyMesh\n" - "(\n" - " const IOobject&,\n" - " const Xfer<pointField>&,\n" - " const Xfer<faceList>&,\n" - " const Xfer<cellList>&\n" - ")\n" - ) << "Cell " << celli << "contains face labels out of range: " + FatalErrorInFunction + << "Cell " << celli << "contains face labels out of range: " << curCell << " Max face index = " << faces_.size() << abort(FatalError); } @@ -724,19 +700,8 @@ void Foam::polyMesh::resetPrimitives if (min(curFace) < 0 || max(curFace) > points_.size()) { - FatalErrorIn - ( - "polyMesh::polyMesh::resetPrimitives\n" - "(\n" - " const Xfer<pointField>&,\n" - " const Xfer<faceList>&,\n" - " const Xfer<labelList>& owner,\n" - " const Xfer<labelList>& neighbour,\n" - " const labelList& patchSizes,\n" - " const labelList& patchStarts\n" - " const bool validBoundary\n" - ")\n" - ) << "Face " << facei << " contains vertex labels out of range: " + FatalErrorInFunction + << "Face " << facei << " contains vertex labels out of range: " << curFace << " Max point index = " << points_.size() << abort(FatalError); } @@ -767,19 +732,8 @@ void Foam::polyMesh::resetPrimitives || (returnReduce(nCells(), sumOp<label>()) == 0) ) { - FatalErrorIn - ( - "polyMesh::polyMesh::resetPrimitives\n" - "(\n" - " const Xfer<pointField>&,\n" - " const Xfer<faceList>&,\n" - " const Xfer<labelList>& owner,\n" - " const Xfer<labelList>& neighbour,\n" - " const labelList& patchSizes,\n" - " const labelList& patchStarts\n" - " const bool validBoundary\n" - ")\n" - ) << "no points or no cells in mesh" << endl; + FatalErrorInFunction + << "no points or no cells in mesh" << endl; } } } @@ -867,8 +821,7 @@ const Foam::labelList& Foam::polyMesh::tetBasePtIs() const { if (debug) { - WarningIn("const labelList& polyMesh::tetBasePtIs() const") - << "Tet base point indices not available. " + WarningInFunction << "Forcing storage of base points." << endl; } @@ -929,10 +882,8 @@ void Foam::polyMesh::addPatches { if (boundaryMesh().size()) { - FatalErrorIn - ( - "void polyMesh::addPatches(const List<polyPatch*>&, const bool)" - ) << "boundary already exists" + FatalErrorInFunction + << "boundary already exists" << abort(FatalError); } @@ -976,15 +927,8 @@ void Foam::polyMesh::addZones { if (pointZones().size() || faceZones().size() || cellZones().size()) { - FatalErrorIn - ( - "void addZones\n" - "(\n" - " const List<pointZone*>&,\n" - " const List<faceZone*>&,\n" - " const List<cellZone*>&\n" - ")" - ) << "point, face or cell zone already exists" + FatalErrorInFunction + << "point, face or cell zone already exists" << abort(FatalError); } @@ -1036,7 +980,7 @@ const Foam::pointField& Foam::polyMesh::points() const { if (clearedPrimitives_) { - FatalErrorIn("const pointField& polyMesh::points() const") + FatalErrorInFunction << "points deallocated" << abort(FatalError); } @@ -1061,7 +1005,7 @@ const Foam::faceList& Foam::polyMesh::faces() const { if (clearedPrimitives_) { - FatalErrorIn("const faceList& polyMesh::faces() const") + FatalErrorInFunction << "faces deallocated" << abort(FatalError); } @@ -1088,8 +1032,7 @@ const Foam::pointField& Foam::polyMesh::oldPoints() const { if (debug) { - WarningIn("const pointField& polyMesh::oldPoints() const") - << "Old points not available. Forcing storage of old points" + WarningInFunction << endl; } @@ -1322,16 +1265,8 @@ void Foam::polyMesh::findCellFacePt } else { - FatalErrorIn - ( - "void Foam::polyMesh::findCellFacePt" - "(" - "const point& p, " - "label& celli, " - "label& tetFacei, " - "label& tetPti" - ") const" - ) << "Did not find nearest cell in search tree." + FatalErrorInFunction + << "Did not find nearest cell in search tree." << abort(FatalError); } } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C index 576655b74a1..14835981ab8 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshCheck/polyMeshCheck.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,11 +97,8 @@ bool Foam::polyMesh::checkFaceOrthogonality if (detailedReport && errorNonOrth == 0) { // Non-orthogonality greater than 90 deg - WarningIn - ( - "polyMesh::checkFaceOrthogonality" - "(const pointField&, const bool) const" - ) << "Severe non-orthogonality for face " + WarningInFunction + << "Severe non-orthogonality for face " << faceI << " between cells " << own[faceI] << " and " << nei[faceI] @@ -227,22 +224,16 @@ bool Foam::polyMesh::checkFaceSkewness // Non-orthogonality greater than 90 deg if (isInternalFace(faceI)) { - WarningIn - ( - "polyMesh::checkFaceSkewnesss" - "(const pointField&, const bool) const" - ) << "Severe skewness " << skew[faceI] + WarningInFunction + << "Severe skewness " << skew[faceI] << " for face " << faceI << " between cells " << own[faceI] << " and " << nei[faceI]; } else { - WarningIn - ( - "polyMesh::checkFaceSkewnesss" - "(const pointField&, const bool) const" - ) << "Severe skewness " << skew[faceI] + WarningInFunction + << "Severe skewness " << skew[faceI] << " for boundary face " << faceI << " on cell " << own[faceI]; } @@ -312,11 +303,8 @@ bool Foam::polyMesh::checkEdgeAlignment } else if (directions[cmpt] != 0) { - FatalErrorIn - ( - "polyMesh::checkEdgeAlignment" - "(const bool, const Vector<label>&, labelHashSet*)" - ) << "directions should contain 0 or 1 but is now " << directions + FatalErrorInFunction + << "directions should contain 0 or 1 but is now " << directions << exit(FatalError); } } diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C index 62c1877fc16..bd778285200 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshFromShapeMesh.C @@ -115,13 +115,8 @@ Foam::labelList Foam::polyMesh::facePatchFaceCells if (!found) { - FatalErrorIn - ( - "polyMesh::facePatchFaceCells(const faceList& patchFaces," - "const labelListList& pointCells," - "const faceListList& cellsFaceShapes," - "const label patchID)" - ) << "face " << fI << " in patch " << patchID + FatalErrorInFunction + << "face " << fI << " in patch " << patchID << " does not have neighbour cell" << " face: " << patchFaces[fI] << abort(FatalError); @@ -282,20 +277,8 @@ void Foam::polyMesh::setTopology } else { - FatalErrorIn - ( - "polyMesh::setTopology\n" - "(\n" - " const cellShapeList& cellsAsShapes,\n" - " const faceListList& boundaryFaces,\n" - " const wordList& boundaryPatchNames,\n" - " labelList& patchSizes,\n" - " labelList& patchStarts,\n" - " label& defaultPatchStart,\n" - " label& nFaces,\n" - " cellList& cells\n" - ")" - ) << "Error in internal face insertion" + FatalErrorInFunction + << "Error in internal face insertion" << abort(FatalError); } } @@ -339,20 +322,8 @@ void Foam::polyMesh::setTopology { if (cells[cellInside][cellFaceI] >= 0) { - FatalErrorIn - ( - "polyMesh::setTopology\n" - "(\n" - " const cellShapeList& cellsAsShapes,\n" - " const faceListList& boundaryFaces,\n" - " const wordList& boundaryPatchNames,\n" - " labelList& patchSizes,\n" - " labelList& patchStarts,\n" - " label& defaultPatchStart,\n" - " label& nFaces,\n" - " cellList& cells\n" - ")" - ) << "Trying to specify a boundary face " << curFace + FatalErrorInFunction + << "Trying to specify a boundary face " << curFace << " on the face on cell " << cellInside << " which is either an internal face or already " << "belongs to some other patch. This is face " @@ -375,7 +346,7 @@ void Foam::polyMesh::setTopology if (!found) { - FatalErrorIn("polyMesh::polyMesh(... construct from shapes...)") + FatalErrorInFunction << "face " << faceI << " of patch " << patchI << " does not seem to belong to cell " << cellInside << " which, according to the addressing, " @@ -622,7 +593,7 @@ Foam::polyMesh::polyMesh if (nDefaultFaces > 0) { - WarningIn("polyMesh::polyMesh(... construct from shapes...)") + WarningInFunction << "Found " << nDefaultFaces << " undefined faces in mesh; adding to default patch." << endl; @@ -634,13 +605,13 @@ Foam::polyMesh::polyMesh { if (patchI != boundaryFaces.size()-1 || boundary_[patchI].size()) { - FatalErrorIn("polyMesh::polyMesh(... construct from shapes...)") + FatalErrorInFunction << "Default patch " << boundary_[patchI].name() << " already has faces in it or is not" << " last in list of patches." << exit(FatalError); } - WarningIn("polyMesh::polyMesh(... construct from shapes...)") + WarningInFunction << "Reusing existing patch " << patchI << " for undefined faces." << endl; @@ -898,7 +869,7 @@ Foam::polyMesh::polyMesh if (nDefaultFaces > 0) { - WarningIn("polyMesh::polyMesh(... construct from shapes...)") + WarningInFunction << "Found " << nDefaultFaces << " undefined faces in mesh; adding to default patch." << endl; @@ -910,13 +881,13 @@ Foam::polyMesh::polyMesh { if (patchI != boundaryFaces.size()-1 || boundary_[patchI].size()) { - FatalErrorIn("polyMesh::polyMesh(... construct from shapes...)") + FatalErrorInFunction << "Default patch " << boundary_[patchI].name() << " already has faces in it or is not" << " last in list of patches." << exit(FatalError); } - WarningIn("polyMesh::polyMesh(... construct from shapes...)") + WarningInFunction << "Reusing existing patch " << patchI << " for undefined faces." << endl; diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C index 6015f1167dd..f185c79a6f0 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -204,8 +204,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate() if (boundaryChanged) { - WarningIn("polyMesh::readUpdateState polyMesh::readUpdate()") - << "Number of patches has changed. This may have " + WarningInFunction << "unexpected consequences. Proceed with care." << endl; boundary_.clear(); @@ -432,7 +431,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate() if (nOldPoints != 0 && nOldPoints != newPoints.size()) { - FatalErrorIn("polyMesh::readUpdate()") + FatalErrorInFunction << "Point motion detected but number of points " << newPoints.size() << " in " << newPoints.objectPath() << " does not correspond to " diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshInitMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMeshInitMesh.C index 33399d41d32..ef2c09e5b6b 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshInitMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshInitMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,7 +62,7 @@ void Foam::polyMesh::initMesh() { if (owner_[facei] < 0) { - FatalErrorIn("polyMesh::initMesh()") + FatalErrorInFunction << "Illegal cell label " << owner_[facei] << " in neighbour addressing for face " << facei << exit(FatalError); @@ -75,7 +75,7 @@ void Foam::polyMesh::initMesh() { if (neighbour_[facei] < 0) { - FatalErrorIn("polyMesh::initMesh()") + FatalErrorInFunction << "Illegal cell label " << neighbour_[facei] << " in neighbour addressing for face " << facei << exit(FatalError); @@ -129,7 +129,7 @@ void Foam::polyMesh::initMesh(cellList& c) { if (cellfaces[faceI] < 0) { - FatalErrorIn("polyMesh::initMesh(cellList&)") + FatalErrorInFunction << "Illegal face label " << cellfaces[faceI] << " in cell " << cellI << exit(FatalError); diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C b/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C index 6c1d76d4aee..a38773d455e 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -309,16 +309,8 @@ Foam::labelList Foam::polyMeshTetDecomposition::findFaceBasePts if (bFTetBasePtI == -2) { - FatalErrorIn - ( - "labelList" - "polyMeshTetDecomposition::findFaceBasePts" - "(" - "const polyMesh& mesh, " - "scalar tol, " - "bool report" - ")" - ) << "Coupled face base point exchange failure for face " + FatalErrorInFunction + << "Coupled face base point exchange failure for face " << fI << abort(FatalError); } @@ -558,16 +550,8 @@ Foam::List<Foam::tetIndices> Foam::polyMeshTetDecomposition::faceTetIndices { if (nWarnings < maxWarnings) { - WarningIn - ( - "List<tetIndices> " - "polyMeshTetDecomposition::faceTetIndices" - "(" - "const polyMesh&, " - "label, " - "label" - ")" - ) << "No base point for face " << fI << ", " << f + WarningInFunction + << "No base point for face " << fI << ", " << f << ", produces a valid tet decomposition." << endl; nWarnings++; @@ -630,17 +614,8 @@ Foam::tetIndices Foam::polyMeshTetDecomposition::triangleTetIndices { if (nWarnings < maxWarnings) { - WarningIn - ( - "tetIndices " - "polyMeshTetDecomposition::triangleTetIndices" - "(" - "const polyMesh&, " - "label, " - "label, " - "label" - ")" - ) << "No base point for face " << fI << ", " << f + WarningInFunction + << "No base point for face " << fI << ", " << f << ", produces a valid tet decomposition." << endl; nWarnings++; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C index 05720e178f1..55a56ea38fd 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -155,10 +155,8 @@ void Foam::cyclicPolyPatch::calcTransforms if (half0Ctrs.size() != half1Ctrs.size()) { - FatalErrorIn - ( - "cyclicPolyPatch::calcTransforms()" - ) << "For patch " << name() + FatalErrorInFunction + << "For patch " << name() << " there are " << half0Ctrs.size() << " face centres, for the neighbour patch " << neighbPatch().name() << " there are " << half1Ctrs.size() @@ -167,10 +165,8 @@ void Foam::cyclicPolyPatch::calcTransforms if (transform() != neighbPatch().transform()) { - FatalErrorIn - ( - "cyclicPolyPatch::calcTransforms()" - ) << "Patch " << name() + FatalErrorInFunction + << "Patch " << name() << " has transform type " << transformTypeNames[transform()] << ", neighbour patch " << neighbPatchName() << " has transform type " @@ -215,10 +211,8 @@ void Foam::cyclicPolyPatch::calcTransforms if (areaDiff > matchTolerance()) { - FatalErrorIn - ( - "cyclicPolyPatch::calcTransforms()" - ) << "face " << facei + FatalErrorInFunction + << "face " << facei << " area does not match neighbour by " << 100*areaDiff << "% -- possible face ordering problem." << endl @@ -347,10 +341,8 @@ void Foam::cyclicPolyPatch::calcTransforms > avgTol ) { - WarningIn - ( - "cyclicPolyPatch::calcTransforms()" - ) << "Specified separation vector " << separationVector_ + WarningInFunction + << "Specified separation vector " << separationVector_ << " differs by that of neighbouring patch " << neighbPatch().separationVector_ << " by more than tolerance " << avgTol << endl @@ -367,10 +359,8 @@ void Foam::cyclicPolyPatch::calcTransforms || mag(separation()[0] - separationVector_) > avgTol ) { - WarningIn - ( - "cyclicPolyPatch::calcTransforms()" - ) << "Specified separationVector " << separationVector_ + WarningInFunction + << "Specified separationVector " << separationVector_ << " differs from computed separation vector " << separation() << endl << "This probably means your geometry is not consistent" @@ -677,15 +667,8 @@ Foam::cyclicPolyPatch::cyclicPolyPatch { if (neighbPatchName_ == word::null && !coupleGroup_.valid()) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "cyclicPolyPatch::cyclicPolyPatch\n" - "(\n" - " const word& name,\n" - " const dictionary& dict,\n" - " const label index,\n" - " const polyBoundaryMesh& bm\n" - ")", dict ) << "No \"neighbourPatch\" provided." << endl << "Is your mesh uptodate with split cyclics?" << endl @@ -695,7 +678,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch if (neighbPatchName_ == name) { - FatalIOErrorIn("cyclicPolyPatch::cyclicPolyPatch(..)", dict) + FatalIOErrorInFunction(dict) << "Neighbour patch name " << neighbPatchName_ << " cannot be the same as this patch " << name << exit(FatalIOError); @@ -711,7 +694,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch scalar magRot = mag(rotationAxis_); if (magRot < SMALL) { - FatalIOErrorIn("cyclicPolyPatch::cyclicPolyPatch(..)", dict) + FatalIOErrorInFunction(dict) << "Illegal rotationAxis " << rotationAxis_ << endl << "Please supply a non-zero vector." << exit(FatalIOError); @@ -779,7 +762,7 @@ Foam::cyclicPolyPatch::cyclicPolyPatch { if (neighbName == name()) { - FatalErrorIn("cyclicPolyPatch::cyclicPolyPatch(..)") + FatalErrorInFunction << "Neighbour patch name " << neighbName << " cannot be the same as this patch " << name() << exit(FatalError); @@ -843,7 +826,7 @@ Foam::label Foam::cyclicPolyPatch::neighbPatchID() const if (neighbPatchID_ == -1) { - FatalErrorIn("cyclicPolyPatch::neighbPatchID() const") + FatalErrorInFunction << "Illegal neighbourPatch name " << neighbPatchName() << endl << "Valid patch names are " << this->boundaryMesh().names() @@ -858,7 +841,7 @@ Foam::label Foam::cyclicPolyPatch::neighbPatchID() const if (nbrPatch.neighbPatchName() != name()) { - WarningIn("cyclicPolyPatch::neighbPatchID() const") + WarningInFunction << "Patch " << name() << " specifies neighbour patch " << neighbPatchName() << endl << " but that in return specifies " @@ -1207,7 +1190,7 @@ const Foam::edgeList& Foam::cyclicPolyPatch::coupledEdges() const if (e[0] < 0 || e[1] < 0) { - FatalErrorIn("cyclicPolyPatch::coupledEdges() const") + FatalErrorInFunction << "Problem : at position " << i << " illegal couple:" << e << abort(FatalError); @@ -1395,11 +1378,8 @@ bool Foam::cyclicPolyPatch::order if (!matchedAll) { - SeriousErrorIn - ( - "cyclicPolyPatch::order" - "(const primitivePatch&, labelList&, labelList&) const" - ) << "Patch:" << name() << " : " + SeriousErrorInFunction + << "Patch:" << name() << " : " << "Cannot match vectors to faces on both sides of patch" << endl << " Perhaps your faces do not match?" @@ -1432,11 +1412,8 @@ bool Foam::cyclicPolyPatch::order if (rotation[newFaceI] == -1) { - SeriousErrorIn - ( - "cyclicPolyPatch::order(const primitivePatch&" - ", labelList&, labelList&) const" - ) << "in patch " << name() + SeriousErrorInFunction + << "in patch " << name() << " : " << "Cannot find point on face " << pp[oldFaceI] << " with vertices " diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H index 88352668261..5ef37b30224 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.H @@ -362,10 +362,8 @@ public: } else { - FatalErrorIn - ( - "cyclicPolyPatch::transformGlobalFace(const label) const" - ) << "Face " << facei << " not in patch " << name() + FatalErrorInFunction + << "Face " << facei << " not in patch " << name() << exit(FatalError); return -1; } diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C index 2c8383c4072..efc2c8adafd 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/oldCyclic/oldCyclicPolyPatch.C @@ -263,11 +263,8 @@ bool Foam::oldCyclicPolyPatch::getGeometricHalves } } - SeriousErrorIn - ( - "oldCyclicPolyPatch::getGeometricHalves" - "(const primitivePatch&, labelList&, labelList&) const" - ) << "Patch " << name() << " gets decomposed in two zones of" + SeriousErrorInFunction + << "Patch " << name() << " gets decomposed in two zones of" << "inequal size: " << half0ToPatch.size() << " and " << half1ToPatch.size() << endl << "This means that the patch is either not two separate regions" @@ -499,10 +496,8 @@ bool Foam::oldCyclicPolyPatch::matchAnchors if (report) { const face& f = half1Faces[half1FaceI]; - SeriousErrorIn - ( - "oldCyclicPolyPatch::matchAnchors(..)" - ) << "Patch:" << name() << " : " + SeriousErrorInFunction + << "Patch:" << name() << " : " << "Cannot find point on face " << f << " with vertices:" << UIndirectList<point>(pp.points(), f)() @@ -602,15 +597,8 @@ Foam::oldCyclicPolyPatch::oldCyclicPolyPatch { if (dict.found("neighbourPatch")) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "oldCyclicPolyPatch::oldCyclicPolyPatch\n" - "(\n" - " const word& name,\n" - " const dictionary& dict,\n" - " const label index,\n" - " const polyBoundaryMesh& bm\n" - ")", dict ) << "Found \"neighbourPatch\" entry when reading cyclic patch " << name << endl @@ -771,7 +759,7 @@ bool Foam::oldCyclicPolyPatch::order if (pp.size()&1) { - FatalErrorIn("oldCyclicPolyPatch::order(..)") + FatalErrorInFunction << "Size of cyclic " << name() << " should be a multiple of 2" << ". It is " << pp.size() << abort(FatalError); } @@ -1191,11 +1179,8 @@ bool Foam::oldCyclicPolyPatch::order if (!matchedAll) { - SeriousErrorIn - ( - "oldCyclicPolyPatch::order" - "(const primitivePatch&, labelList&, labelList&) const" - ) << "Patch:" << name() << " : " + SeriousErrorInFunction + << "Patch:" << name() << " : " << "Cannot match vectors to faces on both sides of patch" << endl << " Perhaps your faces do not match?" << " The obj files written contain the current match." << endl @@ -1269,7 +1254,7 @@ void Foam::oldCyclicPolyPatch::write(Ostream& os) const } } - WarningIn("oldCyclicPolyPatch::write(Ostream& os) const") + WarningInFunction << "Please run foamUpgradeCyclics to convert these old-style" << " cyclics into two separate cyclics patches." << endl; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C index 5b2a4332fdc..50f3ff9b49d 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processor/processorPolyPatch.C @@ -237,10 +237,8 @@ void Foam::processorPolyPatch::calcGeometry(PstreamBuffers& pBufs) writeOBJ(ccStr, c0, c1, vertI); } - FatalErrorIn - ( - "processorPolyPatch::calcGeometry()" - ) << "face " << facei << " area does not match neighbour by " + FatalErrorInFunction + << "face " << facei << " area does not match neighbour by " << 100*mag(magSf - nbrMagSf)/avSf << "% -- possible face ordering problem." << endl << "patch:" << name() @@ -465,7 +463,7 @@ const Foam::labelList& Foam::processorPolyPatch::neighbPoints() const { if (!neighbPointsPtr_.valid()) { - FatalErrorIn("processorPolyPatch::neighbPoints() const") + FatalErrorInFunction << "No extended addressing calculated for patch " << name() << abort(FatalError); } @@ -477,7 +475,7 @@ const Foam::labelList& Foam::processorPolyPatch::neighbEdges() const { if (!neighbEdgesPtr_.valid()) { - FatalErrorIn("processorPolyPatch::neighbEdges() const") + FatalErrorInFunction << "No extended addressing calculated for patch " << name() << abort(FatalError); } @@ -838,7 +836,7 @@ bool Foam::processorPolyPatch::order pts[pI] = localPts[localPtI]; } - FatalErrorIn("Foam::processorPolyPatch::order(...) const") + FatalErrorInFunction << "No match for face " << localFace << nl << pts << abort(FatalError); } @@ -885,11 +883,8 @@ bool Foam::processorPolyPatch::order if (masterCtrs.size() != pp.size()) { - FatalErrorIn - ( - "processorPolyPatch::order(const primitivePatch&" - ", labelList&, labelList&) const" - ) << "in patch:" << name() << " : " + FatalErrorInFunction + << "in patch:" << name() << " : " << "Local size of patch is " << pp.size() << " (faces)." << endl << "Received from neighbour " << masterCtrs.size() @@ -1008,11 +1003,8 @@ bool Foam::processorPolyPatch::order if (!matchedAll) { - SeriousErrorIn - ( - "processorPolyPatch::order(const primitivePatch&" - ", labelList&, labelList&) const" - ) << "in patch:" << name() << " : " + SeriousErrorInFunction + << "in patch:" << name() << " : " << "Cannot match vectors to faces on both sides of patch" << endl << " masterCtrs[0]:" << masterCtrs[0] << endl @@ -1047,11 +1039,8 @@ bool Foam::processorPolyPatch::order if (rotation[newFaceI] == -1) { - SeriousErrorIn - ( - "processorPolyPatch::order(const primitivePatch&" - ", labelList&, labelList&) const" - ) << "in patch " << name() + SeriousErrorInFunction + << "in patch " << name() << " : " << "Cannot find point on face " << pp[oldFaceI] << " with vertices " diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C index e2d86a4977b..8bd031532a6 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -179,7 +179,7 @@ int Foam::processorCyclicPolyPatch::tag() const if (tag_ == Pstream::msgType() || tag_ == -1) { - FatalErrorIn("processorCyclicPolyPatch::tag() const") + FatalErrorInFunction << "Tag calculated from cyclic patch name " << tag_ << " is the same as the current message type " << Pstream::msgType() << " or -1" << nl diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.H index c4ccc58ea49..1f98b30bcab 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.H @@ -277,10 +277,8 @@ public: ); if (referPatchID_ == -1) { - FatalErrorIn - ( - "processorCyclicPolyPatch::referPatchID() const" - ) << "Illegal referPatch name " << referPatchName_ + FatalErrorInFunction + << "Illegal referPatch name " << referPatchName_ << endl << "Valid patch names are " << this->boundaryMesh().names() << exit(FatalError); diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetryPlane/symmetryPlanePolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetryPlane/symmetryPlanePolyPatch.C index 63268e68321..4888ff22700 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetryPlane/symmetryPlanePolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetryPlane/symmetryPlanePolyPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,7 +61,7 @@ void Foam::symmetryPlanePolyPatch::calcGeometry(PstreamBuffers&) { if (magSqr(n_ - nf[facei]) > SMALL) { - FatalErrorIn("symmetryPlanePolyPatch::n()") + FatalErrorInFunction << "Symmetry plane '" << name() << "' is not planar." << endl << "At local face at " diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C index e12d22e5a5c..e8fd99e786a 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,10 +66,7 @@ void Foam::wedgePolyPatch::calcGeometry(PstreamBuffers&) { // only issue warning instead of error so that the case can // still be read for post-processing - WarningIn - ( - "wedgePolyPatch::calcGeometry(PstreamBuffers&)" - ) + WarningInFunction << "Wedge patch '" << name() << "' is not planar." << nl << "At local face at " << primitivePatch::faceCentres()[faceI] @@ -97,7 +94,7 @@ void Foam::wedgePolyPatch::calcGeometry(PstreamBuffers&) if (mag(cnCmptSum) < (1 - SMALL)) { - FatalErrorIn("wedgePolyPatch::calcGeometry(PstreamBuffers&)") + FatalErrorInFunction << "wedge " << name() << " centre plane does not align with a coordinate plane by " << 1 - mag(cnCmptSum) @@ -109,7 +106,7 @@ void Foam::wedgePolyPatch::calcGeometry(PstreamBuffers&) if (magAxis < SMALL) { - FatalErrorIn("wedgePolyPatch::calcGeometry(PstreamBuffers&)") + FatalErrorInFunction << "wedge " << name() << " plane aligns with a coordinate plane." << nl << " The wedge plane should make a small angle (~2.5deg)" diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C index 055fea4f7c7..b161194fc3b 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatchNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,11 +51,8 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New if (cstrIter == wordConstructorTablePtr_->end()) { - FatalErrorIn - ( - "polyPatch::New(const word&, const word&, const label, " - "const label, const label, const polyBoundaryMesh&) " - ) << "Unknown polyPatch type " + FatalErrorInFunction + << "Unknown polyPatch type " << patchType << " for patch " << name << nl << nl << "Valid polyPatch types are :" << endl << wordConstructorTablePtr_->sortedToc() @@ -127,10 +124,8 @@ Foam::autoPtr<Foam::polyPatch> Foam::polyPatch::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "polyPatch::New(const word&, const dictionary&, " - "const label, const polyBoundaryMesh&)", dict ) << "Unknown polyPatch type " << patchType << " for patch " << name << nl << nl diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C index 4326d43f38f..9855309451a 100644 --- a/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C +++ b/src/OpenFOAM/meshes/polyMesh/syncTools/syncTools.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,11 +36,8 @@ void Foam::syncTools::swapBoundaryCellPositions { if (cellData.size() != mesh.nCells()) { - FatalErrorIn - ( - "syncTools<class T>::swapBoundaryCellPositions" - "(const polyMesh&, const UList<T>&, List<T>&)" - ) << "Number of cell values " << cellData.size() + FatalErrorInFunction + << "Number of cell values " << cellData.size() << " is not equal to the number of cells in the mesh " << mesh.nCells() << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C b/src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C index f9b90ae0a12..a1e2b2dc597 100644 --- a/src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/syncTools/syncToolsTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -773,12 +773,8 @@ void Foam::syncTools::syncEdgeMap //{ // if (pointValues.size() != mesh.nPoints()) // { -// FatalErrorIn -// ( -// "syncTools<class T, class CombineOp>::syncPointList" -// "(const polyMesh&, List<T>&, const CombineOp&, const T&" -// ", const bool)" -// ) << "Number of values " << pointValues.size() +// FatalErrorInFunction +// << "Number of values " << pointValues.size() // << " is not equal to the number of points in the mesh " // << mesh.nPoints() << abort(FatalError); // } @@ -950,12 +946,8 @@ void Foam::syncTools::syncEdgeMap //{ // if (pointValues.size() != meshPoints.size()) // { -// FatalErrorIn -// ( -// "syncTools<class T, class CombineOp>::syncPointList" -// "(const polyMesh&, const labelList&, List<T>&, const CombineOp&" -// ", const T&, const bool)" -// ) << "Number of values " << pointValues.size() +// FatalErrorInFunction +// << "Number of values " << pointValues.size() // << " is not equal to the number of points " // << meshPoints.size() << abort(FatalError); // } @@ -999,12 +991,8 @@ void Foam::syncTools::syncPointList { if (pointValues.size() != mesh.nPoints()) { - FatalErrorIn - ( - "syncTools<class T, class CombineOp>::syncPointList" - "(const polyMesh&, List<T>&, const CombineOp&, const T&" - ", const bool)" - ) << "Number of values " << pointValues.size() + FatalErrorInFunction + << "Number of values " << pointValues.size() << " is not equal to the number of points in the mesh " << mesh.nPoints() << abort(FatalError); } @@ -1024,11 +1012,8 @@ void Foam::syncTools::syncPointList //{ // if (pointValues.size() != mesh.nPoints()) // { -// FatalErrorIn -// ( -// "syncTools<class CombineOp>::syncPointPositions" -// "(const polyMesh&, List<point>&, const CombineOp&, const point&)" -// ) << "Number of values " << pointValues.size() +// FatalErrorInFunction +// << "Number of values " << pointValues.size() // << " is not equal to the number of points in the mesh " // << mesh.nPoints() << abort(FatalError); // } @@ -1050,11 +1035,8 @@ void Foam::syncTools::syncPointList { if (pointValues.size() != meshPoints.size()) { - FatalErrorIn - ( - "syncTools<class T, class CombineOp>::syncPointList" - "(const polyMesh&, List<T>&, const CombineOp&, const T&)" - ) << "Number of values " << pointValues.size() + FatalErrorInFunction + << "Number of values " << pointValues.size() << " is not equal to the number of meshPoints " << meshPoints.size() << abort(FatalError); } @@ -1109,11 +1091,8 @@ void Foam::syncTools::syncPointList //{ // if (pointValues.size() != meshPoints.size()) // { -// FatalErrorIn -// ( -// "syncTools<class CombineOp>::syncPointList" -// "(const polyMesh&, List<point>&, const CombineOp&, const point&)" -// ) << "Number of values " << pointValues.size() +// FatalErrorInFunction +// << "Number of values " << pointValues.size() // << " is not equal to the number of meshPoints " // << meshPoints.size() << abort(FatalError); // } @@ -1169,11 +1148,8 @@ void Foam::syncTools::syncEdgeList { if (edgeValues.size() != mesh.nEdges()) { - FatalErrorIn - ( - "syncTools<class T, class CombineOp>::syncEdgeList" - "(const polyMesh&, List<T>&, const CombineOp&, const T&)" - ) << "Number of values " << edgeValues.size() + FatalErrorInFunction + << "Number of values " << edgeValues.size() << " is not equal to the number of edges in the mesh " << mesh.nEdges() << abort(FatalError); } @@ -1215,11 +1191,8 @@ void Foam::syncTools::syncEdgeList //{ // if (edgeValues.size() != mesh.nEdges()) // { -// FatalErrorIn -// ( -// "syncTools<class CombineOp>::syncEdgePositions" -// "(const polyMesh&, List<point>&, const CombineOp&, const point&)" -// ) << "Number of values " << edgeValues.size() +// FatalErrorInFunction +// << "Number of values " << edgeValues.size() // << " is not equal to the number of edges in the mesh " // << mesh.nEdges() << abort(FatalError); // } @@ -1264,11 +1237,8 @@ void Foam::syncTools::syncEdgeList { if (edgeValues.size() != meshEdges.size()) { - FatalErrorIn - ( - "syncTools<class T, class CombineOp>::syncEdgeList" - "(const polyMesh&, List<T>&, const CombineOp&, const T&)" - ) << "Number of values " << edgeValues.size() + FatalErrorInFunction + << "Number of values " << edgeValues.size() << " is not equal to the number of meshEdges " << meshEdges.size() << abort(FatalError); } @@ -1323,12 +1293,8 @@ void Foam::syncTools::syncBoundaryFaceList if (faceValues.size() != nBFaces) { - FatalErrorIn - ( - "syncTools<class T, class CombineOp>::syncBoundaryFaceList" - "(const polyMesh&, UList<T>&, const CombineOp&" - ", const bool)" - ) << "Number of values " << faceValues.size() + FatalErrorInFunction + << "Number of values " << faceValues.size() << " is not equal to the number of boundary faces in the mesh " << nBFaces << abort(FatalError); } @@ -1446,11 +1412,8 @@ void Foam::syncTools::syncFaceList { if (faceValues.size() != mesh.nFaces()) { - FatalErrorIn - ( - "syncTools<unsigned nBits, class CombineOp>::syncFaceList" - "(const polyMesh&, PackedList<nBits>&, const CombineOp&)" - ) << "Number of values " << faceValues.size() + FatalErrorInFunction + << "Number of values " << faceValues.size() << " is not equal to the number of faces in the mesh " << mesh.nFaces() << abort(FatalError); } @@ -1563,11 +1526,8 @@ void Foam::syncTools::swapBoundaryCellList { if (cellData.size() != mesh.nCells()) { - FatalErrorIn - ( - "syncTools<class T>::swapBoundaryCellList" - "(const polyMesh&, const UList<T>&, List<T>&)" - ) << "Number of cell values " << cellData.size() + FatalErrorInFunction + << "Number of cell values " << cellData.size() << " is not equal to the number of cells in the mesh " << mesh.nCells() << abort(FatalError); } @@ -1614,12 +1574,8 @@ void Foam::syncTools::syncPointList { if (pointValues.size() != mesh.nPoints()) { - FatalErrorIn - ( - "syncTools<unsigned nBits, class CombineOp>::syncPointList" - "(const polyMesh&, PackedList<nBits>&, const CombineOp&" - ", const unsigned int)" - ) << "Number of values " << pointValues.size() + FatalErrorInFunction + << "Number of values " << pointValues.size() << " is not equal to the number of points in the mesh " << mesh.nPoints() << abort(FatalError); } @@ -1661,12 +1617,8 @@ void Foam::syncTools::syncEdgeList { if (edgeValues.size() != mesh.nEdges()) { - FatalErrorIn - ( - "syncTools<unsigned nBits, class CombineOp>::syncEdgeList" - "(const polyMesh&, PackedList<nBits>&, const CombineOp&" - ", const unsigned int)" - ) << "Number of values " << edgeValues.size() + FatalErrorInFunction + << "Number of values " << edgeValues.size() << " is not equal to the number of edges in the mesh " << mesh.nEdges() << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C index 0c0525d9ee8..5e44455f0c2 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/ZoneMesh/ZoneMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,7 @@ void Foam::ZoneMesh<ZoneType, MeshType>::calcZoneMap() const // if the pointer is already set if (zoneMapPtr_) { - FatalErrorIn("void ZoneMesh<ZoneType>::calcZoneMap() const") + FatalErrorInFunction << "zone map already calculated" << abort(FatalError); } @@ -82,14 +82,8 @@ bool Foam::ZoneMesh<ZoneType, MeshType>::read() { if (readOpt() == IOobject::MUST_READ_IF_MODIFIED) { - WarningIn - ( - "ZoneMesh::ZoneMesh\n" - "(\n" - " const IOobject&,\n" - " const MeshType&\n" - ")" - ) << "Specified IOobject::MUST_READ_IF_MODIFIED but class" + WarningInFunction + << "Specified IOobject::MUST_READ_IF_MODIFIED but class" << " does not support automatic rereading." << endl; } @@ -548,10 +542,8 @@ const ZoneType& Foam::ZoneMesh<ZoneType, MeshType>::operator[] if (zoneI < 0) { - FatalErrorIn - ( - "ZoneMesh<ZoneType>::operator[](const word&) const" - ) << "Zone named " << zoneName << " not found." << nl + FatalErrorInFunction + << "Zone named " << zoneName << " not found." << nl << "Available zone names: " << names() << endl << abort(FatalError); } @@ -570,10 +562,8 @@ ZoneType& Foam::ZoneMesh<ZoneType, MeshType>::operator[] if (zoneI < 0) { - FatalErrorIn - ( - "ZoneMesh<ZoneType>::operator[](const word&)" - ) << "Zone named " << zoneName << " not found." << nl + FatalErrorInFunction + << "Zone named " << zoneName << " not found." << nl << "Available zone names: " << names() << endl << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C index fd1f72e875f..60eb63af662 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/faceZone/faceZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,10 +56,8 @@ void Foam::faceZone::calcFaceZonePatch() const if (patchPtr_) { - FatalErrorIn - ( - "void faceZone::calcFaceZonePatch() const" - ) << "primitive face zone patch already calculated" + FatalErrorInFunction + << "primitive face zone patch already calculated" << abort(FatalError); } @@ -111,7 +109,7 @@ void Foam::faceZone::calcCellLayers() const // if the pointer is already set if (masterCellsPtr_ || slaveCellsPtr_) { - FatalErrorIn("void faceZone::calcCellLayers() const") + FatalErrorInFunction << "cell layers already calculated" << abort(FatalError); } @@ -165,8 +163,7 @@ void Foam::faceZone::checkAddressing() const { if (size() != flipMap_.size()) { - FatalErrorIn("void Foam::faceZone::checkAddressing() const") - << "Different sizes of the addressing and flipMap arrays. " + FatalErrorInFunction << "Size of addressing: " << size() << " size of flip map: " << flipMap_.size() << abort(FatalError); @@ -182,7 +179,7 @@ void Foam::faceZone::checkAddressing() const { if (!hasWarned && (mf[i] < 0 || mf[i] >= nFaces)) { - WarningIn("void Foam::faceZone::checkAddressing() const") + WarningInFunction << "Illegal face index " << mf[i] << " outside range 0.." << nFaces-1 << endl; hasWarned = true; diff --git a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C index 23a7ab3d7f3..8d31b8a3ad4 100644 --- a/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C +++ b/src/OpenFOAM/meshes/polyMesh/zones/zone/zone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -60,7 +60,7 @@ void Foam::zone::calcLookupMap() const if (lookupMapPtr_) { - FatalErrorIn("void zone::calcLookupMap() const") + FatalErrorInFunction << "Lookup map already calculated" << nl << abort(FatalError); } @@ -207,11 +207,8 @@ bool Foam::zone::checkDefinition(const label maxSize, const bool report) const if (report) { - SeriousErrorIn - ( - "bool zone::checkDefinition(" - "const label maxSize, const bool report) const" - ) << "Zone " << name_ + SeriousErrorInFunction + << "Zone " << name_ << " contains invalid index label " << addr[i] << nl << "Valid index labels are 0.." << maxSize-1 << endl; @@ -226,11 +223,8 @@ bool Foam::zone::checkDefinition(const label maxSize, const bool report) const { if (report) { - WarningIn - ( - "bool zone::checkDefinition(" - "const label maxSize, const bool report) const" - ) << "Zone " << name_ + WarningInFunction + << "Zone " << name_ << " contains duplicate index label " << addr[i] << endl; } } diff --git a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsEdgeOwner.C b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsEdgeOwner.C index 88cce887516..95f49cea126 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsEdgeOwner.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsEdgeOwner.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,10 +73,7 @@ Foam::PatchTools::edgeOwner if (edgeOwner[edgeI] == -1) { - FatalErrorIn - ( - "PatchTools::edgeOwner()" - ) + FatalErrorInFunction << "Edge " << edgeI << " vertices:" << edges[edgeI] << " is used by faces " << nbrFaces << " vertices:" diff --git a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsSearch.C b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsSearch.C index 8ecd790b1ee..6533c3ca172 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsSearch.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PatchTools/PatchToolsSearch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,18 +89,7 @@ Foam::PatchTools::markZone } else if (faceZone[nbrFaceI] != currentZone) { - FatalErrorIn - ( - "PatchTools::markZone" - "(" - "const PrimitivePatch<Face, FaceList, " - "PointField, PointType>& p," - "const BoolListType& borderEdge," - "const label faceI," - "const label currentZone," - "labelList& faceZone" - ")" - ) + FatalErrorInFunction << "Zones " << faceZone[nbrFaceI] << " at face " << nbrFaceI << " connects to zone " << currentZone diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchAddressing.C b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchAddressing.C index a2015069fe9..0508eb31650 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchAddressing.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchAddressing.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -62,11 +62,8 @@ calcAddressing() const { // it is considered an error to attempt to recalculate // if already allocated - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcAddressing()" - ) << "addressing already calculated" + FatalErrorInFunction + << "addressing already calculated" << abort(FatalError); } @@ -245,11 +242,8 @@ calcAddressing() const } else { - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcAddressing()" - ) << "Error in internal edge insertion" + FatalErrorInFunction + << "Error in internal edge insertion" << abort(FatalError); } } diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchBdryPoints.C b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchBdryPoints.C index 1cc39fb96b9..fe0a80ef28d 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchBdryPoints.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchBdryPoints.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,11 +52,8 @@ calcBdryPoints() const { // it is considered an error to attempt to recalculate // if already allocated - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcBdryPoints()" - ) << "edge types already calculated" + FatalErrorInFunction + << "edge types already calculated" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchCheck.C b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchCheck.C index fcd980c7580..68be5b7ab58 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchCheck.C @@ -78,11 +78,8 @@ visitPointRegion if (nextEdgeI == -1) { - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "visitPointRegion" - ) << "Problem: cannot find edge out of " << fEdges + FatalErrorInFunction + << "Problem: cannot find edge out of " << fEdges << "on face " << startFaceI << " that uses point " << pointI << " and is not edge " << startEdgeI << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchEdgeLoops.C b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchEdgeLoops.C index d0c2e3c1cbd..3a7501083a4 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchEdgeLoops.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchEdgeLoops.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,11 +55,8 @@ calcEdgeLoops() const { // it is considered an error to attempt to recalculate // if already allocated - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcIntBdryEdges()" - ) << "edge loops already calculated" + FatalErrorInFunction + << "edge loops already calculated" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchLocalPointOrder.C b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchLocalPointOrder.C index 852262c32bd..7284c313d95 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchLocalPointOrder.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchLocalPointOrder.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,11 +58,8 @@ calcLocalPointOrder() const { // it is considered an error to attempt to recalculate // if already allocated - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcLocalPointOrder()" - ) << "local point order already calculated" + FatalErrorInFunction + << "local point order already calculated" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchMeshData.C b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchMeshData.C index 8816a11785c..10f758c6485 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchMeshData.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchMeshData.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,11 +51,8 @@ calcMeshData() const // if they have already been calculated. if (meshPointsPtr_ || localFacesPtr_) { - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcMeshData()" - ) << "meshPointsPtr_ or localFacesPtr_already allocated" + FatalErrorInFunction + << "meshPointsPtr_ or localFacesPtr_already allocated" << abort(FatalError); } @@ -164,11 +161,8 @@ calcMeshPointMap() const // if they have already been calculated. if (meshPointMapPtr_) { - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcMeshPointMap()" - ) << "meshPointMapPtr_ already allocated" + FatalErrorInFunction + << "meshPointMapPtr_ already allocated" << abort(FatalError); } @@ -215,11 +209,8 @@ calcLocalPoints() const // if they have already been calculated. if (localPointsPtr_) { - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcLocalPoints()" - ) << "localPointsPtr_already allocated" + FatalErrorInFunction + << "localPointsPtr_already allocated" << abort(FatalError); } @@ -267,11 +258,8 @@ calcPointNormals() const // if they have already been calculated. if (pointNormalsPtr_) { - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcPointNormals()" - ) << "pointNormalsPtr_already allocated" + FatalErrorInFunction + << "pointNormalsPtr_already allocated" << abort(FatalError); } @@ -334,11 +322,8 @@ calcFaceCentres() const // if they have already been calculated. if (faceCentresPtr_) { - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcFaceCentres()" - ) << "faceCentresPtr_already allocated" + FatalErrorInFunction + << "faceCentresPtr_already allocated" << abort(FatalError); } @@ -384,11 +369,8 @@ calcFaceNormals() const // if they have already been calculated. if (faceNormalsPtr_) { - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcFaceNormals()" - ) << "faceNormalsPtr_already allocated" + FatalErrorInFunction + << "faceNormalsPtr_already allocated" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchPointAddressing.C b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchPointAddressing.C index 28863131b7f..22374efe12f 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchPointAddressing.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchPointAddressing.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,11 +55,8 @@ calcPointEdges() const { // it is considered an error to attempt to recalculate // if already allocated - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcPointEdges()" - ) << "pointEdges already calculated" + FatalErrorInFunction + << "pointEdges already calculated" << abort(FatalError); } @@ -100,11 +97,8 @@ calcPointFaces() const { // it is considered an error to attempt to recalculate // if already allocated - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "calcPointFaces()" - ) << "pointFaces already calculated" + FatalErrorInFunction + << "pointFaces already calculated" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchProjectPoints.C b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchProjectPoints.C index 61dc971e399..3fe3c7338ad 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchProjectPoints.C +++ b/src/OpenFOAM/meshes/primitiveMesh/PrimitivePatch/PrimitivePatchProjectPoints.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -56,12 +56,8 @@ projectPoints if (projectionDirection.size() != nPoints()) { - FatalErrorIn - ( - "PrimitivePatch<Face, FaceList, PointField, PointType>::" - "projectPoints(const PrimitivePatch& " - ", const Field<PointType>&) const" - ) << "Projection direction field does not correspond to " + FatalErrorInFunction + << "Projection direction field does not correspond to " << "patch points." << endl << "Size: " << projectionDirection.size() << " Number of points: " << nPoints() @@ -303,12 +299,8 @@ projectFaceCentres if (projectionDirection.size() != this->size()) { - FatalErrorIn - ( - "labelList PrimitivePatch<Face, FaceList, PointField, PointType>::" - "projectFaceCentres(const PrimitivePatch& " - ", const Field<PointType>&) const" - ) << "Projection direction field does not correspond to patch faces." + FatalErrorInFunction + << "Projection direction field does not correspond to patch faces." << endl << "Size: " << projectionDirection.size() << " Number of points: " << this->size() << abort(FatalError); diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.C index 595c2862391..0e5beeeb034 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -310,11 +310,8 @@ Foam::tmp<Foam::scalarField> Foam::primitiveMesh::movePoints { if (newPoints.size() < nPoints() || oldPoints.size() < nPoints()) { - FatalErrorIn - ( - "primitiveMesh::movePoints(const pointField& newPoints, " - "const pointField& oldPoints)" - ) << "Cannot move points: size of given point list smaller " + FatalErrorInFunction + << "Cannot move points: size of given point list smaller " << "than the number of active points" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCalcCellShapes.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCalcCellShapes.C index 1c35bde3ffd..7144e41c23e 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCalcCellShapes.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCalcCellShapes.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,7 +40,7 @@ void Foam::primitiveMesh::calcCellShapes() const // if the pointer is already set if (cellShapesPtr_) { - FatalErrorIn("primitiveMesh::calcCellShapes() const") + FatalErrorInFunction << "cellShapes already calculated" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCells.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCells.C index 9f6ddf986e2..8cb2c4360d4 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCells.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCells.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,7 @@ void Foam::primitiveMesh::calcCellCells() const { // For checking calls:abort so we can quickly hunt down // origin of call - FatalErrorIn("primitiveMesh::calcCellCells()") + FatalErrorInFunction << abort(FatalError); } } @@ -50,7 +50,7 @@ void Foam::primitiveMesh::calcCellCells() const // if the pointer is already set if (ccPtr_) { - FatalErrorIn("primitiveMesh::calcCellCells() const") + FatalErrorInFunction << "cellCells already calculated" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C index 7f04d5877d1..458336db208 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellCentresAndVols.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ void Foam::primitiveMesh::calcCellCentresAndVols() const // if the pointer is already set if (cellCentresPtr_ || cellVolumesPtr_) { - FatalErrorIn("primitiveMesh::calcCellCentresAndVols() const") + FatalErrorInFunction << "Cell centres or cell volumes already calculated" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellEdges.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellEdges.C index 21e14118ffa..a4e449af371 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellEdges.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellEdges.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -44,7 +44,7 @@ void Foam::primitiveMesh::calcCellEdges() const { // For checking calls:abort so we can quickly hunt down // origin of call - FatalErrorIn("primitiveMesh::calcCellEdges()") + FatalErrorInFunction << abort(FatalError); } } @@ -53,7 +53,7 @@ void Foam::primitiveMesh::calcCellEdges() const // if the pointer is already set if (cePtr_) { - FatalErrorIn("primitiveMesh::calcCellEdges() const") + FatalErrorInFunction << "cellEdges already calculated" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellPoints.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellPoints.C index 8d520f2fa95..914b4755aab 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellPoints.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCellPoints.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,7 @@ const Foam::labelListList& Foam::primitiveMesh::cellPoints() const { // For checking calls:abort so we can quickly hunt down // origin of call - FatalErrorIn("primitiveMesh::cellPoints()") + FatalErrorInFunction << abort(FatalError); } } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCells.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCells.C index 5ba711be130..5f76854d8dd 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCells.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCells.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -110,7 +110,7 @@ void Foam::primitiveMesh::calcCells() const // if the pointer is already set if (cfPtr_) { - FatalErrorIn("primitiveMesh::calcCells() const") + FatalErrorInFunction << "cells already calculated" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C index a0aacc82727..01daafe3554 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -699,11 +699,8 @@ bool Foam::primitiveMesh::checkFaceAngles if (maxDeg < -SMALL || maxDeg > 180+SMALL) { - FatalErrorIn - ( - "primitiveMesh::checkFaceAngles" - "(const bool, const scalar, labelHashSet*)" - ) << "maxDeg should be [0..180] but is now " << maxDeg + FatalErrorInFunction + << "maxDeg should be [0..180] but is now " << maxDeg << exit(FatalError); } @@ -785,11 +782,8 @@ bool Foam::primitiveMesh::checkFaceFlatness if (warnFlatness < 0 || warnFlatness > 1) { - FatalErrorIn - ( - "primitiveMesh::checkFaceFlatness" - "(const bool, const scalar, labelHashSet*)" - ) << "warnFlatness should be [0..1] but is now " << warnFlatness + FatalErrorInFunction + << "warnFlatness should be [0..1] but is now " << warnFlatness << exit(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdgeCells.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdgeCells.C index 22b5f9f1624..9aeba752a3f 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdgeCells.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdgeCells.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,7 +41,7 @@ const Foam::labelListList& Foam::primitiveMesh::edgeCells() const { // For checking calls:abort so we can quickly hunt down // origin of call - FatalErrorIn("primitiveMesh::edgeCells()") + FatalErrorInFunction << abort(FatalError); } } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdgeFaces.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdgeFaces.C index 7b4c0e5fc8a..7f028196ac6 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdgeFaces.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdgeFaces.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,7 +40,7 @@ const Foam::labelListList& Foam::primitiveMesh::edgeFaces() const { // For checking calls:abort so we can quickly hunt down // origin of call - FatalErrorIn("primitiveMesh::edgeFaces()") + FatalErrorInFunction << abort(FatalError); } } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdges.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdges.C index d39c6ad909a..b79879f01ff 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdges.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshEdges.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -83,7 +83,7 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const // if the pointer is already set if ((edgesPtr_ || pePtr_) || (doFaceEdges && fePtr_)) { - FatalErrorIn("primitiveMesh::calcEdges(const bool) const") + FatalErrorInFunction << "edges or pointEdges or faceEdges already calculated" << abort(FatalError); } @@ -381,7 +381,7 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const else if (nbrPointI < nInternalPoints_) { // Not possible! - FatalErrorIn("primitiveMesh::calcEdges(..)") + FatalErrorInFunction << abort(FatalError); } else @@ -404,7 +404,7 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const { const edge& e = es[edgeI]; - FatalErrorIn("primitiveMesh::calcEdges(..)") + FatalErrorInFunction << "Did not sort edge " << edgeI << " points:" << e << " coords:" << points()[e[0]] << points()[e[1]] << endl @@ -483,11 +483,8 @@ Foam::label Foam::primitiveMesh::findFirstCommonElementFromSortedLists } if (result == -1) { - FatalErrorIn - ( - "primitiveMesh::findFirstCommonElementFromSortedLists" - "(const labelList&, const labelList&)" - ) << "No common elements in lists " << list1 << " and " << list2 + FatalErrorInFunction + << "No common elements in lists " << list1 << " and " << list2 << abort(FatalError); } return result; diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshFaceCentresAndAreas.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshFaceCentresAndAreas.C index 589ff7a98bc..236b1e30ee0 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshFaceCentresAndAreas.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshFaceCentresAndAreas.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,7 +48,7 @@ void Foam::primitiveMesh::calcFaceCentresAndAreas() const // if the pointer is already set if (faceCentresPtr_ || faceAreasPtr_) { - FatalErrorIn("primitiveMesh::calcFaceCentresAndAreas() const") + FatalErrorInFunction << "Face centres or face areas already calculated" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointCells.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointCells.C index fce127ee370..a30bf8858e5 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointCells.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointCells.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -42,7 +42,7 @@ void Foam::primitiveMesh::calcPointCells() const { // For checking calls:abort so we can quickly hunt down // origin of call - FatalErrorIn("primitiveMesh::calcPointCells()") + FatalErrorInFunction << abort(FatalError); } } @@ -51,7 +51,7 @@ void Foam::primitiveMesh::calcPointCells() const // if the pointer is already set if (pcPtr_) { - FatalErrorIn("primitiveMesh::calcPointCells() const") + FatalErrorInFunction << "pointCells already calculated" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointPoints.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointPoints.C index a37ecef0404..cb6fa584906 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointPoints.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshPointPoints.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,7 @@ void Foam::primitiveMesh::calcPointPoints() const { // For checking calls:abort so we can quickly hunt down // origin of call - FatalErrorIn("primitiveMesh::calcPointPoints()") + FatalErrorInFunction << abort(FatalError); } } @@ -48,7 +48,7 @@ void Foam::primitiveMesh::calcPointPoints() const // if the pointer is already set if (ppPtr_) { - FatalErrorIn("primitiveMesh::calcPointPoints() const") + FatalErrorInFunction << "pointPoints already calculated" << abort(FatalError); } @@ -76,7 +76,7 @@ void Foam::primitiveMesh::calcPointPoints() const } else { - FatalErrorIn("primitiveMesh::calcPointPoints() const") + FatalErrorInFunction << "something wrong with edges" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/patchZones.C b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/patchZones.C index fe5a09b19f1..fba0466599e 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/patchZones.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/patchZones.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -165,10 +165,8 @@ Foam::patchZones::patchZones if (borderEdge.size() != pp_.nEdges()) { - FatalErrorIn - ( - "patchZones::patchZones(const primitivePatch&, const boolList&)" - ) << "borderEdge boolList not same size as number of edges" << endl + FatalErrorInFunction + << "borderEdge boolList not same size as number of edges" << endl << "borderEdge:" << borderEdge.size() << endl << "nEdges :" << pp_.nEdges() << abort(FatalError); diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/walkPatch.C b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/walkPatch.C index 9e1455874b2..5b721d73261 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/walkPatch.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitivePatch/walkPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,7 +87,7 @@ Foam::label Foam::walkPatch::getNeighbour if (nbrEdgeI == -1) { - FatalErrorIn("getNeighbour") + FatalErrorInFunction << "Did not find edge on face " << faceI << " that uses vertices" << v0 << " and " << v1 << abort(FatalError); } @@ -114,7 +114,7 @@ Foam::label Foam::walkPatch::getNeighbour } else { - FatalErrorIn("getNeighbour") + FatalErrorInFunction << "Illegal surface on patch. Face " << faceI << " at vertices " << v0 << ',' << v1 << " has fewer than 1 or more than 2 neighbours" diff --git a/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointHit.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointHit.H index 3e2e4dd6986..e6196b9d379 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointHit.H +++ b/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointHit.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -128,7 +128,7 @@ public: { if (!hit_) { - FatalErrorIn("const Point& PointHit::hitPoint() const") + FatalErrorInFunction << "requested a hit point for a miss" << abort(FatalError); } @@ -147,7 +147,7 @@ public: { if (hit_) { - FatalErrorIn("const Point& PointHit::missPoint() const") + FatalErrorInFunction << "requested a miss point for a hit" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointIndexHit.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointIndexHit.H index 7e1103b2769..fa15dbfd429 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointIndexHit.H +++ b/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointIndexHit.H @@ -119,7 +119,7 @@ public: { if (!hit_) { - FatalErrorIn("PointIndexHit::hitPoint() const") + FatalErrorInFunction << "requested a hit point for a miss" << abort(FatalError); } @@ -132,7 +132,7 @@ public: { if (hit_) { - FatalErrorIn("PointIndexHit::missPoint() const") + FatalErrorInFunction << "requested a miss point for a hit" << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C index fe4f649f154..7f222fb8a80 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C +++ b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -49,7 +49,7 @@ void Foam::plane::calcPntAndVec(const scalarList& C) } else { - FatalErrorIn("void plane::calcPntAndVec(const scalarList&)") + FatalErrorInFunction << "At least one plane coefficient must have a value" << abort(FatalError); } @@ -61,7 +61,7 @@ void Foam::plane::calcPntAndVec(const scalarList& C) if (magUnitVector < VSMALL) { - FatalErrorIn("void plane::calcPntAndVec(const scalarList&)") + FatalErrorInFunction << "Plane normal defined with zero length" << abort(FatalError); } @@ -88,15 +88,8 @@ void Foam::plane::calcPntAndVec || mag(point3-point1) < VSMALL ) { - FatalErrorIn - ( - "void plane::calcPntAndVec\n" - "(\n" - " const point&,\n" - " const point&,\n" - " const point&\n" - ")\n" - ) << "Bad points:" << point1 << ' ' << point2 << ' ' << point3 + FatalErrorInFunction + << "Bad points:" << point1 << ' ' << point2 << ' ' << point3 << abort(FatalError); } @@ -105,15 +98,8 @@ void Foam::plane::calcPntAndVec if (magUnitVector < VSMALL) { - FatalErrorIn - ( - "void plane::calcPntAndVec\n" - "(\n" - " const point&,\n" - " const point&,\n" - " const point&\n" - ")\n" - ) << "Plane normal defined with zero length" << nl + FatalErrorInFunction + << "Plane normal defined with zero length" << nl << "Bad points:" << point1 << ' ' << point2 << ' ' << point3 << abort(FatalError); } @@ -138,7 +124,7 @@ Foam::plane::plane(const vector& normalVector) } else { - FatalErrorIn("plane::plane(const vector&)") + FatalErrorInFunction << "plane normal has zero length. basePoint:" << basePoint_ << abort(FatalError); } @@ -159,7 +145,7 @@ Foam::plane::plane(const point& basePoint, const vector& normalVector) } else { - FatalErrorIn("plane::plane(const point&, const vector&)") + FatalErrorInFunction << "plane normal has zero length. basePoint:" << basePoint_ << abort(FatalError); } @@ -226,7 +212,7 @@ Foam::plane::plane(const dictionary& dict) } else { - FatalIOErrorIn("plane::plane(const dictionary&)", dict) + FatalIOErrorInFunction(dict) << "Invalid plane type: " << planeType << nl << "Valid options include: planeEquation, embeddedPoints and " << "pointAndNormal" @@ -249,7 +235,7 @@ Foam::plane::plane(Istream& is) } else { - FatalErrorIn("plane::plane(Istream& is)") + FatalErrorInFunction << "plane normal has zero length. basePoint:" << basePoint_ << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H index e941956d602..a5e6864c7c5 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H +++ b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -124,7 +124,7 @@ inline Foam::triPointRef Foam::tetrahedron<Point, PointRef>::tri } else { - FatalErrorIn("tetrahedron::tri(const label faceI) const") + FatalErrorInFunction << "index out of range 0 -> 3. faceI = " << faceI << abort(FatalError); return triPointRef(b_, c_, d_); @@ -907,7 +907,7 @@ tetSliceWithPlane } else { - FatalErrorIn("tetSliceWithPlane(..)") + FatalErrorInFunction << "Missed edge:" << posEdge << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.H index 85c8f8de564..6051b36c425 100644 --- a/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.H +++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/intersection.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -93,10 +93,7 @@ public: { if (t < -VSMALL) { - FatalErrorIn - ( - "scalar intersection::setPlanarTol(const scalar t)" - ) << "Negative planar tolerance. This is not allowed." + FatalErrorInFunction << abort(FatalError); } diff --git a/src/OpenFOAM/meshes/treeBoundBox/treeBoundBox.C b/src/OpenFOAM/meshes/treeBoundBox/treeBoundBox.C index 1cec955dbdc..9dfb3e9094d 100644 --- a/src/OpenFOAM/meshes/treeBoundBox/treeBoundBox.C +++ b/src/OpenFOAM/meshes/treeBoundBox/treeBoundBox.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -130,10 +130,8 @@ Foam::treeBoundBox::treeBoundBox(const UList<point>& points) { if (points.empty()) { - WarningIn - ( - "treeBoundBox::treeBoundBox(const UList<point>&)" - ) << "cannot find bounding box for zero-sized pointField, " + WarningInFunction + << "cannot find bounding box for zero-sized pointField, " << "returning zero" << endl; return; @@ -151,11 +149,8 @@ Foam::treeBoundBox::treeBoundBox { if (points.empty() || indices.empty()) { - WarningIn - ( - "treeBoundBox::treeBoundBox" - "(const UList<point>&, const labelUList&)" - ) << "cannot find bounding box for zero-sized pointField, " + WarningInFunction + << "cannot find bounding box for zero-sized pointField, " << "returning zero" << endl; return; @@ -195,10 +190,8 @@ Foam::treeBoundBox Foam::treeBoundBox::subBbox { if (octant > 7) { - FatalErrorIn - ( - "treeBoundBox::subBbox(const point&, const direction)" - ) << "octant should be [0..7]" + FatalErrorInFunction + << "octant should be [0..7]" << abort(FatalError); } diff --git a/src/OpenFOAM/primitives/Pair/Pair.H b/src/OpenFOAM/primitives/Pair/Pair.H index 6715bffd7e5..ef30fb547f6 100644 --- a/src/OpenFOAM/primitives/Pair/Pair.H +++ b/src/OpenFOAM/primitives/Pair/Pair.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -113,7 +113,7 @@ public: { if (first() == second()) { - FatalErrorIn("Pair<Type>::other(const Type&) const") + FatalErrorInFunction << "Call to other only valid for Pair with differing" << " elements:" << *this << abort(FatalError); } @@ -125,7 +125,7 @@ public: { if (second() != a) { - FatalErrorIn("Pair<Type>::other(const Type&) const") + FatalErrorInFunction << "Pair " << *this << " does not contain " << a << abort(FatalError); } diff --git a/src/OpenFOAM/primitives/Tensor2D/tensor2D/tensor2D.C b/src/OpenFOAM/primitives/Tensor2D/tensor2D/tensor2D.C index 3d86f738f0c..4ac7a9dcb50 100644 --- a/src/OpenFOAM/primitives/Tensor2D/tensor2D/tensor2D.C +++ b/src/OpenFOAM/primitives/Tensor2D/tensor2D/tensor2D.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -115,7 +115,7 @@ vector2D eigenValues(const tensor2D& t) } else { - FatalErrorIn("eigenValues(const tensor2D&)") + FatalErrorInFunction << "zero and complex eigenvalues in tensor2D: " << t << abort(FatalError); } diff --git a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H index eb313e51ec8..4752ea43f54 100644 --- a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H +++ b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceI.H @@ -79,10 +79,8 @@ inline const Cmpt& VectorSpace<Form, Cmpt, nCmpt>::component # ifdef FULLDEBUG if (d >= nCmpt) { - FatalErrorIn - ( - "VectorSpace<Form, Cmpt, nCmpt>::component(direction) const" - ) << "index out of range" + FatalErrorInFunction + << "index out of range" << abort(FatalError); } # endif @@ -100,7 +98,7 @@ inline Cmpt& VectorSpace<Form, Cmpt, nCmpt>::component # ifdef FULLDEBUG if (d >= nCmpt) { - FatalErrorIn("VectorSpace<Form, Cmpt, nCmpt>::component(direction)") + FatalErrorInFunction << "index out of range" << abort(FatalError); } @@ -120,10 +118,8 @@ inline void VectorSpace<Form, Cmpt, nCmpt>::component # ifdef FULLDEBUG if (d >= nCmpt) { - FatalErrorIn - ( - "VectorSpace<Form, Cmpt, nCmpt>::component(Cmpt&, direction) const" - ) << "index out of range" + FatalErrorInFunction + << "index out of range" << abort(FatalError); } # endif @@ -142,11 +138,8 @@ inline void VectorSpace<Form, Cmpt, nCmpt>::replace # ifdef FULLDEBUG if (d >= nCmpt) { - FatalErrorIn - ( - "VectorSpace<Form, Cmpt, nCmpt>::" - "replace(direction, const Cmpt&) const" - ) << "index out of range" + FatalErrorInFunction + << "index out of range" << abort(FatalError); } # endif @@ -166,10 +159,8 @@ inline const Cmpt& VectorSpace<Form, Cmpt, nCmpt>::operator[] # ifdef FULLDEBUG if (d >= nCmpt) { - FatalErrorIn - ( - "VectorSpace<Form, Cmpt, nCmpt>::operator[](direction d) const" - ) << "index out of range" + FatalErrorInFunction + << "index out of range" << abort(FatalError); } # endif @@ -187,7 +178,7 @@ inline Cmpt& VectorSpace<Form, Cmpt, nCmpt>::operator[] # ifdef FULLDEBUG if (d >= nCmpt) { - FatalErrorIn("VectorSpace<Form, Cmpt, nCmpt>::operator[](direction d)") + FatalErrorInFunction << "index out of range" << abort(FatalError); } diff --git a/src/OpenFOAM/primitives/bools/Switch/Switch.C b/src/OpenFOAM/primitives/bools/Switch/Switch.C index e2a2a0d8550..1ff04b5316d 100644 --- a/src/OpenFOAM/primitives/bools/Switch/Switch.C +++ b/src/OpenFOAM/primitives/bools/Switch/Switch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -94,7 +94,7 @@ Foam::Switch::switchType Foam::Switch::asEnum if (!allowInvalid) { - FatalErrorIn("Switch::asEnum(const std::string&, const bool)") + FatalErrorInFunction << "unknown switch word " << str << nl << abort(FatalError); } diff --git a/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.C b/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.C index 28b0924db95..4f3d1b12d3f 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/CSV/CSV.C @@ -36,7 +36,7 @@ namespace Foam { if (componentColumns_[0] >= splitted.size()) { - FatalErrorIn("CSV<label>::readValue(const List<string>&)") + FatalErrorInFunction << "No column " << componentColumns_[0] << " in " << splitted << endl << exit(FatalError); @@ -50,7 +50,7 @@ namespace Foam { if (componentColumns_[0] >= splitted.size()) { - FatalErrorIn("CSV<scalar>::readValue(const List<string>&)") + FatalErrorInFunction << "No column " << componentColumns_[0] << " in " << splitted << endl << exit(FatalError); @@ -69,7 +69,7 @@ namespace Foam { if (componentColumns_[i] >= splitted.size()) { - FatalErrorIn("CSV<Type>::readValue(const List<string>&)") + FatalErrorInFunction << "No column " << componentColumns_[i] << " in " << splitted << endl << exit(FatalError); @@ -92,7 +92,7 @@ void Foam::CSV<Type>::read() if (!is.good()) { - FatalIOErrorIn("CSV<Type>::read()", is) + FatalIOErrorInFunction(is) << "Cannot open CSV file for reading." << exit(FatalIOError); } @@ -214,7 +214,7 @@ Foam::CSV<Type>::CSV { if (componentColumns_.size() != pTraits<Type>::nComponents) { - FatalErrorIn("Foam::CSV<Type>::CSV(const word&, Istream&)") + FatalErrorInFunction << componentColumns_ << " does not have the expected length of " << pTraits<Type>::nComponents << endl << exit(FatalError); diff --git a/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryNew.C b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryNew.C index ef023e4c3c4..e2edd026fd8 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryNew.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/DataEntry/DataEntryNew.C @@ -62,7 +62,7 @@ Foam::autoPtr<Foam::DataEntry<Type> > Foam::DataEntry<Type>::New if (cstrIter == dictionaryConstructorTablePtr_->end()) { - FatalErrorIn("DataEntry<Type>::New(const word&, const dictionary&)") + FatalErrorInFunction << "Unknown DataEntry type " << DataEntryType << " for DataEntry " << entryName << nl << nl diff --git a/src/OpenFOAM/primitives/functions/DataEntry/PolynomialEntry/PolynomialEntry.C b/src/OpenFOAM/primitives/functions/DataEntry/PolynomialEntry/PolynomialEntry.C index e5cc7d1da04..7479702cdfe 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/PolynomialEntry/PolynomialEntry.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/PolynomialEntry/PolynomialEntry.C @@ -53,11 +53,8 @@ Foam::PolynomialEntry<Type>::PolynomialEntry if (!coeffs_.size()) { - FatalErrorIn - ( - "PolynomialEntry<Type>::" - "PolynomialEntry(const word&, const dictionary&)" - ) << "PolynomialEntry coefficients for entry " << this->name_ + FatalErrorInFunction + << "PolynomialEntry coefficients for entry " << this->name_ << " are invalid (empty)" << nl << exit(FatalError); } @@ -74,11 +71,8 @@ Foam::PolynomialEntry<Type>::PolynomialEntry { if (!canIntegrate_) { - WarningIn - ( - "PolynomialEntry<Type>::PolynomialEntry" - "(const word&, const dictionary&)" - ) << "PolynomialEntry " << this->name_ << " cannot be integrated" + WarningInFunction + << "PolynomialEntry " << this->name_ << " cannot be integrated" << endl; } } @@ -99,11 +93,8 @@ Foam::PolynomialEntry<Type>::PolynomialEntry { if (!coeffs_.size()) { - FatalErrorIn - ( - "Foam::PolynomialEntry<Type>::PolynomialEntry" - "(const word&, const List<Tuple2<Type, Type> >&)" - ) << "PolynomialEntry coefficients for entry " << this->name_ + FatalErrorInFunction + << "PolynomialEntry coefficients for entry " << this->name_ << " are invalid (empty)" << nl << exit(FatalError); } @@ -120,11 +111,8 @@ Foam::PolynomialEntry<Type>::PolynomialEntry { if (!canIntegrate_) { - WarningIn - ( - "Foam::PolynomialEntry<Type>::PolynomialEntry" - "(const word&, const List<Tuple2<Type, Type> >&)" - ) << "PolynomialEntry " << this->name_ << " cannot be integrated" + WarningInFunction + << "PolynomialEntry " << this->name_ << " cannot be integrated" << endl; } } diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C index 2dedd9ffe35..8d781f541f5 100644 --- a/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C +++ b/src/OpenFOAM/primitives/functions/DataEntry/Table/TableBase.C @@ -159,7 +159,7 @@ Foam::TableBase<Type>::wordToBoundsHandling } else { - WarningIn("Foam::TableBase<Type>::wordToBoundsHandling(const word&)") + WarningInFunction << "bad outOfBounds specifier " << bound << " using 'warn'" << endl; @@ -187,7 +187,7 @@ void Foam::TableBase<Type>::check() const { if (!table_.size()) { - FatalErrorIn("Foam::TableBase<Type>::check() const") + FatalErrorInFunction << "Table for entry " << this->name_ << " is invalid (empty)" << nl << exit(FatalError); } @@ -202,7 +202,7 @@ void Foam::TableBase<Type>::check() const // avoid duplicate values (divide-by-zero error) if (currValue <= prevValue) { - FatalErrorIn("Foam::TableBase<Type>::check() const") + FatalErrorInFunction << "out-of-order value: " << currValue << " at index " << i << exit(FatalError); } @@ -224,27 +224,15 @@ bool Foam::TableBase<Type>::checkMinBounds { case ERROR: { - FatalErrorIn - ( - "bool Foam::TableBase<Type>::checkMinBounds" - "(" - "const scalar, " - "scalar&" - ") const" - ) << "value (" << x << ") underflow" + FatalErrorInFunction + << "value (" << x << ") underflow" << exit(FatalError); break; } case WARN: { - WarningIn - ( - "bool Foam::TableBase<Type>::checkMinBounds" - "(" - "const scalar, " - "scalar&" - ") const" - ) << "value (" << x << ") underflow" << nl + WarningInFunction + << "value (" << x << ") underflow" << nl << endl; // fall-through to 'CLAMP' @@ -286,27 +274,15 @@ bool Foam::TableBase<Type>::checkMaxBounds { case ERROR: { - FatalErrorIn - ( - "bool Foam::TableBase<Type>::checkMaxBounds" - "(" - "const scalar, " - "scalar&" - ") const" - ) << "value (" << x << ") overflow" + FatalErrorInFunction + << "value (" << x << ") overflow" << exit(FatalError); break; } case WARN: { - WarningIn - ( - "bool Foam::TableBase<Type>::checkMaxBounds" - "(" - "const scalar, " - "scalar&" - ") const" - ) << "value (" << x << ") overflow" << nl + WarningInFunction + << "value (" << x << ") overflow" << nl << endl; // fall-through to 'CLAMP' diff --git a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C index 5a545f150cf..4d99d698bf9 100644 --- a/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C +++ b/src/OpenFOAM/primitives/functions/Polynomial/Polynomial.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,10 +76,8 @@ Foam::Polynomial<PolySize>::Polynomial(const UList<scalar>& coeffs) { if (coeffs.size() != PolySize) { - FatalErrorIn - ( - "Polynomial<PolySize>::Polynomial(const UList<scalar>&)" - ) << "Size mismatch: Needed " << PolySize + FatalErrorInFunction + << "Size mismatch: Needed " << PolySize << " but given " << coeffs.size() << nl << exit(FatalError); } @@ -111,10 +109,8 @@ Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is) if (isName != name) { - FatalErrorIn - ( - "Polynomial<PolySize>::Polynomial(const word&, Istream&)" - ) << "Expected polynomial name " << name << " but read " << isName + FatalErrorInFunction + << "Expected polynomial name " << name << " but read " << isName << nl << exit(FatalError); } @@ -123,10 +119,8 @@ Foam::Polynomial<PolySize>::Polynomial(const word& name, Istream& is) if (this->size() == 0) { - FatalErrorIn - ( - "Polynomial<PolySize>::Polynomial(const word&, Istream&)" - ) << "Polynomial coefficients for entry " << isName + FatalErrorInFunction + << "Polynomial coefficients for entry " << isName << " are invalid (empty)" << nl << exit(FatalError); } } diff --git a/src/OpenFOAM/primitives/functions/Polynomial/polynomialFunction.C b/src/OpenFOAM/primitives/functions/Polynomial/polynomialFunction.C index fa9ccea8307..e10d5a7c97a 100644 --- a/src/OpenFOAM/primitives/functions/Polynomial/polynomialFunction.C +++ b/src/OpenFOAM/primitives/functions/Polynomial/polynomialFunction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -89,10 +89,8 @@ Foam::polynomialFunction::polynomialFunction(const label order) { if (this->empty()) { - FatalErrorIn - ( - "polynomialFunction::polynomialFunction(const label order)" - ) << "polynomialFunction coefficients are invalid (empty)" + FatalErrorInFunction + << "polynomialFunction coefficients are invalid (empty)" << nl << exit(FatalError); } } @@ -114,10 +112,8 @@ Foam::polynomialFunction::polynomialFunction(const UList<scalar>& coeffs) { if (this->empty()) { - FatalErrorIn - ( - "polynomialFunction::polynomialFunction(const UList<scalar>&)" - ) << "polynomialFunction coefficients are invalid (empty)" + FatalErrorInFunction + << "polynomialFunction coefficients are invalid (empty)" << nl << exit(FatalError); } } @@ -131,10 +127,8 @@ Foam::polynomialFunction::polynomialFunction(Istream& is) { if (this->empty()) { - FatalErrorIn - ( - "polynomialFunction::polynomialFunction(Istream&)" - ) << "polynomialFunction coefficients are invalid (empty)" + FatalErrorInFunction + << "polynomialFunction coefficients are invalid (empty)" << nl << exit(FatalError); } } @@ -192,14 +186,8 @@ Foam::scalar Foam::polynomialFunction::integrate if (logActive_) { - FatalErrorIn - ( - "scalar polynomialFunction::integrate" - "(" - "const scalar, " - "const scalar" - ") const" - ) << "Cannot integrate polynomial with logarithmic coefficients" + FatalErrorInFunction + << "Cannot integrate polynomial with logarithmic coefficients" << nl << abort(FatalError); } diff --git a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C index ec1e8efddaf..178898eb071 100644 --- a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransform.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -180,11 +180,8 @@ void Foam::globalIndexAndTransform::determineTransforms() { if (nextTrans == 6) { - FatalErrorIn - ( - "void Foam::globalIndexAndTransform::" - "determineTransforms()" - ) << "More than six unsigned transforms" + FatalErrorInFunction + << "More than six unsigned transforms" << " detected:" << nl << transforms_ << exit(FatalError); } @@ -220,11 +217,8 @@ void Foam::globalIndexAndTransform::determineTransforms() { if (nextTrans == 6) { - FatalErrorIn - ( - "void Foam::globalIndexAndTransform::" - "determineTransforms()" - ) << "More than six unsigned transforms" + FatalErrorInFunction + << "More than six unsigned transforms" << " detected:" << nl << transforms_ << exit(FatalError); } @@ -283,11 +277,7 @@ void Foam::globalIndexAndTransform::determineTransforms() if (nextTrans > 3) { - FatalErrorIn - ( - "void Foam::globalIndexAndTransform::" - "determineTransforms()" - ) + FatalErrorInFunction << "More than three independent basic " << "transforms detected:" << nl << allTransforms @@ -305,10 +295,8 @@ void Foam::globalIndexAndTransform::determineTransforms() if (transforms_.size() > 3) { - WarningIn - ( - "void globalIndexAndTransform::determineTransforms()" - ) << "More than three independent basic " + WarningInFunction + << "More than three independent basic " << "transforms detected:" << nl << transforms_ << nl << "This is not a space filling tiling and will probably" diff --git a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransformI.H b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransformI.H index 9227e6a990b..5ce965ea48d 100644 --- a/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransformI.H +++ b/src/OpenFOAM/primitives/globalIndexAndTransform/globalIndexAndTransformI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -77,13 +77,7 @@ Foam::label Foam::globalIndexAndTransform::encodeTransformIndex { if (permutationIndices.size() != transforms_.size()) { - FatalErrorIn - ( - "Foam::label encodeTransformIndex" - "(" - "const List<label>& permutationIndices," - ") const" - ) + FatalErrorInFunction << "permutationIndices " << permutationIndices << "are of a different size to the number of independent transforms" << abort(FatalError); @@ -97,13 +91,7 @@ Foam::label Foam::globalIndexAndTransform::encodeTransformIndex { if (mag(permutationIndices[b]) > 1) { - FatalErrorIn - ( - "Foam::label encodeTransformIndex" - "(" - "const List<label>& permutationIndices," - ") const" - ) + FatalErrorInFunction << "permutationIndices " << permutationIndices << "are illegal, they must all be only -1, 0 or +1" << abort(FatalError); @@ -173,10 +161,8 @@ Foam::globalIndexAndTransform::decodeTransformIndex t /= 3; if (t != 0) { - FatalErrorIn - ( - "globalIndexAndTransform::decodeTransformIndex(const label)" - ) << "transformIndex : " << transformIndex + FatalErrorInFunction + << "transformIndex : " << transformIndex << " has more than 3 fields." << abort(FatalError); } @@ -221,7 +207,7 @@ Foam::label Foam::globalIndexAndTransform::addToTransformIndex if (sign == 0) { // sent from patch without a transformation. Do nothing. - FatalErrorIn("globalIndexAndTransform::addToTransformIndex(..)") + FatalErrorInFunction << "patch:" << mesh_.boundaryMesh()[patchI].name() << " transform:" << matchTransI << " sign:" << sign << " current transforms:" << permutation @@ -256,16 +242,8 @@ Foam::label Foam::globalIndexAndTransform::addToTransformIndex } else { - FatalErrorIn - ( - "Foam::label " - "Foam::globalIndexAndTransform::addToTransformIndex\n" - "(\n" - "const label,\n" - "const label,\n" - "const bool\n" - ") const\n" - ) << "More than one patch accessing the same transform " + FatalErrorInFunction + << "More than one patch accessing the same transform " << "but not of the same sign." << endl << "patch:" << mesh_.boundaryMesh()[patchI].name() << " transform:" << matchTransI << " sign:" << sign @@ -377,15 +355,7 @@ Foam::labelPair Foam::globalIndexAndTransform::encode { if (transformIndex < 0 || transformIndex >= base_) { - FatalErrorIn - ( - "Foam::labelPair Foam::globalIndexAndTransform::encode" - "(" - "const label procI, " - "const label index, " - "const label transformIndex" - ")" - ) + FatalErrorInFunction << "TransformIndex " << transformIndex << " is outside allowed range of 0 to " << base_ - 1 @@ -394,15 +364,7 @@ Foam::labelPair Foam::globalIndexAndTransform::encode if (procI > labelMax/base_) { - FatalErrorIn - ( - "Foam::labelPair Foam::globalIndexAndTransform::encode" - "(" - "const label procI, " - "const label index, " - "const label transformIndex" - ")" - ) + FatalErrorInFunction << "Overflow : encoding processor " << procI << " in base " << base_ << " exceeds capability of label (" << labelMax << "). Please recompile with larger datatype for label." @@ -521,14 +483,7 @@ Foam::labelList Foam::globalIndexAndTransform::transformIndicesForPatches // transform. if (permutation[matchTransI] != sign) { - FatalErrorIn - ( - "const Foam::List<Foam::vectorTensorTransform>& " - "Foam::globalIndexAndTransform::transformsForPatches" - "(" - "const labelList& patchIs" - ") const" - ) + FatalErrorInFunction << "More than one patch accessing the same transform " << "but not of the same sign." << exit(FatalError); @@ -658,14 +613,7 @@ Foam::labelList Foam::globalIndexAndTransform::transformIndicesForPatches } default: { - FatalErrorIn - ( - "const Foam::List<Foam::vectorTensorTransform>& " - "Foam::globalIndexAndTransform::transformsForPatches" - "(" - "const labelList& patchIs" - ") const" - ) + FatalErrorInFunction << "Only 1-3 transforms are possible." << exit(FatalError); } diff --git a/src/OpenFOAM/primitives/ints/label/label.C b/src/OpenFOAM/primitives/ints/label/label.C index 22b2014bfda..10a621f462e 100644 --- a/src/OpenFOAM/primitives/ints/label/label.C +++ b/src/OpenFOAM/primitives/ints/label/label.C @@ -50,7 +50,7 @@ Foam::label Foam::pow(label a, label b) #ifdef FULLDEBUG if (b < 0) { - FatalErrorIn("pow(label a, label b)") + FatalErrorInFunction << "negative value for b is not supported" << abort(FatalError); } @@ -71,7 +71,7 @@ Foam::label Foam::factorial(label n) #ifdef FULLDEBUG if (n > 12 && n < 0) { - FatalErrorIn("factorial(label n)") + FatalErrorInFunction << "n value out of range" << abort(FatalError); } diff --git a/src/OpenFOAM/primitives/ints/uLabel/uLabel.C b/src/OpenFOAM/primitives/ints/uLabel/uLabel.C index 9c8411093d1..f4aea858dd8 100644 --- a/src/OpenFOAM/primitives/ints/uLabel/uLabel.C +++ b/src/OpenFOAM/primitives/ints/uLabel/uLabel.C @@ -50,7 +50,7 @@ Foam::uLabel Foam::pow(uLabel a, uLabel b) #ifdef FULLDEBUG if (b < 0) { - FatalErrorIn("pow(uLabel a, uLabel b)") + FatalErrorInFunction << "negative value for b is not supported" << abort(FatalError); } @@ -71,7 +71,7 @@ Foam::uLabel Foam::factorial(uLabel n) #ifdef FULLDEBUG if (n > 12 && n < 0) { - FatalErrorIn("factorial(uLabel n)") + FatalErrorInFunction << "n value out of range" << abort(FatalError); } diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C index cd117cd7e83..52387922b18 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C +++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -286,15 +286,8 @@ Foam::string Foam::stringOps::getVariable if (value.empty()) { - FatalIOErrorIn + FatalIOErrorInFunction ( - "stringOps::getVariable\n" - "(\n" - " const word&,\n" - " const dictionary&,\n" - " const bool,\n" - " const bool\n" - ")\n", dict ) << "Cannot find dictionary or environment variable " << name << exit(FatalIOError); @@ -302,15 +295,8 @@ Foam::string Foam::stringOps::getVariable } else { - FatalIOErrorIn + FatalIOErrorInFunction ( - "stringOps::getVariable\n" - "(\n" - " const word&,\n" - " const dictionary&,\n" - " const bool,\n" - " const bool\n" - ")\n", dict ) << "Cannot find dictionary variable " << name << exit(FatalIOError); @@ -792,10 +778,8 @@ Foam::string& Foam::stringOps::inplaceExpand } else { - FatalErrorIn - ( - "stringOps::inplaceExpand(string&, const bool)" - ) << "Unknown variable name '" << varName << "'" + FatalErrorInFunction + << "Unknown variable name '" << varName << "'" << exit(FatalError); } } -- GitLab