VTK  9.4.20241121
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
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
14VTK_ABI_NAMESPACE_BEGIN
16class vtkImageData;
18
19class VTKIOH5RAGE_EXPORT H5RageAdaptor
20{
21public:
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
42protected:
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
50 int Rank;
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
58 double* TimeSteps;
59
60 // Geometry information for sharing data with other processors
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
71 int64_t TotalTuples;
73
74 // Variable information retrieved from hdf filenames
76 std::vector<std::string> VariableName;
77};
78
79VTK_ABI_NAMESPACE_END
80#endif
81
82// VTK-HeaderTest-Exclude: H5RageAdaptor.h
int ** ExtentSchedule
void LoadVariableData(vtkImageData *data, int timeStep, vtkDataArraySelection *cellSelection)
int GetWholeExtent(int ext)
double * TimeSteps
int GetNumberOfTimeSteps()
std::vector< std::string > HdfFileName
int GetSubExtent(int ext)
std::vector< std::string > VariableName
int CollectMetaData(const char *H5RageFileName)
std::string TrimString(const std::string &str)
int64_t TotalTuples
const char * GetVariableName(int indx)
int ParseH5RageFile(const char *H5RageFileName)
int GetNumberOfVariables()
int InitializeGlobal(const char *DescFile)
int64_t * NumberOfTuples
double GetOrigin(int dim)
H5RageAdaptor(vtkMultiProcessController *ctrl)
double GetSpacing(int dim)
vtkMultiProcessController * Controller
double GetTimeStep(int step)
void ConvertHDFData(int ndims, int *dims_out, T *hdfData)
int GetDimension(int dim)
Store on/off settings for data arrays, etc.
topologically and geometrically regular array of data
Multiprocessing communication superclass.