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

@ -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
@ -130,7 +130,7 @@ int main(int argc, char *argv[])
);
if (!ok)
{
WarningIn(args.executable())
WarningInFunction
<< "At level " << level
<< " there are " << coarseSize
<< " agglomerated cells but " << newCoarseSize

View File

@ -225,7 +225,7 @@ int main(int argc, char *argv[])
{
if (mesh.V().size() != mesh.nCells())
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Volume not mapped. V:" << mesh.V().size()
<< " nCells:" << mesh.nCells()
<< exit(FatalError);
@ -238,7 +238,7 @@ int main(int argc, char *argv[])
if (mag(newVol-totalVol)/totalVol > 1e-10)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Volume loss: old volume:" << totalVol
<< " new volume:" << newVol
<< exit(FatalError);
@ -260,7 +260,7 @@ int main(int argc, char *argv[])
if (notEqual(max, 1.0, 1e-10) || notEqual(min, 1.0, 1e-10))
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Uniform volVectorField not preserved."
<< " Min and max should both be 1.0. min:" << min
<< " max:" << max
@ -284,7 +284,7 @@ int main(int argc, char *argv[])
if (notEqual(max, 0.0, 1e-10) || notEqual(min, 0.0, 1e-10))
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Linear profile not preserved."
<< " Min and max should both be 0.0. min:" << min
<< " max:" << max
@ -307,7 +307,7 @@ int main(int argc, char *argv[])
if (notEqual(max, 1.0, 1e-10) || notEqual(min, 1.0, 1e-10))
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Uniform surfaceScalarField not preserved."
<< " Min and max should both be 1.0. min:" << min
<< " max:" << max

View File

@ -53,14 +53,14 @@ int main(int argc, char *argv[])
if (globalNumbering.localSize() != mesh.nCells())
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Problem." << abort(FatalError);
}
if (!Pstream::parRun())
{
WarningIn(args.executable())
WarningInFunction
<< "globalIndex class is only useful in parallel code."
<< endl;
}
@ -77,14 +77,14 @@ int main(int argc, char *argv[])
if (procI != Pstream::myProcNo() || localCellI != cellI)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Problem. cellI:" << cellI << " localCellI:" << localCellI
<< " procI:" << procI << abort(FatalError);
}
if (!globalNumbering.isLocal(globalCellI))
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Problem. cellI:" << cellI << " globalCellI:" << globalCellI
<< " not local" << abort(FatalError);
}
@ -95,7 +95,7 @@ int main(int argc, char *argv[])
if (mesh.nCells() < 1)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Test needs to be run on a case with at least one"
<< " cell per processor." << abort(FatalError);
}
@ -109,7 +109,7 @@ int main(int argc, char *argv[])
if (procI != Pstream::myProcNo()-1)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Problem. global:" << prevProcCellI
<< " expected on processor:" << Pstream::myProcNo()-1
<< " but is calculated to be on procI:" << procI
@ -118,14 +118,14 @@ int main(int argc, char *argv[])
if (globalNumbering.isLocal(prevProcCellI))
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Problem. globalCellI:" << prevProcCellI
<< " calculated as local" << abort(FatalError);
}
if (!globalNumbering.isLocal(procI, prevProcCellI))
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Problem. globalCellI:" << prevProcCellI
<< " not calculated as local on processor:" << procI
<< abort(FatalError);
@ -140,7 +140,7 @@ int main(int argc, char *argv[])
if (procI != Pstream::myProcNo()+1)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Problem. global:" << nextProcCellI
<< " expected on processor:" << Pstream::myProcNo()+1
<< " but is calculated to be on procI:" << procI
@ -149,14 +149,14 @@ int main(int argc, char *argv[])
if (globalNumbering.isLocal(nextProcCellI))
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Problem. globalCellI:" << nextProcCellI
<< " calculated as local" << abort(FatalError);
}
if (!globalNumbering.isLocal(procI, nextProcCellI))
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Problem. globalCellI:" << nextProcCellI
<< " not calculated as local on processor:" << procI
<< abort(FatalError);

View File

