1 # -*- coding: latin-1 -*-
2 # Copyright (C) 2009-2013 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
25 geompy = hexablock.geompy
27 #---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
31 # ======================================================= test_pipes
35 doc = hexablock.addDocument (name)
37 orig = doc.addVertex ( 8, 0, 0)
38 vx = doc.addVector ( 1 ,0, 0)
39 vy = doc.addVector ( 0, 1, 0)
40 vz = doc.addVector ( 0, 0, 1)
54 grid = doc.makeCartesianTop (size_x, size_y, size_z)
55 pipe = doc.makePipeUni (orig, vx, vz, rint, rext, angle,
56 haut, nr, size_cyl, nh)
58 c1 = grid.getVertexIJK (2, 1, size_z)
59 c2 = grid.getVertexIJK (3, 1, size_z)
61 p1 = pipe.getVertexIJK (1, 7, 1)
62 p2 = pipe.getVertexIJK (1, 8, 1)
66 for na in range (size_cyl) :
67 quad = pipe.getQuadIJ (0, na, 1)
69 qpattern.append (quad)
71 for ni in range (1, size_x-1) :
72 for nj in range (1, size_y-1) :
73 quad = grid.getQuadIJ (ni, nj, size_z)
83 doc.saveVtk ("replace0.vtk")
85 doc.replace (qpattern, qtarget, p1,c1, p2,c2)
87 doc.saveVtk ("replace1.vtk")
91 doc.saveVtk ("replace2.vtk")
94 # ================================================================= Begin
98 doc.addLaws (0.9, True)
100 mesh_hexas = hexablock.mesh (doc, "maillage:hexas")