COMP: consistent FatalError/FatalIOError exit types

STYLE: hostName() is short name, don't need parameter
This commit is contained in:
Mark Olesen
2021-11-30 14:03:31 +01:00
parent ed5dee71a4
commit e9054ec636
29 changed files with 45 additions and 45 deletions

View File

@ -137,7 +137,7 @@ composedFunctionImplicitFunction
{ {
FatalIOErrorInFunction(funcDict) FatalIOErrorInFunction(funcDict)
<< "Entry " << key << " is not a dictionary" << endl << "Entry " << key << " is not a dictionary" << endl
<< exit(FatalError); << exit(FatalIOError);
} }
const dictionary& subdict = dEntry.dict(); const dictionary& subdict = dEntry.dict();

View File

@ -284,16 +284,16 @@ Foam::expressions::exprResult::exprResult
valType_ = "none"; valType_ = "none";
} }
FatalErrorInFunction FatalIOErrorInFunction(dict)
<< "Do not know how to read data type " << valType_ << "Do not know how to read data type " << valType_
<< (uniform ? " as a single value." : ".") << nl << (uniform ? " as a single value." : ".") << nl
<< exit(FatalError); << exit(FatalIOError);
} }
} }
else if (needsValue) else if (needsValue)
{ {
FatalIOErrorInFunction(dict) FatalIOErrorInFunction(dict)
<< "No entry 'value' defined in " << dict.name() << nl << "No entry 'value' defined" << nl
<< exit(FatalIOError); << exit(FatalIOError);
} }
} }

View File

