Salome HOME
Bug 0020072: GHS3DPRLPLUGIN update. Integrating the attached patch.
[modules/smesh.git] / src / SMESH_SWIG / ex30_tepal.py
1 # CEA/LGLS 2008, Christian Van Wambeke (CEA/LGLS), Francis KLOSS (OCC)
2 # ====================================================================
3
4 import os
5
6 import geompy
7 import smesh
8
9 # Parameters
10 # ----------
11
12 results = "/export/home/wambeke/ZZ"
13
14 radius =  50
15 height = 200
16
17 # Build a cylinder
18 # ----------------
19
20 base = geompy.MakeVertex(0, 0, 0)
21 direction = geompy.MakeVectorDXDYDZ(0, 0, 1)
22
23 cylinder = geompy.MakeCylinder(base, direction, radius, height)
24
25 geompy.addToStudy(cylinder, "Cylinder")
26
27 # Define a mesh on a geometry
28 # ---------------------------
29
30 m = smesh.Mesh(cylinder)
31
32 # 2D mesh with BLSURF
33 # -------------------
34
35 algo2d = m.Triangle(smesh.BLSURF)
36
37 algo2d.SetPhysicalMesh(1)
38 algo2d.SetPhySize(5)
39
40 algo2d.SetGeometricMesh(0)
41
42 # 3D mesh with tepal
43 # ------------------
44
45 algo3d = m.Tetrahedron(smesh.GHS3DPRL)
46
47 algo3d.SetMEDName(results)
48 algo3d.SetNbPart(4)
49 algo3d.SetBackground(False)
50 algo3d.SetKeepFiles(False)
51
52 # Launch meshers
53 # --------------
54
55 status = m.Compute()
56
57 # Test if ok
58 # ----------
59
60 if os.access(results+".xml", os.F_OK):
61     print "Ok: tepal"
62 else:
63     print "KO: tepal"