VTK  9.2.6
H5RageAdaptor.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: H5RageAdaptor.h
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html 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 =========================================================================*/
15 #ifndef H5RageAdaptor_h
16 #define H5RageAdaptor_h
17 
18 #include "vtkDataArraySelection.h"
19 #include "vtkIOH5RageModule.h" // For export macro
20 
21 #include <cstdint> // for std::int64_t
22 #include <string> // for std::string
23 #include <vector> // for std::vector
24 
26 class vtkImageData;
28 
29 class VTKIOH5RAGE_EXPORT H5RageAdaptor
30 {
31 public:
33  ~H5RageAdaptor();
34 
35  int InitializeGlobal(const char* DescFile);
36  void LoadVariableData(vtkImageData* data, int timeStep, vtkDataArraySelection* cellSelection);
37  template <class T>
38  void ConvertHDFData(int ndims, int* dims_out, T* hdfData);
39 
40  int GetNumberOfTimeSteps() { return this->NumberOfTimeSteps; }
41  double GetTimeStep(int step) { return this->TimeSteps[step]; }
42 
43  int GetNumberOfVariables() { return (int)this->VariableName.size(); }
44  const char* GetVariableName(int indx) { return this->VariableName[indx].c_str(); }
45 
46  int GetWholeExtent(int ext) { return this->WholeExtent[ext]; }
47  int GetSubExtent(int ext) { return this->SubExtent[ext]; }
48  int GetDimension(int dim) { return this->Dimension[dim]; }
49  double GetOrigin(int dim) { return this->Origin[dim]; }
50  double GetSpacing(int dim) { return this->Spacing[dim]; }
51 
52 protected:
53  // Collect the metadata
54  int CollectMetaData(const char* H5RageFileName);
55  int ParseH5RageFile(const char* H5RageFileName);
56  std::string TrimString(const std::string& str);
57 
58  // Used in parallel reader and load balancing
60  int Rank;
61  int TotalRank;
62 
63  // Time series of hdf files
64  std::vector<std::string> HdfFileName; // all hdf files
65 
66  // Time step information retrieved from hdf filenames
68  double* TimeSteps;
69 
70  // Geometry information for sharing data with other processors
72  int64_t* NumberOfTuples;
73 
74  int WholeExtent[6]; // Size of image
75  int SubExtent[6]; // Size of image this processor
76  int Dimension[3]; // Dimension of image
77  double Origin[3]; // Physical origin
78  double Spacing[3]; // Physical spacing
79 
81  int64_t TotalTuples;
82  bool UseFloat64;
83 
84  // Variable information retrieved from hdf filenames
86  std::vector<std::string> VariableName;
87 };
88 
89 #endif
90 
91 // VTK-HeaderTest-Exclude: H5RageAdaptor.h
double GetOrigin(int dim)
Definition: H5RageAdaptor.h:49
double * TimeSteps
Definition: H5RageAdaptor.h:68
int GetNumberOfTimeSteps()
Definition: H5RageAdaptor.h:40
double GetTimeStep(int step)
Definition: H5RageAdaptor.h:41
int GetNumberOfVariables()
Definition: H5RageAdaptor.h:43
int GetDimension(int dim)
Definition: H5RageAdaptor.h:48
int64_t TotalTuples
Definition: H5RageAdaptor.h:81
topologically and geometrically regular array of data
Definition: vtkImageData.h:53
Store on/off settings for data arrays, etc.
double GetSpacing(int dim)
Definition: H5RageAdaptor.h:50
vtkMultiProcessController * Controller
Definition: H5RageAdaptor.h:59
int GetSubExtent(int ext)
Definition: H5RageAdaptor.h:47
int ** ExtentSchedule
Definition: H5RageAdaptor.h:71
const char * GetVariableName(int indx)
Definition: H5RageAdaptor.h:44
std::vector< std::string > HdfFileName
Definition: H5RageAdaptor.h:64
int NumberOfDimensions
Definition: H5RageAdaptor.h:80
int64_t * NumberOfTuples
Definition: H5RageAdaptor.h:72
int GetWholeExtent(int ext)
Definition: H5RageAdaptor.h:46
std::vector< std::string > VariableName
Definition: H5RageAdaptor.h:86
Multiprocessing communication superclass.