ENH: functionObjects improvements.

- readFields works seamlessly on-the-fly and as postprocessor
- new surfaceInterpolateFields to create interpolated field
- writeRegisteredObject only check upon writing, not upon startup
- add min,max to faceSource
This commit is contained in:
mattijs
2010-04-12 17:04:40 +01:00
parent f1e7cae646
commit 9bf63117ae
17 changed files with 668 additions and 83 deletions

View File

@ -67,28 +67,6 @@ void Foam::writeRegisteredObject::read(const dictionary& dict)
if (active_)
{
dict.lookup("objectNames") >> objectNames_;
forAll(objectNames_, i)
{
if (obr_.foundObject<regIOobject>(objectNames_[i]))
{
regIOobject& obj =
const_cast<regIOobject&>
(
obr_.lookupObject<regIOobject>(objectNames_[i])
);
obj.writeOpt() = IOobject::NO_WRITE;
}
else
{
FatalErrorIn
(
"Foam::writeRegisteredObject::read(const dictionary&)"
) << "Object " << objectNames_[i] << " not found in "
<< "database. Available objects are:" << nl << obr_.toc()
<< nl << exit(FatalError);
}
}
}
}
@ -111,9 +89,27 @@ void Foam::writeRegisteredObject::write()
{
forAll(objectNames_, i)
{
const regIOobject& obj =
obr_.lookupObject<regIOobject>(objectNames_[i]);
obj.write();
if (obr_.foundObject<regIOobject>(objectNames_[i]))
{
regIOobject& obj =
const_cast<regIOobject&>
(
obr_.lookupObject<regIOobject>(objectNames_[i])
);
// Switch off automatic writing to prevent double write
obj.writeOpt() = IOobject::NO_WRITE;
obj.write();
}
else
{
WarningIn
(
"Foam::writeRegisteredObject::read(const dictionary&)"
) << "Object " << objectNames_[i] << " not found in "
<< "database. Available objects are:" << nl << obr_.toc()
<< endl;
}
}
}
}