1 # -*- coding: latin-1 -*-
2 # Copyright (C) 2009-2023 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, or (at your option) any later version.
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
26 #---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
29 # ======================================================= test_sphere
32 doc = hexablock.addDocument ("default")
34 center = doc.addVertex (0,0,0)
36 orig = doc.addVertex (0,0,0)
37 vz = doc.addVector (0,0,1)
38 vx = doc.addVector (1,0,0)
44 doc.makeSphere (center, vx, vz, radius, radhole, orig, nrad, nang, nhaut)
45 doc.saveVtk ("Rind1.vtk")
48 # ======================================================= test_part_sphere
49 def test_part_sphere () :
51 doc = hexablock.addDocument ("default")
53 center = doc.addVertex (0,0,0)
55 orig = doc.addVertex (0,0,-4)
56 vz = doc.addVector (0,0,1)
57 vx = doc.addVector (1,0,0)
64 doc.makePartSphere (center, vx, vz, radius, radhole, orig, angle,
66 doc.saveVtk ("Rind2.vtk")
69 # ======================================================= test_rind
72 doc = hexablock.addDocument ("default")
74 center = doc.addVertex (0,0,0)
77 orig = doc.addVertex (0,0,0)
78 vz = doc.addVector (0,0,1)
79 vx = doc.addVector (1,0,0)
85 doc.makeRind (center, vx, vz, radius, radint, radhole, orig,
87 doc.saveVtk ("Rind3.vtk")
90 # ======================================================= test_part_rind
91 def test_part_rind () :
93 doc = hexablock.addDocument ("default")
95 center = doc.addVertex (0,0,0)
98 orig = doc.addVertex (0,0,0)
99 vz = doc.addVector (0,0,1)
100 vx = doc.addVector (1,0,0)
107 doc.makePartRind (center, vx, vz, radius, radint, radhole, orig, angle,
109 doc.saveVtk ("Rind4.vtk")
112 # ================================================================= Begin
115 ##test_part_sphere ()
116 doc = test_part_rind ()
119 law = doc.addLaw("Uniform", 4)
121 for j in range(doc.countPropagation()):
122 propa = doc.getPropagation(j)
125 mesh_hexas = hexablock.mesh(doc, "rind:hexas")