mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: disable ensightWrite, vtkWrite function objects in post-process mode
- prevents accidental overwrite of runtime conversions.
This commit is contained in:
@ -85,6 +85,15 @@ Foam::functionObjects::ensightWrite::ensightWrite
|
|||||||
dirName_("ensightWrite"),
|
dirName_("ensightWrite"),
|
||||||
consecutive_(false)
|
consecutive_(false)
|
||||||
{
|
{
|
||||||
|
if (postProcess)
|
||||||
|
{
|
||||||
|
// Disable for post-process mode.
|
||||||
|
// Emit as FatalError for the try/catch in the caller.
|
||||||
|
FatalError
|
||||||
|
<< type() << " disabled in post-process mode"
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
read(dict);
|
read(dict);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -56,6 +56,15 @@ Foam::functionObjects::vtkWrite::vtkWrite
|
|||||||
selectFields_(),
|
selectFields_(),
|
||||||
dirName_("VTK")
|
dirName_("VTK")
|
||||||
{
|
{
|
||||||
|
if (postProcess)
|
||||||
|
{
|
||||||
|
// Disable for post-process mode.
|
||||||
|
// Emit as FatalError for the try/catch in the caller.
|
||||||
|
FatalError
|
||||||
|
<< type() << " disabled in post-process mode"
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
read(dict);
|
read(dict);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,7 @@ runTimeModifiable true;
|
|||||||
|
|
||||||
functions
|
functions
|
||||||
{
|
{
|
||||||
|
#include "ensightWrite"
|
||||||
#include "vtkWrite"
|
#include "vtkWrite"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,18 @@
|
|||||||
|
// -*- C++ -*-
|
||||||
|
// Minimal example of using the ensight write function object.
|
||||||
|
// Many more options possible
|
||||||
|
ensightWrite
|
||||||
|
{
|
||||||
|
type ensightWrite;
|
||||||
|
libs ("libutilityFunctionObjects.so");
|
||||||
|
log true;
|
||||||
|
|
||||||
|
// Fields to output (words or regex)
|
||||||
|
fields (U p "(k|epsilon|omega)");
|
||||||
|
|
||||||
|
//- Write more frequent than fields
|
||||||
|
writeControl timeStep;
|
||||||
|
writeInterval 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
Reference in New Issue
Block a user