1 # Copyright (C) 2009-2016 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 # exemple repris de test_hexa1.cxx (test_joint())
30 doc = hexablock.addDocument()
32 orig1 = doc.addVertex(0, 0, 0)
33 dx = doc.addVector(1, 0, 0)
34 dy = doc.addVector(0, 1, 0)
35 dz = doc.addVector(0, 0, 1)
40 grid1 = doc.makeCartesian(orig1, dx, dy, dz, dimx, dimy, dimz)
42 orig2 = doc.addVertex(dimx/2.0, 0, 8)
43 grid2 = doc.makeCylindrical(orig2, dx, dy, 1, 180, 1, dimz, dimy,
48 prems = grid1.getQuadIJ(mx, my, dimz)
49 cible = grid2.getQuadJK(dimz, mx, my)
51 # @todo reference = test_hexa1.cxx ou ModelTest.cxx ?
52 v1 = prems.getVertex(0)
53 v2 = cible.getVertex(0)
54 v3 = prems.getVertex(1)
55 v4 = cible.getVertex(3)
58 liste.extend([grid1.getQuadIJ(nx, my, dimz) for nx in range(dimx) if nx != mx])
59 liste.extend([grid1.getQuadIJ(mx, ny, dimz) for ny in range(dimy) if ny != my])
63 elts = doc.joinQuads(liste, cible, v1, v2, v3, v4, height)
66 nbr_joint_vertex = elts.countVertex()
67 nbr_surf_vertex = nbr_joint_vertex/(height + 1)
69 ind0 = elts.findVertex(v1)
70 for nh in range(nbr_surf_vertex):
71 elts.getVertex(nh).setScalar(5)
72 for nh in range(height):
73 elts.getVertex(nh*nbr_surf_vertex).setScalar(3)
76 file_name = os.path.join(os.environ['TMP'], 'joint.vtk')
77 #### elts.saveVtk(file_name)
79 print "...test join OK"