COVISE Core
File29.h
Go to the documentation of this file.
1/* This file is part of COVISE.
2
3 You can use it under the terms of the GNU Lesser General Public License
4 version 2.1 or later, see lgpl-2.1.txt.
5
6 * License: LGPL 2+ */
7
8#ifndef __FILE29_H_
9#define __FILE29_H_
10
11#include <covise/covise.h>
12#include <util/coTypes.h>
13
14#include "istreamBLK.h"
15#include "StarFile.h"
16
17namespace covise
18{
19
21{
22public:
23 typedef float float32;
24 typedef int int32;
25 struct DropRec
26 {
27 int32 iorg, idt, idc; // FORTRAN header later overwritten by index
28 float32 x, y, z, u, v, w;
29 float32 dens, diam, mass, coun, temp;
30 };
31
32private:
33 File29(const File29 &);
37
38 void analyseHeader();
39 long readHeader(long blockNo);
40 long actualHeaderBlock, nextHeaderBlock; //,blk_per_step;
42
43 // this is a function that dumps a text to somewhere;
44 void (*dumper)(const char *);
45
46 // our default: print to stderr
47 static void printStderr(const char *text);
48
49 // we need this to check whether file has changed
50 ino_t d_inode;
51 dev_t d_device;
52
53 // Number of nroplets in timestep
54 int d_numDrops[50000];
55
56 // we read Droplets in this structure
58
59 // timestep in the structure
62
63 // Size factor for elimination or 'bad' particles: eliminate all > fact*avgSize
65
66public:
67 // struct Header {
68
69 int iter;
70 float time;
71 int ncell, // 1
72 nbc, // 2
73 nbw, // 3
74 nbs, // 4
75 nbb, // 5
76 nnode; // 6
77 char title[52]; // 7-
78 int nbcyc, // 22
79 nbcut, // 23
80 nsol, // 24
81 numcon, // 25
82 lvers, // 26
83 ndrop9_, // 27
84 ndrop9, // 28
85 ncitem, // 29
86 nvitem, // 30
87 nsitem, // 31
88 lmvgrd, // 32
89 lct_field1[12], // 33 - 44
90 field45_56[12], // 45 - 56
91 lsrf_field1[17], // 57 - 73
92 lct1_6, // 74
93 field75_90[16], // 75 - 90
94 lct_field2[3], // 91 - 73
95 field94_98[5], // 94 - 98
96 ntcell, // 99
97 field100, // 100
98 lct_field3[47], // 101 - 147
99 field148_199[52], // 148 - 199
100 nummat, // 200
101 nsmat; // 201
102 float materials[799]; // 202 - 1000
103 int lsrf_field2[47], // 1001 - 1047
104 lsrf_field3[47], // 1048 - 1094
105 field1095_1345[251], // 1095 - 1345
106 lct20, // 1346
107 field1347_1799[453], // 1347 - 1799
108 lstar[100], // 1800 - 1899 (FTN: lstar[1]->1801
109 field1900_1909[10], // 1900 - 1909
110 nbsio, // 1910
111 nwprsm, // 1911
112 nprsm, // 1912
113 nbsi, // 1913
114 ias, // 1914
115 itypen, // 1915
116 icoup, // 1916
117 mspin, // 1917
118 iunben, // 1918
119 field1919_2048[130]; // 1919 - 2048
120
122
123 // postconv fields
124 int lct[201], lsrf[201], ndata[201][4], ndrec, irasi, irpsm, ircnd;
125 /*
126 enum { VELOCITY = 1, // 1
127 VMAG, // 2
128 U,V,W, // 3 4 5
129 PRESSURE, // 6
130 TE,ED, // 7 8
131 TVIS,TEMPERATURE,DENSITY, // 9 10 11
132 LAMVIS,CP,COND, // 12 13 14
133 DROP_COORD, DROP_VEL, // 15 16
134 DROP_DENS, DROP_DIAM, // 17 18
135 DROP_TEMP, DROP_NO, // 19 20
136 DROP_MASS, // 21
137 SCALAR } ; // 22
138 // Scalar_1 = 22
139 // Scalar_6 = 27 ...
140 */
141
142 ~File29();
143
144 // see setDumper()
145 File29(int fd, void (*dumpFunct)(const char *) = NULL);
146
148 {
149 return (ncell != 0);
150 }
151
152 long skip_to_step(int stepNo);
153 int skip_to_time(float time);
154 int skip_to_field(int fieldNo);
155 long skip_to_next_field();
156
157 float getRealTime(int step);
158
159 int getVertexCoordinates(int step,
160 float *x, float *y, float *z,
161 int *len);
162 int readField(int step, int field,
163 int *starToCov, int elements,
164 float *f1, float *f2, float *f3);
165 // Header empty U V W Pressure TE ED VIS Temperature Density Lam_Vis CP COND Scalar
166 int headerBlock[50000];
167
168 // get the choice list
169 virtual ChoiceList *get_choice(const char **, int) const;
170
171 // number of steps in this file
173 {
174 return numSteps;
175 }
176
177 // set the dump device: must be a pointer to 'void funct(const char *)'
178 void setDumper(void (*newDumper)(const char *));
179
180 void findHeaders();
181
183 // 1 = true
184 // 0 = false
185 // -1 = could not stat file
186 int isFile(const char *filename);
187
189 // steps are counted 1...n
190 int getNumDrops(int step_no) const
191 {
192 return d_numDrops[step_no - 1];
193 }
194};
195}
196#endif
#define STAREXPORT
Definition: coExport.h:212
#define NULL
Definition: covise_list.h:22
GLdouble GLdouble z
Definition: khronos-glext.h:6565
const GLdouble * v
Definition: khronos-glext.h:6442
GLint GLint GLint GLint GLint GLint y
Definition: khronos-glext.h:6346
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
GLenum GLsizei len
Definition: khronos-glext.h:7440
GLubyte GLubyte GLubyte GLubyte w
Definition: khronos-glext.h:6793
GLint GLint GLint GLint GLint x
Definition: khronos-glext.h:6346
list of all chemical elements
Definition: coConfig.h:27
Definition: ChoiceList.h:19
Definition: File29.h:21
int isValid()
Definition: File29.h:147
int nwprsm
Definition: File29.h:111
int iunben
Definition: File29.h:118
int nsitem
Definition: File29.h:87
dev_t d_device
Definition: File29.h:51
int icoup
Definition: File29.h:116
int field100
Definition: File29.h:97
int nummat
Definition: File29.h:100
int nvitem
Definition: File29.h:86
int nsmat
Definition: File29.h:101
int d_numActDrops
Definition: File29.h:61
int d_lastDropStep
Definition: File29.h:60
float d_elimSizeFactor
Definition: File29.h:64
ino_t d_inode
Definition: File29.h:50
int ntcell
Definition: File29.h:96
File29(const File29 &)
int lct20
Definition: File29.h:106
int ndrop9
Definition: File29.h:84
int nbsi
Definition: File29.h:113
float time
Definition: File29.h:70
int mspin
Definition: File29.h:117
int lmvgrd
Definition: File29.h:88
long actualHeaderBlock
Definition: File29.h:40
int nnode
Definition: File29.h:76
int ncitem
Definition: File29.h:85
int nbcut
Definition: File29.h:79
int nbs
Definition: File29.h:74
int nbb
Definition: File29.h:75
int lct1_6
Definition: File29.h:92
int ias
Definition: File29.h:114
int ncell
Definition: File29.h:71
int skip_to_field(int fieldNo)
int nbw
Definition: File29.h:73
int lvers
Definition: File29.h:82
istreamBLK input
Definition: File29.h:36
int irasi
Definition: File29.h:124
int nprsm
Definition: File29.h:112
int int32
Definition: File29.h:24
File29 & operator=(const File29 &)
int ndrop9_
Definition: File29.h:83
int nbsio
Definition: File29.h:110
int numSteps
Definition: File29.h:41
int getNumDrops(int step_no) const
Definition: File29.h:190
int nbcyc
Definition: File29.h:78
DropRec * d_actDrop
Definition: File29.h:57
int nsol
Definition: File29.h:80
int nbc
Definition: File29.h:72
int get_num_steps()
Definition: File29.h:172
int itypen
Definition: File29.h:115
int skip_to_time(float time)
float float32
Definition: File29.h:23
int numcon
Definition: File29.h:81
int iter
Definition: File29.h:69
Definition: File29.h:26
float32 u
Definition: File29.h:28
float32 dens
Definition: File29.h:29
int32 idc
Definition: File29.h:27
Definition: istreamBLK.h:27
Definition: StarFile.h:18