medcoupling 9.13.0__cp39-cp39-win_amd64.whl → 9.15.0__cp39-cp39-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- CaseIO.py +27 -8
- CaseReader.py +491 -275
- CaseWriter.py +344 -172
- MCMailFileReader.py +412 -0
- MEDCouplingCompat.py +221 -0
- MEDCouplingRemapper.py +407 -4
- MEDLoader.py +267 -0
- MEDLoaderFinalize.py +626 -12
- MEDLoaderSplitter.py +141 -100
- MEDRenumber.py +221 -0
- VTKReader.py +314 -151
- _MEDCouplingCompat.pyd +0 -0
- _MEDCouplingRemapper.pyd +0 -0
- _MEDLoader.pyd +0 -0
- _MEDPartitioner.pyd +0 -0
- _MEDRenumber.pyd +0 -0
- _medcoupling.pyd +0 -0
- geom2medcoupling.py +34 -17
- hdf5.dll +0 -0
- interpkernel.dll +0 -0
- libxml2.dll +0 -0
- medC.dll +0 -0
- {medcoupling-9.13.0.dist-info → medcoupling-9.15.0.dist-info}/METADATA +12 -17
- medcoupling-9.15.0.dist-info/RECORD +31 -0
- medcoupling.dll +0 -0
- medcoupling.py +467 -4
- medcouplingremapper.dll +0 -0
- medicoco.dll +0 -0
- medloader.dll +0 -0
- medpartitionercpp.dll +0 -0
- renumbercpp.dll +0 -0
- vtk2medcoupling.py +273 -17
- medcoupling-9.13.0.dist-info/RECORD +0 -30
- {medcoupling-9.13.0.dist-info → medcoupling-9.15.0.dist-info}/WHEEL +0 -0
VTKReader.py
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# -*- coding: iso-8859-1 -*-
|
2
|
-
# Copyright (C) 2007-
|
2
|
+
# Copyright (C) 2007-2025 CEA, EDF
|
3
3
|
#
|
4
4
|
# This library is free software; you can redistribute it and/or
|
5
5
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -21,286 +21,449 @@
|
|
21
21
|
|
22
22
|
from MEDLoader import *
|
23
23
|
|
24
|
+
|
24
25
|
class PVDReader:
|
25
26
|
@classmethod
|
26
|
-
def New(cls,fileName):
|
27
|
-
"""
|
27
|
+
def New(cls, fileName):
|
28
|
+
"""Static constructor."""
|
28
29
|
return PVDReader(fileName)
|
29
30
|
pass
|
30
31
|
|
31
|
-
def __init__(self,fileName):
|
32
|
-
self._fileName=fileName
|
32
|
+
def __init__(self, fileName):
|
33
|
+
self._fileName = fileName
|
33
34
|
pass
|
34
35
|
|
35
36
|
def loadTopInfo(self):
|
36
|
-
fd=open(self._fileName,"r")
|
37
|
+
fd = open(self._fileName, "r")
|
37
38
|
return self.__parseXML(fd)
|
38
39
|
|
39
|
-
def __parseXML(self,fd):
|
40
|
+
def __parseXML(self, fd):
|
40
41
|
import xml.sax
|
42
|
+
|
41
43
|
class PVD_SAX_Reader(xml.sax.ContentHandler):
|
42
44
|
def __init__(self):
|
43
|
-
self._tsteps=[]
|
45
|
+
self._tsteps = []
|
44
46
|
pass
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
47
|
+
|
48
|
+
def startElement(self, name, attrs):
|
49
|
+
if name == "VTKFile":
|
50
|
+
if attrs["type"] != "Collection":
|
51
|
+
raise Exception(
|
52
|
+
"Mismatch between reader (PVD) type and file content !"
|
53
|
+
)
|
49
54
|
return
|
50
|
-
if name=="DataSet":
|
51
|
-
self._tsteps.append((float(attrs["timestep"]),str(attrs["file"])))
|
55
|
+
if name == "DataSet":
|
56
|
+
self._tsteps.append((float(attrs["timestep"]), str(attrs["file"])))
|
52
57
|
return
|
53
58
|
pass
|
59
|
+
|
54
60
|
pass
|
55
|
-
|
56
|
-
|
61
|
+
|
62
|
+
rd = PVD_SAX_Reader()
|
63
|
+
parser = xml.sax.make_parser()
|
57
64
|
parser.setContentHandler(rd)
|
58
65
|
parser.parse(fd)
|
59
66
|
return rd
|
67
|
+
|
60
68
|
pass
|
61
69
|
|
70
|
+
|
62
71
|
class PVTUReader:
|
63
72
|
@classmethod
|
64
|
-
def New(cls,fileName):
|
65
|
-
"""
|
73
|
+
def New(cls, fileName):
|
74
|
+
"""Static constructor."""
|
66
75
|
return PVTUReader(fileName)
|
67
76
|
pass
|
68
77
|
|
69
|
-
def __init__(self,fileName):
|
70
|
-
self._fileName=fileName
|
78
|
+
def __init__(self, fileName):
|
79
|
+
self._fileName = fileName
|
71
80
|
pass
|
72
81
|
|
73
82
|
def loadParaInfo(self):
|
74
|
-
fd=open(self._fileName,"r")
|
83
|
+
fd = open(self._fileName, "r")
|
75
84
|
return self.__parseXML(fd)
|
76
85
|
|
77
|
-
def __parseXML(self,fd):
|
86
|
+
def __parseXML(self, fd):
|
78
87
|
import xml.sax
|
88
|
+
|
79
89
|
class PVTU_SAX_Reader(xml.sax.ContentHandler):
|
80
90
|
def __init__(self):
|
81
|
-
self._data_array={2:self.DAPointData,3:self.DACellData}
|
82
|
-
self._node_fields=[]
|
83
|
-
self._cell_fields=[]
|
84
|
-
self._pfiles=[]
|
85
|
-
self._tmp=None
|
91
|
+
self._data_array = {2: self.DAPointData, 3: self.DACellData}
|
92
|
+
self._node_fields = []
|
93
|
+
self._cell_fields = []
|
94
|
+
self._pfiles = []
|
95
|
+
self._tmp = None
|
86
96
|
pass
|
87
|
-
|
88
|
-
|
97
|
+
|
98
|
+
def DAPointData(self, attrs):
|
99
|
+
self._node_fields.append(
|
100
|
+
(str(attrs["Name"]), int(attrs["NumberOfComponents"]))
|
101
|
+
)
|
89
102
|
pass
|
90
|
-
|
91
|
-
|
103
|
+
|
104
|
+
def DACellData(self, attrs):
|
105
|
+
self._cell_fields.append(
|
106
|
+
(str(attrs["Name"]), int(attrs["NumberOfComponents"]))
|
107
|
+
)
|
92
108
|
pass
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
109
|
+
|
110
|
+
def startElement(self, name, attrs):
|
111
|
+
if name == "VTKFile":
|
112
|
+
if attrs["type"] != "PUnstructuredGrid":
|
113
|
+
raise Exception(
|
114
|
+
"Mismatch between reader (PVTU) type and file content !"
|
115
|
+
)
|
97
116
|
return
|
98
|
-
if name=="Piece":
|
117
|
+
if name == "Piece":
|
99
118
|
self._pfiles.append(str(attrs["Source"]))
|
100
119
|
return
|
101
|
-
if name=="PPointData":
|
102
|
-
self._tmp=2
|
120
|
+
if name == "PPointData":
|
121
|
+
self._tmp = 2
|
103
122
|
return
|
104
|
-
if name=="PCellData":
|
105
|
-
self._tmp=3
|
123
|
+
if name == "PCellData":
|
124
|
+
self._tmp = 3
|
106
125
|
return
|
107
|
-
if name=="PDataArray":
|
126
|
+
if name == "PDataArray":
|
108
127
|
if self._tmp in self._data_array:
|
109
128
|
self._data_array[self._tmp](attrs)
|
110
129
|
pass
|
111
130
|
return
|
112
131
|
pass
|
132
|
+
|
113
133
|
pass
|
114
|
-
|
115
|
-
|
134
|
+
|
135
|
+
rd = PVTU_SAX_Reader()
|
136
|
+
parser = xml.sax.make_parser()
|
116
137
|
parser.setContentHandler(rd)
|
117
138
|
parser.parse(fd)
|
118
139
|
return rd
|
140
|
+
|
119
141
|
pass
|
120
142
|
|
143
|
+
|
121
144
|
class VTURawReader:
|
122
|
-
"""
|
123
|
-
|
124
|
-
VTKTypes_2_MC=[
|
145
|
+
"""Converting a VTU file in raw mode into the MED format."""
|
146
|
+
|
147
|
+
VTKTypes_2_MC = [
|
148
|
+
-1,
|
149
|
+
0,
|
150
|
+
-1,
|
151
|
+
1,
|
152
|
+
33,
|
153
|
+
3,
|
154
|
+
-1,
|
155
|
+
5,
|
156
|
+
-1,
|
157
|
+
4,
|
158
|
+
14,
|
159
|
+
-1,
|
160
|
+
NORM_HEXA8,
|
161
|
+
16,
|
162
|
+
15,
|
163
|
+
-1,
|
164
|
+
22,
|
165
|
+
-1,
|
166
|
+
-1,
|
167
|
+
-1,
|
168
|
+
-1,
|
169
|
+
2,
|
170
|
+
6,
|
171
|
+
8,
|
172
|
+
20,
|
173
|
+
30,
|
174
|
+
25,
|
175
|
+
23,
|
176
|
+
9,
|
177
|
+
27,
|
178
|
+
-1,
|
179
|
+
-1,
|
180
|
+
-1,
|
181
|
+
-1,
|
182
|
+
7,
|
183
|
+
-1,
|
184
|
+
-1,
|
185
|
+
-1,
|
186
|
+
-1,
|
187
|
+
-1,
|
188
|
+
-1,
|
189
|
+
-1,
|
190
|
+
31,
|
191
|
+
]
|
125
192
|
|
126
193
|
class NormalException(Exception):
|
127
|
-
def __init__(self,lineNb):
|
194
|
+
def __init__(self, lineNb):
|
128
195
|
Exception.__init__(self)
|
129
|
-
self._line_nb=lineNb
|
196
|
+
self._line_nb = lineNb
|
197
|
+
|
130
198
|
def getLineNb(self):
|
131
199
|
return self._line_nb
|
200
|
+
|
132
201
|
pass
|
133
|
-
|
202
|
+
|
134
203
|
class NotRawVTUException(Exception):
|
135
204
|
pass
|
136
205
|
|
137
206
|
def loadInMEDFileDS(self):
|
138
207
|
import numpy as np
|
139
|
-
|
140
|
-
|
208
|
+
|
209
|
+
fd = open(self._fileName, "r")
|
210
|
+
ref, rd = self.__parseXML(fd)
|
141
211
|
#
|
142
|
-
ret=MEDFileData()
|
143
|
-
ms=MEDFileMeshes()
|
144
|
-
|
212
|
+
ret = MEDFileData()
|
213
|
+
ms = MEDFileMeshes()
|
214
|
+
ret.setMeshes(ms)
|
215
|
+
fs = MEDFileFields()
|
216
|
+
ret.setFields(fs)
|
145
217
|
#
|
146
|
-
types=np.memmap(
|
147
|
-
|
218
|
+
types = np.memmap(
|
219
|
+
fd,
|
220
|
+
dtype=rd._type_types,
|
221
|
+
mode="r",
|
222
|
+
offset=ref + rd._off_types,
|
223
|
+
shape=(rd._nb_cells,),
|
224
|
+
)
|
225
|
+
types = self.__swapIfNecessary(rd._bo, types)
|
148
226
|
# mesh dimension detection
|
149
|
-
types2=types.copy()
|
150
|
-
|
227
|
+
types2 = types.copy()
|
228
|
+
types2.sort()
|
229
|
+
types2 = np.unique(types2)
|
230
|
+
meshDim = MEDCouplingMesh.GetDimensionOfGeometricType(
|
231
|
+
self.VTKTypes_2_MC[types2[0]]
|
232
|
+
)
|
151
233
|
for typ in types2[1:]:
|
152
|
-
md=MEDCouplingMesh.GetDimensionOfGeometricType(self.VTKTypes_2_MC[typ])
|
153
|
-
if md!=meshDim:
|
234
|
+
md = MEDCouplingMesh.GetDimensionOfGeometricType(self.VTKTypes_2_MC[typ])
|
235
|
+
if md != meshDim:
|
154
236
|
raise Exception("MultiLevel umeshes not managed yet !")
|
155
237
|
pass
|
156
|
-
m=MEDCouplingUMesh("mesh",meshDim)
|
238
|
+
m = MEDCouplingUMesh("mesh", meshDim)
|
157
239
|
# coordinates
|
158
|
-
coo=np.memmap(
|
159
|
-
|
240
|
+
coo = np.memmap(
|
241
|
+
fd,
|
242
|
+
dtype=rd._type_coords,
|
243
|
+
mode="r",
|
244
|
+
offset=ref + rd._off_coords,
|
245
|
+
shape=(rd._nb_nodes * rd._space_dim,),
|
246
|
+
)
|
247
|
+
coo = self.__swapIfNecessary(rd._bo, coo)
|
248
|
+
coo = DataArrayDouble(np.array(coo, dtype="float64"))
|
249
|
+
coo.rearrange(rd._space_dim)
|
160
250
|
m.setCoords(coo)
|
161
251
|
# connectivity
|
162
|
-
offsets=np.memmap(
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
252
|
+
offsets = np.memmap(
|
253
|
+
fd,
|
254
|
+
dtype=rd._type_off,
|
255
|
+
mode="r",
|
256
|
+
offset=ref + rd._off_off,
|
257
|
+
shape=(rd._nb_cells,),
|
258
|
+
)
|
259
|
+
offsets = self.__swapIfNecessary(rd._bo, offsets)
|
260
|
+
connLgth = offsets[-1]
|
261
|
+
offsets2 = DataArrayInt(rd._nb_cells + 1)
|
262
|
+
offsets2.setIJ(0, 0, 0)
|
263
|
+
offsets2[1:] = DataArrayInt(offsets)
|
264
|
+
offsets3 = offsets2.deltaShiftIndex()
|
265
|
+
offsets2 = offsets3.deepCopy()
|
266
|
+
offsets3 += 1
|
267
|
+
offsets3.computeOffsetsFull()
|
268
|
+
offsets = offsets3
|
269
|
+
tmp1 = DataArrayInt(len(offsets2), 2)
|
270
|
+
tmp1[:, 0] = 1
|
271
|
+
tmp1[:, 1] = offsets2
|
272
|
+
tmp1.rearrange(1)
|
273
|
+
tmp1.computeOffsetsFull()
|
274
|
+
tmp1 = DataArrayInt.Range(1, 2 * len(offsets2), 2).buildExplicitArrByRanges(
|
275
|
+
tmp1
|
276
|
+
)
|
277
|
+
conn = np.memmap(
|
278
|
+
fd,
|
279
|
+
dtype=rd._type_conn,
|
280
|
+
mode="r",
|
281
|
+
offset=ref + rd._off_conn,
|
282
|
+
shape=(connLgth,),
|
283
|
+
)
|
284
|
+
conn = self.__swapIfNecessary(rd._bo, conn)
|
285
|
+
types = np.array(types, dtype="int32")
|
286
|
+
types = DataArrayInt(types)
|
287
|
+
types.transformWithIndArr(self.VTKTypes_2_MC)
|
288
|
+
conn2 = DataArrayInt(offsets.back())
|
289
|
+
conn2[offsets[0:-1]] = types
|
290
|
+
conn2[tmp1] = DataArrayInt(conn)
|
291
|
+
m.setConnectivity(conn2, offsets, True)
|
292
|
+
m.checkConsistencyLight()
|
293
|
+
mm = MEDFileUMesh()
|
294
|
+
mm.setMeshAtLevel(0, m)
|
295
|
+
ms.pushMesh(mm)
|
177
296
|
# Fields on nodes and on cells
|
178
|
-
for spatialDisc,nbEnt,fields in [
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
f.
|
187
|
-
|
297
|
+
for spatialDisc, nbEnt, fields in [
|
298
|
+
(ON_NODES, rd._nb_nodes, rd._node_fields),
|
299
|
+
(ON_CELLS, rd._nb_cells, rd._cell_fields),
|
300
|
+
]:
|
301
|
+
for name, typ, nbCompo, off in fields:
|
302
|
+
ff = MEDFileFieldMultiTS()
|
303
|
+
f = MEDCouplingFieldDouble(spatialDisc, ONE_TIME)
|
304
|
+
f.setName(name)
|
305
|
+
f.setMesh(m)
|
306
|
+
vals = np.memmap(
|
307
|
+
fd, dtype=typ, mode="r", offset=ref + off, shape=(nbEnt * nbCompo)
|
308
|
+
)
|
309
|
+
vals = self.__swapIfNecessary(rd._bo, vals)
|
310
|
+
arr = DataArrayDouble(np.array(vals, dtype="float64"))
|
311
|
+
arr.rearrange(nbCompo)
|
312
|
+
f.setArray(arr)
|
313
|
+
f.checkConsistencyLight()
|
314
|
+
f.setTime(self._time[0], self._time[1], 0)
|
188
315
|
ff.appendFieldNoProfileSBT(f)
|
189
316
|
fs.pushField(ff)
|
190
317
|
pass
|
191
318
|
pass
|
192
319
|
return ret
|
193
320
|
|
194
|
-
def __parseXML(self,fd):
|
321
|
+
def __parseXML(self, fd):
|
195
322
|
import xml.sax
|
323
|
+
|
196
324
|
class VTU_SAX_Reader(xml.sax.ContentHandler):
|
197
325
|
def __init__(self):
|
198
|
-
self._loc=None
|
199
|
-
self._data_array={
|
200
|
-
|
201
|
-
|
326
|
+
self._loc = None
|
327
|
+
self._data_array = {
|
328
|
+
0: self.DAPoints,
|
329
|
+
1: self.DACells,
|
330
|
+
2: self.DAPointData,
|
331
|
+
3: self.DACellData,
|
332
|
+
}
|
333
|
+
self._node_fields = []
|
334
|
+
self._cell_fields = []
|
202
335
|
pass
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
self.
|
336
|
+
|
337
|
+
def setLocator(self, loc):
|
338
|
+
self._loc = loc
|
339
|
+
|
340
|
+
def DAPoints(self, attrs):
|
341
|
+
self._space_dim = int(attrs["NumberOfComponents"])
|
342
|
+
self._type_coords = str(attrs["type"]).lower()
|
343
|
+
self._off_coords = int(attrs["offset"])
|
209
344
|
pass
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
self.
|
345
|
+
|
346
|
+
def DACells(self, attrs):
|
347
|
+
if attrs["Name"] == "connectivity":
|
348
|
+
self._type_conn = str(attrs["type"]).lower()
|
349
|
+
self._off_conn = int(attrs["offset"])
|
214
350
|
pass
|
215
|
-
if attrs["Name"]=="offsets":
|
216
|
-
self._type_off=str(attrs["type"]).lower()
|
217
|
-
self._off_off=int(attrs["offset"])
|
351
|
+
if attrs["Name"] == "offsets":
|
352
|
+
self._type_off = str(attrs["type"]).lower()
|
353
|
+
self._off_off = int(attrs["offset"])
|
218
354
|
pass
|
219
|
-
if attrs["Name"]=="types":
|
220
|
-
self._type_types=str(attrs["type"]).lower()
|
221
|
-
self._off_types=int(attrs["offset"])
|
355
|
+
if attrs["Name"] == "types":
|
356
|
+
self._type_types = str(attrs["type"]).lower()
|
357
|
+
self._off_types = int(attrs["offset"])
|
222
358
|
pass
|
223
359
|
pass
|
224
|
-
|
225
|
-
|
360
|
+
|
361
|
+
def DAPointData(self, attrs):
|
362
|
+
self._node_fields.append(
|
363
|
+
(
|
364
|
+
str(attrs["Name"]),
|
365
|
+
str(attrs["type"]).lower(),
|
366
|
+
int(attrs["NumberOfComponents"]),
|
367
|
+
int(attrs["offset"]),
|
368
|
+
)
|
369
|
+
)
|
226
370
|
pass
|
227
|
-
|
228
|
-
|
371
|
+
|
372
|
+
def DACellData(self, attrs):
|
373
|
+
self._cell_fields.append(
|
374
|
+
(
|
375
|
+
str(attrs["Name"]),
|
376
|
+
str(attrs["type"]).lower(),
|
377
|
+
int(attrs["NumberOfComponents"]),
|
378
|
+
int(attrs["offset"]),
|
379
|
+
)
|
380
|
+
)
|
229
381
|
pass
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
382
|
+
|
383
|
+
def startElement(self, name, attrs):
|
384
|
+
if name == "VTKFile":
|
385
|
+
if attrs["type"] != "UnstructuredGrid":
|
386
|
+
raise Exception(
|
387
|
+
"Mismatch between reader (VTU) type and file content !"
|
388
|
+
)
|
389
|
+
self._bo = bool(
|
390
|
+
["LittleEndian", "BigEndian"].index(attrs["byte_order"])
|
391
|
+
)
|
235
392
|
pass
|
236
|
-
if name=="Piece":
|
237
|
-
self._nb_cells=int(attrs["NumberOfCells"])
|
238
|
-
self._nb_nodes=int(attrs["NumberOfPoints"])
|
393
|
+
if name == "Piece":
|
394
|
+
self._nb_cells = int(attrs["NumberOfCells"])
|
395
|
+
self._nb_nodes = int(attrs["NumberOfPoints"])
|
239
396
|
return
|
240
|
-
if name=="Points":
|
241
|
-
self._tmp=0
|
397
|
+
if name == "Points":
|
398
|
+
self._tmp = 0
|
242
399
|
return
|
243
|
-
if name=="Cells":
|
244
|
-
self._tmp=1
|
400
|
+
if name == "Cells":
|
401
|
+
self._tmp = 1
|
245
402
|
return
|
246
|
-
if name=="PointData":
|
247
|
-
self._tmp=2
|
403
|
+
if name == "PointData":
|
404
|
+
self._tmp = 2
|
248
405
|
return
|
249
|
-
if name=="CellData":
|
250
|
-
self._tmp=3
|
406
|
+
if name == "CellData":
|
407
|
+
self._tmp = 3
|
251
408
|
return
|
252
|
-
if name=="DataArray":
|
409
|
+
if name == "DataArray":
|
253
410
|
self._data_array[self._tmp](attrs)
|
254
411
|
return
|
255
|
-
if name=="AppendedData":
|
256
|
-
if str(attrs["encoding"])=="raw":
|
412
|
+
if name == "AppendedData":
|
413
|
+
if str(attrs["encoding"]) == "raw":
|
257
414
|
raise VTURawReader.NormalException(self._loc.getLineNumber())
|
258
415
|
else:
|
259
|
-
raise VTURawReader.NotRawVTUException(
|
416
|
+
raise VTURawReader.NotRawVTUException(
|
417
|
+
"The file is not a raw VTU ! Change reader !"
|
418
|
+
)
|
260
419
|
pass
|
420
|
+
|
261
421
|
pass
|
262
|
-
|
263
|
-
|
422
|
+
|
423
|
+
rd = VTU_SAX_Reader()
|
424
|
+
parser = xml.sax.make_parser()
|
264
425
|
parser.setContentHandler(rd)
|
265
|
-
locator=xml.sax.expatreader.ExpatLocator(parser)
|
426
|
+
locator = xml.sax.expatreader.ExpatLocator(parser)
|
266
427
|
rd.setLocator(locator)
|
267
|
-
isOK=False
|
428
|
+
isOK = False
|
268
429
|
try:
|
269
430
|
parser.parse(fd)
|
270
431
|
except self.NormalException as e:
|
271
|
-
isOK=True
|
432
|
+
isOK = True
|
272
433
|
fd.seek(0)
|
273
|
-
for i in range(e.getLineNb()):
|
274
|
-
|
434
|
+
for i in range(e.getLineNb()):
|
435
|
+
fd.readline()
|
436
|
+
ref = fd.tell() + 5
|
275
437
|
pass
|
276
438
|
if not isOK:
|
277
439
|
raise Exception("Error in VTURawReader : not a raw format ?")
|
278
|
-
return ref,rd
|
440
|
+
return ref, rd
|
279
441
|
|
280
442
|
@classmethod
|
281
|
-
def New(cls,fileName,tim=(0
|
282
|
-
"""
|
283
|
-
return VTURawReader(fileName,tim)
|
443
|
+
def New(cls, fileName, tim=(0.0, 0)):
|
444
|
+
"""Static constructor."""
|
445
|
+
return VTURawReader(fileName, tim)
|
284
446
|
pass
|
285
447
|
|
286
|
-
def __init__(self,fileName,tim=(0
|
287
|
-
msg="The time specified in constructor as 2nd arg should be a tuple containing 2 values 1 float and 1 int !"
|
448
|
+
def __init__(self, fileName, tim=(0.0, 0)):
|
449
|
+
msg = "The time specified in constructor as 2nd arg should be a tuple containing 2 values 1 float and 1 int !"
|
288
450
|
if not isinstance(tim, tuple):
|
289
451
|
raise Exception(msg)
|
290
|
-
if len(tim)!=2:
|
452
|
+
if len(tim) != 2:
|
291
453
|
raise Exception(msg)
|
292
454
|
if not isinstance(tim[0], float) or not isinstance(tim[1], int):
|
293
455
|
raise Exception(msg)
|
294
|
-
self._fileName=fileName
|
295
|
-
self._time=tim
|
456
|
+
self._fileName = fileName
|
457
|
+
self._time = tim
|
296
458
|
pass
|
297
459
|
|
298
|
-
def __swapIfNecessary(self,b,arr):
|
460
|
+
def __swapIfNecessary(self, b, arr):
|
299
461
|
if b:
|
300
|
-
ret=arr.copy()
|
462
|
+
ret = arr.copy()
|
301
463
|
ret.byteswap(True)
|
302
464
|
return ret
|
303
465
|
else:
|
304
466
|
return arr
|
305
467
|
pass
|
468
|
+
|
306
469
|
pass
|
_MEDCouplingCompat.pyd
CHANGED
Binary file
|
_MEDCouplingRemapper.pyd
CHANGED
Binary file
|
_MEDLoader.pyd
CHANGED
Binary file
|
_MEDPartitioner.pyd
CHANGED
Binary file
|
_MEDRenumber.pyd
CHANGED
Binary file
|
_medcoupling.pyd
CHANGED
Binary file
|