ENH: Updated Info, Warning and Error messages

This commit is contained in:
Andrew Heather
2015-12-08 11:15:39 +00:00
parent ae95edeea4
commit eafd5a3850
94 changed files with 351 additions and 1040 deletions

View File

@ -86,12 +86,8 @@ void Foam::cyclicPeriodicAMIPolyPatch::syncTransforms() const
{
if (periodicPatch.separation().size() > 1)
{
FatalErrorIn
(
"cyclicPeriodicAMIPolyPatch::resetAMI"
"(const AMIPatchToPatchInterpolation::interpolationMethod&"
") const"
) << "Periodic patch " << periodicPatchName_
FatalErrorInFunction
<< "Periodic patch " << periodicPatchName_
<< " has non-uniform separation vector "
<< periodicPatch.separation()
<< "This is not allowed inside " << type()
@ -101,12 +97,8 @@ void Foam::cyclicPeriodicAMIPolyPatch::syncTransforms() const
if (periodicPatch.forwardT().size() > 1)
{
FatalErrorIn
(
"cyclicPeriodicAMIPolyPatch::resetAMI"
"(const AMIPatchToPatchInterpolation::interpolationMethod&"
") const"
) << "Periodic patch " << periodicPatchName_
FatalErrorInFunction
<< "Periodic patch " << periodicPatchName_
<< " has non-uniform transformation tensor "
<< periodicPatch.forwardT()
<< "This is not allowed inside " << type()
@ -362,7 +354,7 @@ void Foam::cyclicPeriodicAMIPolyPatch::resetAMI
scalar srcSum(gAverage(AMIPtr_->srcWeightsSum()));
scalar tgtSum(gAverage(AMIPtr_->tgtWeightsSum()));
// Direction (or rather side of AMI : this or nbr patch) of
// Direction (or rather side of AMI : this or nbr patch) of
// geometry replication
bool direction = nTransforms_ >= 0;
@ -501,13 +493,7 @@ void Foam::cyclicPeriodicAMIPolyPatch::resetAMI
// so for now this situation is flagged as a SeriousError instead of
// a FatalError since the default matchTolerance is quite strict
// (0.001) and can get triggered far into the simulation.
SeriousErrorIn
(
"void Foam::cyclicPeriodicAMIPolyPatch::resetPeriodicAMI"
"("
"const AMIPatchToPatchInterpolation::interpolationMethod&"
") const"
)
SeriousErrorInFunction
<< "Patches " << name() << " and " << neighbPatch().name()
<< " do not couple to within a tolerance of "
<< matchTolerance()
@ -534,13 +520,7 @@ void Foam::cyclicPeriodicAMIPolyPatch::resetAMI
// This check means that e.g. different numbers of stator and
// rotor partitions are not allowed.
// Again see the section above about tolerances.
SeriousErrorIn
(
"void Foam::cyclicPeriodicAMIPolyPatch::resetPeriodicAMI"
"("
"const AMIPatchToPatchInterpolation::interpolationMethod&"
") const"
)
SeriousErrorInFunction
<< "Patches " << name() << " and " << neighbPatch().name()
<< " do not overlap an integer number of times when transformed"
<< " according to the periodic patch "
@ -676,7 +656,7 @@ Foam::label Foam::cyclicPeriodicAMIPolyPatch::periodicPatchID() const
if (periodicPatchID_ == -1)
{
FatalErrorIn("cyclicPolyAMIPatch::periodicPatchID() const")
FatalErrorInFunction
<< "Illegal periodicPatch name " << periodicPatchName_
<< nl << "Valid patch names are "
<< this->boundaryMesh().names()

View File

@ -1036,13 +1036,8 @@ Foam::FaceCellWave<Type, TrackingData>::FaceCellWave
|| allCellInfo.size() != mesh_.nCells()
)
{
FatalErrorIn
(
"FaceCellWave<Type, TrackingData>::FaceCellWave"
"(const polyMesh&, const List<labelPair>&, const labelList&"
", const List<Type>,"
" UList<Type>&, UList<Type>&, const label maxIter)"
) << "face and cell storage not the size of mesh faces, cells:"
FatalErrorInFunction
<< "face and cell storage not the size of mesh faces, cells:"
<< endl
<< " allFaceInfo :" << allFaceInfo.size() << endl
<< " mesh_.nFaces():" << mesh_.nFaces() << endl
@ -1059,13 +1054,8 @@ Foam::FaceCellWave<Type, TrackingData>::FaceCellWave
if ((maxIter > 0) && (iter >= maxIter))
{
FatalErrorIn
(
"FaceCellWave<Type, TrackingData>::FaceCellWave"
"(const polyMesh&, const List<labelPair>&, const labelList&"
", const List<Type>, UList<Type>&, UList<Type>&"
", const label maxIter)"
) << "Maximum number of iterations reached. Increase maxIter." << endl
FatalErrorInFunction
<< "Maximum number of iterations reached. Increase maxIter." << endl
<< " maxIter:" << maxIter << endl
<< " nChangedCells:" << nChangedCells_ << endl
<< " nChangedFaces:" << nChangedFaces_ << endl

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -119,7 +119,7 @@ void Foam::regionSplit::calcNonCompactRegionSplit
if (blockedFace.size() && !blockedFace[faceI])
{
FatalErrorIn("regionSplit::calcNonCompactRegionSplit(..)")
FatalErrorInFunction
<< "Problem: unblocked face " << faceI
<< " at " << mesh().faceCentres()[faceI]
<< " on unassigned cell " << cellI

View File

@ -98,15 +98,8 @@ Foam::triSurface Foam::subTriSurfaceMesh::subset
if (regionMap.size() == 0)
{
FatalIOErrorIn
(
"subTriSurfaceMesh::subset"
"(\n"
" const IOobject&,\n"
" const dictionary&\n"
")",
dict
) << "Found no regions in triSurface matching " << regionNames
FatalIOErrorInFunction(dict)
<< "Found no regions in triSurface matching " << regionNames
<< ". Valid regions are " << patchNames(s)
<< exit(FatalIOError);
}