VTK: IO/H5Rage/H5RageAdaptor.h Source File

| VTK 9.3.1

H5RageAdaptor.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-FileCopyrightText: Copyright (c) Kitware, Inc.
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef H5RageAdaptor_h
5 #define H5RageAdaptor_h
6
7 #include "vtkDataArraySelection.h"
8 #include "vtkIOH5RageModule.h" // For export macro
9
10 #include <cstdint> // for std::int64_t
11 #include <string> // for std::string
12 #include <vector> // for std::vector
13
14 VTK_ABI_NAMESPACE_BEGIN
15 class vtkDataArraySelection;
16 class vtkImageData;
17 class vtkMultiProcessController;
18
19 class VTKIOH5RAGE_EXPORT H5RageAdaptor
20 {
21 public:
22 H5RageAdaptor(vtkMultiProcessController* ctrl);
23 ~H5RageAdaptor();
24
25 int InitializeGlobal(const char* DescFile);
26 void LoadVariableData(vtkImageData* data, int timeStep, vtkDataArraySelection* cellSelection);
27 template <class T>
28 void ConvertHDFData(int ndims, int* dims_out, T* hdfData);
29
30 int GetNumberOfTimeSteps() { return this->NumberOfTimeSteps; }
31 double GetTimeStep(int step) { return this->TimeSteps[step]; }
32
33 int GetNumberOfVariables() { return (int)this->VariableName.size(); }
34 const char* GetVariableName(int indx) { return this->VariableName[indx].c_str(); }
35
36 int GetWholeExtent(int ext) { return this->WholeExtent[ext]; }
37 int GetSubExtent(int ext) { return this->SubExtent[ext]; }
38 int GetDimension(int dim) { return this->Dimension[dim]; }
39 double GetOrigin(int dim) { return this->Origin[dim]; }
40 double GetSpacing(int dim) { return this->Spacing[dim]; }
41
42 protected:
43 // Collect the metadata
44 int CollectMetaData(const char* H5RageFileName);
45 int ParseH5RageFile(const char* H5RageFileName);
46 std::string TrimString(const std::string& str);
47
48 // Used in parallel reader and load balancing
49 vtkMultiProcessController* Controller;
50 int Rank;
51 int TotalRank;
52
53 // Time series of hdf files
54 std::vector<std::string> HdfFileName; // all hdf files
55
56 // Time step information retrieved from hdf filenames
57 int NumberOfTimeSteps;
58 double* TimeSteps;
59
60 // Geometry information for sharing data with other processors
61 int** ExtentSchedule;
62 int64_t* NumberOfTuples;
63
64 int WholeExtent[6]; // Size of image
65 int SubExtent[6]; // Size of image this processor
66 int Dimension[3]; // Dimension of image
67 double Origin[3]; // Physical origin
68 double Spacing[3]; // Physical spacing
69
70 int NumberOfDimensions;
71 int64_t TotalTuples;
72 bool UseFloat64;
73
74 // Variable information retrieved from hdf filenames
75 int NumberOfVariables;
76 std::vector<std::string> VariableName;
77 };
78
79 VTK_ABI_NAMESPACE_END
80 #endif
81
82 // VTK-HeaderTest-Exclude: H5RageAdaptor.h
H5RageAdaptor
Definition: H5RageAdaptor.h:20
H5RageAdaptor::ExtentSchedule
int ** ExtentSchedule
Definition: H5RageAdaptor.h:61
H5RageAdaptor::LoadVariableData
void LoadVariableData(vtkImageData *data, int timeStep, vtkDataArraySelection *cellSelection)
H5RageAdaptor::GetWholeExtent
int GetWholeExtent(int ext)
Definition: H5RageAdaptor.h:36
H5RageAdaptor::UseFloat64
bool UseFloat64
Definition: H5RageAdaptor.h:72
H5RageAdaptor::TimeSteps
double * TimeSteps
Definition: H5RageAdaptor.h:58
H5RageAdaptor::GetNumberOfTimeSteps
int GetNumberOfTimeSteps()
Definition: H5RageAdaptor.h:30
H5RageAdaptor::~H5RageAdaptor
~H5RageAdaptor()
H5RageAdaptor::GetVariableName
const char * GetVariableName(int indx)
Definition: H5RageAdaptor.h:34
H5RageAdaptor::HdfFileName
std::vector< std::string > HdfFileName
Definition: H5RageAdaptor.h:54
H5RageAdaptor::GetSubExtent
int GetSubExtent(int ext)
Definition: H5RageAdaptor.h:37
H5RageAdaptor::VariableName
std::vector< std::string > VariableName
Definition: H5RageAdaptor.h:76
H5RageAdaptor::CollectMetaData
int CollectMetaData(const char *H5RageFileName)
H5RageAdaptor::TrimString
std::string TrimString(const std::string &str)
H5RageAdaptor::TotalTuples
int64_t TotalTuples
Definition: H5RageAdaptor.h:71
H5RageAdaptor::ParseH5RageFile
int ParseH5RageFile(const char *H5RageFileName)
H5RageAdaptor::NumberOfVariables
int NumberOfVariables
Definition: H5RageAdaptor.h:75
H5RageAdaptor::GetNumberOfVariables
int GetNumberOfVariables()
Definition: H5RageAdaptor.h:33
H5RageAdaptor::NumberOfTimeSteps
int NumberOfTimeSteps
Definition: H5RageAdaptor.h:57
H5RageAdaptor::InitializeGlobal
int InitializeGlobal(const char *DescFile)
H5RageAdaptor::NumberOfTuples
int64_t * NumberOfTuples
Definition: H5RageAdaptor.h:62
H5RageAdaptor::GetOrigin
double GetOrigin(int dim)
Definition: H5RageAdaptor.h:39
H5RageAdaptor::H5RageAdaptor
H5RageAdaptor(vtkMultiProcessController *ctrl)
H5RageAdaptor::Rank
int Rank
Definition: H5RageAdaptor.h:50
H5RageAdaptor::GetSpacing
double GetSpacing(int dim)
Definition: H5RageAdaptor.h:40
H5RageAdaptor::Controller
vtkMultiProcessController * Controller
Definition: H5RageAdaptor.h:49
H5RageAdaptor::NumberOfDimensions
int NumberOfDimensions
Definition: H5RageAdaptor.h:70
H5RageAdaptor::GetTimeStep
double GetTimeStep(int step)
Definition: H5RageAdaptor.h:31
H5RageAdaptor::TotalRank
int TotalRank
Definition: H5RageAdaptor.h:51
H5RageAdaptor::ConvertHDFData
void ConvertHDFData(int ndims, int *dims_out, T *hdfData)
H5RageAdaptor::GetDimension
int GetDimension(int dim)
Definition: H5RageAdaptor.h:38
vtkDataArraySelection
Store on/off settings for data arrays, etc.
Definition: vtkDataArraySelection.h:37
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:52
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:72
vtkX3D::data
@ data
Definition: vtkX3D.h:315
vtkX3D::string
@ string
Definition: vtkX3D.h:490
vtkDataArraySelection.h