Time and functionObject updated for end()

- added end() method to functionObject, functionObjectList & associated classes
- moved outputFilters from src/sampling -> src/OpenFOAM/db/functionObjects
This commit is contained in:
Mark Olesen
2009-02-17 12:48:10 +01:00
parent c2256e51f3
commit fee6e312b9
35 changed files with 255 additions and 114 deletions

View File

@ -58,7 +58,7 @@ Foam::dynamicPressure::dynamicPressure
name_(name),
obr_(obr),
active_(true),
pName_(dict.lookup("p")),
pName_(dict.lookupOrDefault<word>("p", "p")),
rho_(readScalar(dict.lookup("rho")))
{
// Check if the available mesh is an fvMesh, otherwise deactivate
@ -68,7 +68,7 @@ Foam::dynamicPressure::dynamicPressure
WarningIn
(
"dynamicPressure::dynamicPressure"
"(const objectRegistry& obr, const dictionary& dict)"
"(const objectRegistry&, const dictionary&)"
) << "No fvMesh available, deactivating." << nl
<< endl;
}
@ -81,7 +81,7 @@ Foam::dynamicPressure::dynamicPressure
WarningIn
(
"dynamicPressure::dynamicPressure"
"(const objectRegistry& obr, const dictionary& dict)"
"(const objectRegistry&, const dictionary&)"
) << "Pressure is not kinematic pressure, deactivating." << nl
<< endl;
}
@ -103,7 +103,7 @@ void Foam::dynamicPressure::read(const dictionary& dict)
{
if (active_)
{
dict.lookup("p") >> pName_;
dict.readIfPresent("p", pName_);
dict.lookup("rho") >> rho_;
}
}
@ -115,6 +115,12 @@ void Foam::dynamicPressure::execute()
}
void Foam::dynamicPressure::end()
{
// Do nothing - only valid on write
}
void Foam::dynamicPressure::write()
{
if (active_)

View File

@ -66,10 +66,10 @@ class dynamicPressure
//- on/off switch
bool active_;
//- Name of pressure field
//- Name of pressure field, default is "p"
word pName_;
//- Density
//- Density value
scalar rho_;
@ -120,9 +120,12 @@ public:
//- Read the dynamicPressure data
virtual void read(const dictionary&);
//- Execute
//- Execute, currently does nothing
virtual void execute();
//- Execute at the final time-loop, currently does nothing
virtual void end();
//- Calculate the dynamicPressure and write
virtual void write();