STYLE: use FatalIOError and minor changes to log output

This commit is contained in:
Andrew Heather
2018-05-09 12:43:11 +01:00
parent 16f3eac7d6
commit 56231b5b5f

View File

@ -99,8 +99,18 @@ bool Foam::functionObjects::reference::read(const dictionary& dict)
{
localDict_ = dict;
Log << type() << " " << name() << nl
<< " field: " << fieldName_ << nl;
if (dict.readIfPresent("scale", scale_))
{
Log << " scale: " << scale_ << nl;
}
if (dict.readIfPresent("position", position_))
{
Log << " sample position: " << position_ << nl;
positionIsSet_ = true;
celli_ = mesh_.findCell(position_);
@ -109,24 +119,16 @@ bool Foam::functionObjects::reference::read(const dictionary& dict)
if (celli == -1)
{
FatalErrorInFunction
<< "Sample cell could not be found at position " << position_
<< exit(FatalError);
FatalIOErrorInFunction(dict)
<< "Sample cell could not be found at position "
<< position_ << exit(FatalIOError);
}
interpolationScheme_ =
dict.lookupOrDefault<word>("interpolationScheme", "cell");
}
dict.readIfPresent("scale", scale_);
Log << type() << " " << name() << nl
<< " field: " << fieldName_ << nl
<< " sample position: " << position_ << nl
<< " scale: " << scale_ << nl
<< endl;
Log << endl;
return true;
}