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

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