mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -41,15 +41,14 @@ namespace Foam
|
||||
Foam::systemCall::systemCall
|
||||
(
|
||||
const word& name,
|
||||
const objectRegistry& obr,
|
||||
const objectRegistry&,
|
||||
const dictionary& dict,
|
||||
const bool loadFromFiles
|
||||
const bool
|
||||
)
|
||||
:
|
||||
name_(name),
|
||||
obr_(obr),
|
||||
active_(true),
|
||||
executeCalls_(),
|
||||
endCalls_(),
|
||||
writeCalls_()
|
||||
{
|
||||
read(dict);
|
||||
@ -66,8 +65,16 @@ Foam::systemCall::~systemCall()
|
||||
|
||||
void Foam::systemCall::read(const dictionary& dict)
|
||||
{
|
||||
dict.lookup("executeCalls") >> executeCalls_;
|
||||
dict.lookup("writeCalls") >> writeCalls_;
|
||||
dict.readIfPresent("executeCalls", executeCalls_);
|
||||
dict.readIfPresent("endCalls", endCalls_);
|
||||
dict.readIfPresent("writeCalls", writeCalls_);
|
||||
|
||||
if (executeCalls_.empty() && endCalls_.empty() && writeCalls_.empty())
|
||||
{
|
||||
WarningIn("Foam::system::read(const dictionary&)")
|
||||
<< "no executeCalls, endCalls or writeCalls defined."
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -79,6 +86,16 @@ void Foam::systemCall::execute()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::systemCall::end()
|
||||
{
|
||||
forAll(endCalls_, callI)
|
||||
{
|
||||
::system(endCalls_[callI].c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::systemCall::write()
|
||||
{
|
||||
forAll(writeCalls_, callI)
|
||||
|
||||
@ -63,14 +63,12 @@ protected:
|
||||
//- Name of this set of system calls
|
||||
word name_;
|
||||
|
||||
const objectRegistry& obr_;
|
||||
|
||||
//- on/off switch
|
||||
bool active_;
|
||||
|
||||
//- List of calls to execute - every step
|
||||
stringList executeCalls_;
|
||||
|
||||
//- List of calls to execute when exiting the time-loop
|
||||
stringList endCalls_;
|
||||
|
||||
//- List of calls to execute - write steps
|
||||
stringList writeCalls_;
|
||||
|
||||
@ -97,9 +95,9 @@ public:
|
||||
systemCall
|
||||
(
|
||||
const word& name,
|
||||
const objectRegistry&,
|
||||
const objectRegistry& unused,
|
||||
const dictionary&,
|
||||
const bool loadFromFiles = false
|
||||
const bool loadFromFilesUnused = false
|
||||
);
|
||||
|
||||
|
||||
@ -119,10 +117,13 @@ public:
|
||||
//- Read the system calls
|
||||
virtual void read(const dictionary&);
|
||||
|
||||
//- Execute
|
||||
//- Execute the "executeCalls" at each time-step
|
||||
virtual void execute();
|
||||
|
||||
//- Write
|
||||
//- Execute the "endCalls" at the final time-loop
|
||||
virtual void end();
|
||||
|
||||
//- Write, execute the "writeCalls"
|
||||
virtual void write();
|
||||
|
||||
//- Update for changes of mesh
|
||||
|
||||
Reference in New Issue
Block a user