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