vtkPV4Foam.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::vtkPV4Foam
26 
27 Description
28  Provides a reader interface for OpenFOAM to VTK interaction.
29 
30 SourceFiles
31  vtkPV4Foam.C
32  vtkPV4Foam.H
33  vtkPV4FoamFields.C
34  vtkPV4FoamMesh.C
35  vtkPV4FoamMeshLagrangian.C
36  vtkPV4FoamTemplates.C
37  vtkPV4FoamMeshSet.C
38  vtkPV4FoamMeshVolume.C
39  vtkPV4FoamMeshZone.C
40  vtkPV4FoamFaceField.H
41  vtkPV4FoamLagrangianFields.H
42  vtkPV4FoamPatchField.H
43  vtkPV4FoamPointFields.H
44  vtkPV4FoamPoints.H
45  vtkPV4FoamUpdateInfo.C
46  vtkPV4FoamUpdateInfoFields.H
47  vtkPV4FoamUtils.C
48  vtkPV4FoamVolFields.H
49  vtkPV4FoamAddToSelection.H
50 
51  // Needed by VTK:
52  vtkDataArrayTemplateImplicit.txx
53 
54 \*---------------------------------------------------------------------------*/
55 
56 #ifndef vtkPV4Foam_H
57 #define vtkPV4Foam_H
58 
59 // do not include legacy strstream headers
60 #ifndef VTK_EXCLUDE_STRSTREAM_HEADERS
61 # define VTK_EXCLUDE_STRSTREAM_HEADERS
62 #endif
63 
64 #include "className.H"
65 #include "fileName.H"
66 #include "stringList.H"
67 #include "wordList.H"
68 #include "primitivePatch.H"
70 #include "volPointInterpolation.H"
71 
72 #undef VTKPV4FOAM_DUALPORT
73 
74 // * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
75 
76 class vtkDataArraySelection;
77 class vtkDataSet;
78 class vtkPoints;
79 class vtkPV4FoamReader;
80 class vtkRenderer;
81 class vtkTextActor;
82 class vtkMultiBlockDataSet;
83 class vtkPolyData;
84 class vtkUnstructuredGrid;
85 class vtkIndent;
86 
87 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
88 
89 namespace Foam
90 {
91 
92 // OpenFOAM class forward declarations
93 class argList;
94 class Time;
95 class fvMesh;
96 class IOobjectList;
97 class polyPatch;
98 class faceSet;
99 class pointSet;
100 
101 template<class Type> class IOField;
102 template<class Type> class List;
103 
104 /*---------------------------------------------------------------------------*\
105  Class vtkPV4Foam Declaration
106 \*---------------------------------------------------------------------------*/
107 
108 class vtkPV4Foam
109 {
110  // Private classes
111 
112  //- Bookkeeping for GUI checklists and the multi-block organization
113  class arrayRange
114  {
115  const char *name_;
116  int block_;
117  int start_;
118  int size_;
119 
120  public:
121 
122  arrayRange(const char *name, const int blockNo=0)
123  :
124  name_(name),
125  block_(blockNo),
126  start_(0),
127  size_(0)
128  {}
129 
130  //- Return the block holding these datasets
131  int block() const
132  {
133  return block_;
134  }
135 
136  //- Assign block number, return previous value
137  int block(int blockNo)
138  {
139  int prev = block_;
140  block_ = blockNo;
141  return prev;
142  }
143 
144  //- Return block name
145  const char* name() const
146  {
147  return name_;
148  }
149 
150  //- Return array start index
151  int start() const
152  {
153  return start_;
154  }
155 
156  //- Return array end index
157  int end() const
158  {
159  return start_ + size_;
160  }
161 
162  //- Return sublist size
163  int size() const
164  {
165  return size_;
166  }
167 
168  bool empty() const
169  {
170  return !size_;
171  }
172 
173  //- Reset the size to zero and optionally assign a new start
174  void reset(const int startAt = 0)
175  {
176  start_ = startAt;
177  size_ = 0;
178  }
179 
180  //- Increment the size
181  void operator+=(const int n)
182  {
183  size_ += n;
184  }
185  };
186 
187  //- Bookkeeping for polyhedral cell decomposition
188  // hide in extra pointMap (cellSet/cellZone) for now
189  class polyDecomp
190  {
194 
195  public:
196 
197  polyDecomp()
198  {}
199 
200  //- Label of original cell for decomposed cells
202  {
203  return superCells_;
204  }
205 
206  //- Label of original cell for decomposed cells
207  const labelList& superCells() const
208  {
209  return superCells_;
210  }
211 
212  //- Cell-centre labels for additional points of decomposed cells
214  {
215  return addPointCellLabels_;
216  }
217 
218  //- Cell-centre labels for additional points of decomposed cells
219  const labelList& addPointCellLabels() const
220  {
221  return addPointCellLabels_;
222  }
223 
224  //- Point labels for subsetted meshes
226  {
227  return pointMap_;
228  }
229 
230  //- Point labels for subsetted meshes
231  const labelList& pointMap() const
232  {
233  return pointMap_;
234  }
235 
236 
237  //- Clear
238  void clear()
239  {
240  superCells_.clear();
242  pointMap_.clear();
243  }
244  };
245 
246 
247  // Private Data
248 
249  //- Access to the controlling vtkPV4FoamReader
250  vtkPV4FoamReader* reader_;
251 
252  //- OpenFOAM time control
254 
255  //- OpenFOAM mesh
256  fvMesh* meshPtr_;
257 
258  //- The mesh region
260 
261  //- The mesh directory for the region
263 
264  //- The time index
265  int timeIndex_;
266 
267  //- Track changes in mesh geometry
268  bool meshChanged_;
269 
270  //- Track changes in fields
271  bool fieldsChanged_;
272 
273  //- Selected geometrical parts (internalMesh, patches, ...)
275 
276  //- Datasets corresponding to selected geometrical pieces
277  // a negative number indicates that no vtkmesh exists for this piece
279 
280  //- First instance and size of various mesh parts
281  // used to index into partStatus_ and partDataset_
291 
292  //- Decomposed cells information (mesh regions)
293  // TODO: regions
295 
296  //- Decomposed cells information (cellZone meshes)
298 
299  //- Decomposed cells information (cellSet meshes)
301 
302  //- List of patch names for rendering to window
304 
305  // Private Member Functions
306 
307  // Convenience method use to convert the readers from VTK 5
308  // multiblock API to the current composite data infrastructure
309  static void AddToBlock
310  (
311  vtkMultiBlockDataSet* output,
312  vtkDataSet* dataset,
313  const arrayRange&,
314  const label datasetNo,
315  const std::string& datasetName
316  );
317 
318  // Convenience method use to convert the readers from VTK 5
319  // multiblock API to the current composite data infrastructure
320  static vtkDataSet* GetDataSetFromBlock
321  (
322  vtkMultiBlockDataSet* output,
323  const arrayRange&,
324  const label datasetNo
325  );
326 
327  // Convenience method use to convert the readers from VTK 5
328  // multiblock API to the current composite data infrastructure
330  (
331  vtkMultiBlockDataSet* output,
332  const arrayRange&
333  );
334 
335  //- Reset data counters
336  void resetCounters();
337 
338  // Update information helper functions
339 
340  //- Update the mesh parts selected in the GUI
341  void updateMeshPartsStatus();
342 
343  //- Internal mesh info
344  void updateInfoInternalMesh(vtkDataArraySelection*);
345 
346  //- Lagrangian info
347  void updateInfoLagrangian(vtkDataArraySelection*);
348 
349  //- Patch info
350  void updateInfoPatches(vtkDataArraySelection*, stringList&);
351 
352  //- Set info
353  void updateInfoSets(vtkDataArraySelection*);
354 
355  //- Zone info
356  void updateInfoZones(vtkDataArraySelection*);
357 
358  //- Get non-empty zone names for zoneType from file
359  wordList getZoneNames(const word& zoneType) const;
360 
361  //- Get non-empty zone names from mesh info
362  template<class ZoneType>
364  (
366  ) const;
367 
368  //- Add objects of Type to paraview array selection
369  template<class Type>
371  (
372  vtkDataArraySelection*,
373  const IOobjectList&,
374  const string& suffix=string::null
375  );
376 
377  //- Field info
378  template<template<class> class patchType, class meshType>
379  void updateInfoFields(vtkDataArraySelection*);
380 
381  //- Lagrangian field info
383 
384 
385  // Update helper functions
386 
387  //- OpenFOAM mesh
388  void updateFoamMesh();
389 
390  //- Reduce memory footprint after conversion
391  void reduceMemory();
392 
393 
394  // Mesh conversion functions
395 
396  //- Volume mesh
397  void convertMeshVolume(vtkMultiBlockDataSet*, int& blockNo);
398 
399  //- Lagrangian mesh
400  void convertMeshLagrangian(vtkMultiBlockDataSet*, int& blockNo);
401 
402  //- Patch meshes
403  void convertMeshPatches(vtkMultiBlockDataSet*, int& blockNo);
404 
405  //- Cell zone meshes
406  void convertMeshCellZones(vtkMultiBlockDataSet*, int& blockNo);
407 
408  //- Face zone meshes
409  void convertMeshFaceZones(vtkMultiBlockDataSet*, int& blockNo);
410 
411  //- Point zone meshes
412  void convertMeshPointZones(vtkMultiBlockDataSet*, int& blockNo);
413 
414  //- Cell set meshes
415  void convertMeshCellSets(vtkMultiBlockDataSet*, int& blockNo);
416 
417  //- Face set meshes
418  void convertMeshFaceSets(vtkMultiBlockDataSet*, int& blockNo);
419 
420  //- Point set meshes
421  void convertMeshPointSets(vtkMultiBlockDataSet*, int& blockNo);
422 
423 
424  // Add mesh functions
425 
426  //- Add internal mesh/cell set meshes
427  vtkUnstructuredGrid* volumeVTKMesh(const fvMesh&, polyDecomp&);
428 
429  //- Add Lagrangian mesh
430  vtkPolyData* lagrangianVTKMesh
431  (
432  const fvMesh&,
433  const word& cloudName
434  );
435 
436  //- Add patch mesh
437  template<class PatchType>
438  vtkPolyData* patchVTKMesh(const word& name, const PatchType&);
439 
440  //- Add point zone
441  vtkPolyData* pointZoneVTKMesh
442  (
443  const fvMesh&,
444  const labelList& pointLabels
445  );
446 
447  //- Add face set mesh
448  vtkPolyData* faceSetVTKMesh
449  (
450  const fvMesh&,
451  const faceSet&
452  );
453 
454  //- Add point mesh
455  vtkPolyData* pointSetVTKMesh
456  (
457  const fvMesh&,
458  const pointSet&
459  );
460 
461  // Field conversion functions
462 
463  //- Convert volume fields
464  void convertVolFields(vtkMultiBlockDataSet*);
465 
466  //- Convert point fields
467  void convertPointFields(vtkMultiBlockDataSet*);
468 
469  //- Convert Lagrangian fields
470  void convertLagrangianFields(vtkMultiBlockDataSet*);
471 
472 
473  //- Add the fields in the selected time directory to the selection
474  // lists
475  template<class GeoField>
477  (
478  vtkDataArraySelection*,
479  const IOobjectList&,
480  const string& suffix=string::null
481  );
482 
483 
484  // Convert OpenFOAM fields
485 
486  //- Volume field - all types
487  template<class Type>
488  void convertVolField
489  (
492  const bool interpFields,
493  vtkMultiBlockDataSet* output
494  );
495 
496  //- Volume fields - all types
497  template<class Type>
498  void convertVolFields
499  (
500  const fvMesh&,
502  const IOobjectList&,
503  const bool interpFields,
504  vtkMultiBlockDataSet* output
505  );
506 
507  //- Volume internal fields (DimensionedField)- all types
508  template<class Type>
509  void convertDimFields
510  (
511  const fvMesh&,
513  const IOobjectList&,
514  const bool interpFields,
515  vtkMultiBlockDataSet* output
516  );
517 
518  //- Volume field - all selected parts
519  template<class Type>
521  (
524  vtkMultiBlockDataSet* output,
525  const arrayRange&,
526  const List<polyDecomp>& decompLst
527  );
528 
529  //- Volume field
530  template<class Type>
531  void convertVolField
532  (
534  vtkMultiBlockDataSet* output,
535  const arrayRange&,
536  const label datasetNo,
537  const polyDecomp&
538  );
539 
540  //- Patch field
541  template<class Type>
542  void convertPatchField
543  (
544  const word& name,
545  const Field<Type>&,
546  vtkMultiBlockDataSet* output,
547  const arrayRange&,
548  const label datasetNo
549  );
550 
551  //- Face set/zone field
552  template<class Type>
553  void convertFaceField
554  (
556  vtkMultiBlockDataSet* output,
557  const arrayRange&,
558  const label datasetNo,
559  const fvMesh&,
560  const labelList& faceLabels
561  );
562 
563  //- Lagrangian fields - all types
564  template<class Type>
566  (
567  const IOobjectList&,
568  vtkMultiBlockDataSet* output,
569  const label datasetNo
570  );
571 
572  //- Lagrangian field
573  template<class Type>
575  (
576  const IOField<Type>&,
577  vtkMultiBlockDataSet* output,
578  const arrayRange&,
579  const label datasetNo
580  );
581 
582  //- Point fields - all types
583  template<class Type>
584  void convertPointFields
585  (
586  const fvMesh&,
587  const pointMesh&,
588  const IOobjectList&,
589  vtkMultiBlockDataSet* output
590  );
591 
592  //- Point field - all selected parts
593  template<class Type>
595  (
597  vtkMultiBlockDataSet* output,
598  const arrayRange&,
599  const List<polyDecomp>&
600  );
601 
602  //- Point fields
603  template<class Type>
604  void convertPointField
605  (
608  vtkMultiBlockDataSet* output,
609  const arrayRange&,
610  const label datasetNo,
611  const polyDecomp&
612  );
613 
614  //- Patch point field
615  template<class Type>
617  (
618  const word& name,
619  const Field<Type>&,
620  vtkMultiBlockDataSet* output,
621  const arrayRange&,
622  const label datasetNo
623  );
624 
625 
626  // GUI selection helper functions
627 
628  //- Only keep what is listed in hashSet
629  static void pruneObjectList
630  (
631  IOobjectList&,
632  const wordHashSet&
633  );
634 
635  //- Retrieve the current selections
636  static wordHashSet getSelected(vtkDataArraySelection*);
637 
638  //- Retrieve a sub-list of the current selections
639  static wordHashSet getSelected
640  (
641  vtkDataArraySelection*,
642  const arrayRange&
643  );
644 
645  //- Retrieve the current selections
646  static stringList getSelectedArrayEntries(vtkDataArraySelection*);
647 
648  //- Retrieve a sub-list of the current selections
650  (
651  vtkDataArraySelection*,
652  const arrayRange&
653  );
654 
655  //- Set selection(s)
656  static void setSelectedArrayEntries
657  (
658  vtkDataArraySelection*,
659  const stringList&
660  );
661 
662  //- Get the first word from the mesh parts selection
663  word getPartName(const int);
664 
665 
666  //- Disallow default bitwise copy construct
667  vtkPV4Foam(const vtkPV4Foam&);
668 
669  //- Disallow default bitwise assignment
670  void operator=(const vtkPV4Foam&);
671 
672 
673 public:
674 
675  //- Static data members
676 
677  ClassName("vtkPV4Foam");
678 
679 
680  // Constructors
681 
682  //- Construct from components
683  vtkPV4Foam
684  (
685  const char* const FileName,
686  vtkPV4FoamReader* reader
687  );
688 
689 
690  //- Destructor
691  ~vtkPV4Foam();
692 
693 
694  // Member Functions
695 
696  //- Update
697  void updateInfo();
698 
699  void Update
700  (
701  vtkMultiBlockDataSet* output,
702  vtkMultiBlockDataSet* lagrangianOutput
703  );
704 
705  //- Clean any storage
706  void CleanUp();
707 
708  //- Allocate and return a list of selected times
709  // returns the count via the parameter
710  double* findTimes(int& nTimeSteps);
711 
712  //- Add/remove patch names to/from the view
713  void renderPatchNames(vtkRenderer*, const bool show);
714 
715  //- Set the runTime to the first plausible request time,
716  // returns the timeIndex
717  // sets to "constant" on error
718  int setTime(int count, const double requestTimes[]);
719 
720 
721  //- The current time index
722  int timeIndex() const
723  {
724  return timeIndex_;
725  }
726 
727 
728  // Access
729 
730  //- Debug information
731  void PrintSelf(ostream&, vtkIndent) const;
732 
733  //- Simple memory used debugging information
734  static void printMemory();
735 
736 };
737 
738 
739 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
740 
741 } // End namespace Foam
742 
743 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
744 
745 #ifdef NoRepository
746  #include "vtkPV4FoamTemplates.C"
747 #endif
748 
749 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
750 
751 #endif
752 
753 // ************************************************************************* //
Foam::vtkPV4Foam::updateInfoPatches
void updateInfoPatches(vtkDataArraySelection *, stringList &)
Patch info.
Foam::vtkPV4Foam::updateInfoFields
void updateInfoFields(vtkDataArraySelection *)
Field info.
Definition: vtkPV4FoamUpdateInfoFields.H:36
Foam::vtkPV4Foam::faceSetVTKMesh
vtkPolyData * faceSetVTKMesh(const fvMesh &, const faceSet &)
Add face set mesh.
Foam::vtkPV4Foam::arrayRange
Bookkeeping for GUI checklists and the multi-block organization.
Definition: vtkPV4Foam.H:112
Foam::vtkPV4Foam::polyDecomp
Bookkeeping for polyhedral cell decomposition.
Definition: vtkPV4Foam.H:188
Foam::vtkPV4Foam::timeIndex
int timeIndex() const
The current time index.
Definition: vtkPV4Foam.H:721
Foam::vtkPV4Foam::arrayRange::arrayRange
arrayRange(const char *name, const int blockNo=0)
Definition: vtkPV4Foam.H:121
Foam::vtkPV4Foam::arrayRangeLagrangian_
arrayRange arrayRangeLagrangian_
Definition: vtkPV4Foam.H:283
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::vtkPV4Foam::setSelectedArrayEntries
static void setSelectedArrayEntries(vtkDataArraySelection *, const stringList &)
Set selection(s)
Definition: vtkPV4FoamUtils.C:303
Foam::vtkPV4Foam::convertLagrangianField
void convertLagrangianField(const IOField< Type > &, vtkMultiBlockDataSet *output, const arrayRange &, const label datasetNo)
Lagrangian field.
Definition: vtkPV4FoamLagrangianFields.H:62
Foam::vtkPV4Foam::arrayRange::start
int start() const
Return array start index.
Definition: vtkPV4Foam.H:150
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::IOField
A primitive field of type <T> with automated input and output.
Definition: IOField.H:50
PrimitivePatchInterpolation.H
Foam::vtkPV4Foam::arrayRange::block
int block() const
Return the block holding these datasets.
Definition: vtkPV4Foam.H:130
Foam::vtkPV4Foam::convertMeshFaceZones
void convertMeshFaceZones(vtkMultiBlockDataSet *, int &blockNo)
Face zone meshes.
Foam::vtkPV4Foam::polyDecomp::superCells
const labelList & superCells() const
Label of original cell for decomposed cells.
Definition: vtkPV4Foam.H:206
Foam::vtkPV4Foam::arrayRangeFaceSets_
arrayRange arrayRangeFaceSets_
Definition: vtkPV4Foam.H:288
Foam::vtkPV4Foam::partDataset_
labelList partDataset_
Datasets corresponding to selected geometrical pieces.
Definition: vtkPV4Foam.H:277
Foam::vtkPV4Foam::vtkPV4Foam
vtkPV4Foam(const vtkPV4Foam &)
Disallow default bitwise copy construct.
Foam::vtkPV4Foam::arrayRangePointZones_
arrayRange arrayRangePointZones_
Definition: vtkPV4Foam.H:286
Foam::vtkPV4Foam::findTimes
double * findTimes(int &nTimeSteps)
Allocate and return a list of selected times.
Foam::vtkPV4Foam::arrayRange::name
const char * name() const
Return block name.
Definition: vtkPV4Foam.H:144
Foam::vtkPV4Foam::convertMeshVolume
void convertMeshVolume(vtkMultiBlockDataSet *, int &blockNo)
Volume mesh.
Foam::vtkPV4Foam::getZoneNames
wordList getZoneNames(const word &zoneType) const
Get non-empty zone names for zoneType from file.
Foam::vtkPV4Foam::arrayRange::start_
int start_
Definition: vtkPV4Foam.H:116
Foam::vtkPV4Foam::patchVTKMesh
vtkPolyData * patchVTKMesh(const word &name, const PatchType &)
Add patch mesh.
Foam::vtkPV4Foam::convertVolFieldBlock
void convertVolFieldBlock(const GeometricField< Type, fvPatchField, volMesh > &, autoPtr< GeometricField< Type, pointPatchField, pointMesh > > &, vtkMultiBlockDataSet *output, const arrayRange &, const List< polyDecomp > &decompLst)
Volume field - all selected parts.
Definition: vtkPV4FoamVolFields.H:362
Foam::vtkPV4Foam::convertMeshPointSets
void convertMeshPointSets(vtkMultiBlockDataSet *, int &blockNo)
Point set meshes.
Foam::vtkPV4Foam::polyDecomp::addPointCellLabels
const labelList & addPointCellLabels() const
Cell-centre labels for additional points of decomposed cells.
Definition: vtkPV4Foam.H:218
Foam::vtkPV4Foam::renderPatchNames
void renderPatchNames(vtkRenderer *, const bool show)
Add/remove patch names to/from the view.
Foam::vtkPV4Foam::updateMeshPartsStatus
void updateMeshPartsStatus()
Update the mesh parts selected in the GUI.
Foam::vtkPV4Foam::fieldsChanged_
bool fieldsChanged_
Track changes in fields.
Definition: vtkPV4Foam.H:270
Foam::vtkPV4Foam::resetCounters
void resetCounters()
Reset data counters.
Foam::vtkPV4Foam::arrayRange::size
int size() const
Return sublist size.
Definition: vtkPV4Foam.H:162
Foam::vtkPV4Foam::partStatus_
boolList partStatus_
Selected geometrical parts (internalMesh, patches, ...)
Definition: vtkPV4Foam.H:273
Foam::vtkPV4Foam::convertPointField
void convertPointField(const GeometricField< Type, pointPatchField, pointMesh > &, const GeometricField< Type, fvPatchField, volMesh > &, vtkMultiBlockDataSet *output, const arrayRange &, const label datasetNo, const polyDecomp &)
Point fields.
Definition: vtkPV4FoamPointFields.H:203
Foam::vtkPV4Foam::updateInfoInternalMesh
void updateInfoInternalMesh(vtkDataArraySelection *)
Internal mesh info.
Foam::faceSet
A list of face labels.
Definition: faceSet.H:48
Foam::vtkPV4Foam::zonePolyDecomp_
List< polyDecomp > zonePolyDecomp_
Decomposed cells information (cellZone meshes)
Definition: vtkPV4Foam.H:296
Foam::vtkPV4Foam::convertFaceField
void convertFaceField(const GeometricField< Type, fvPatchField, volMesh > &, vtkMultiBlockDataSet *output, const arrayRange &, const label datasetNo, const fvMesh &, const labelList &faceLabels)
Face set/zone field.
Definition: vtkPV4FoamFaceField.H:44
Foam::vtkPV4Foam::arrayRange::name_
const char * name_
Definition: vtkPV4Foam.H:114
Foam::vtkPV4Foam::arrayRange::block
int block(int blockNo)
Assign block number, return previous value.
Definition: vtkPV4Foam.H:136
Foam::vtkPV4Foam::PrintSelf
void PrintSelf(ostream &, vtkIndent) const
Debug information.
Foam::vtkPV4Foam::convertMeshCellSets
void convertMeshCellSets(vtkMultiBlockDataSet *, int &blockNo)
Cell set meshes.
Foam::HashSet
A HashTable with keys but without contents.
Definition: HashSet.H:59
Foam::vtkPV4Foam::polyDecomp::pointMap
const labelList & pointMap() const
Point labels for subsetted meshes.
Definition: vtkPV4Foam.H:230
Foam::vtkPV4Foam::updateInfoLagrangian
void updateInfoLagrangian(vtkDataArraySelection *)
Lagrangian info.
wordList.H
Foam::vtkPV4Foam::ClassName
ClassName("vtkPV4Foam")
Static data members.
Foam::vtkPV4Foam::arrayRangeVolume_
arrayRange arrayRangeVolume_
First instance and size of various mesh parts.
Definition: vtkPV4Foam.H:281
Foam::vtkPV4Foam::updateFoamMesh
void updateFoamMesh()
OpenFOAM mesh.
vtkPV4FoamTemplates.C
Foam::vtkPV4Foam::polyDecomp::superCells_
labelList superCells_
Definition: vtkPV4Foam.H:190
Foam::vtkPV4Foam::pointZoneVTKMesh
vtkPolyData * pointZoneVTKMesh(const fvMesh &, const labelList &pointLabels)
Add point zone.
Foam::vtkPV4Foam::pointSetVTKMesh
vtkPolyData * pointSetVTKMesh(const fvMesh &, const pointSet &)
Add point mesh.
n
label n
Definition: TABSMDCalcMethod2.H:31
Foam::vtkPV4Foam::arrayRangeCellZones_
arrayRange arrayRangeCellZones_
Definition: vtkPV4Foam.H:284
Foam::vtkPV4Foam::convertMeshCellZones
void convertMeshCellZones(vtkMultiBlockDataSet *, int &blockNo)
Cell zone meshes.
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::vtkPV4Foam::operator=
void operator=(const vtkPV4Foam &)
Disallow default bitwise assignment.
Foam::Field< Type >
Foam::vtkPV4Foam::lagrangianVTKMesh
vtkPolyData * lagrangianVTKMesh(const fvMesh &, const word &cloudName)
Add Lagrangian mesh.
Foam::vtkPV4Foam::convertLagrangianFields
void convertLagrangianFields(vtkMultiBlockDataSet *)
Convert Lagrangian fields.
Foam::vtkPV4Foam::csetPolyDecomp_
List< polyDecomp > csetPolyDecomp_
Decomposed cells information (cellSet meshes)
Definition: vtkPV4Foam.H:299
Foam::vtkPV4Foam::volumeVTKMesh
vtkUnstructuredGrid * volumeVTKMesh(const fvMesh &, polyDecomp &)
Add internal mesh/cell set meshes.
Foam::vtkPV4Foam::convertMeshFaceSets
void convertMeshFaceSets(vtkMultiBlockDataSet *, int &blockNo)
Face set meshes.
Foam::vtkPV4Foam::convertMeshPointZones
void convertMeshPointZones(vtkMultiBlockDataSet *, int &blockNo)
Point zone meshes.
Foam::vtkPV4Foam::arrayRange::reset
void reset(const int startAt=0)
Reset the size to zero and optionally assign a new start.
Definition: vtkPV4Foam.H:173
className.H
Macro definitions for declaring ClassName(), NamespaceName(), etc.
Foam::vtkPV4Foam::addToSelection
label addToSelection(vtkDataArraySelection *, const IOobjectList &, const string &suffix=string::null)
Add objects of Type to paraview array selection.
fileName.H
Foam::ZoneMesh
A list of mesh zones.
Definition: cellZoneMeshFwd.H:39
Foam::vtkPV4Foam::convertVolField
void convertVolField(const PtrList< PrimitivePatchInterpolation< primitivePatch > > &, const GeometricField< Type, fvPatchField, volMesh > &, const bool interpFields, vtkMultiBlockDataSet *output)
Volume field - all types.
Definition: vtkPV4FoamVolFields.H:48
Foam::vtkPV4Foam::meshDir_
fileName meshDir_
The mesh directory for the region.
Definition: vtkPV4Foam.H:261
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::vtkPV4Foam::polyDecomp::pointMap
labelList & pointMap()
Point labels for subsetted meshes.
Definition: vtkPV4Foam.H:224
Foam::vtkPV4Foam::printMemory
static void printMemory()
Simple memory used debugging information.
Definition: vtkPV4FoamUtils.C:330
Foam::vtkPV4Foam::reader_
vtkPV4FoamReader * reader_
Access to the controlling vtkPV4FoamReader.
Definition: vtkPV4Foam.H:249
Foam::vtkPV4Foam::Update
void Update(vtkMultiBlockDataSet *output, vtkMultiBlockDataSet *lagrangianOutput)
Foam::vtkPV4Foam::arrayRange::empty
bool empty() const
Definition: vtkPV4Foam.H:167
Foam::vtkPV4Foam::dbPtr_
autoPtr< Time > dbPtr_
OpenFOAM time control.
Definition: vtkPV4Foam.H:252
Foam::vtkPV4Foam::arrayRange::end
int end() const
Return array end index.
Definition: vtkPV4Foam.H:156
Foam::vtkPV4Foam::addObjectsToSelection
label addObjectsToSelection(vtkDataArraySelection *, const IOobjectList &, const string &suffix=string::null)
Add the fields in the selected time directory to the selection.
Foam::string::null
static const string null
An empty string.
Definition: string.H:86
Foam::vtkPV4Foam::~vtkPV4Foam
~vtkPV4Foam()
Destructor.
Foam::vtkPV4Foam::convertPatchField
void convertPatchField(const word &name, const Field< Type > &, vtkMultiBlockDataSet *output, const arrayRange &, const label datasetNo)
Patch field.
Definition: vtkPV4FoamPatchField.H:45
Foam::vtkPV4Foam::meshChanged_
bool meshChanged_
Track changes in mesh geometry.
Definition: vtkPV4Foam.H:267
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:48
Foam::vtkPV4Foam::updateInfo
void updateInfo()
Update.
Foam::IOobjectList
List of IOobjects with searching and retrieving facilities.
Definition: IOobjectList.H:50
Foam::vtkPV4Foam::arrayRange::block_
int block_
Definition: vtkPV4Foam.H:115
Foam::vtkPV4Foam::setTime
int setTime(int count, const double requestTimes[])
Set the runTime to the first plausible request time,.
Foam::vtkPV4Foam::convertDimFields
void convertDimFields(const fvMesh &, const PtrList< PrimitivePatchInterpolation< primitivePatch > > &, const IOobjectList &, const bool interpFields, vtkMultiBlockDataSet *output)
Volume internal fields (DimensionedField)- all types.
Definition: vtkPV4FoamVolFields.H:301
Foam::vtkPV4Foam::polyDecomp::addPointCellLabels
labelList & addPointCellLabels()
Cell-centre labels for additional points of decomposed cells.
Definition: vtkPV4Foam.H:212
Foam::vtkPV4Foam::polyDecomp::superCells
labelList & superCells()
Label of original cell for decomposed cells.
Definition: vtkPV4Foam.H:200
Foam::vtkPV4Foam::meshPtr_
fvMesh * meshPtr_
OpenFOAM mesh.
Definition: vtkPV4Foam.H:255
Foam::vtkPV4Foam::convertPointFieldBlock
void convertPointFieldBlock(const GeometricField< Type, pointPatchField, pointMesh > &, vtkMultiBlockDataSet *output, const arrayRange &, const List< polyDecomp > &)
Point field - all selected parts.
Definition: vtkPV4FoamPointFields.H:174
Foam::vtkPV4Foam::updateInfoLagrangianFields
void updateInfoLagrangianFields()
Lagrangian field info.
volPointInterpolation.H
Foam::vtkPV4Foam::GetNumberOfDataSets
static label GetNumberOfDataSets(vtkMultiBlockDataSet *output, const arrayRange &)
Definition: vtkPV4FoamUtils.C:159
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::vtkPV4Foam::meshRegion_
word meshRegion_
The mesh region.
Definition: vtkPV4Foam.H:258
Foam::vtkPV4Foam::updateInfoZones
void updateInfoZones(vtkDataArraySelection *)
Zone info.
Foam::PrimitivePatchInterpolation
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
Definition: PrimitivePatchInterpolation.H:51
Foam::pointSet
A set of point labels.
Definition: pointSet.H:48
Foam::vtkPV4Foam
Provides a reader interface for OpenFOAM to VTK interaction.
Definition: vtkPV4Foam.H:107
Foam::vtkPV4Foam::CleanUp
void CleanUp()
Clean any storage.
Foam::vtkPV4Foam::getPartName
word getPartName(const int)
Get the first word from the mesh parts selection.
Definition: vtkPV4FoamUtils.C:177
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
Foam::vtkPV4Foam::convertPatchPointField
void convertPatchPointField(const word &name, const Field< Type > &, vtkMultiBlockDataSet *output, const arrayRange &, const label datasetNo)
Patch point field.
Definition: vtkPV4FoamPatchField.H:87
Foam::vtkPV4Foam::patchTextActorsPtrs_
List< vtkTextActor * > patchTextActorsPtrs_
List of patch names for rendering to window.
Definition: vtkPV4Foam.H:302
Foam::vtkPV4Foam::convertMeshPatches
void convertMeshPatches(vtkMultiBlockDataSet *, int &blockNo)
Patch meshes.
Foam::List::clear
void clear()
Clear the list, i.e. set size to zero.
Definition: List.C:379
Foam::vtkPV4Foam::polyDecomp::clear
void clear()
Clear.
Definition: vtkPV4Foam.H:237
Foam::vtkPV4Foam::GetDataSetFromBlock
static vtkDataSet * GetDataSetFromBlock(vtkMultiBlockDataSet *output, const arrayRange &, const label datasetNo)
Definition: vtkPV4FoamUtils.C:137
Foam::vtkPV4Foam::arrayRange::size_
int size_
Definition: vtkPV4Foam.H:117
cloudName
const word cloudName(propsDict.lookup("cloudName"))
Foam::vtkPV4Foam::arrayRangePatches_
arrayRange arrayRangePatches_
Definition: vtkPV4Foam.H:282
List
Definition: Test.C:19
Foam::vtkPV4Foam::arrayRangePointSets_
arrayRange arrayRangePointSets_
Definition: vtkPV4Foam.H:289
Foam::vtkPV4Foam::arrayRange::operator+=
void operator+=(const int n)
Increment the size.
Definition: vtkPV4Foam.H:180
Foam::vtkPV4Foam::pruneObjectList
static void pruneObjectList(IOobjectList &, const wordHashSet &)
Only keep what is listed in hashSet.
Foam::vtkPV4Foam::polyDecomp::polyDecomp
polyDecomp()
Definition: vtkPV4Foam.H:196
Foam::vtkPV4Foam::polyDecomp::pointMap_
labelList pointMap_
Definition: vtkPV4Foam.H:192
Foam::vtkPV4Foam::convertPointFields
void convertPointFields(vtkMultiBlockDataSet *)
Convert point fields.
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::vtkPV4Foam::arrayRangeFaceZones_
arrayRange arrayRangeFaceZones_
Definition: vtkPV4Foam.H:285
Foam::vtkPV4Foam::regionPolyDecomp_
List< polyDecomp > regionPolyDecomp_
Decomposed cells information (mesh regions)
Definition: vtkPV4Foam.H:293
Foam::vtkPV4Foam::getSelectedArrayEntries
static stringList getSelectedArrayEntries(vtkDataArraySelection *)
Retrieve the current selections.
Definition: vtkPV4FoamUtils.C:225
Foam::vtkPV4Foam::AddToBlock
static void AddToBlock(vtkMultiBlockDataSet *output, vtkDataSet *dataset, const arrayRange &, const label datasetNo, const std::string &datasetName)
Definition: vtkPV4FoamUtils.C:77
stringList.H
Foam::vtkPV4Foam::getSelected
static wordHashSet getSelected(vtkDataArraySelection *)
Retrieve the current selections.
Definition: vtkPV4FoamUtils.C:184
Foam::vtkPV4Foam::polyDecomp::addPointCellLabels_
labelList addPointCellLabels_
Definition: vtkPV4Foam.H:191
pointLabels
labelList pointLabels(nPoints, -1)
Foam::vtkPV4Foam::convertVolFields
void convertVolFields(vtkMultiBlockDataSet *)
Convert volume fields.
Foam::vtkPV4Foam::convertMeshLagrangian
void convertMeshLagrangian(vtkMultiBlockDataSet *, int &blockNo)
Lagrangian mesh.
Foam::name
word name(const complex &)
Return a string representation of a complex.
Definition: complex.C:47
Foam::vtkPV4Foam::timeIndex_
int timeIndex_
The time index.
Definition: vtkPV4Foam.H:264
Foam::vtkPV4Foam::updateInfoSets
void updateInfoSets(vtkDataArraySelection *)
Set info.
Foam::vtkPV4Foam::arrayRangeCellSets_
arrayRange arrayRangeCellSets_
Definition: vtkPV4Foam.H:287
Foam::vtkPV4Foam::reduceMemory
void reduceMemory()
Reduce memory footprint after conversion.