@ -309,7 +309,7 @@ int main(int argc, char *argv[])
{
if (mesh.V().size() != mesh.nCells())
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Volume not mapped. V:" << mesh.V().size()
<< " nCells:" << mesh.nCells()
<< exit(FatalError);
@ -322,7 +322,7 @@ int main(int argc, char *argv[])
if (mag(newVol-totalVol)/totalVol > 1e-10)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Volume loss: old volume:" << totalVol
<< " new volume:" << newVol
<< exit(FatalError);
@ -344,7 +344,7 @@ int main(int argc, char *argv[])
if (notEqual(max, 1.0, 1e-10) || notEqual(min, 1.0, 1e-10))
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Uniform volVectorField not preserved."
<< " Min and max should both be 1.0. min:" << min
<< " max:" << max
@ -389,7 +389,7 @@ int main(int argc, char *argv[])
if (notEqual(max, 1.0, 1e-10) || notEqual(min, 1.0, 1e-10))
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Uniform surfaceScalarField not preserved."
<< " Min and max should both be 1.0. min:" << min
<< " max:" << max

View File

@ -169,7 +169,7 @@ int main(int argc, char *argv[])
if (data != procI)
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "From processor " << procI << " received " << data
<< " but expected " << procI
<< exit(FatalError);

View File

@ -71,7 +71,7 @@ void checkFaceEdges
if (edges[myEdges[fp]] != edge(f[fp], f[fp1]))
{
FatalErrorIn("checkFaceEdges")
FatalErrorInFunction
<< "Edges of face not in face point order:"
<< "face:" << faceI << " localF:" << f
<< " faceEdges:" << myEdges

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
@ -70,11 +70,8 @@ IndexType GatherBase::offset
{
if (values.size() != indices.size())
{
FatalErrorIn
(
"GatherBase::offset(const List<DataType>&, "
"const List<IndexType>&, AddOp)"
) << "Input data and indices lists not equal size." << endl
FatalErrorInFunction
<< "Input data and indices lists not equal size." << endl
<< "data size:" << values.size()
<< " indices:" << indices.size()
<< abort(FatalError);

View File

@ -103,7 +103,7 @@ int main(int argc, char *argv[])
if (!Pstream::parRun())
{
FatalErrorIn(args.executable())
FatalErrorInFunction
<< "Please run in parallel" << exit(FatalError);
}

View File

@ -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
@ -125,12 +125,8 @@ void Foam::router::fixWeights
if (minNodeI == -1)
{
WarningIn
(
"Foam::router::fixWeights"
"(const label startNodeI, const label endNodeI,"
"const label nodeI, const label prevNodeI)"
) << "Cannot route from node " << nodeI
WarningInFunction
<< "Cannot route from node " << nodeI
<< " since all neigbours of node "
<< "already allocated:" << endl;
@ -138,12 +134,7 @@ void Foam::router::fixWeights
{
label nbrNodeI = myNeighbours[neighbourI];
WarningIn
(
"Foam::router::fixWeights"
"(const label startNodeI, const label endNodeI,"
"const label nodeI, const label prevNodeI)"
) << " neighbour:" << nbrNodeI
WarningInFunction
<< " weight:" << weights_[nbrNodeI] << endl;
}
return;
@ -292,7 +283,7 @@ bool Foam::router::route(const labelList& path, const label pathValue)
{
if (pathValue >= 0)
{
FatalErrorIn("router::route(const labelList&, const label)")
FatalErrorInFunction
<< "Illegal pathValue " << pathValue << exit(FatalError);
}
@ -382,7 +373,7 @@ Foam::labelList Foam::router::getRoute(const label pathValue) const
if (pathNodeI == -1)
{
FatalErrorIn("router::getRoute(const label)")
FatalErrorInFunction
<< "No route with value " << pathValue << endl;
}

View File

@ -29,7 +29,6 @@ Description
\*---------------------------------------------------------------------------*/
#include "syncTools.H"
#include "argList.H"
#include "polyMesh.H"
@ -81,7 +80,7 @@ void testPackedList(const polyMesh& mesh, Random& rndGen)
|| maxEdgeValues[i] != label(maxBits.get(i))
)
{
FatalErrorIn("testPackedList()")
FatalErrorInFunction
<< "edge:" << i
<< " minlabel:" << edgeValues[i]
<< " minbits:" << bits.get(i)
@ -128,7 +127,7 @@ void testPackedList(const polyMesh& mesh, Random& rndGen)
|| maxPointValues[i] != label(maxBits.get(i))
)
{
FatalErrorIn("testPackedList()")
FatalErrorInFunction
<< "point:" << i
<< " at:" << mesh.points()[i]
<< " minlabel:" << pointValues[i]
@ -170,7 +169,7 @@ void testPackedList(const polyMesh& mesh, Random& rndGen)
|| maxFaceValues[faceI] != label(maxBits.get(faceI))
)
{
FatalErrorIn("testPackedList()")
FatalErrorInFunction
<< "face:" << faceI
<< " minlabel:" << faceValues[faceI]
<< " minbits:" << bits.get(faceI)
@ -187,7 +186,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
{
Info<< nl << "Testing Map synchronisation." << endl;
WarningIn("testSparseData()")
WarningInFunction
<< "Position test of sparse data only correct for cases without cyclics"
<< " with shared points." << endl;
@ -252,7 +251,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
if (fullPt != sparsePt)
{
FatalErrorIn("testSparseData()")
FatalErrorInFunction
<< "point:" << meshPointI
<< " full:" << fullPt
<< " sparse:" << sparsePt
@ -270,7 +269,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
if (fullPt != sparsePt)
{
FatalErrorIn("testSparseData()")
FatalErrorInFunction
<< "point:" << meshPointI
<< " full:" << fullPt
<< " sparse:" << sparsePt
@ -335,7 +334,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
if (fullPt != sparsePt)
{
FatalErrorIn("testSparseData()")
FatalErrorInFunction
<< "edge:" << meshEdgeI
<< " points:" << mesh.edges()[meshEdgeI]
<< " full:" << fullPt
@ -359,7 +358,7 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
if (fullPt != sparsePt)
{
FatalErrorIn("testSparseData()")
FatalErrorInFunction
<< "Extra edge:" << meshEdgeI
<< " points:" << mesh.edges()[meshEdgeI]
<< " full:" << fullPt
@ -392,7 +391,7 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
{
if (mag(syncedPoints[pointI] - mesh.points()[pointI]) > SMALL)
{
FatalErrorIn("testPointSync()")
FatalErrorInFunction
<< "Point " << pointI
<< " original location " << mesh.points()[pointI]
<< " synced location " << syncedPoints[pointI]
@ -428,13 +427,11 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
{
if (nMasters[pointI] != 1)
{
//FatalErrorIn("testPointSync()")
WarningIn("testPointSync()")
WarningInFunction
<< "Point " << pointI
<< " original location " << mesh.points()[pointI]
<< " has " << nMasters[pointI]
<< " masters."
//<< exit(FatalError);
<< endl;
}
}
@ -470,7 +467,7 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
if (mag(syncedMids[edgeI] - eMid) > SMALL)
{
FatalErrorIn("testEdgeSync()")
FatalErrorInFunction
<< "Edge " << edgeI
<< " original midpoint " << eMid
<< " synced location " << syncedMids[edgeI]
@ -507,13 +504,11 @@ void testEdgeSync(const polyMesh& mesh, Random& rndGen)
if (nMasters[edgeI] != 1)
{
const edge& e = edges[edgeI];
//FatalErrorIn("testEdgeSync()")
WarningIn("testEdgeSync()")
WarningInFunction
<< "Edge " << edgeI
<< " at:" << mesh.points()[e[0]] << mesh.points()[e[1]]
<< " has " << nMasters[edgeI]
<< " masters."
//<< exit(FatalError);
<< endl;
}
}
@ -541,7 +536,7 @@ void testFaceSync(const polyMesh& mesh, Random& rndGen)
{
if (mag(syncedFc[faceI] - mesh.faceCentres()[faceI]) > SMALL)
{
FatalErrorIn("testFaceSync()")
FatalErrorInFunction
<< "Face " << faceI
<< " original centre " << mesh.faceCentres()[faceI]
<< " synced centre " << syncedFc[faceI]
@ -576,7 +571,7 @@ void testFaceSync(const polyMesh& mesh, Random& rndGen)
{
if (nMasters[faceI] != 1)
{
FatalErrorIn("testFaceSync()")
FatalErrorInFunction
<< "Face " << faceI
<< " centre " << mesh.faceCentres()[faceI]
<< " has " << nMasters[faceI]

View File

@ -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
@ -152,7 +152,7 @@ int main(int argc, char *argv[])
if (mag(volInside+volOutside-tetA.mag()) > SMALL)
{
FatalErrorIn("Test-tetetOverlap")
FatalErrorInFunction
<< "Tet volumes do not sum up to input tet."
<< exit(FatalError);
}