mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: adding hook adjustTimeStep to function objects. The hook is called in
Time::adjustDeltaT(). It allows function objects to manipulate the time step to
dump at adjustable times. The following options are available for output in
function objects: timeStep, outputTime, adjustableTime, runTime, clockTime
and cpuTime.
This commit is contained in:
@ -46,6 +46,7 @@ Foam::writeRegisteredObject::writeRegisteredObject
|
||||
)
|
||||
:
|
||||
name_(name),
|
||||
exclusiveWriting_(true),
|
||||
obr_(obr),
|
||||
objectNames_()
|
||||
{
|
||||
@ -64,6 +65,7 @@ Foam::writeRegisteredObject::~writeRegisteredObject()
|
||||
void Foam::writeRegisteredObject::read(const dictionary& dict)
|
||||
{
|
||||
dict.lookup("objectNames") >> objectNames_;
|
||||
dict.readIfPresent("exclusiveWriting", exclusiveWriting_);
|
||||
}
|
||||
|
||||
|
||||
@ -96,12 +98,12 @@ void Foam::writeRegisteredObject::write()
|
||||
(
|
||||
obr_.lookupObject<regIOobject>(objectNames_[i])
|
||||
);
|
||||
// Switch off automatic writing to prevent double write
|
||||
obj.writeOpt() = IOobject::NO_WRITE;
|
||||
|
||||
Info<< type() << " " << name_ << " output:" << nl
|
||||
<< " writing object " << obj.name() << nl
|
||||
<< endl;
|
||||
if (exclusiveWriting_)
|
||||
{
|
||||
// Switch off automatic writing to prevent double write
|
||||
obj.writeOpt() = IOobject::NO_WRITE;
|
||||
}
|
||||
|
||||
obj.write();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user