mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use 'statusDone' keyword for coupling (#1243)
This commit is contained in:
committed by
Andrew Heather
parent
ac646d48b7
commit
6301866a9c
@ -94,7 +94,7 @@ Foam::externalFileCoupler::externalFileCoupler()
|
||||
:
|
||||
runState_(NONE),
|
||||
commsDir_("<case>/comms"),
|
||||
statusEnd_("done"),
|
||||
statusDone_("done"),
|
||||
waitInterval_(1u),
|
||||
timeOut_(100u),
|
||||
slaveFirst_(false),
|
||||
@ -109,7 +109,7 @@ Foam::externalFileCoupler::externalFileCoupler(const fileName& commsDir)
|
||||
:
|
||||
runState_(NONE),
|
||||
commsDir_(commsDir),
|
||||
statusEnd_("done"),
|
||||
statusDone_("done"),
|
||||
waitInterval_(1u),
|
||||
timeOut_(100u),
|
||||
slaveFirst_(false),
|
||||
@ -157,7 +157,7 @@ bool Foam::externalFileCoupler::readDict(const dictionary& dict)
|
||||
dict.readEntry("commsDir", commsDir_);
|
||||
commsDir_.expand();
|
||||
commsDir_.clean();
|
||||
statusEnd_ = dict.lookupOrDefault<word>("shutdown", "done");
|
||||
statusDone_ = dict.lookupOrDefault<word>("statusDone", "done");
|
||||
slaveFirst_ = dict.lookupOrDefault("initByExternal", false);
|
||||
|
||||
Info<< type() << ": initialize" << nl
|
||||
@ -360,10 +360,10 @@ void Foam::externalFileCoupler::shutdown() const
|
||||
{
|
||||
if (Pstream::master() && runState_ == MASTER && Foam::isDir(commsDir_))
|
||||
{
|
||||
Log << type() << ": lock file status=" << statusEnd_ << endl;
|
||||
Log << type() << ": lock file status=" << statusDone_ << endl;
|
||||
|
||||
std::ofstream os(lockFile());
|
||||
os << "status=" << statusEnd_ << nl;
|
||||
os << "status=" << statusDone_ << nl;
|
||||
}
|
||||
|
||||
runState_ = DONE; // Avoid re-triggering in destructor
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software: you can redistribute it and/or modify i
|
||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
@ -54,7 +54,7 @@ Description
|
||||
waitInterval 1;
|
||||
timeOut 100;
|
||||
initByExternal no;
|
||||
shutdown done;
|
||||
statusDone done;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
@ -129,7 +129,7 @@ private:
|
||||
fileName commsDir_;
|
||||
|
||||
//- Value for "status=..." on termination
|
||||
word statusEnd_;
|
||||
word statusDone_;
|
||||
|
||||
//- Interval time between checking for return data [s]
|
||||
unsigned waitInterval_;
|
||||
@ -283,6 +283,7 @@ public:
|
||||
|
||||
|
||||
//- Generate \c status=done in lock (only when run-state = master)
|
||||
// The exact text can be specified via the statusDone keyword
|
||||
void shutdown() const;
|
||||
|
||||
//- Remove files written by OpenFOAM
|
||||
|
||||
@ -88,7 +88,7 @@ Usage
|
||||
log yes;
|
||||
commsDir "<case>/comms";
|
||||
initByExternal yes;
|
||||
shutdown done; // Any arbitrary status=... value
|
||||
statusDone done; // Any arbitrary status=... value
|
||||
|
||||
regions
|
||||
{
|
||||
@ -129,7 +129,7 @@ Usage
|
||||
commsDir | Communication directory | yes |
|
||||
waitInterval | wait interval in (s) | no | 1
|
||||
timeOut | timeout in (s) | no | 100*waitInterval
|
||||
shutdown | Lockfile status=... on termination | no | done
|
||||
statusDone | Lockfile status=... on termination | no | done
|
||||
initByExternal | Initialization values supplied by external app | yes
|
||||
calcFrequency | Calculation frequency | no | 1
|
||||
regions | The regions to couple | yes |
|
||||
|
||||
Reference in New Issue
Block a user