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:
Mark Olesen
2019-02-13 11:22:46 +01:00
committed by Andrew Heather
parent 03e6aa1a6d
commit 42fbf6d38c
68 changed files with 7123 additions and 847 deletions

View File

@ -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.
@ -50,7 +48,7 @@ namespace functionObjects
{
namespace runTimePostPro
{
defineTypeNameAndDebug(functionObjectLine, 0);
defineTypeName(functionObjectLine);
addToRunTimeSelectionTable(pathline, functionObjectLine, dictionary);
}
}
@ -67,7 +65,7 @@ static vtkSmartPointer<vtkPolyData> getPolyDataFile(const Foam::fileName& fName)
// Not extremely elegant...
vtkSmartPointer<vtkPolyData> dataset;
if (fName.ext() == "vtk")
if ("vtk" == fName.ext())
{
auto reader = vtkSmartPointer<vtkPolyDataReader>::New();
@ -78,7 +76,7 @@ static vtkSmartPointer<vtkPolyData> getPolyDataFile(const Foam::fileName& fName)
return dataset;
}
if (fName.ext() == "vtp")
if ("vtp" == fName.ext())
{
auto reader = vtkSmartPointer<vtkXMLPolyDataReader>::New();
@ -127,7 +125,8 @@ addGeometryToScene
vtkRenderer* renderer
)
{
if (!visible_)
// Currently master-only
if (!visible_ || !renderer || !Pstream::master())
{
return;
}
@ -155,10 +154,19 @@ addGeometryToScene
return;
}
DebugInfo << " Resolved lines " << fName << endl;
auto mapper = vtkSmartPointer<vtkPolyDataMapper>::New();
setField(position, fieldName_, mapper, renderer, polyData);
setField
(
position,
fieldName_,
queryFieldAssociation(fieldName_, polyData),
mapper,
renderer
);
actor_->SetMapper(mapper);