forked from i-RIC/iriclib
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiriclib_cgnsfile.h
253 lines (214 loc) · 12.8 KB
/
iriclib_cgnsfile.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
#ifndef IRICLIB_CGNSFILE_H
#define IRICLIB_CGNSFILE_H
#include "iriclib_global.h"
#include <cgnslib.h>
namespace iRICLib {
class CgnsFile
{
public:
CgnsFile();
~CgnsFile();
void setFileName(const char* fileName);
void setFileId(int fileId);
// -----------------------------------
// Initialization and Basic functions
// -----------------------------------
int Init();
int InitRead_Base(const char* basename);
int InitRead();
void OptionDivideSolutions();
int Flush();
int GotoBase(int* B);
int GotoCC();
int GotoRawDataTop();
int Set_ZoneId(int zoneid);
// ------------------------------
// Calculation Condition Reading
// ------------------------------
int CC_Read_Integer(const char* name, int* intvalue);
int CC_Read_Real(const char* name, double* realvalue);
int CC_Read_RealSingle(const char* name, float* realvalue);
int CC_Read_StringLen(const char* name, int* length);
int CC_Read_String(const char* name, char* strvalue);
int CC_Read_FunctionalSize(const char* name, cgsize_t* size);
int CC_Read_Functional(const char* name, double* x, double* y);
int CC_Read_FunctionalWithName(const char* name, const char* paramname, double* data);
int CC_Read_Functional_RealSingle(const char* name, float* x, float* y);
int CC_Read_FunctionalWithName_RealSingle(const char* name, const char* paramname, float* data);
int CC_Read_FunctionalWithName_String(const char* name, const char* paramname, char* strvalue);
int CC_Read_FunctionalWithName_StringLen(const char* name, const char* paramname, int* length);
int CC_Write_Integer(const char* name, int intvalue);
int CC_Write_Real(const char* name, double realvalue);
int CC_Write_String(const char* name, const char* strvalue);
int CC_Write_Functional(const char* name, int length, double* realarray_x, double* realarray_y);
int CC_Write_FunctionalWithName(const char* name, const char* paramname, int length, double* data);
int CC_Write_FunctionalWithName_String(const char* name, const char* paramname, const char* value);
// --------------------------------------
// Complex Calculation Condition Reading
// --------------------------------------
int Complex_CC_Read_Count(const char* groupname, int* count);
int Complex_CC_Read_Integer(const char* groupname, int num, const char* name, int* intvalue);
int Complex_CC_Read_Real(const char* groupname, int num, const char* name, double* realvalue);
int Complex_CC_Read_RealSingle(const char* groupname, int num, const char* name, float* realvalue);
int Complex_CC_Read_StringLen(const char* groupname, int num, const char* name, int* length);
int Complex_CC_Read_String(const char* groupname, int num, const char* name, char* strvalue);
int Complex_CC_Read_FunctionalSize(const char* groupname, int num, const char* name, cgsize_t* size);
int Complex_CC_Read_Functional(const char* groupname, int num, const char* name, double* x, double* y);
int Complex_CC_Read_FunctionalWithName(const char* groupname, int num, const char* name, const char *paramname, double* data);
int Complex_CC_Read_Functional_RealSingle(const char* groupname, int num, const char* name, float* x, float* y);
int Complex_CC_Read_FunctionalWithName_RealSingle(const char* groupname, int num, const char* name, const char* paramname, float* data);
int Complex_CC_Read_FunctionalWithName_StringLen(const char *groupname, int num, const char *name, const char* paramname, int* length);
int Complex_CC_Read_FunctionalWithName_String(const char *groupname, int num, const char *name, const char* paramname, char* strvalue);
int Complex_CC_Read_Grid_Node(const char* groupname, int* values);
int Complex_CC_Read_Grid_Cell(const char* groupname, int* values);
int Complex_CC_Clear_Complex();
int Complex_CC_Write_Integer(const char* groupname, int num, const char* name, int intvalue);
int Complex_CC_Write_Real(const char* groupname, int num, const char* name, double realvalue);
int Complex_CC_Write_String(const char* groupname, int num, const char* name, const char* strvalue);
int Complex_CC_Write_Functional(const char* groupname, int num, const char* name, int length, double* realarray_x, double* realarray_y);
int Complex_CC_Write_FunctionalWithName(const char* groupname, int num, const char* name, const char *paramname, int length, double* data);
int Complex_CC_Write_FunctionalWithName_String(const char* groupname, int num, const char* name, const char *paramname, const char* strvalue);
int Complex_CC_Write_Grid_Node(const char* groupname, int* values);
int Complex_CC_Write_Grid_Cell(const char* groupname, int* values);
// ---------
// Grid I/O
// ---------
int Grid_GotoCoord2d(cgsize_t* isize, cgsize_t* jsize);
int Grid_GetCoord2d(double *x, double *y);
int Grid_GotoCoord3d(cgsize_t* isize, cgsize_t* jsize, cgsize_t* ksize);
int Grid_GetCoord3d(double *x, double *y, double *z);
int Grid_Read_NodeCount(int* count);
int Grid_Read_CellCount(int* count);
int Grid_Read_IFaceCount(int* count);
int Grid_Read_JFaceCount(int* count);
int Grid_Read_Real_Node(const char* name, double* values);
int Grid_Read_Integer_Node(const char* name, int* values);
int Grid_Read_Real_Cell(const char *name, double* values);
int Grid_Read_Integer_Cell(const char *name, int* values);
int Grid_Read_FunctionalDimensionSize(const char* name, const char* dimname, cgsize_t* count);
int Grid_Read_FunctionalDimension_Integer(const char* name, const char* dimname, int* value);
int Grid_Read_FunctionalDimension_Real(const char* name, const char* dimname, double* value);
int Grid_Read_FunctionalTimeSize(const char* name, cgsize_t* count);
int Grid_Read_FunctionalTime(const char* name, double* time);
int Grid_Read_Functional_Integer_Node(const char* name, int dimid, int* value);
int Grid_Read_Functional_Real_Node(const char* name, int dimid, double* value);
int Grid_Read_Functional_Integer_Cell(const char* name, int dimid, int* value);
int Grid_Read_Functional_Real_Cell(const char* name, int dimid, double* value);
int Grid_Init(int zoneId);
int Grid_WriteGridCoord1d(cgsize_t isize, double* x);
int Grid_WriteGridCoord2d(cgsize_t isize, cgsize_t jsize, double* x, double* y);
int Grid_WriteGridCoord3d(cgsize_t isize, cgsize_t jsize, cgsize_t ksize, double* x, double* y, double* z);
int Grid_Write_Real_Node(const char* name, double* values);
int Grid_Write_Integer_Node(const char* name, int* values);
int Grid_Write_Real_Cell(const char* name, double* values);
int Grid_Write_Integer_Cell(const char* name, int* values);
// -----------------------
// Boundary Condition I/O
// -----------------------
void BC_Init_Names();
void BC_Read_Count(const char* typeName, int* num);
int BC_Read_IndicesSize(const char* typeName, int num, cgsize_t* size); // size is the number of nodes/cells/edges.
int BC_Read_IndicesSize2(const char* typeName, int num, cgsize_t* size); // size is the number of values. For structured grids, it returns twice value of BC_Read_IndicesSize(), because it is a list of (i, j).
int BC_Read_Indices(const char* typeName, int num, cgsize_t* indices);
int BC_Read_Integer(const char* typeName, int num, const char* name, int* intvalue);
int BC_Read_Real(const char* typeName, int num, const char* name, double* realvalue);
int BC_Read_RealSingle(const char* typeName, int num, const char* name, float* realvalue);
int BC_Read_StringLen(const char* typeName, int num, const char* name, int* length);
int BC_Read_String(const char* typeName, int num, const char* name, char* strvalue);
int BC_Read_FunctionalSize(const char* typeName, int num, const char* name, cgsize_t* size);
int BC_Read_Functional(const char* typeName, int num, const char* name, double* x, double* y);
int BC_Read_FunctionalWithName(const char* typeName, int num, const char* name, const char *paramname, double* data);
int BC_Read_Functional_RealSingle(const char* typeName, int num, const char* name, float* x, float* y);
int BC_Read_FunctionalWithName_RealSingle(const char* typeName, int num, const char* name, const char* paramname, float* data);
int BC_Read_FunctionalWithName_StringLen(const char* typeName, int num, const char* name, const char* paramname, int* length);
int BC_Read_FunctionalWithName_String(const char *typeName, int num, const char* name, const char* paramname, char* strvalue);
int BC_Clear();
int BC_Write_Indices(const char* typeName, int num, cgsize_t size, cgsize_t* indices); // size is the number of nodes/cells/edges.
int BC_Write_Indices2(const char* typeName, int num, cgsize_t size, cgsize_t* indices); // size is the number of values. For structured grid it should be twice value passed to BC_Write_Indices().
int BC_Write_Integer(const char* typeName, int num, const char* name, int intvalue);
int BC_Write_Real(const char* typeName, int num, const char* name, double realvalue);
int BC_Write_String(const char* typeName, int num, const char* name, const char* strvalue);
int BC_Write_Functional(const char* typeName, int num, const char* name, int length, double* realarray_x, double* realarray_y);
int BC_Write_FunctionalWithName(const char* typeName, int num, const char* name, const char *paramname, int length, double* data);
int BC_Write_FunctionalWithName_String(const char* typeName, int num, const char* name, const char *paramname, const char* strvalue);
// -------------
// Solution I/O
// -------------
int Sol_Read_Count(int* count);
int Sol_Read_Time(int step, double* time);
int Sol_Read_Iteration(int step, int* index);
int Sol_Read_BaseIterative_Integer(int step, const char* name, int* value);
int Sol_Read_BaseIterative_Real(int step, const char* name, double* value);
int Sol_Read_BaseIterative_StringLen(int step, const char* name, int* length);
int Sol_Read_BaseIterative_String(int step, const char* name, char* strvalue);
int Sol_Read_GridCoord2d(int step, double* x, double* y);
int Sol_Read_GridCoord3d(int step, double* x, double* y, double* z);
int Sol_Read_Integer(int step, const char *name, int* data);
int Sol_Read_Cell_Integer(int step, const char *name, int* data);
int Sol_Read_IFace_Integer(int step, const char *name, int* data);
int Sol_Read_JFace_Integer(int step, const char *name, int* data);
int Sol_Read_Real(int step, const char *name, double* data);
int Sol_Read_Cell_Real(int step, const char *name, double* data);
int Sol_Read_IFace_Real(int step, const char *name, double* data);
int Sol_Read_JFace_Real(int step, const char *name, double* data);
int Sol_Write_Time(double time);
int Sol_Write_Iteration(int index);
int Sol_Write_BaseIterative_Integer(const char *name, int value);
int Sol_Write_BaseIterative_Real(const char *name, double value);
int Sol_Write_BaseIterative_String(const char* name, const char* value);
int Sol_Write_GridCoord2d(double *x, double *y);
int Sol_Write_GridCoord3d(double *x, double *y, double *z);
int Sol_Write_Integer(const char *name, int* data);
int Sol_Write_Cell_Integer(const char *name, int* data);
int Sol_Write_IFace_Integer(const char *name, int* data);
int Sol_Write_JFace_Integer(const char *name, int* data);
int Sol_Write_Real(const char *name, double* data);
int Sol_Write_Cell_Real(const char *name, double* data);
int Sol_Write_IFace_Real(const char *name, double* data);
int Sol_Write_JFace_Real(const char *name, double* data);
// --------------
// ErrorCode I/O
// --------------
int ErrorCode_Write(int errorcode);
// ----------------------
// Solution Particle I/O
// ----------------------
int Sol_Particle_Write_Pos2d(cgsize_t count, double* x, double* y);
int Sol_Particle_Write_Pos3d(cgsize_t count, double* x, double* y, double* z);
int Sol_Particle_Write_Real(const char* name, double* value);
int Sol_Particle_Write_Integer(const char* name, int* value);
// ----------------------------
// Solution Particle Group I/O
// ----------------------------
int Sol_ParticleGroup_Write_GroupBegin(const char* name);
int Sol_ParticleGroup_Write_GroupEnd();
int Sol_ParticleGroup_Write_Pos2d(double x, double y);
int Sol_ParticleGroup_Write_Pos3d(double x, double y, double z);
int Sol_ParticleGroup_Write_Integer(const char* name, int value);
int Sol_ParticleGroup_Write_Real(const char* name, double value);
// ----------------------
// Solution Polydata I/O
// ----------------------
int Sol_PolyData_Write_GroupBegin(const char* name);
int Sol_PolyData_Write_GroupEnd();
int Sol_PolyData_Write_Polygon(int numPoints, double* x, double* y);
int Sol_PolyData_Write_Polyline(int numPoints, double* x, double* y);
int Sol_PolyData_Write_Integer(const char* name, int value);
int Sol_PolyData_Write_Real(const char* name, double value);
// --------------------
// Geographic data I/O
// --------------------
int Geo_Count(const char* name, int* count);
int Geo_Filename(const char* name, int geoid, char* filename, int* type);
private:
class Impl;
class SolutionWriter;
class SolutionWriterStandard;
class SolutionWriterDivideSolutions;
Impl* impl;
};
} // iRICLib
#ifdef _DEBUG
#include "private/iriclib_cgnsfile_impl.h"
#endif // _DEBUG
#endif // IRICLIB_CGNSFILE_H