@ -432,7 +432,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
if (this->size() != GeoMesh::size(this->mesh())) if (this->size() != GeoMesh::size(this->mesh()))
{ {
FatalErrorInFunction FatalIOErrorInFunction(dict)
<< " number of field elements = " << this->size() << " number of field elements = " << this->size()
<< " number of mesh elements = " << GeoMesh::size(this->mesh()) << " number of mesh elements = " << GeoMesh::size(this->mesh())
<< exit(FatalIOError); << exit(FatalIOError);

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com \\ / A nd | www.openfoam.com
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2016-2017 OpenCFD Ltd. Copyright (C) 2016-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -37,7 +37,7 @@ namespace
{ {
// Write environment entry // Write environment entry
inline static void printEnv inline void printEnv
( (
Foam::Ostream& os, Foam::Ostream& os,
const Foam::word& key, const Foam::word& key,
@ -61,7 +61,7 @@ Foam::Ostream& Foam::profilingSysInfo::write
Ostream& os Ostream& os
) const ) const
{ {
os.writeEntry("host", Foam::hostName(false)); // short name os.writeEntry("host", Foam::hostName()); // short name
os.writeEntry("date", Foam::clock::dateTime()); os.writeEntry("date", Foam::clock::dateTime());
// compile-time information // compile-time information

View File

@ -82,8 +82,8 @@ FOAM_DEPRECATED_FOR(2020-05, "hasEnv() function")
inline bool env(const std::string& envName) { return Foam::hasEnv(envName); } inline bool env(const std::string& envName) { return Foam::hasEnv(envName); }
//- Return the system's host name, as per hostname(1) //- Return the system's host name, as per hostname(1)
// Optionally with the full name (as per the '-f' option) // \note the full name (as per the '-f' option) may be unreliable
string hostName(const bool full=false); string hostName(bool full=false);
//- Return the system's domain name, as per hostname(1) with the '-d' option //- Return the system's domain name, as per hostname(1) with the '-d' option
string domainName(); string domainName();

View File

@ -564,7 +564,7 @@ static Foam::string recursiveExpand
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Expansion ${{ is missing a closing '}}'\n" << "Expansion ${{ is missing a closing '}}'\n"
<< exit(FatalIOError); << exit(FatalError);
} }
///Info<< "eval <" << out << ">" << endl; ///Info<< "eval <" << out << ">" << endl;

View File

@ -62,7 +62,7 @@ Foam::cyclicFaPatchField<Type>::cyclicFaPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -61,7 +61,7 @@ Foam::emptyFaPatchField<Type>::emptyFaPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -79,7 +79,7 @@ Foam::processorFaPatchField<Type>::processorFaPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -59,7 +59,7 @@ Foam::symmetryFaPatchField<Type>::symmetryFaPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -94,7 +94,7 @@ Foam::cyclicFvPatchField<Type>::cyclicFvPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -116,7 +116,7 @@ Foam::cyclicACMIFvPatchField<Type>::cyclicACMIFvPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -102,7 +102,7 @@ Foam::cyclicAMIFvPatchField<Type>::cyclicAMIFvPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -59,7 +59,7 @@ Foam::emptyFvPatchField<Type>::emptyFvPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -131,7 +131,7 @@ Foam::processorFvPatchField<Type>::processorFvPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
if (debug && !ptf.ready()) if (debug && !ptf.ready())
{ {

View File

@ -106,7 +106,7 @@ Foam::processorCyclicFvPatchField<Type>::processorCyclicFvPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -81,7 +81,7 @@ Foam::symmetryFvPatchField<Type>::symmetryFvPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -61,7 +61,7 @@ Foam::symmetryPlaneFvPatchField<Type>::symmetryPlaneFvPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -63,7 +63,7 @@ Foam::wedgeFvPatchField<Type>::wedgeFvPatchField
<< "\n for patch " << p.name() << "\n for patch " << p.name()
<< " of field " << this->internalField().name() << " of field " << this->internalField().name()
<< " in file " << this->internalField().objectPath() << " in file " << this->internalField().objectPath()
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2015 OpenFOAM Foundation Copyright (C) 2015 OpenFOAM Foundation
Copyright (C) 2015-2020 OpenCFD Ltd. Copyright (C) 2015-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -911,8 +911,8 @@ bool Foam::functionObjects::streamLineBase::read(const dictionary& dict)
if (dict.found("direction")) if (dict.found("direction"))
{ {
FatalIOErrorInFunction(dict) << "Cannot specify both " FatalIOErrorInFunction(dict)
<< "\"trackForward\" and \"direction\"" << "Cannot specify both 'trackForward' and 'direction'" << nl
<< exit(FatalIOError); << exit(FatalIOError);
} }
} }
@ -923,9 +923,9 @@ bool Foam::functionObjects::streamLineBase::read(const dictionary& dict)
dict.readEntry("lifeTime", lifeTime_); dict.readEntry("lifeTime", lifeTime_);
if (lifeTime_ < 1) if (lifeTime_ < 1)
{ {
FatalErrorInFunction FatalIOErrorInFunction(dict)
<< "Illegal value " << lifeTime_ << " for lifeTime" << "Illegal value " << lifeTime_ << " for lifeTime"
<< exit(FatalError); << exit(FatalIOError);
} }

View File

@ -106,7 +106,7 @@ void Foam::fv::actuationDiskSource::calcFroudeMethod
FatalErrorInFunction FatalErrorInFunction
<< "Cp and Ct must be greater than zero." << nl << "Cp and Ct must be greater than zero." << nl
<< "Cp = " << Cp << ", Ct = " << Ct << "Cp = " << Cp << ", Ct = " << Ct
<< exit(FatalIOError); << exit(FatalError);
} }
// (BJSB:Eq. 3.9) // (BJSB:Eq. 3.9)
@ -213,7 +213,7 @@ void Foam::fv::actuationDiskSource::calcVariableScalingMethod
FatalErrorInFunction FatalErrorInFunction
<< "Cp and Ct must be greater than zero." << nl << "Cp and Ct must be greater than zero." << nl
<< "Cp = " << Cp << ", Ct = " << Ct << "Cp = " << Cp << ", Ct = " << Ct
<< exit(FatalIOError); << exit(FatalError);
} }
// Calibrated thrust/power coeffs from power/thrust curves (LSRMTK:Eq. 6) // Calibrated thrust/power coeffs from power/thrust curves (LSRMTK:Eq. 6)

View File

@ -68,7 +68,7 @@ addRadialActuationDiskAxialInertialResistance
FatalErrorInFunction FatalErrorInFunction
<< "Radial distribution coefficients lead to zero polynomial." << nl << "Radial distribution coefficients lead to zero polynomial." << nl
<< "radialCoeffs = " << radialCoeffs_ << "radialCoeffs = " << radialCoeffs_
<< exit(FatalIOError); << exit(FatalError);
} }
// Compute upstream U and rho, spatial-averaged over monitor-region // Compute upstream U and rho, spatial-averaged over monitor-region

View File

@ -125,9 +125,9 @@ Foam::cylinderAnnulusToCell::cylinderAnnulusToCell
if (innerRadius_ > radius_) if (innerRadius_ > radius_)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "inner radius = " << innerRadius_ << "cannot be larger than " << "inner radius = " << innerRadius_ << " cannot be larger than "
<< "outer radius = " << radius_ << "outer radius = " << radius_
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -114,9 +114,9 @@ Foam::cylinderToCell::cylinderToCell
if (innerRadius_ > radius_) if (innerRadius_ > radius_)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "inner radius = " << innerRadius_ << "cannot be larger than " << "inner radius = " << innerRadius_ << " cannot be larger than "
<< "outer radius = " << radius_ << "outer radius = " << radius_
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -125,9 +125,9 @@ Foam::cylinderAnnulusToFace::cylinderAnnulusToFace
if (innerRadius_ > radius_) if (innerRadius_ > radius_)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "inner radius = " << innerRadius_ << "cannot be larger than " << "inner radius = " << innerRadius_ << " cannot be larger than "
<< "outer radius = " << radius_ << "outer radius = " << radius_
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -114,9 +114,9 @@ Foam::cylinderToFace::cylinderToFace
if (innerRadius_ > radius_) if (innerRadius_ > radius_)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "inner radius = " << innerRadius_ << "cannot be larger than " << "inner radius = " << innerRadius_ << " cannot be larger than "
<< "outer radius = " << radius_ << "outer radius = " << radius_
<< exit(FatalIOError); << exit(FatalError);
} }
} }

