ENH: Updated weight field initialisation for fieldValues function object

This commit is contained in:
andy
2011-08-16 18:05:06 +01:00
parent c2dd153a14
commit 53f332bc60
6 changed files with 55 additions and 39 deletions

View File

@ -284,23 +284,7 @@ void Foam::fieldValues::faceSource::initialise(const dictionary& dict)
if (operation_ == opWeightedAverage)
{
dict.lookup("weightField") >> weightFieldName_;
if
(
obr().foundObject<volScalarField>(weightFieldName_)
|| obr().foundObject<surfaceScalarField>(weightFieldName_)
)
{
Info<< " weight field = " << weightFieldName_;
}
else
{
FatalErrorIn("faceSource::initialise()")
<< type() << " " << name_ << ": "
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):"
<< nl << " Weight field " << weightFieldName_
<< " must be either a " << volScalarField::typeName << " or "
<< surfaceScalarField::typeName << nl << exit(FatalError);
}
Info<< " weight field = " << weightFieldName_;
}
Info<< nl << endl;