Salome HOME
Join modifications from branch BR_DEBUG_3_2_0b1
[modules/geom.git] / src / GEOM_SWIG / GEOM_Spanner.py
1 #  GEOM GEOM_SWIG : binding of C++ implementaion with Python
2 #
3 #  Copyright (C) 2003  CEA
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.
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 #
22 #
23 #  File   : GEOM_Spanner.py
24 #  Author : Julia DOROVSKIKH
25 #  Module : GEOM
26 #  $Header$
27
28 ############# MakeSpanner #############
29
30 def MakeSpanner (salome, geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None, hasGUI = 0):
31
32   ### Variables ###
33
34   th = 4.0
35
36   ### BlocksOp ###
37
38   BlocksOp = geompy.BlocksOp
39
40   ### Basic points and directions ###
41
42   p0  = geompy.MakeVertex(0., 0., 0.)
43   pth = geompy.MakeVertex(0., 0., th)
44
45   vx = geompy.MakeVectorDXDYDZ(1., 0., 0.)
46   vy = geompy.MakeVectorDXDYDZ(0., 1., 0.)
47   vz = geompy.MakeVectorDXDYDZ(0., 0., 1.)
48
49   vxy = geompy.MakeVectorDXDYDZ(1., 1., 0.)
50
51   ### Block 1 ###
52
53   p_10_0  = geompy.MakeVertex(10.,  0., 0.)
54   p_10_25 = geompy.MakeVertex(10., 25., 0.)
55   p_0_35  = geompy.MakeVertex( 0., 35., 0.)
56   p_0_10  = geompy.MakeVertex( 0., 10., 0.)
57
58   Face11 = geompy.MakeQuad4Vertices(p_10_0, p_10_25, p_0_10, p_0_35);
59   id_face11 = geompy.addToStudy(Face11, "1 Face for Block 1")
60
61   Face12 = geompy.MakeTranslationTwoPoints(Face11, p0, pth)
62   id_face12 = geompy.addToStudy(Face12, "2 Face for Block 1")
63
64   Block1 = geompy.MakeHexa2Faces(Face11, Face12)
65   id_block1 = geompy.addToStudy(Block1, "Block 1")
66
67   ### Block 2 ###
68
69   p_15_0  = geompy.MakeVertex(15.,  0., 0.)
70   p_15_20 = geompy.MakeVertex(15., 20., 0.)
71
72   Edge21 = geompy.MakeEdge(p_15_0, p_15_20)
73   id_edge21 = geompy.addToStudy(Edge21, "1 Edge for Block 2")
74
75   Edge22 = geompy.GetEdge(Block1, p_10_0, p_10_25)
76   id_edge22 = geompy.addToStudy(Edge22, "2 Edge for Block 2")
77
78   Face21 = geompy.MakeQuad2Edges(Edge21, Edge22);
79   id_face21 = geompy.addToStudy(Face21, "1 Face for Block 2")
80
81   Face22 = geompy.MakeTranslationTwoPoints(Face21, p0, pth)
82   id_face22 = geompy.addToStudy(Face22, "2 Face for Block 2")
83
84   Block2 = geompy.MakeHexa2Faces(Face21, Face22)
85   id_block2 = geompy.addToStudy(Block2, "Block 2")
86
87   ### Block 3 ###
88
89   p_15_10_1 = geompy.MakeVertex(15., 10., 1.)
90
91   Face31 = geompy.GetFaceNearPoint(Block2, p_15_10_1)
92   id_face31 = geompy.addToStudy(Face31, "1 Face for Block 3")
93
94   Prism1 = geompy.MakePrismVecH(Face31, vx, 5);
95   id_prism1 = geompy.addToStudy(Prism1, "Prism to be Block 3")
96
97   nbFaces = geompy.ShapesOp.NumberOfFaces(Prism1)
98   if nbFaces == 6:
99     print "Prism 1 is a hexahedral solid"
100   else:
101     print "Prism 1 is not a hexahedral solid"
102
103   Prism1_faces = geompy.SubShapeAllSorted(Prism1, geompy.ShapeType["FACE"])
104   ii = 1
105   for aFace in  Prism1_faces:
106     name = geompy.SubShapeName(aFace, Prism1)
107     Id_Face = geompy.addToStudyInFather(Prism1, aFace, name)
108     ii = ii + 1
109
110   Block3 = geompy.MakeHexa(Prism1_faces[0], Prism1_faces[1],
111                            Prism1_faces[2], Prism1_faces[3],
112                            Prism1_faces[4], Prism1_faces[5]);
113   id_block3 = geompy.addToStudy(Block3, "Block 3")
114
115   ### Block 4 ###
116
117   Face41 = geompy.GetOppositeFace(Block3, Face31)
118   id_face41 = geompy.addToStudy(Face41, "1 Face for Block 4")
119
120   p_25_5  = geompy.MakeVertex(25.,  5., 0.)
121   p_25_20 = geompy.MakeVertex(25., 20., 0.)
122
123   Edge41 = geompy.MakeEdge(p_25_5, p_25_20)
124   id_edge41 = geompy.addToStudy(Edge41, "1 Edge for Block 4")
125
126   p_25_5_2  = geompy.MakeVertex(25.,  5., th)
127   p_25_20_2 = geompy.MakeVertex(25., 20., th)
128
129   Edge42 = geompy.MakeEdge(p_25_5_2, p_25_20_2)
130   id_edge42 = geompy.addToStudy(Edge42, "2 Edge for Block 4")
131
132   Edge43 = geompy.MakeEdge(p_25_5, p_25_5_2)
133   id_edge43 = geompy.addToStudy(Edge43, "3 Edge for Block 4")
134
135   Edge44 = geompy.MakeEdge(p_25_20, p_25_20_2)
136   id_edge44 = geompy.addToStudy(Edge44, "4 Edge for Block 4")
137
138   Face42 = geompy.MakeQuad(Edge41, Edge42, Edge43, Edge44)
139   id_face42 = geompy.addToStudy(Face42, "2 Face for Block 4")
140
141   Block4 = geompy.MakeHexa2Faces(Face41, Face42)
142   id_block4 = geompy.addToStudy(Block4, "Block 4")
143
144   ### Block 5 ###
145
146   p_25_30   = geompy.MakeVertex(25., 30., 0.)
147   p_25_30_1 = geompy.MakeVertex(25., 30., 1)
148   axis_rot = geompy.MakeVector(p_25_30, p_25_30_1)
149
150   Face51 = Face42
151   Face52 = geompy.MakeRotation(Face51, axis_rot, math.pi/2.)
152   id_face52 = geompy.addToStudy(Face52, "2 Face for Block 5")
153
154   Block5 = geompy.MakeHexa2Faces(Face51, Face52)
155   id_block5 = geompy.addToStudy(Block5, "Block 5")
156
157   ### Compound of blocks 1 - 4 ###
158
159   Comp1234 = geompy.MakeCompound([Block1, Block2, Block3, Block4])
160   Glue1234 = geompy.MakeGlueFaces(Comp1234, 1e-5)
161   id_glue1234 = geompy.addToStudy(Glue1234, "Glue 1234")
162
163   plane_mirror = geompy.MakePlane(p_25_30, vxy, 100.)
164   #id_plane_mirror = geompy.addToStudy(plane_mirror, "Plane for mirror")
165
166   Mirror1 = geompy.MakeMirrorByPlane(Glue1234, plane_mirror)
167   id_mirror1 = geompy.addToStudy(Mirror1, "Mirror 1")
168
169   ### The second end ###
170
171   p_18_0 = geompy.MakeVertex(18., 0., 0.)
172   p_20_0 = geompy.MakeVertex(20., 0., 0.)
173   p_40_0 = geompy.MakeVertex(40., 0., 0.)
174
175   Edge1s = geompy.MakeEdge(p_20_0, p_40_0)
176   id_edge1s = geompy.addToStudy(Edge1s, "1 Edge for Block 1s")
177
178   Edge2s = geompy.MakeRotation(Edge1s, vz, math.pi/12.)
179   id_edge2s = geompy.addToStudy(Edge2s, "2 Edge for Block 1s")
180
181   p_18_0_r = geompy.MakeRotation(p_18_0, vz, math.pi/24.)
182   p_20_0_r = geompy.MakeRotation(p_20_0, vz, math.pi/12.)
183   p_40_0_r = geompy.MakeRotation(p_40_0, vz, math.pi/12.)
184
185   Edge3s = geompy.MakeEdge(p_40_0, p_40_0_r)
186   id_edge3s = geompy.addToStudy(Edge3s, "3 Edge for Block 1s")
187
188   Edge4s = geompy.MakeArc(p_20_0, p_18_0_r, p_20_0_r)
189   id_edge4s = geompy.addToStudy(Edge4s, "4 Edge for Block 1s")
190
191   Face1s = geompy.MakeQuad(Edge1s, Edge2s, Edge3s, Edge4s)
192   id_face1s = geompy.addToStudy(Face1s, "1 Face for Block 1s")
193
194   Block1s = geompy.MakePrismVecH(Face1s, vz, th);
195   id_block1s = geompy.addToStudy(Block1s, "Block 1s")
196
197   p_30_0_1 = geompy.MakeVertex(30., 0., 1.)
198
199   Face2s = geompy.GetFaceNearPoint(Block1s, p_30_0_1)
200   id_face2s = geompy.addToStudy(Face2s, "2 Face of Block 1s")
201
202   f2s_ind = geompy.LocalOp.GetSubShapeIndex(Block1s, Face2s)
203
204   Block1s_tr1 = geompy.MakeMultiTransformation1D(Block1s, f2s_ind, 0, 24)
205   id_block1s_tr1 = geompy.addToStudy(Block1s_tr1, "Multi-transformed Block 1s")
206
207   p_60_150_0 = geompy.MakeVertex(60., -150., 0.)
208   Gear = geompy.MakeTranslationTwoPoints(Block1s_tr1, p0, p_60_150_0)
209   id_gear = geompy.addToStudy(Gear, "Gear")
210
211   ### Link two parts ###
212
213   ### Linking Block 1 ###
214
215   p_55_0_1 = geompy.MakeVertex(55., 0., 1.)
216   p_55_110_1 = geompy.MakeVertex(55., -110., 1.)
217
218   Face11l = geompy.GetFaceNearPoint(Block5, p_55_0_1)
219   id_face11l = geompy.addToStudy(Face11l, "1 Face for Linking Block 1")
220
221   Face12l = geompy.GetFaceNearPoint(Gear, p_55_110_1)
222   id_face12l = geompy.addToStudy(Face12l, "2 Face for Linking Block 1")
223
224   Block1l = geompy.MakeHexa2Faces(Face11l, Face12l)
225   id_block1l = geompy.addToStudy(Block1l, "Linking Block 1")
226
227   ### Linking Block 2 ###
228
229   p_25_0_1 = geompy.MakeVertex(25., 0., 1.)
230   p_45_110_1 = geompy.MakeVertex(45., -110., 1.)
231
232   Face21l = geompy.GetFaceNearPoint(Block4, p_25_0_1)
233   id_face21l = geompy.addToStudy(Face21l, "1 Face for Linking Block 2")
234
235   Face22l = geompy.GetFaceNearPoint(Gear, p_45_110_1)
236   id_face22l = geompy.addToStudy(Face22l, "2 Face for Linking Block 2")
237
238   Block2l = geompy.MakeHexa2Faces(Face21l, Face22l)
239   id_block2l = geompy.addToStudy(Block2l, "Linking Block 2")
240
241   ### Linking Block 3 ###
242
243   p_55_30_1 = geompy.MakeVertex(55., 30., 1.)
244   p_65_110_1 = geompy.MakeVertex(65., -110., 1.)
245
246   Face31l = geompy.GetFaceNearPoint(Mirror1, p_55_30_1)
247   id_face31l = geompy.addToStudy(Face31l, "1 Face for Linking Block 3")
248
249   Face32l = geompy.GetFaceNearPoint(Gear, p_65_110_1)
250   id_face32l = geompy.addToStudy(Face32l, "2 Face for Linking Block 3")
251
252   Block3l = geompy.MakeHexa2Faces(Face31l, Face32l)
253   id_block3l = geompy.addToStudy(Block3l, "Linking Block 3")
254
255   ### Handle ###
256
257   CompLB = geompy.MakeCompound([Block1l, Block2l, Block3l])
258   Handle = geompy.MakeGlueFaces(CompLB, 1e-5)
259   id_handle = geompy.addToStudy(Handle, "Handle")
260
261   Block1h = geompy.GetBlockNearPoint(Handle, p_45_110_1)
262   id_block1h = geompy.addToStudyInFather(Handle, Block1h, "Block 1 of Handle")
263
264   Block2h = geompy.GetBlockNearPoint(Handle, p_65_110_1)
265   id_block2h = geompy.addToStudyInFather(Handle, Block2h, "Block 2 of Handle")
266
267   Face11h = geompy.GetFaceByNormale(Block1h, vx)
268   id_face11h = geompy.addToStudyInFather(Block1h, Face11h, "Face 1")
269
270   Face12h = geompy.GetOppositeFace(Block1h, Face11h)
271   id_face12h = geompy.addToStudyInFather(Block1h, Face12h, "Face 2")
272
273   Face21h = geompy.GetFaceByNormale(Block2h, vx)
274   id_face21h = geompy.addToStudyInFather(Block2h, Face21h, "Face 1")
275
276   Face22h = geompy.GetOppositeFace(Block2h, Face21h)
277   id_face22h = geompy.addToStudyInFather(Block2h, Face22h, "Face 2")
278
279   Block3h = BlocksOp.GetBlockByParts(Handle, [Face11h, Face21h])
280   if BlocksOp.IsDone() == 0:
281     Block3h = BlocksOp.GetBlockByParts(Handle, [Face11h, Face22h])
282     if BlocksOp.IsDone() == 0:
283         Block3h = BlocksOp.GetBlockByParts(Handle, [Face12h, Face21h])
284         if BlocksOp.IsDone() == 0:
285             Block3h = BlocksOp.GetBlockByParts(Handle, [Face12h, Face22h])
286   if BlocksOp.IsDone() == 0:
287     print "ERROR: BlocksOp.GetBlockByParts() failed : ", BlocksOp.GetErrorCode()
288   else:
289     id_block3h = geompy.addToStudyInFather(Handle, Block3h, "Block 3 of Handle")
290
291   ### The whole shape ###
292
293   CompALL = geompy.MakeCompound([Glue1234, Block5, Mirror1, Handle, Gear])
294   Spanner = geompy.MakeGlueFaces(CompALL, 1e-5)
295   id_glueALL = geompy.addToStudy(Spanner, "The Spanner")
296
297   ### Check the Spanner ###
298
299   isCompOfBlocks6 = BlocksOp.CheckCompoundOfBlocks(Spanner)
300   if isCompOfBlocks6 == 0:
301     print "Spanner is not a compound of hexahedral solids"
302   else:
303     print "Spanner is a compound of hexahedral solids"
304
305   if isBlocksTest == 1:
306
307     print "##################### Test More #####################"
308
309     ### Get Blocks 4 and 5 from the spanner ###
310
311     Face42_sp = geompy.GetFaceByEdges(Spanner, Edge41, Edge42)
312     id_face42_sp = geompy.addToStudyInFather(Spanner, Face42_sp, "Face 4_2")
313
314     Blocks_f4_sp = geompy.GetBlocksByParts(Spanner, [Face42_sp])
315
316     isMRot2D = 0
317
318     for aBlock in Blocks_f4_sp:
319       name = geompy.SubShapeName(aBlock, Spanner)
320       Id_block = geompy.addToStudyInFather(Spanner, aBlock, name)
321
322       f42_sp_ind = geompy.LocalOp.GetSubShapeIndex(aBlock, Face42_sp)
323
324       Face_5_horiz = geompy.GetFaceByNormale(aBlock, vz)
325       f_5_horiz_ind = geompy.LocalOp.GetSubShapeIndex(aBlock, Face_5_horiz)
326
327       MRot = geompy.MakeMultiTransformation2D(aBlock, f42_sp_ind, 0, 3, f_5_horiz_ind, 0, 5)
328       if MRot is not None:
329         isMRot2D = 1
330         p_z100 = geompy.MakeVertex(0., 0., 100.)
331         MRot_tr = geompy.MakeTranslationTwoPoints(MRot, p0, p_z100)
332         id_MRot_tr = geompy.addToStudy(MRot_tr, "Multi-rotated block 5")
333
334     if isMRot2D == 0:
335       print "2D Multi Transformation failed"
336
337     ### Get one face of the Gear ###
338
339     p_20_0_tr   = geompy.MakeTranslationTwoPoints(p_20_0  , p0, p_60_150_0)
340     p_20_0_r_tr = geompy.MakeTranslationTwoPoints(p_20_0_r, p0, p_60_150_0)
341     p_40_0_tr   = geompy.MakeTranslationTwoPoints(p_40_0  , p0, p_60_150_0)
342     p_40_0_r_tr = geompy.MakeTranslationTwoPoints(p_40_0_r, p0, p_60_150_0)
343
344     Face_g_1 = geompy.GetFaceByPoints(Gear, p_20_0_tr, p_20_0_r_tr, p_40_0_tr, p_40_0_r_tr)
345     id_face_g_1 = geompy.addToStudyInFather(Gear, Face_g_1, "Face of Gear by four points")
346
347     edgesNb = geompy.ShapesOp.NumberOfEdges(Face_g_1)
348     print "Face of Gear has ", edgesNb, " edges"
349
350     Face_g_1_tr = geompy.MakeTranslationTwoPoints(Face_g_1, p0, pth)
351     id_face_g_1_tr = geompy.addToStudyInFather(Gear, Face_g_1_tr, "Face of Gear by four points, translated")
352
353     ### equivalent of Block1s, but made as block
354
355     Block_new = geompy.MakeHexa2Faces(Face_g_1, Face_g_1_tr)
356     id_block_new = geompy.addToStudy(Block_new, "Block New")
357
358   if isMeshTest == 1:
359
360     print "##################### Build Mesh #####################"
361
362     import StdMeshers
363
364     # ---- add a middle block of spanner handle in study
365
366     p_45_0_1 = geompy.MakeVertex(45., 0., 1.)
367     BlockMh = geompy.GetBlockNearPoint(Spanner, p_45_0_1)
368     id_blockMh = geompy.addToStudyInFather(Spanner, BlockMh, "Middle Block of Spanner Handle")
369
370     # ---- add the top face of the middle block in study
371
372     FaceTop = geompy.GetFaceByNormale(BlockMh, vz)
373     id_facetop = geompy.addToStudyInFather(BlockMh, FaceTop, "Top Face")
374
375     # ---- add long edges of the top face in study
376
377     FaceTop_edges = geompy.SubShapeAllSorted(FaceTop, geompy.ShapeType["EDGE"])
378     Edge1 = FaceTop_edges[0]
379     Edge2 = FaceTop_edges[3]
380     Id_Edge1 = geompy.addToStudyInFather(FaceTop, Edge1, "Edge 1")
381     Id_Edge2 = geompy.addToStudyInFather(FaceTop, Edge2, "Edge 2")
382
383     # ---- launch SMESH
384
385     smeshgui = None
386     if hasGUI == 1:
387       smeshgui = salome.ImportComponentGUI("SMESH")
388       smeshgui.Init(salome.myStudyId)
389
390     print "-------------------------- create Hypothesis"
391
392     print "-------------------------- NumberOfSegments"
393
394     hypNbSeg3 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
395     hypNbSeg3.SetNumberOfSegments(3)
396     print hypNbSeg3.GetName()
397     print hypNbSeg3.GetId()
398     print hypNbSeg3.GetNumberOfSegments()
399
400     if hasGUI == 1:
401       idseg = salome.ObjectToID(hypNbSeg3)
402       smeshgui.SetName(idseg, "NumberOfSegments_3");
403
404     print "-------------------------- LocalLength"
405
406     hypLen1 = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so")
407     hypLen1.SetLength(10)
408     print hypLen1.GetName()
409     print hypLen1.GetId()
410     print hypLen1.GetLength()
411
412     if hasGUI == 1:
413       idlength = salome.ObjectToID(hypLen1)
414       smeshgui.SetName(idlength, "Local_Length_10");
415
416     print "-------------------------- Propagation"
417
418     hypProp = smesh.CreateHypothesis("Propagation", "libStdMeshersEngine.so")
419     print hypProp.GetName()
420     print hypProp.GetId()
421
422     if hasGUI == 1:
423       idprop = salome.ObjectToID(hypProp)
424       smeshgui.SetName(idprop, "Propagation hypothesis");
425
426     #print "-------------------------- NumberOfSegments"
427     #
428     #hypNbSeg15 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so")
429     #hypNbSeg15.SetNumberOfSegments(15)
430     #print hypNbSeg15.GetName()
431     #print hypNbSeg15.GetId()
432     #print hypNbSeg15.GetNumberOfSegments()
433     #
434     #if hasGUI == 1:
435     #  idseg15 = salome.ObjectToID(hypNbSeg15)
436     #  smeshgui.SetName(idseg15, "NumberOfSegments_15");
437
438     print "-------------------------- Regular_1D"
439
440     algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so")
441     listHyp = algoReg.GetCompatibleHypothesis()
442     for hyp in listHyp:
443         print hyp
444     print algoReg.GetName()
445     print algoReg.GetId()
446
447     if hasGUI == 1:
448       idreg = salome.ObjectToID(algoReg)
449       smeshgui.SetName(idreg, "Regular_1D");
450
451     print "-------------------------- Quadrangle_2D"
452
453     algoQuad = smesh.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so")
454     listHyp = algoQuad.GetCompatibleHypothesis()
455     for hyp in listHyp:
456         print hyp
457     print algoQuad.GetName()
458     print algoQuad.GetId()
459
460     if hasGUI == 1:
461       idquad = salome.ObjectToID(algoQuad)
462       smeshgui.SetName(idquad, "Quadrangle_2D");
463
464     print "---- Init a Mesh with the Spanner"
465
466     mesh = smesh.CreateMesh(Spanner)
467     if hasGUI == 1:
468       idmesh = salome.ObjectToID(mesh)
469       smeshgui.SetName(idmesh, "Meshed Spanner");
470
471     print "-------------------------- add hypothesis to Spanner"
472
473     mesh.AddHypothesis(Spanner, algoReg)
474     mesh.AddHypothesis(Spanner, hypNbSeg3)
475     mesh.AddHypothesis(Spanner, algoQuad)
476
477     print "-------------------------- add hypothesis to the Middle Block"
478
479     submesh_bl = mesh.GetSubMesh(BlockMh, "SubMesh Middle Block")
480     mesh.AddHypothesis(BlockMh, hypLen1)
481
482     print "-------------------------- add hypothesis to the long edges of the Top Face of the Middle Block"
483
484     submesh_e1 = mesh.GetSubMesh(Edge1, "SubMesh Edge 1 of Top Face")
485     mesh.AddHypothesis(Edge1, hypProp)
486     #mesh.AddHypothesis(Edge1, hypNbSeg15)
487
488     submesh_e2 = mesh.GetSubMesh(Edge2, "SubMesh Edge 2 of Top Face")
489     mesh.AddHypothesis(Edge2, hypProp)
490     #mesh.AddHypothesis(Edge2, hypNbSeg15)
491
492     print "-------------------------- compute the mesh"
493     smesh.Compute(mesh, Spanner)
494
495     print "Information about the Mesh:"
496     print "Number of nodes       : ", mesh.NbNodes()
497     print "Number of edges       : ", mesh.NbEdges()
498     print "Number of faces       : ", mesh.NbFaces()
499     print "Number of triangles   : ", mesh.NbTriangles()
500     print "Number of quadrangles : ", mesh.NbQuadrangles()
501     print "Number of volumes     : ", mesh.NbVolumes()
502     print "Number of tetrahedrons: ", mesh.NbTetras()
503
504   return Spanner