View File

@ -60,7 +60,7 @@ void Foam::geomDecomp::setOrder()
FatalIOErrorInFunction(decompDict_) FatalIOErrorInFunction(decompDict_)
<< "Illegal decomposition order " << order << nl << "Illegal decomposition order " << order << nl
<< "It should only contain x, y or z" << "It should only contain x, y or z"
<< exit(FatalError); << exit(FatalIOError);
break; break;
} }
} }
@ -76,11 +76,11 @@ void Foam::geomDecomp::readCoeffs()
if (nDomains_ != n_.x()*n_.y()*n_.z()) if (nDomains_ != n_.x()*n_.y()*n_.z())
{ {
// Verify that the input makes sense // Verify that the input makes sense
FatalErrorInFunction FatalIOErrorInFunction(coeffsDict_)
<< "Wrong number of domain divisions in geomDecomp:" << nl << "Wrong number of domain divisions in geomDecomp:" << nl
<< "Number of domains : " << nDomains_ << nl << "Number of domains : " << nDomains_ << nl
<< "Wanted decomposition : " << n_ << "Wanted decomposition : " << n_
<< exit(FatalError); << exit(FatalIOError);
} }
setOrder(); setOrder();

View File

@ -436,7 +436,7 @@ bool Foam::surfaceWriter::checkOpen() const
{ {
FatalErrorInFunction FatalErrorInFunction
<< type() << " : Attempted to write without a path" << nl << type() << " : Attempted to write without a path" << nl
<< exit(FatalIOError); << exit(FatalError);
} }
return !outputPath_.empty(); return !outputPath_.empty();

View File

@ -62,7 +62,7 @@ inline Foam::thirdBodyEfficiencies::thirdBodyEfficiencies
{ {
if (coeffs.size() != species_.size()) if (coeffs.size() != species_.size())
{ {
FatalErrorInFunction FatalIOErrorInFunction(dict)
<< "number of efficiencies = " << coeffs.size() << "number of efficiencies = " << coeffs.size()
<< " is not equat to the number of species " << species_.size() << " is not equat to the number of species " << species_.size()
<< exit(FatalIOError); << exit(FatalIOError);