forked from Kitware/VTK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VPICDataSet.h
110 lines (82 loc) · 4.25 KB
/
VPICDataSet.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
/////////////////////////////////////////////////////////////////////////////
//
// VPICDataSet class contains information for VPIC application
// for all time steps across all processors
//
/////////////////////////////////////////////////////////////////////////////
#ifndef VPICDataSet_h
#define VPICDataSet_h
#include "VPICDefinition.h"
#include "VPICGlobal.h"
#include "VPICView.h"
#include <iostream>
#include <string>
using namespace std;
class VPIC_EXPORT VPICDataSet {
public:
VPICDataSet();
~VPICDataSet();
// Initialize with global information about files, sizes and variables
void initialize(const string& inFile);
// Initialize a subview
void setView(
int* xDecomposition, // Extent of files to include in view
int* yDecomposition, // Extent of files to include in view
int* zDecomposition); // Extent of files to include in view
// Have each part load data into appropriate part of viz data on processor
void loadVariableData(
float* varData, // Pre allocated array to fill
int varOffset, // Offset into varData from ParaView
int* localDim, // Ghost enhanced block for local
int timeStep, // Dump to load from
int variable, // Variable index to load
int component); // Component of variable to load
bool needsGridCalculation() { return this->view->needsGridCalculation(); }
void calculateGridExtents() { this->view->calculateGridExtents(); }
// Check main directory for additional time steps and adjust structures
void addNewTimeSteps() { this->global.addNewTimeSteps(); }
void PrintSelf(ostream& os, int indent);
void setRank(int r) { this->rank = r; }
void setTotalRank(int t) { this->totalRank = t; }
int getRank() { return this->rank; }
int getTotalRank() { return this->totalRank; }
// Global common information
int getNumberOfParts() { return this->global.getNumberOfParts(); }
int getNumberOfTimeSteps() { return this->global.getNumberOfTimeSteps(); }
int getTimeStep(int dump) { return this->global.getDumpTime(dump); }
int getNumberOfVariables() { return this->global.getNumberOfVariables(); }
string getVariableName(int v){ return this->global.getVariableName(v); }
int getVariableStruct(int v){ return this->global.getVariableStruct(v); }
void getLayoutSize(int layout[]);
// View specific information
void setStride(int s[]) { this->view->setStride(s); }
void getDecomposition(int d[]) { this->view->getDecomposition(d); }
void getGridSize(int grid[]) { this->view->getGridSize(grid); }
void getOrigin(float origin[]) { this->view->getOrigin(origin); }
void getOrigin(double origin[]) { this->view->getOrigin(origin); }
void getStep(float step[]) { this->view->getStep(step); }
void getStep(double step[]) { this->view->getStep(step); }
void getPhysicalExtent(float extent[])
{ this->view->getPhysicalExtent(extent); }
void getPhysicalExtent(double extent[])
{ this->view->getPhysicalExtent(extent); }
void getWholeExtent(int extent[])
{ this->view->getWholeExtent(extent); }
void getSubExtent(int piece, int extent[])
{ this->view->getSubExtent(piece, extent); }
void getSubDimension(int piece, int dim[])
{ this->view->getSubDimension(piece, dim); }
int getNumberOfCells() { return this->view->getNumberOfCells(); }
int getNumberOfNodes() { return this->view->getNumberOfNodes(); }
int getProcessorUsed(); // Is this processor used to render view
private:
int rank; // Processor number
int totalRank; // Number of graphics processors
VPICGlobal global; // Global information about overall data
VPICView* view; // Current view
int currentTimeStep; // When changing view, keep the same timestep
int curXExtent[DIMENSION]; // Current view extent
int curYExtent[DIMENSION]; // Current view extent
int curZExtent[DIMENSION]; // Current view extent
};
#endif