VTK  9.3.1
vtkAMReXGridReader.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
13 #ifndef vtkAMReXGridReader_h
14 #define vtkAMReXGridReader_h
15 
16 #include "vtkAMRBaseReader.h"
17 #include "vtkIOAMRModule.h" // For export macro
18 #include "vtkNew.h" // for vtkNew
19 
20 #include <string> // for std::string.
21 #include <vector> // for std::vector.
22 
23 VTK_ABI_NAMESPACE_BEGIN
24 class vtkOverlappingAMR;
26 
27 class VTKIOAMR_EXPORT vtkAMReXGridReader : public vtkAMRBaseReader
28 {
29 public:
30  static vtkAMReXGridReader* New();
32  void PrintSelf(ostream& os, vtkIndent indent) override;
33 
37  int GetNumberOfBlocks() override;
38 
42  int GetNumberOfLevels() override;
43 
47  void SetFileName(VTK_FILEPATH const char* fileName) override;
48 
49 protected:
51  ~vtkAMReXGridReader() override;
52 
56  void ReadMetaData() override;
57 
61  int GetBlockLevel(int blockIdx) override;
62 
70  int GetLevelBlockID(int blockIdx);
71 
75  int FillMetaData() override;
76 
80  vtkUniformGrid* GetAMRGrid(int blockIdx) override;
81 
85  void GetAMRGridData(int blockIdx, vtkUniformGrid* block, const char* field) override;
86 
91  void GetAMRGridPointData(int blockIdx, vtkUniformGrid* block, const char* field) override;
92 
96  void SetUpDataArraySelections() override;
97 
98  int GetDimension();
99  bool IsReady;
100 
101 private:
102  vtkAMReXGridReader(const vtkAMReXGridReader&) = delete;
103  void operator=(const vtkAMReXGridReader&) = delete;
104 
105  void ComputeStats(
106  vtkAMReXGridReaderInternal* internal, std::vector<int>& numBlocks, double min[3]);
107  vtkAMReXGridReaderInternal* Internal;
108 };
109 
110 VTK_ABI_NAMESPACE_END
111 #endif
virtual void GetAMRGridPointData(int blockIdx, vtkUniformGrid *block, const char *field)=0
Loads the block Point data.
virtual int GetNumberOfBlocks()=0
Returns the total number of blocks.
virtual vtkUniformGrid * GetAMRGrid(int blockIdx)=0
Loads the block according to the index w.r.t.
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 int GetBlockLevel(int blockIdx)=0
Returns the block level for the given block.
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:28
reader for AMReX plotfiles grid data.
virtual void GetAMRGridData(int blockIdx, vtkUniformGrid *block, const char *field)=0
Loads the block data.
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.