ENH: improvements to Time

- expose the names of write and stopAt controls for reuse elsewhere and
  provide a stopAtControls enum for 'unknown'

- track the requested number of sub-cycles (was previously a bool)
This commit is contained in:
Mark Olesen
2017-11-28 10:11:06 +01:00
parent fab9fb4332
commit ca5b0dcbaa
8 changed files with 205 additions and 132 deletions

View File

@ -49,18 +49,6 @@ namespace functionObjects
}
const Foam::Enum
<
Foam::Time::stopAtControls
>
Foam::functionObjects::abort::actionNames_
{
{ Time::stopAtControls::saNoWriteNow, "noWriteNow" },
{ Time::stopAtControls::saWriteNow, "writeNow" },
{ Time::stopAtControls::saNextWrite, "nextWrite" },
};
// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
// file-scope
@ -126,12 +114,6 @@ Foam::functionObjects::abort::abort
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::functionObjects::abort::~abort()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::functionObjects::abort::read(const dictionary& dict)
@ -145,7 +127,7 @@ bool Foam::functionObjects::abort::read(const dictionary& dict)
const auto oldAction = action_;
action_ = actionNames_.lookupOrDefault
action_ = Time::stopAtControlNames.lookupOrDefault
(
"action",
dict,

View File

@ -30,6 +30,7 @@ Group
Description
Watches for presence of the named file in the $FOAM_CASE directory
and aborts the calculation if it is present.
The presence of the abort file is only checked on the master process.
Currently the following action types are supported:
@ -73,9 +74,6 @@ class abort
{
// Private data
//- A subset of Time stopAtControls
static const Enum<Time::stopAtControls> actionNames_;
//- Reference to the Time
const Time& time_;
@ -116,7 +114,7 @@ public:
//- Destructor
virtual ~abort();
virtual ~abort() = default;
// Member Functions