mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support writeControl 'none' (#1448)
- for special cases when normal writing is to be completely disabled and replaced with alternate means (eg, via a function object). - support "adjustable" as "adjustableRunTime" alias to reduce typing for writeControl or outputControl
This commit is contained in:
committed by
Andrew Heather
parent
0840bfdcb8
commit
4cc7bf1468
@ -53,8 +53,7 @@ Foam::Time::stopAtControlNames
|
|||||||
{ stopAtControls::saNoWriteNow, "noWriteNow" },
|
{ stopAtControls::saNoWriteNow, "noWriteNow" },
|
||||||
{ stopAtControls::saWriteNow, "writeNow" },
|
{ stopAtControls::saWriteNow, "writeNow" },
|
||||||
{ stopAtControls::saNextWrite, "nextWrite" },
|
{ stopAtControls::saNextWrite, "nextWrite" },
|
||||||
// NOTE: stopAtControls::saUnknown is left untabulated here so that it can
|
// Leave saUnknown untabulated - fallback to flag unknown settings
|
||||||
// be used as fallback value to flag unknown settings
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -64,11 +63,14 @@ const Foam::Enum
|
|||||||
>
|
>
|
||||||
Foam::Time::writeControlNames
|
Foam::Time::writeControlNames
|
||||||
({
|
({
|
||||||
|
{ writeControls::wcNone, "none" },
|
||||||
{ writeControls::wcTimeStep, "timeStep" },
|
{ writeControls::wcTimeStep, "timeStep" },
|
||||||
{ writeControls::wcRunTime, "runTime" },
|
{ writeControls::wcRunTime, "runTime" },
|
||||||
|
{ writeControls::wcAdjustableRunTime, "adjustable" },
|
||||||
{ writeControls::wcAdjustableRunTime, "adjustableRunTime" },
|
{ writeControls::wcAdjustableRunTime, "adjustableRunTime" },
|
||||||
{ writeControls::wcClockTime, "clockTime" },
|
{ writeControls::wcClockTime, "clockTime" },
|
||||||
{ writeControls::wcCpuTime, "cpuTime" },
|
{ writeControls::wcCpuTime, "cpuTime" },
|
||||||
|
// Leave wcUnknown untabulated - fallback to flag unknown settings
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -1170,6 +1172,10 @@ Foam::Time& Foam::Time::operator++()
|
|||||||
|
|
||||||
switch (writeControl_)
|
switch (writeControl_)
|
||||||
{
|
{
|
||||||
|
case wcNone:
|
||||||
|
case wcUnknown:
|
||||||
|
break;
|
||||||
|
|
||||||
case wcTimeStep:
|
case wcTimeStep:
|
||||||
writeTime_ = !(timeIndex_ % label(writeInterval_));
|
writeTime_ = !(timeIndex_ % label(writeInterval_));
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
| Copyright (C) 2011-2017 OpenFOAM Foundation
|
| Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
@ -83,11 +83,13 @@ public:
|
|||||||
//- Write control options
|
//- Write control options
|
||||||
enum writeControls
|
enum writeControls
|
||||||
{
|
{
|
||||||
|
wcNone, //!< "none"
|
||||||
wcTimeStep, //!< "timeStep"
|
wcTimeStep, //!< "timeStep"
|
||||||
wcRunTime, //!< "runTime"
|
wcRunTime, //!< "runTime"
|
||||||
wcAdjustableRunTime, //!< "adjustableRunTime"
|
wcAdjustableRunTime, //!< "adjustable" / "adjustableRunTime"
|
||||||
wcClockTime, //!< "clockTime"
|
wcClockTime, //!< "clockTime"
|
||||||
wcCpuTime //!< "cpuTime"
|
wcCpuTime, //!< "cpuTime"
|
||||||
|
wcUnknown //!< Dummy no-op
|
||||||
};
|
};
|
||||||
|
|
||||||
//- Stop-run control options, which are primarily used when
|
//- Stop-run control options, which are primarily used when
|
||||||
|
|||||||
@ -39,6 +39,7 @@ Foam::timeControl::timeControlNames_
|
|||||||
{ timeControl::ocTimeStep, "timeStep" },
|
{ timeControl::ocTimeStep, "timeStep" },
|
||||||
{ timeControl::ocWriteTime, "writeTime" },
|
{ timeControl::ocWriteTime, "writeTime" },
|
||||||
{ timeControl::ocOutputTime, "outputTime" },
|
{ timeControl::ocOutputTime, "outputTime" },
|
||||||
|
{ timeControl::ocAdjustableRunTime, "adjustable" },
|
||||||
{ timeControl::ocAdjustableRunTime, "adjustableRunTime" },
|
{ timeControl::ocAdjustableRunTime, "adjustableRunTime" },
|
||||||
{ timeControl::ocRunTime, "runTime" },
|
{ timeControl::ocRunTime, "runTime" },
|
||||||
{ timeControl::ocClockTime, "clockTime" },
|
{ timeControl::ocClockTime, "clockTime" },
|
||||||
|
|||||||
Reference in New Issue
Block a user