ENH: improve file reader support for runTimePostProcessing (#1091)

- support .vtp format for geometry, surface, line, cloud.

- use native reader for handling vtk, vtp, obj, stl surface files.
  For other formats, use the MeshedSurface (the surfMesh lib) to
  handle reading and Foam::vtk::Tools::Patch to handle the
  conversion to vtkPolyData. This combination is more memory efficient.

- update tutorial case to include vtp surface geometry
This commit is contained in:
Mark Olesen
2018-12-16 19:14:22 +01:00
parent b6983e6af5
commit c3507f74f2
33 changed files with 681 additions and 441 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -70,6 +70,7 @@ SourceFiles
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Forward declarations
class vtkActor;
class vtkRenderer;
class vtkRenderWindow;
@ -123,7 +124,7 @@ protected:
// Protected data
//- Colours
HashPtrTable<Function1<vector>, word> colours_;
HashPtrTable<Function1<vector>> colours_;
// Camera settings
@ -197,26 +198,27 @@ public:
// Member Functions
// Access
// Access
//- Return the colours
const HashPtrTable<Function1<vector>, word>& colours() const;
//- Return the colours
const HashPtrTable<Function1<vector>>& colours() const;
//- Return the current frame index
label frameIndex() const;
//- Return the current frame index
label frameIndex() const;
//- Return the current position (in range 0-1)
scalar position() const;
//- Return the current position (in range 0-1)
scalar position() const;
void read(const dictionary& dict);
void initialise(vtkRenderer* renderer, const word& outputName);
void read(const dictionary& dict);
//- Main control loop
bool loop(vtkRenderer* renderer);
void initialise(vtkRenderer* renderer, const word& outputName);
//- Save image to file
void saveImage(vtkRenderWindow* renderWindow) const;
//- Main control loop
bool loop(vtkRenderer* renderer);
//- Save image to file
void saveImage(vtkRenderWindow* renderWindow) const;
};