mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: extended runTimePostProcessing (#1206)
- Extended runTimePostProcessing to include access to "live"
simulation objects such a geometry patches and sampled surfaces
stored on the "functionObjectObjects" registry.
- Add 'live' runTimePostProcessing of cloud data.
Extracts position and fields from the cloud via its objectRegistry writer
- For the "live" simulation objects, there are two new volume filters
that work directly with the OpenFOAM volume fields:
* iso-surface
* cutting planes
Both use the VTK algorithms directly and support multiple values.
Eg, can make multiple iso-levels or multiple planes parallel to each
other.
- When VTK has been compiled with MPI-support, parallel rendering will
be used.
- Additional title text properties (shadow, italic etc)
- Simplified handling of scalar-bar and visibility switches
- Support multiple text positions. Eg, for adding watermark text.
This commit is contained in:
committed by
Andrew Heather
parent
03e6aa1a6d
commit
42fbf6d38c
@ -2,10 +2,8 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
| Copyright (C) 2015 OpenFOAM Foundation
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -56,9 +54,53 @@ Description
|
||||
- Selection of colour maps
|
||||
.
|
||||
|
||||
Scene configuration is performed using standard OpenFOAM dictionaries, using
|
||||
the main headings of: output=, camera, colours, points, lines,
|
||||
surfaces and text.
|
||||
Mandatory entries:
|
||||
\verbatim
|
||||
output
|
||||
{
|
||||
name image;
|
||||
width 800;
|
||||
height 600;
|
||||
}
|
||||
|
||||
camera
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
colours
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
text
|
||||
{
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
Optional entries:
|
||||
\verbatim
|
||||
points
|
||||
{
|
||||
}
|
||||
|
||||
lines
|
||||
{
|
||||
...
|
||||
}
|
||||
|
||||
surfaces
|
||||
{
|
||||
...
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
Dictionary controls
|
||||
\table
|
||||
Property | Description | Required | Default
|
||||
type | Type-name: runTimePostProcessing | yes |
|
||||
debug | Additional debug information | no | false
|
||||
\endtable
|
||||
|
||||
SourceFiles
|
||||
runTimePostProcessing.C
|
||||
@ -76,14 +118,20 @@ SourceFiles
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Forward declarations
|
||||
class vtkRenderer;
|
||||
// Forward Declarations
|
||||
class vtkMultiPieceDataSet;
|
||||
class vtkMultiProcessController;
|
||||
class vtkRenderWindow;
|
||||
class vtkRenderer;
|
||||
template<class T> class vtkSmartPointer;
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace functionObjects
|
||||
{
|
||||
// Forward declarations
|
||||
class runTimePostProcessing;
|
||||
|
||||
namespace runTimePostPro
|
||||
{
|
||||
// Forward declarations
|
||||
@ -101,11 +149,9 @@ class runTimePostProcessing
|
||||
:
|
||||
public fvMeshFunctionObject
|
||||
{
|
||||
private:
|
||||
// Private Data
|
||||
|
||||
// Private data
|
||||
|
||||
// Output
|
||||
//- Output information
|
||||
struct outputType
|
||||
{
|
||||
word name_;
|
||||
@ -116,6 +162,9 @@ private:
|
||||
//- Output instance
|
||||
outputType output_;
|
||||
|
||||
//- Parallel rendering
|
||||
bool parallel_;
|
||||
|
||||
//- Scene manager
|
||||
runTimePostPro::scene scene_;
|
||||
|
||||
@ -138,6 +187,15 @@ private:
|
||||
template<class Type>
|
||||
void readObjects(const dictionary& dict, PtrList<Type>& objects) const;
|
||||
|
||||
//- Construct controller and dispatch to render
|
||||
void render();
|
||||
|
||||
//- Static function for SetSingleMethod binding
|
||||
static void render(vtkMultiProcessController* ctrl, void* data);
|
||||
|
||||
//- Render scene using given controller
|
||||
void render(vtkMultiProcessController* ctrl);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -162,11 +220,26 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Parallel rendering
|
||||
bool parallel() const
|
||||
{
|
||||
return parallel_;
|
||||
}
|
||||
|
||||
//- May need to gather parts to render on single-processor
|
||||
// True when OpenFOAM is running in parallel but VTK is not.
|
||||
bool needsCollective() const
|
||||
{
|
||||
return Pstream::parRun() && !parallel_;
|
||||
}
|
||||
|
||||
//- Reference to the underlying OpenFOAM mesh
|
||||
const fvMesh& mesh() const
|
||||
{
|
||||
return mesh_;
|
||||
}
|
||||
|
||||
|
||||
//- Read the post-processing controls
|
||||
virtual bool read(const dictionary& dict);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user