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

@ -70,16 +70,8 @@ Foam::DESModelRegions::DESModelRegions
if (!isA<fvMesh>(obr_))
{
active_ = false;
WarningIn
(
"DESModelRegions::DESModelRegions"
"("
"const word&, "
"const objectRegistry&, "
"const dictionary&, "
"const bool"
")"
) << "No fvMesh available, deactivating " << name_ << nl
WarningInFunction
<< "No fvMesh available, deactivating " << name_ << nl
<< endl;
}

View File

@ -126,7 +126,7 @@ void Foam::blendingFactor::read(const dictionary& dict)
dict.readIfPresent("tolerance", tolerance_);
if ((tolerance_ < 0) || (tolerance_ > 1))
{
FatalErrorIn("void Foam::blendingFactor::read(const dictionary&)")
FatalErrorInFunction
<< "tolerance must be in the range 0 to 1. Supplied value: "
<< tolerance_ << exit(FatalError);
}

View File

@ -75,17 +75,7 @@ void Foam::fluxSummary::initialiseFaceZone
if (zoneI == -1)
{
FatalErrorIn
(
"void Foam::fluxSummary::initialiseFaceZone"
"("
"const word&, "
"DynamicList<word>&, "
"DynamicList<List<label> >&, "
"DynamicList<List<label> >&, "
"DynamicList<List<scalar> >&"
") const"
)
FatalErrorInFunction
<< "Unable to find faceZone " << faceZoneName
<< ". Valid faceZones are: " << mesh.faceZones().names()
<< exit(FatalError);
@ -178,19 +168,7 @@ void Foam::fluxSummary::initialiseFaceZoneAndDirection
if (zoneI == -1)
{
FatalErrorIn
(
"void Foam::fluxSummary::initialiseFaceZoneAndDirection"
"("
"const word&, "
"const vector&, "
"DynamicList<vector>&, "
"DynamicList<word>&, "
"DynamicList<List<label> >&, "
"DynamicList<List<label> >&, "
"DynamicList<List<scalar> >&"
") const"
)
FatalErrorInFunction
<< "Unable to find faceZone " << faceZoneName
<< ". Valid faceZones are: " << mesh.faceZones().names()
<< exit(FatalError);
@ -299,19 +277,7 @@ void Foam::fluxSummary::initialiseCellZoneAndDirection
if (cellZoneI == -1)
{
FatalErrorIn
(
"void Foam::fluxSummary::initialiseCellZoneAndDirection"
"("
"const word&, "
"const vector&, "
"DynamicList<vector>&, "
"DynamicList<word>&, "
"DynamicList<List<label> >&, "
"DynamicList<List<label> >&, "
"DynamicList<List<scalar> >&"
") const"
)
FatalErrorInFunction
<< "Unable to find cellZone " << cellZoneName
<< ". Valid zones are: " << mesh.cellZones().names()
<< exit(FatalError);
@ -474,19 +440,8 @@ void Foam::fluxSummary::initialiseCellZoneAndDirection
{
if (allEdgeInfo[fEdges[i]].region() != -1)
{
WarningIn
(
"void Foam::fluxSummary::initialiseCellZoneAndDirection"
"("
"const word&, "
"const vector&, "
"DynamicList<vector>&, "
"DynamicList<word>&, "
"DynamicList<List<label> >&, "
"DynamicList<List<label> >&, "
"DynamicList<List<scalar> >&"
") const"
) << "Problem in edge face wave: attempted to assign a "
WarningInFunction
<< "Problem in edge face wave: attempted to assign a "
<< "value to an edge that has already been visited. "
<< "Edge info: " << allEdgeInfo[fEdges[i]]
<< endl;
@ -650,16 +605,8 @@ Foam::fluxSummary::fluxSummary
if (!isA<fvMesh>(obr_))
{
active_ = false;
WarningIn
(
"fluxSummary::fluxSummary"
"("
"const word&, "
"const objectRegistry&, "
"const dictionary&, "
"const bool"
")"
) << "No fvMesh available, deactivating " << name_
WarningInFunction
<< "No fvMesh available, deactivating " << name_
<< endl;
}
@ -759,11 +706,7 @@ void Foam::fluxSummary::read(const dictionary& dict)
}
default:
{
FatalIOErrorIn
(
"void Foam::fluxSummary::read(const dictionary&)",
dict
)
FatalIOErrorInFunction(dict)
<< "unhandled enumeration " << modeTypeNames_[mode_]
<< abort(FatalIOError);
}
@ -887,7 +830,7 @@ void Foam::fluxSummary::write()
}
else
{
FatalErrorIn("void Foam::fluxSummary::write()")
FatalErrorInFunction
<< "Unsupported flux field " << phi.name() << " with dimensions "
<< phi.dimensions() << ". Expected eithe mass flow or volumetric "
<< "flow rate" << abort(FatalError);

View File

@ -66,13 +66,7 @@ Foam::tmp<Foam::volScalarField> Foam::pressureTools::rho
{
if (!rhoInfInitialised_)
{
FatalErrorIn
(
"Foam::tmp<Foam::volScalarField> Foam::pressureTools::rho"
"("
" const volScalarField&"
") const"
)
FatalErrorInFunction
<< type() << " " << name_ << ": "
<< "pressure identified as incompressible, but reference "
<< "density is not set. Please set rhoName to rhoInf, and "

View File

@ -162,7 +162,7 @@ void Foam::yPlus::execute()
}
else
{
WarningIn("void Foam::yPlus::execute()")
WarningInFunction
<< "Unable to find compressible turbulence model in the "
<< "database: yPlus will not be calculated" << endl;
}
@ -181,14 +181,14 @@ void Foam::yPlus::execute()
}
else
{
WarningIn("void Foam::yPlus::execute()")
WarningInFunction
<< "Unable to find incompressible turbulence model in the "
<< "database: yPlus will not be calculated" << endl;
}
}
else
{
WarningIn("void Foam::yPlus::execute()")
WarningInFunction
<< "Unknown " << phiName_ << " dimensions: "
<< phi.dimensions() << nl
<< "Expected either " << dimMass/dimTime << " or "

View File

@ -80,7 +80,6 @@ void Foam::yPlus::calcYPlus
<< token::TAB << maxYplus
<< token::TAB << avgYplus
<< endl;
}
}
else if (isA<wallFvPatch>(patch))
{