1 # -*- coding: latin-1 -*-
2 # Copyright (C) 2009-2012 CEA/DEN, EDF R&D
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.
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.
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
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 # Hexa : Creation d'hexaedres
27 #---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
30 # ======================================================= test_sphere
33 doc = hexablock.addDocument ("default")
35 center = doc.addVertex (0,0,0)
37 orig = doc.addVertex (0,0,0)
38 vz = doc.addVector (0,0,1)
39 vx = doc.addVector (1,0,0)
45 doc.makeSphere (center, vx, vz, radius, radhole, orig, nrad, nang, nhaut)
46 doc.saveVtk ("Rind1.vtk")
49 # ======================================================= test_part_sphere
50 def test_part_sphere () :
52 doc = hexablock.addDocument ("default")
54 center = doc.addVertex (0,0,0)
56 orig = doc.addVertex (0,0,-4)
57 vz = doc.addVector (0,0,1)
58 vx = doc.addVector (1,0,0)
65 doc.makePartSphere (center, vx, vz, radius, radhole, orig, angle,
67 doc.saveVtk ("Rind2.vtk")
70 # ======================================================= test_rind
73 doc = hexablock.addDocument ("default")
75 center = doc.addVertex (0,0,0)
78 orig = doc.addVertex (0,0,0)
79 vz = doc.addVector (0,0,1)
80 vx = doc.addVector (1,0,0)
86 doc.makeRind (center, vx, vz, radius, radint, radhole, orig,
88 doc.saveVtk ("Rind3.vtk")
91 # ======================================================= test_part_rind
92 def test_part_rind () :
94 doc = hexablock.addDocument ("default")
96 center = doc.addVertex (0,0,0)
99 orig = doc.addVertex (0,0,0)
100 vz = doc.addVector (0,0,1)
101 vx = doc.addVector (1,0,0)
108 doc.makePartRind (center, vx, vz, radius, radint, radhole, orig, angle,
110 doc.saveVtk ("Rind4.vtk")
113 # ================================================================= Begin
116 ##test_part_sphere ()
117 doc = test_part_rind ()
120 law = doc.addLaw("Uniform", 4)
122 for j in range(doc.countPropagation()):
123 propa = doc.getPropagation(j)
126 mesh_hexas = hexablock.mesh(doc, "rind:hexas")