applications: Update ...ErrorIn -> ...ErrorInFunction

Avoids the clutter and maintenance effort associated with providing the
function signature string.
This commit is contained in:
Henry Weller
2015-11-10 17:53:31 +00:00
parent 735ce9cce7
commit e2ef006b91
271 changed files with 851 additions and 1559 deletions

View File

@ -437,7 +437,7 @@ int main(int argc, char *argv[])
if (!validActions.found(action))
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Unsupported action " << action << endl
<< "Supported actions:" << validActions.toc() << abort(FatalError);
}
@ -468,7 +468,7 @@ int main(int argc, char *argv[])
if (invertedSpace && validActions[action] == booleanSurface::DIFFERENCE)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Inverted space only makes sense for union or intersection."
<< exit(FatalError);
}
@ -708,7 +708,7 @@ int main(int argc, char *argv[])
}
else
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Unsupported booleanSurface:booleanOpType and space "
<< action << " " << invertedSpace
<< abort(FatalError);

View File

@ -57,7 +57,7 @@ bool validTri
{
if (f[fp] < 0 || f[fp] >= surf.points().size())
{
WarningIn("validTri(const triSurface&, const label)")
WarningInFunction
<< "triangle " << faceI << " vertices " << f
<< " uses point indices outside point range 0.."
<< surf.points().size()-1 << endl;
@ -67,7 +67,7 @@ bool validTri
if ((f[0] == f[1]) || (f[0] == f[2]) || (f[1] == f[2]))
{
WarningIn("validTri(const triSurface&, const label)")
WarningInFunction
<< "triangle " << faceI
<< " uses non-unique vertices " << f
<< " coords:" << f.points(surf.points())
@ -100,7 +100,7 @@ bool validTri
&& ((f[2] == nbrF[0]) || (f[2] == nbrF[1]) || (f[2] == nbrF[2]))
)
{
WarningIn("validTri(const triSurface&, const label)")
WarningInFunction
<< "triangle " << faceI << " vertices " << f
<< " has the same vertices as triangle " << nbrFaceI
<< " vertices " << nbrF
@ -146,11 +146,8 @@ labelList countBins
if ((index < 0) || (index >= nBins))
{
WarningIn
(
"countBins(const scalar, const scalar, const label"
", const scalarField&)"
) << "value " << val << " at index " << i
WarningInFunction
<< "value " << val << " at index " << i
<< " outside range " << min << " .. " << max << endl;
if (index < 0)
@ -257,7 +254,7 @@ int main(int argc, char *argv[])
if (region < 0 || region >= regionSize.size())
{
WarningIn(args.executable())
WarningInFunction
<< "Triangle " << faceI << " vertices " << surf[faceI]
<< " has region " << region << " which is outside the range"
<< " of regions 0.." << surf.patches().size()-1
@ -371,7 +368,7 @@ int main(int argc, char *argv[])
if (triQ[minIndex] < SMALL)
{
WarningIn(args.executable()) << "Minimum triangle quality is "
WarningInFunction
<< triQ[minIndex] << ". This might give problems in"
<< " self-intersection testing later on." << endl;
}

View File

@ -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
@ -175,7 +175,7 @@ static void splitTri
}
else
{
FatalErrorIn("splitTri(..)")
FatalErrorInFunction
<< "Edge " << e << " not part of triangle " << f
<< " fp:" << fp
<< " fp1:" << fp1
@ -206,14 +206,14 @@ static bool insertSorted
{
if (findIndex(sortedVerts, vertI) != -1)
{
FatalErrorIn("insertSorted(..)") << "Trying to insert vertex " << vertI
FatalErrorInFunction
<< " which is already in list of sorted vertices "
<< sortedVerts << abort(FatalError);
}
if (weight <= 0 || weight >= 1)
{
FatalErrorIn("insertSorted(..)") << "Trying to insert vertex " << vertI
FatalErrorInFunction
<< " with illegal weight " << weight
<< " into list of sorted vertices "
<< sortedVerts << abort(FatalError);
@ -228,7 +228,7 @@ static bool insertSorted
if (mag(w - weight) < SMALL)
{
WarningIn("insertSorted(..)")
WarningInFunction
<< "Trying to insert weight " << weight << " which is close to"
<< " existing weight " << w << " in " << sortedWeights
<< endl;
@ -359,7 +359,7 @@ static void markCollapsedFaces
// Mark face as being collapsed
if (faceToEdge[faceI] != -1)
{
FatalErrorIn("markCollapsedFaces(..)")
FatalErrorInFunction
<< "Cannot collapse face " << faceI << " since "
<< " is marked to be collapsed both to edge "
<< faceToEdge[faceI] << " and " << edgeI
@ -386,7 +386,7 @@ static void markRegion
{
if (faceToEdge[faceI] == -1 || collapseRegion[faceI] != -1)
{
FatalErrorIn("markRegion(..)")
FatalErrorInFunction
<< "Problem : crossed into uncollapsed/regionized face"
<< abort(FatalError);
}
@ -422,7 +422,7 @@ static void markRegion
}
else if (collapseRegion[nbrFaceI] != regionI)
{
FatalErrorIn("markRegion(..)")
FatalErrorInFunction
<< "Edge:" << edgeI << " between face " << faceI
<< " with region " << regionI
<< " and face " << nbrFaceI
@ -494,7 +494,7 @@ static label edgeType
}
else if (usesRegion != region)
{
FatalErrorIn("edgeRegion") << abort(FatalError);
FatalErrorInFunction << abort(FatalError);
}
else
{
@ -519,7 +519,7 @@ static label edgeType
{
if (usesRegion == -1)
{
FatalErrorIn("edgeRegion") << abort(FatalError);
FatalErrorInFunction << abort(FatalError);
return -2;
}
else
@ -640,7 +640,7 @@ static void projectNonSpanPoints
if (!pHit.hit())
{
FatalErrorIn("projectNonSpanPoints")
FatalErrorInFunction
<< abort(FatalError);
}
@ -737,7 +737,7 @@ static void getSplitVerts
if (i0 == -1 || i1 == -1)
{
FatalErrorIn("getSplitVerts")
FatalErrorInFunction
<< "Did not find edge in projected vertices." << nl
<< "region:" << regionI << nl
<< "spanPoints:" << spanPoints

View File

@ -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,7 +77,7 @@ int main(int argc, char *argv[])
if (reduction <= 0 || reduction > 1)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Reduction factor " << reduction
<< " should be within 0..1" << endl
<< "(it is the reduction in number of vertices)"

View File

@ -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
@ -107,7 +107,7 @@ int main(int argc, char *argv[])
if (importName == exportName)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Output file " << exportName << " would overwrite input file."
<< exit(FatalError);
}

View File

@ -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
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
// disable inplace editing
if (importName == exportName)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Output file " << exportName << " would overwrite input file."
<< exit(FatalError);
}

View File

@ -73,7 +73,7 @@ scalar calcVertexNormalWeight
if (index == -1)
{
FatalErrorIn("calcVertexNormals()")
FatalErrorInFunction
<< "Point not in face" << abort(FatalError);
}
@ -853,7 +853,7 @@ surfaceFeatures::edgeStatus checkFlatRegionEdge
}
else if (dir == 0)
{
FatalErrorIn("problem.")
FatalErrorInFunction
<< exit(FatalError);
}
else
@ -1083,7 +1083,7 @@ int main(int argc, char *argv[])
}
else
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "No initial feature set. Provide either one"
<< " of extractFromFile (to read existing set)" << nl
<< " or extractFromSurface (to construct new set from angle)"

View File

@ -471,7 +471,7 @@ int main(int argc, char *argv[])
if (eFaces.size() != 1)
{
WarningIn(args.executable())
WarningInFunction
<< "Edge is attached to " << eFaces.size()
<< " faces." << endl;

View File

@ -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
@ -103,7 +103,7 @@ int main(int argc, char *argv[])
if (m < 0)
{
WarningIn(args.executable() + "::main")
WarningInFunction
<< "Negative mass detected, the surface may be inside-out." << endl;
}
@ -117,7 +117,7 @@ int main(int argc, char *argv[])
while ((magSqr(eVal) < VSMALL) && pertI < 10)
{
WarningIn(args.executable() + "::main")
WarningInFunction
<< "No eigenValues found, shape may have symmetry, "
<< "perturbing inertia tensor diagonal" << endl;
@ -320,7 +320,7 @@ int main(int argc, char *argv[])
}
else
{
WarningIn(args.executable() + "::main")
WarningInFunction
<< "Non-unique eigenvectors, cannot compute transformation "
<< "from Cartesian axes" << endl;
@ -337,7 +337,7 @@ int main(int argc, char *argv[])
if (f[0] == f[1] || f[0] == f[2] || f[1] == f[2])
{
WarningIn(args.executable())
WarningInFunction
<< "Illegal triangle " << faceI << " vertices " << f
<< " coords " << f.points(surf.points()) << endl;
}

View File

@ -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
@ -109,7 +109,7 @@ void getFixedPoints
if (!matchedAll)
{
WarningIn("getFixedPoints(const edgeMesh&, const pointField&)")
WarningInFunction
<< "Did not match all feature points to points on the surface"
<< endl;
}
@ -150,14 +150,14 @@ int main(int argc, char *argv[])
if (lambda < 0 || lambda > 1)
{
FatalErrorIn(args.executable()) << "Illegal relaxation factor "
FatalErrorInFunction
<< lambda << endl
<< "0: no change 1: move vertices to average of neighbours"
<< exit(FatalError);
}
if (mu < 0 || mu > 1)
{
FatalErrorIn(args.executable()) << "Illegal relaxation factor "
FatalErrorInFunction
<< mu << endl
<< "0: no change 1: move vertices to average of neighbours"
<< exit(FatalError);

View File

@ -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 @@ int main(int argc, char *argv[])
// disable inplace editing
if (importName == exportName)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Output file " << exportName << " would overwrite input file."
<< exit(FatalError);
}
@ -196,8 +196,7 @@ int main(int argc, char *argv[])
if (!csDictIoPtr->headerOk())
{
FatalErrorIn(args.executable())
<< "Cannot open coordinateSystems file\n "
FatalErrorInFunction
<< csDictIoPtr->objectPath() << nl
<< exit(FatalError);
}
@ -211,7 +210,7 @@ int main(int argc, char *argv[])
const label csIndex = csLst.findIndex(csName);
if (csIndex < 0)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Cannot find -from " << csName << nl
<< "available coordinateSystems: " << csLst.toc() << nl
<< exit(FatalError);
@ -227,7 +226,7 @@ int main(int argc, char *argv[])
const label csIndex = csLst.findIndex(csName);
if (csIndex < 0)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Cannot find -to " << csName << nl
<< "available coordinateSystems: " << csLst.toc() << nl
<< exit(FatalError);
@ -240,8 +239,7 @@ int main(int argc, char *argv[])
// maybe fix this later
if (fromCsys.valid() && toCsys.valid())
{
FatalErrorIn(args.executable())
<< "Only allowed '-from' or '-to' option at the moment."
FatalErrorInFunction
<< exit(FatalError);
}
}

View File

@ -103,7 +103,7 @@ int main(int argc, char *argv[])
if (importName == exportName)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Output file " << exportName << " would overwrite input file."
<< exit(FatalError);
}

View File

@ -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
@ -176,8 +176,7 @@ int main(int argc, char *argv[])
if (!ioPtr->headerOk())
{
FatalErrorIn(args.executable())
<< "Cannot open coordinateSystems file\n "
FatalErrorInFunction
<< ioPtr->objectPath() << nl
<< exit(FatalError);
}
@ -191,7 +190,7 @@ int main(int argc, char *argv[])
const label csIndex = csLst.findIndex(csName);
if (csIndex < 0)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Cannot find -from " << csName << nl
<< "available coordinateSystems: " << csLst.toc() << nl
<< exit(FatalError);
@ -207,7 +206,7 @@ int main(int argc, char *argv[])
const label csIndex = csLst.findIndex(csName);
if (csIndex < 0)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Cannot find -to " << csName << nl
<< "available coordinateSystems: " << csLst.toc() << nl
<< exit(FatalError);
@ -220,8 +219,7 @@ int main(int argc, char *argv[])
// maybe fix this later
if (fromCsys.valid() && toCsys.valid())
{
FatalErrorIn(args.executable())
<< "Only allowed '-from' or '-to' option at the moment."
FatalErrorInFunction
<< exit(FatalError);
}
}

View File

@ -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
@ -189,8 +189,7 @@ int main(int argc, char *argv[])
if (!ioPtr->headerOk())
{
FatalErrorIn(args.executable())
<< "Cannot open coordinateSystems file\n "
FatalErrorInFunction
<< ioPtr->objectPath() << nl
<< exit(FatalError);
}
@ -204,7 +203,7 @@ int main(int argc, char *argv[])
const label csIndex = csLst.findIndex(csName);
if (csIndex < 0)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Cannot find -from " << csName << nl
<< "available coordinateSystems: " << csLst.toc() << nl
<< exit(FatalError);
@ -220,7 +219,7 @@ int main(int argc, char *argv[])
const label csIndex = csLst.findIndex(csName);
if (csIndex < 0)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Cannot find -to " << csName << nl
<< "available coordinateSystems: " << csLst.toc() << nl
<< exit(FatalError);
@ -233,8 +232,7 @@ int main(int argc, char *argv[])
// maybe fix this later
if (fromCsys.valid() && toCsys.valid())
{
FatalErrorIn(args.executable())
<< "Only allowed '-from' or '-to' option at the moment."
FatalErrorInFunction
<< exit(FatalError);
}
}

View File

@ -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
@ -162,7 +162,7 @@ int main(int argc, char *argv[])
if (zoneIDs.empty())
{
WarningIn(args.executable())
WarningInFunction
<< "Cannot find any faceZone name matching "
<< zoneName << endl;
}

View File

@ -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
@ -137,7 +137,7 @@ int main(int argc, char *argv[])
if (!Pstream::parRun())
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Please run this program on the decomposed case."
<< " It will read surface " << surfFileName
<< " and decompose it such that it overlaps the mesh bounding box."

View File

@ -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
@ -151,7 +151,7 @@ int main(int argc, char *argv[])
if (iterationNo == iterationLimit)
{
WarningIn("surfaceSplitByTopology")
WarningInFunction
<< "Iteration limit of " << iterationLimit << "reached" << endl;
}

View File

@ -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
@ -152,14 +152,14 @@ void testSortedEdgeFaces(const triSurface& surf)
{
if (findIndex(sortMyFaces, myFaces[i]) == -1)
{
FatalErrorIn("testSortedEdgeFaces(..)") << abort(FatalError);
FatalErrorInFunction << abort(FatalError);
}
}
forAll(sortMyFaces, i)
{
if (findIndex(myFaces, sortMyFaces[i]) == -1)
{
FatalErrorIn("testSortedEdgeFaces(..)") << abort(FatalError);
FatalErrorInFunction << abort(FatalError);
}
}
}
@ -299,7 +299,7 @@ label findEdge
}
FatalErrorIn("findEdge(..)") << "Cannot find edge with labels " << v0
FatalErrorInFunction
<< ' ' << v1 << " in candidates " << edgeLabels
<< " with vertices:" << UIndirectList<edge>(surf.edges(), edgeLabels)()
<< abort(FatalError);
@ -338,7 +338,7 @@ label otherEdge
}
}
FatalErrorIn("otherEdge(..)") << "Cannot find other edge on face " << faceI
FatalErrorInFunction
<< " verts:" << surf.localPoints()[faceI]
<< " connected to point " << pointI
<< " faceEdges:" << UIndirectList<edge>(surf.edges(), fEdges)()
@ -404,7 +404,7 @@ void walkSplitLine
if (eFaces.size() != 2)
{
FatalErrorIn("walkSplitPoint(..)")
FatalErrorInFunction
<< "Can only handle edges with 2 or 4 edges for now."
<< abort(FatalError);
}
@ -419,7 +419,7 @@ void walkSplitLine
}
else
{
FatalErrorIn("walkSplitPoint(..)") << abort(FatalError);
FatalErrorInFunction << abort(FatalError);
}
}
while (true);
@ -539,7 +539,7 @@ void calcPointVecs
surf.write("errorSurf.obj");
FatalErrorIn("calcPointVecs(..)")
FatalErrorInFunction
<< "Cannot find two faces using border edge " << edgeI
<< " verts:" << edges[edgeI]
<< " eFaces:" << eFaces << endl

View File

@ -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
@ -93,7 +93,7 @@ int main(int argc, char *argv[])
if (markedZone.size() && markedZone.size() != 2)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "zone specification should be two points, min and max of "
<< "the boundingbox" << endl
<< "zone:" << markedZone
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|| markedPoints[pointI] >= surf1.nPoints()
)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "localPoint label " << markedPoints[pointI]
<< "out of range."
<< " The mesh has got "
@ -170,7 +170,7 @@ int main(int argc, char *argv[])
|| markedEdges[edgeI] >= surf1.nEdges()
)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "edge label " << markedEdges[edgeI]
<< "out of range."
<< " The mesh has got "
@ -323,7 +323,7 @@ int main(int argc, char *argv[])
|| markedFaces[faceI] >= surf1.size()
)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Face label " << markedFaces[faceI] << "out of range."
<< " The mesh has got "
<< surf1.size() << " faces."

View File

@ -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 @@ int main(int argc, char *argv[])
if (args.options().empty())
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "No options supplied, please use one or more of "
"-translate, -rotate or -scale options."
<< exit(FatalError);