medcoupling 9.13.0__cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.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 +31 -0
- CaseReader.py +424 -0
- CaseWriter.py +349 -0
- MEDCoupling.py +15020 -0
- MEDCouplingRemapper.py +15491 -0
- MEDLoader.py +21994 -0
- MEDLoaderFinalize.py +66 -0
- MEDLoaderSplitter.py +199 -0
- MEDPartitioner.py +163 -0
- MEDRenumber.py +14946 -0
- VTKReader.py +306 -0
- _MEDCoupling.so +0 -0
- _MEDCouplingRemapper.so +0 -0
- _MEDLoader.so +0 -0
- _MEDPartitioner.so +0 -0
- _MEDRenumber.so +0 -0
- _medcoupling.so +0 -0
- geom2medcoupling.py +99 -0
- medcoupling-9.13.0.dist-info/METADATA +45 -0
- medcoupling-9.13.0.dist-info/RECORD +37 -0
- medcoupling-9.13.0.dist-info/WHEEL +6 -0
- medcoupling.libs/libgfortran-040039e1.so.5.0.0 +0 -0
- medcoupling.libs/libhdf5-1c824725.so.103.0.0 +0 -0
- medcoupling.libs/libinterpkernel-71542653.so +0 -0
- medcoupling.libs/libmedC-33a5e5d1.so.11.1.1 +0 -0
- medcoupling.libs/libmedcoupling-837c78c0.so +0 -0
- medcoupling.libs/libmedcouplingremapper-9bb9d18f.so +0 -0
- medcoupling.libs/libmedfwrap-292e4f7f.so.11.1.1 +0 -0
- medcoupling.libs/libmedicoco-ba7f6be6.so +0 -0
- medcoupling.libs/libmedloader-deccdcc9.so +0 -0
- medcoupling.libs/libmedpartitionercpp-c7f41708.so +0 -0
- medcoupling.libs/libmetis-ace54c0c.so +0 -0
- medcoupling.libs/libquadmath-96973f99.so.0.0.0 +0 -0
- medcoupling.libs/librenumbercpp-8a16a450.so +0 -0
- medcoupling.libs/libxml2-e666f9db.so.2.10.3 +0 -0
- medcoupling.py +22874 -0
- vtk2medcoupling.py +72 -0
VTKReader.py
ADDED
@@ -0,0 +1,306 @@
|
|
1
|
+
# -*- coding: iso-8859-1 -*-
|
2
|
+
# Copyright (C) 2007-2024 CEA, EDF
|
3
|
+
#
|
4
|
+
# This library is free software; you can redistribute it and/or
|
5
|
+
# modify it under the terms of the GNU Lesser General Public
|
6
|
+
# License as published by the Free Software Foundation; either
|
7
|
+
# version 2.1 of the License, or (at your option) any later version.
|
8
|
+
#
|
9
|
+
# This library is distributed in the hope that it will be useful,
|
10
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
11
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
12
|
+
# Lesser General Public License for more details.
|
13
|
+
#
|
14
|
+
# You should have received a copy of the GNU Lesser General Public
|
15
|
+
# License along with this library; if not, write to the Free Software
|
16
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
17
|
+
#
|
18
|
+
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
19
|
+
#
|
20
|
+
# Author : Anthony GEAY (CEA/DEN/DM2S/STMF)
|
21
|
+
|
22
|
+
from MEDLoader import *
|
23
|
+
|
24
|
+
class PVDReader:
|
25
|
+
@classmethod
|
26
|
+
def New(cls,fileName):
|
27
|
+
""" Static constructor. """
|
28
|
+
return PVDReader(fileName)
|
29
|
+
pass
|
30
|
+
|
31
|
+
def __init__(self,fileName):
|
32
|
+
self._fileName=fileName
|
33
|
+
pass
|
34
|
+
|
35
|
+
def loadTopInfo(self):
|
36
|
+
fd=open(self._fileName,"r")
|
37
|
+
return self.__parseXML(fd)
|
38
|
+
|
39
|
+
def __parseXML(self,fd):
|
40
|
+
import xml.sax
|
41
|
+
class PVD_SAX_Reader(xml.sax.ContentHandler):
|
42
|
+
def __init__(self):
|
43
|
+
self._tsteps=[]
|
44
|
+
pass
|
45
|
+
def startElement(self,name,attrs):
|
46
|
+
if name=="VTKFile":
|
47
|
+
if attrs["type"]!="Collection":
|
48
|
+
raise Exception("Mismatch between reader (PVD) type and file content !")
|
49
|
+
return
|
50
|
+
if name=="DataSet":
|
51
|
+
self._tsteps.append((float(attrs["timestep"]),str(attrs["file"])))
|
52
|
+
return
|
53
|
+
pass
|
54
|
+
pass
|
55
|
+
rd=PVD_SAX_Reader()
|
56
|
+
parser=xml.sax.make_parser()
|
57
|
+
parser.setContentHandler(rd)
|
58
|
+
parser.parse(fd)
|
59
|
+
return rd
|
60
|
+
pass
|
61
|
+
|
62
|
+
class PVTUReader:
|
63
|
+
@classmethod
|
64
|
+
def New(cls,fileName):
|
65
|
+
""" Static constructor. """
|
66
|
+
return PVTUReader(fileName)
|
67
|
+
pass
|
68
|
+
|
69
|
+
def __init__(self,fileName):
|
70
|
+
self._fileName=fileName
|
71
|
+
pass
|
72
|
+
|
73
|
+
def loadParaInfo(self):
|
74
|
+
fd=open(self._fileName,"r")
|
75
|
+
return self.__parseXML(fd)
|
76
|
+
|
77
|
+
def __parseXML(self,fd):
|
78
|
+
import xml.sax
|
79
|
+
class PVTU_SAX_Reader(xml.sax.ContentHandler):
|
80
|
+
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
|
86
|
+
pass
|
87
|
+
def DAPointData(self,attrs):
|
88
|
+
self._node_fields.append((str(attrs["Name"]),int(attrs["NumberOfComponents"])))
|
89
|
+
pass
|
90
|
+
def DACellData(self,attrs):
|
91
|
+
self._cell_fields.append((str(attrs["Name"]),int(attrs["NumberOfComponents"])))
|
92
|
+
pass
|
93
|
+
def startElement(self,name,attrs):
|
94
|
+
if name=="VTKFile":
|
95
|
+
if attrs["type"]!="PUnstructuredGrid":
|
96
|
+
raise Exception("Mismatch between reader (PVTU) type and file content !")
|
97
|
+
return
|
98
|
+
if name=="Piece":
|
99
|
+
self._pfiles.append(str(attrs["Source"]))
|
100
|
+
return
|
101
|
+
if name=="PPointData":
|
102
|
+
self._tmp=2
|
103
|
+
return
|
104
|
+
if name=="PCellData":
|
105
|
+
self._tmp=3
|
106
|
+
return
|
107
|
+
if name=="PDataArray":
|
108
|
+
if self._tmp in self._data_array:
|
109
|
+
self._data_array[self._tmp](attrs)
|
110
|
+
pass
|
111
|
+
return
|
112
|
+
pass
|
113
|
+
pass
|
114
|
+
rd=PVTU_SAX_Reader()
|
115
|
+
parser=xml.sax.make_parser()
|
116
|
+
parser.setContentHandler(rd)
|
117
|
+
parser.parse(fd)
|
118
|
+
return rd
|
119
|
+
pass
|
120
|
+
|
121
|
+
class VTURawReader:
|
122
|
+
""" Converting a VTU file in raw mode into the MED format.
|
123
|
+
"""
|
124
|
+
VTKTypes_2_MC=[-1,0,-1,1,33,3,-1,5,-1,4,14,-1,NORM_HEXA8,16,15,-1,22,-1,-1,-1,-1,2,6,8,20,30,25,23,9,27,-1,-1,-1,-1,7,-1,-1,-1,-1,-1,-1,-1,31]
|
125
|
+
|
126
|
+
class NormalException(Exception):
|
127
|
+
def __init__(self,lineNb):
|
128
|
+
Exception.__init__(self)
|
129
|
+
self._line_nb=lineNb
|
130
|
+
def getLineNb(self):
|
131
|
+
return self._line_nb
|
132
|
+
pass
|
133
|
+
|
134
|
+
class NotRawVTUException(Exception):
|
135
|
+
pass
|
136
|
+
|
137
|
+
def loadInMEDFileDS(self):
|
138
|
+
import numpy as np
|
139
|
+
fd=open(self._fileName,"r")
|
140
|
+
ref,rd=self.__parseXML(fd)
|
141
|
+
#
|
142
|
+
ret=MEDFileData()
|
143
|
+
ms=MEDFileMeshes() ; ret.setMeshes(ms)
|
144
|
+
fs=MEDFileFields() ; ret.setFields(fs)
|
145
|
+
#
|
146
|
+
types=np.memmap(fd,dtype=rd._type_types,mode='r',offset=ref+rd._off_types,shape=(rd._nb_cells,))
|
147
|
+
types=self.__swapIfNecessary(rd._bo,types)
|
148
|
+
# mesh dimension detection
|
149
|
+
types2=types.copy() ; types2.sort() ; types2=np.unique(types2)
|
150
|
+
meshDim=MEDCouplingMesh.GetDimensionOfGeometricType(self.VTKTypes_2_MC[types2[0]])
|
151
|
+
for typ in types2[1:]:
|
152
|
+
md=MEDCouplingMesh.GetDimensionOfGeometricType(self.VTKTypes_2_MC[typ])
|
153
|
+
if md!=meshDim:
|
154
|
+
raise Exception("MultiLevel umeshes not managed yet !")
|
155
|
+
pass
|
156
|
+
m=MEDCouplingUMesh("mesh",meshDim)
|
157
|
+
# coordinates
|
158
|
+
coo=np.memmap(fd,dtype=rd._type_coords,mode='r',offset=ref+rd._off_coords,shape=(rd._nb_nodes*rd._space_dim,))
|
159
|
+
coo=self.__swapIfNecessary(rd._bo,coo) ; coo=DataArrayDouble(np.array(coo,dtype='float64')) ; coo.rearrange(rd._space_dim)
|
160
|
+
m.setCoords(coo)
|
161
|
+
# connectivity
|
162
|
+
offsets=np.memmap(fd,dtype=rd._type_off,mode='r',offset=ref+rd._off_off,shape=(rd._nb_cells,))
|
163
|
+
offsets=self.__swapIfNecessary(rd._bo,offsets) ; connLgth=offsets[-1] ; offsets2=DataArrayInt(rd._nb_cells+1) ; offsets2.setIJ(0,0,0)
|
164
|
+
offsets2[1:]=DataArrayInt(offsets)
|
165
|
+
offsets3=offsets2.deltaShiftIndex() ; offsets2=offsets3.deepCopy() ; offsets3+=1 ; offsets3.computeOffsetsFull()
|
166
|
+
offsets=offsets3
|
167
|
+
tmp1=DataArrayInt(len(offsets2),2) ; tmp1[:,0]=1 ; tmp1[:,1]=offsets2 ; tmp1.rearrange(1) ; tmp1.computeOffsetsFull()
|
168
|
+
tmp1=DataArrayInt.Range(1,2*len(offsets2),2).buildExplicitArrByRanges(tmp1)
|
169
|
+
conn=np.memmap(fd,dtype=rd._type_conn,mode='r',offset=ref+rd._off_conn,shape=(connLgth,))
|
170
|
+
conn=self.__swapIfNecessary(rd._bo,conn)
|
171
|
+
types=np.array(types,dtype='int32') ; types=DataArrayInt(types) ; types.transformWithIndArr(self.VTKTypes_2_MC)
|
172
|
+
conn2=DataArrayInt(offsets.back())
|
173
|
+
conn2[offsets[0:-1]]=types
|
174
|
+
conn2[tmp1]=DataArrayInt(conn)
|
175
|
+
m.setConnectivity(conn2,offsets,True)
|
176
|
+
m.checkConsistencyLight() ; mm=MEDFileUMesh() ; mm.setMeshAtLevel(0,m) ; ms.pushMesh(mm)
|
177
|
+
# Fields on nodes and on cells
|
178
|
+
for spatialDisc,nbEnt,fields in [(ON_NODES,rd._nb_nodes,rd._node_fields),(ON_CELLS,rd._nb_cells,rd._cell_fields)]:
|
179
|
+
for name,typ,nbCompo,off in fields:
|
180
|
+
ff=MEDFileFieldMultiTS()
|
181
|
+
f=MEDCouplingFieldDouble(spatialDisc,ONE_TIME)
|
182
|
+
f.setName(name) ; f.setMesh(m)
|
183
|
+
vals=np.memmap(fd,dtype=typ,mode='r',offset=ref+off,shape=(nbEnt*nbCompo))
|
184
|
+
vals=self.__swapIfNecessary(rd._bo,vals)
|
185
|
+
arr=DataArrayDouble(np.array(vals,dtype='float64')) ; arr.rearrange(nbCompo)
|
186
|
+
f.setArray(arr) ; f.checkConsistencyLight()
|
187
|
+
f.setTime(self._time[0],self._time[1],0)
|
188
|
+
ff.appendFieldNoProfileSBT(f)
|
189
|
+
fs.pushField(ff)
|
190
|
+
pass
|
191
|
+
pass
|
192
|
+
return ret
|
193
|
+
|
194
|
+
def __parseXML(self,fd):
|
195
|
+
import xml.sax
|
196
|
+
class VTU_SAX_Reader(xml.sax.ContentHandler):
|
197
|
+
def __init__(self):
|
198
|
+
self._loc=None
|
199
|
+
self._data_array={0:self.DAPoints,1:self.DACells,2:self.DAPointData,3:self.DACellData}
|
200
|
+
self._node_fields=[]
|
201
|
+
self._cell_fields=[]
|
202
|
+
pass
|
203
|
+
def setLocator(self,loc):
|
204
|
+
self._loc=loc
|
205
|
+
def DAPoints(self,attrs):
|
206
|
+
self._space_dim=int(attrs["NumberOfComponents"])
|
207
|
+
self._type_coords=str(attrs["type"]).lower()
|
208
|
+
self._off_coords=int(attrs["offset"])
|
209
|
+
pass
|
210
|
+
def DACells(self,attrs):
|
211
|
+
if attrs["Name"]=="connectivity":
|
212
|
+
self._type_conn=str(attrs["type"]).lower()
|
213
|
+
self._off_conn=int(attrs["offset"])
|
214
|
+
pass
|
215
|
+
if attrs["Name"]=="offsets":
|
216
|
+
self._type_off=str(attrs["type"]).lower()
|
217
|
+
self._off_off=int(attrs["offset"])
|
218
|
+
pass
|
219
|
+
if attrs["Name"]=="types":
|
220
|
+
self._type_types=str(attrs["type"]).lower()
|
221
|
+
self._off_types=int(attrs["offset"])
|
222
|
+
pass
|
223
|
+
pass
|
224
|
+
def DAPointData(self,attrs):
|
225
|
+
self._node_fields.append((str(attrs["Name"]),str(attrs["type"]).lower(),int(attrs["NumberOfComponents"]),int(attrs["offset"])))
|
226
|
+
pass
|
227
|
+
def DACellData(self,attrs):
|
228
|
+
self._cell_fields.append((str(attrs["Name"]),str(attrs["type"]).lower(),int(attrs["NumberOfComponents"]),int(attrs["offset"])))
|
229
|
+
pass
|
230
|
+
def startElement(self,name,attrs):
|
231
|
+
if name=="VTKFile":
|
232
|
+
if attrs["type"]!="UnstructuredGrid":
|
233
|
+
raise Exception("Mismatch between reader (VTU) type and file content !")
|
234
|
+
self._bo=bool(["LittleEndian","BigEndian"].index(attrs["byte_order"]))
|
235
|
+
pass
|
236
|
+
if name=="Piece":
|
237
|
+
self._nb_cells=int(attrs["NumberOfCells"])
|
238
|
+
self._nb_nodes=int(attrs["NumberOfPoints"])
|
239
|
+
return
|
240
|
+
if name=="Points":
|
241
|
+
self._tmp=0
|
242
|
+
return
|
243
|
+
if name=="Cells":
|
244
|
+
self._tmp=1
|
245
|
+
return
|
246
|
+
if name=="PointData":
|
247
|
+
self._tmp=2
|
248
|
+
return
|
249
|
+
if name=="CellData":
|
250
|
+
self._tmp=3
|
251
|
+
return
|
252
|
+
if name=="DataArray":
|
253
|
+
self._data_array[self._tmp](attrs)
|
254
|
+
return
|
255
|
+
if name=="AppendedData":
|
256
|
+
if str(attrs["encoding"])=="raw":
|
257
|
+
raise VTURawReader.NormalException(self._loc.getLineNumber())
|
258
|
+
else:
|
259
|
+
raise VTURawReader.NotRawVTUException("The file is not a raw VTU ! Change reader !")
|
260
|
+
pass
|
261
|
+
pass
|
262
|
+
rd=VTU_SAX_Reader()
|
263
|
+
parser=xml.sax.make_parser()
|
264
|
+
parser.setContentHandler(rd)
|
265
|
+
locator=xml.sax.expatreader.ExpatLocator(parser)
|
266
|
+
rd.setLocator(locator)
|
267
|
+
isOK=False
|
268
|
+
try:
|
269
|
+
parser.parse(fd)
|
270
|
+
except self.NormalException as e:
|
271
|
+
isOK=True
|
272
|
+
fd.seek(0)
|
273
|
+
for i in range(e.getLineNb()): fd.readline()
|
274
|
+
ref=fd.tell()+5
|
275
|
+
pass
|
276
|
+
if not isOK:
|
277
|
+
raise Exception("Error in VTURawReader : not a raw format ?")
|
278
|
+
return ref,rd
|
279
|
+
|
280
|
+
@classmethod
|
281
|
+
def New(cls,fileName,tim=(0.,0)):
|
282
|
+
""" Static constructor. """
|
283
|
+
return VTURawReader(fileName,tim)
|
284
|
+
pass
|
285
|
+
|
286
|
+
def __init__(self,fileName,tim=(0.,0)):
|
287
|
+
msg="The time specified in constructor as 2nd arg should be a tuple containing 2 values 1 float and 1 int !"
|
288
|
+
if not isinstance(tim, tuple):
|
289
|
+
raise Exception(msg)
|
290
|
+
if len(tim)!=2:
|
291
|
+
raise Exception(msg)
|
292
|
+
if not isinstance(tim[0], float) or not isinstance(tim[1], int):
|
293
|
+
raise Exception(msg)
|
294
|
+
self._fileName=fileName
|
295
|
+
self._time=tim
|
296
|
+
pass
|
297
|
+
|
298
|
+
def __swapIfNecessary(self,b,arr):
|
299
|
+
if b:
|
300
|
+
ret=arr.copy()
|
301
|
+
ret.byteswap(True)
|
302
|
+
return ret
|
303
|
+
else:
|
304
|
+
return arr
|
305
|
+
pass
|
306
|
+
pass
|
_MEDCoupling.so
ADDED
Binary file
|
_MEDCouplingRemapper.so
ADDED
Binary file
|
_MEDLoader.so
ADDED
Binary file
|
_MEDPartitioner.so
ADDED
Binary file
|
_MEDRenumber.so
ADDED
Binary file
|
_medcoupling.so
ADDED
Binary file
|
geom2medcoupling.py
ADDED
@@ -0,0 +1,99 @@
|
|
1
|
+
#! /usr/bin/env python3
|
2
|
+
# -*- coding: utf-8 -*-
|
3
|
+
# Copyright (C) 2021-2024 CEA, EDF
|
4
|
+
#
|
5
|
+
# This library is free software; you can redistribute it and/or
|
6
|
+
# modify it under the terms of the GNU Lesser General Public
|
7
|
+
# License as published by the Free Software Foundation; either
|
8
|
+
# version 2.1 of the License, or (at your option) any later version.
|
9
|
+
#
|
10
|
+
# This library is distributed in the hope that it will be useful,
|
11
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
13
|
+
# Lesser General Public License for more details.
|
14
|
+
#
|
15
|
+
# You should have received a copy of the GNU Lesser General Public
|
16
|
+
# License along with this library; if not, write to the Free Software
|
17
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
18
|
+
#
|
19
|
+
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
20
|
+
#
|
21
|
+
# Author : Anthony GEAY (EDF R&D)
|
22
|
+
|
23
|
+
import medcoupling as mc
|
24
|
+
|
25
|
+
def __to_geomshape_3D(mcmesh):
|
26
|
+
"""
|
27
|
+
Precondition mcmesh is a MEDCouplingUMesh containing exactly one linear 3D cell.
|
28
|
+
"""
|
29
|
+
import salome
|
30
|
+
salome.standalone()
|
31
|
+
salome.salome_init()
|
32
|
+
import GEOM
|
33
|
+
from salome.geom import geomBuilder
|
34
|
+
geompy = geomBuilder.New()
|
35
|
+
|
36
|
+
mcmesh2 = mcmesh.deepCopyConnectivityOnly()
|
37
|
+
vertices = [ geompy.MakeVertex(*list(elt)) for elt in mcmesh2.getCoords()]
|
38
|
+
|
39
|
+
mcfaces = mcmesh2.buildDescendingConnectivity()[0]
|
40
|
+
shell_1 = geompy.MakeShell(
|
41
|
+
[
|
42
|
+
geompy.MakeFaceWires(
|
43
|
+
[
|
44
|
+
geompy.MakePolyline([ vertices[nodeidx] for nodeidx in elt.getAllConn()[1:] ], True)
|
45
|
+
]
|
46
|
+
, 1
|
47
|
+
)
|
48
|
+
for elt in mcfaces ]
|
49
|
+
)
|
50
|
+
return geompy.MakeSolid([shell_1])
|
51
|
+
|
52
|
+
def to_geomshape(mcmesh):
|
53
|
+
"""
|
54
|
+
Method converting a unique 3D linear cell in a MEDCoupling mesh to GEOM Shape solid
|
55
|
+
|
56
|
+
:param mcmesh: Mesh with single 3D linear cell.
|
57
|
+
:type mcmesh: mc.MEDCouplingUMesh
|
58
|
+
:return: GEOM shape
|
59
|
+
:rtype: GEOM_Object
|
60
|
+
"""
|
61
|
+
if not isinstance(mcmesh,mc.MEDCouplingUMesh):
|
62
|
+
raise RuntimeError("Input mesh is expected to be of type mc.MEDCouplingUMesh !")
|
63
|
+
if mcmesh.getNumberOfCells() != 1:
|
64
|
+
raise RuntimeError("Input mesh is expected to contain exactly one cell !")
|
65
|
+
if not mc.MEDCouplingUMesh.IsLinearGeometricType( mc.MEDCoupling1SGTUMesh(mcmesh).getCellModelEnum() ) :
|
66
|
+
raise RuntimeError("The unique cell in the mesh is expected to be linear !")
|
67
|
+
dico = { 3 : __to_geomshape_3D }
|
68
|
+
mdim = mcmesh.getMeshDimension()
|
69
|
+
if mdim not in dico:
|
70
|
+
raise RuntimeError( "Input mesh is expected to have mesh dimension in {}".format(list(dico.keys())) )
|
71
|
+
if mcmesh.getSpaceDimension() != 3:
|
72
|
+
mcmesh.changeSpaceDimension(3,0.0)
|
73
|
+
return (dico[mdim])(mcmesh)
|
74
|
+
|
75
|
+
def compute_interpolation_P0P0_matrix_with_geom(srcMesh,trgMesh):
|
76
|
+
"""
|
77
|
+
Method computing interpolation matrix P0P0 using GEOM/OCCT engine.
|
78
|
+
This method is normaly slower than mc.MEDCouplingRemapper.prepare method but it may be used to check values.
|
79
|
+
|
80
|
+
:return: a matrix with the same format than mc.MEDCouplingRemapper.getCrudeMatrix (use mc.MEDCouplingRemapper.ToCSRMatrix to convert it into scipy sparse format)
|
81
|
+
"""
|
82
|
+
mat_geom = [ {} for i in range(trgMesh.getNumberOfCells()) ]
|
83
|
+
for j in range(trgMesh.getNumberOfCells()):
|
84
|
+
for i in range(srcMesh.getNumberOfCells()):
|
85
|
+
mc_src_mesh = srcMesh[i]
|
86
|
+
src_geom = to_geomshape(mc_src_mesh)
|
87
|
+
mc_trg_mesh = trgMesh[j]
|
88
|
+
trg_geom = to_geomshape(mc_trg_mesh)
|
89
|
+
|
90
|
+
from salome.geom import geomBuilder
|
91
|
+
geompy = geomBuilder.New()
|
92
|
+
import GEOM
|
93
|
+
geompy.ExportBREP(src_geom, "src.brep")
|
94
|
+
geompy.ExportBREP(trg_geom, "trg.brep")
|
95
|
+
Common_1 = geompy.MakeCommonList([src_geom, trg_geom], True)
|
96
|
+
_,_,volume = geompy.BasicProperties(Common_1)
|
97
|
+
if volume > 0.:
|
98
|
+
mat_geom[j][i] = volume
|
99
|
+
return mat_geom
|
@@ -0,0 +1,45 @@
|
|
1
|
+
Metadata-Version: 1.2
|
2
|
+
Name: medcoupling
|
3
|
+
Version: 9.13.0
|
4
|
+
Summary: Powerful library to manipulate meshes and fields
|
5
|
+
Home-page: https://docs.salome-platform.org/latest/dev/MEDCoupling/developer/index.html
|
6
|
+
Author: EDF R&D
|
7
|
+
Author-email: eric.fayolle@edf.fr
|
8
|
+
License: LGPL
|
9
|
+
Keywords: salome mesh numerical simulation
|
10
|
+
Platform: any
|
11
|
+
Classifier: Development Status :: 5 - Production/Stable
|
12
|
+
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
|
13
|
+
Classifier: Programming Language :: C++
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Physics
|
16
|
+
Classifier: Intended Audience :: Science/Research
|
17
|
+
Requires-Dist: scipy
|
18
|
+
|
19
|
+
|
20
|
+
# MEDCoupling
|
21
|
+
|
22
|
+
[](https://pypi.org/project/medcoupling)
|
23
|
+
https://github.com/jschueller/medcoupling-wheels
|
24
|
+
[](https://github.com/jschueller/medcoupling-wheels/actions/workflows/stable.yml)
|
25
|
+
|
26
|
+
|
27
|
+
MEDCoupling is a powerful library to manipulate meshes and fields from the [SALOME](https://www.salome-platform.org/) platform.
|
28
|
+
|
29
|
+
Refer to the [documentation](https://docs.salome-platform.org/latest/dev/MEDCoupling/developer/index.html).
|
30
|
+
|
31
|
+
## Installation from PyPI
|
32
|
+
|
33
|
+
To install MEDCoupling, you can now simply do
|
34
|
+
|
35
|
+
```
|
36
|
+
pip install -U medcoupling
|
37
|
+
```
|
38
|
+
|
39
|
+
Binary wheels are available for 64-bit Windows (`win_amd64`) and Linux-like platforms (`manylinux2014_x86_64`).
|
40
|
+
|
41
|
+
To ensure that MEDCoupling is well installed, try importing it with:
|
42
|
+
|
43
|
+
```
|
44
|
+
import medcoupling # should not raise error
|
45
|
+
```
|
@@ -0,0 +1,37 @@
|
|
1
|
+
MEDLoader.py,sha256=-FLOJhrBhKJb8KEG_qGdI_DB6zaf434xL9cKhBcjQIM,749459
|
2
|
+
_MEDPartitioner.so,sha256=rqvWSK7AgJnxRZmx9nRVgg2Q0h5mfm2W6uHYlBNUtn8,97857
|
3
|
+
MEDCoupling.py,sha256=j_WY2soH7HhphnsCYpPDWTLeVeHaC2XP4asksWhyPic,509931
|
4
|
+
_MEDCouplingRemapper.so,sha256=z9rmodrjYYFer68x62HoHtlEUg20KA_V1x8ecfJRlhs,5674201
|
5
|
+
CaseIO.py,sha256=BB_-bq1Ht94ewqCjc0VIWNBAdu6Tuht_BM_drGXz35U,1704
|
6
|
+
MEDRenumber.py,sha256=LyKwT0a2jbMTOYB-3hPLSRAmcOJtoZ1cj_I3xRSL2Ak,505417
|
7
|
+
_MEDLoader.so,sha256=VU4WoaTlPIryvAiU1Dsddu2pwPV13fzzN8OlxZ1gu3s,8003289
|
8
|
+
MEDPartitioner.py,sha256=hobviqMFcRteNSQgDAnK2qM_aMjeVSsWalVobNKrR9c,5635
|
9
|
+
vtk2medcoupling.py,sha256=jZ5GzBc750YQjtVFNWKsMKsmzPyohJbqHy1AfhlULKI,2703
|
10
|
+
CaseWriter.py,sha256=aViDtqDBHzZDTOlVi7r_xQJFS30qsVbGGlIX6YC3MZA,16019
|
11
|
+
_MEDRenumber.so,sha256=lG-PEIBWWttTCZEx7D5OEUTXMmKhxdKhuPbpGKr83UA,5564153
|
12
|
+
MEDLoaderSplitter.py,sha256=1tL7UpYpn2bxlAmc1t9TOXfJWid_GdaLIdZfpmR39rw,9158
|
13
|
+
VTKReader.py,sha256=UfcqicvU1IUexPDk_RqenFgFzyMKA12htuKZNosh6Aw,12295
|
14
|
+
_medcoupling.so,sha256=TZuoJm3n9fETOtOH5pROx5-0wRF7hc5kl90eL1j__u0,8218497
|
15
|
+
_MEDCoupling.so,sha256=_OZTwUqTjxp6TueqHVk2qHVCshIxZHucwIGoVmY4KWQ,5547241
|
16
|
+
medcoupling.py,sha256=L4L0Eqz5i3rgwVx_NPthsCU5_QwNW6cNT6ZvSIrqti8,787380
|
17
|
+
geom2medcoupling.py,sha256=fRVN2odT4GnapKYjPlaAdBZkOlMQiLHRYodNNsuddO0,4010
|
18
|
+
MEDLoaderFinalize.py,sha256=6T1n5w30lrEJcDZrfnSx8mN0eocM0fGhCkKTBHRvlXI,2728
|
19
|
+
CaseReader.py,sha256=F7ME-G9iaRFgMyKYo4FO-nO0fnyw1Eeflkc0MvGi8D0,19770
|
20
|
+
MEDCouplingRemapper.py,sha256=MmyEeNKSyV8AdbDbTx5XY02MYEMWgKp80ySumetyclI,548270
|
21
|
+
medcoupling-9.13.0.dist-info/RECORD,,
|
22
|
+
medcoupling-9.13.0.dist-info/METADATA,sha256=DvTOETA7T1iZwEgfyx6z2U4iK-P-9LGXKLsa5BQhGD8,1647
|
23
|
+
medcoupling-9.13.0.dist-info/WHEEL,sha256=jtnYk5S9Zo1kkQy8lGIiYH1bpe4azcMnAVeUSP_xDVQ,138
|
24
|
+
medcoupling.libs/librenumbercpp-8a16a450.so,sha256=kdhXGiZXKbrccn3WVg9yDEOJg75-mdr7zxRG4YRFcLU,84497
|
25
|
+
medcoupling.libs/libmedicoco-ba7f6be6.so,sha256=biCOVrNCbEPd_pzfzgph74YTYzfE7iJxAsJNbW9X1UA,34937
|
26
|
+
medcoupling.libs/libhdf5-1c824725.so.103.0.0,sha256=OQXq7WSq1h_CkwiDLG2mYs-Gwv9tx2H_eMDHmtvUcPE,4322561
|
27
|
+
medcoupling.libs/libmedcouplingremapper-9bb9d18f.so,sha256=Ngq2RFrwvnYUkZcnI41JStl4Gz9VfRzxXmaSaEotAYg,1868961
|
28
|
+
medcoupling.libs/libmedloader-deccdcc9.so,sha256=DjMBfHZT8EysX-e8RvMizqx2VzITOy8U1PIUErEco08,5297457
|
29
|
+
medcoupling.libs/libmetis-ace54c0c.so,sha256=jf3MihOTbkdEKNt3WHnVPk1jfeo7TvrUDURkbUSsl84,640849
|
30
|
+
medcoupling.libs/libmedfwrap-292e4f7f.so.11.1.1,sha256=U_mTsti2FlQ3tql82Dl_3jtMBBVQLNJS_uLAuz1cvUA,274105
|
31
|
+
medcoupling.libs/libmedC-33a5e5d1.so.11.1.1,sha256=FUxXbAGR1hqHqImkOm-l3h7EtxETfa5Q4Kvgf-wYty0,1364401
|
32
|
+
medcoupling.libs/libgfortran-040039e1.so.5.0.0,sha256=FK-zEpsai1C8QKOwggx_EVLqm8EBIaqxUpQ_cFdHKIY,2686065
|
33
|
+
medcoupling.libs/libquadmath-96973f99.so.0.0.0,sha256=k0wi3tDn0WnE1GeIdslgUa3z2UVF2pYvYLQWWbB12js,247609
|
34
|
+
medcoupling.libs/libxml2-e666f9db.so.2.10.3,sha256=OApRLNO_-41N40CuL4-4_ztVkP23V5DwcZjhJHzKMys,6113673
|
35
|
+
medcoupling.libs/libmedcoupling-837c78c0.so,sha256=fH0-OkrMvpHzaUR6HzlGnACsCXat6La-lG4bzn4xPeM,6317145
|
36
|
+
medcoupling.libs/libmedpartitionercpp-c7f41708.so,sha256=LABirFAyG6Ui6bfa2CnKuuEo7clyNhRslP4YzxBdAzE,583265
|
37
|
+
medcoupling.libs/libinterpkernel-71542653.so,sha256=v2xsc4E0XBGooR2Pnisl_eNFEWbvR599cgkrZBa0wlk,1586025
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|