-
Notifications
You must be signed in to change notification settings - Fork 5
/
vtkPhastaSyncIOReader.h
152 lines (122 loc) · 4.96 KB
/
vtkPhastaSyncIOReader.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
/*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkPhastaSyncIOReader.h,v $
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkPhastaSyncIOReader - Reader for RPI's PHASTA software
// .SECTION Description
// vtkPhastaSyncIOReader reads RPI's Scorec's PHASTA (Parallel Hierarchic
// Adaptive Stabilized Transient Analysis) dumps. See
// http://www.scorec.rpi.edu/software_products.html or contact Scorec for
// information on PHASTA.
#ifndef __vtkPhastaSyncIOReader_h
#define __vtkPhastaSyncIOReader_h
#include "vtkUnstructuredGridAlgorithm.h"
#include "vtkPhastaSyncIOMetaReader.h"
class vtkUnstructuredGrid;
class vtkPoints;
class vtkDataSetAttributes;
class vtkInformationVector;
/////////////////////
class vtkPVXMLParser;
class vtkPhastaSyncIOReader;
//////////////////////
//BTX
struct vtkPhastaSyncIOReaderInternal;
//ETX
class VTK_EXPORT vtkPhastaSyncIOReader : public vtkUnstructuredGridAlgorithm
{
public:
static vtkPhastaSyncIOReader *New();
vtkTypeMacro(vtkPhastaSyncIOReader,vtkUnstructuredGridAlgorithm);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Specify file name of Phasta geometry file to read.
vtkSetStringMacro(GeometryFileName);
vtkGetStringMacro(GeometryFileName);
// Description:
// Specify file name of Phasta field file to read.
vtkSetStringMacro(FieldFileName);
vtkGetStringMacro(FieldFileName);
// Description:
// Clear/Set info. in FieldInfoMap for object of vtkPhastaSyncIOReaderInternal
void ClearFieldInfo();
void SetFieldInfo(const char *paraviewFieldTag,
const char* phastaFieldTag,
int index,
int numOfComps,
int dataDependency,
const char* dataType);
protected:
vtkPhastaSyncIOReader();
~vtkPhastaSyncIOReader();
virtual int RequestData(vtkInformation* request,
vtkInformationVector** inputVector,
vtkInformationVector* outputVector);
void ReadGeomFile(char *GeomFileName,
int &firstVertexNo,
vtkPoints *points,
int &noOfNodes,
int &noOfCells);
void ReadFieldFile(char *fieldFileName ,
int firstVertexNo,
vtkDataSetAttributes *field,
int &noOfNodes);
void ReadFieldFile(char *fieldFileName,
int firstVertexNo,
vtkUnstructuredGrid *output,
int &noOfDatas);
private:
char *GeometryFileName;
char *FieldFileName;
////////////////////
vtkPVXMLParser* Parser;
char* FileName;
///////////////////
int NumberOfVariables; //number of variable in the field file
static char* StringStripper( const char istring[] );
static int cscompare( const char teststring[],
const char targetstring[] );
static void isBinary( const char iotype[] );
static size_t typeSize( const char typestring[] );
//CHANGE////////////////////////////////////////////////////
static void queryphmpiio_( const char filename[],
int *nfields,
int *nppf );
static void finalizephmpiio_( int *fileDescriptor );
//CHANGE END///////////////////////////////////////////////
static int readHeader( FILE* fileObject,
const char phrase[],
int* params,
int expect );
static void SwapArrayByteOrder_( void* array,
int nbytes,
int nItems );
static void openfile( const char filename[],
const char mode[],
int* fileDescriptor );
static void closefile( int* fileDescriptor,
const char mode[] );
static void readheader( int* fileDescriptor,
const char keyphrase[],
void* valueArray,
int* nItems,
const char datatype[],
const char iotype[] );
static void readdatablock( int* fileDescriptor,
const char keyphrase[],
void* valueArray,
int* nItems,
const char datatype[],
const char iotype[] );
private:
vtkPhastaSyncIOReaderInternal *Internal;
vtkPhastaSyncIOReader(const vtkPhastaSyncIOReader&); // Not implemented
void operator=(const vtkPhastaSyncIOReader&); // Not implemented
};
#endif