VTK  9.2.6
vtkAMReXGridReader.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkAMReXGridReader.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
25 #ifndef vtkAMReXGridReader_h
26 #define vtkAMReXGridReader_h
27 
28 #include "vtkAMRBaseReader.h"
29 #include "vtkIOAMRModule.h" // For export macro
30 #include "vtkNew.h" // for vtkNew
31 
32 #include <string> // for std::string.
33 #include <vector> // for std::vector.
34 
35 class vtkOverlappingAMR;
37 
38 class VTKIOAMR_EXPORT vtkAMReXGridReader : public vtkAMRBaseReader
39 {
40 public:
41  static vtkAMReXGridReader* New();
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
48  int GetNumberOfBlocks() override;
49 
53  int GetNumberOfLevels() override;
54 
58  void SetFileName(VTK_FILEPATH const char* fileName) override;
59 
60 protected:
62  ~vtkAMReXGridReader() override;
63 
67  void ReadMetaData() override;
68 
72  int GetBlockLevel(const int blockIdx) override;
73 
81  int GetLevelBlockID(const int blockIdx);
82 
86  int FillMetaData() override;
87 
91  vtkUniformGrid* GetAMRGrid(const int blockIdx) override;
92 
96  void GetAMRGridData(const int blockIdx, vtkUniformGrid* block, const char* field) override;
97 
102  void GetAMRGridPointData(const int blockIdx, vtkUniformGrid* block, const char* field) override;
103 
107  void SetUpDataArraySelections() override;
108 
109  int GetDimension();
110  bool IsReady;
111 
112 private:
113  vtkAMReXGridReader(const vtkAMReXGridReader&) = delete;
114  void operator=(const vtkAMReXGridReader&) = delete;
115 
116  void ComputeStats(
117  vtkAMReXGridReaderInternal* internal, std::vector<int>& numBlocks, double min[3]);
118  vtkAMReXGridReaderInternal* Internal;
119 };
120 
121 #endif
virtual void GetAMRGridPointData(const int blockIdx, vtkUniformGrid *block, const char *field)=0
Loads the block Point data.
virtual vtkUniformGrid * GetAMRGrid(const int blockIdx)=0
Loads the block according to the index w.r.t.
virtual int GetNumberOfBlocks()=0
Returns the total number of blocks.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
Consists of the low-level AMReX Reader used by the vtkAMReXGridReader.
virtual void ReadMetaData()=0
Reads all the metadata from the file.
virtual void SetFileName(VTK_FILEPATH const char *fileName)=0
Set/Get the filename.
virtual int GetNumberOfLevels()=0
Returns the total number of levels.
a simple class to control print indentation
Definition: vtkIndent.h:39
reader for AMReX plotfiles grid data.
virtual void GetAMRGridData(const int blockIdx, vtkUniformGrid *block, const char *field)=0
Loads the block data.
virtual int GetBlockLevel(const int blockIdx)=0
Returns the block level for the given block.
image data with blanking
#define VTK_FILEPATH
hierarchical dataset of vtkUniformGrids
An abstract class that encapsulates common functionality for all AMR readers.
static vtkOverlappingAMRAlgorithm * New()
virtual int FillMetaData()=0
Loads all the AMR metadata & constructs the LevelIdxPair12InternalIdx datastructure which maps (level...
virtual void SetUpDataArraySelections()=0
Initializes the PointDataArraySelection & CellDataArraySelection.