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
27 #---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
30 # ======================================================= bug_quad2
33 doc = hexablock.addDocument ("default")
35 ori = doc.addVertex ( 0, 0, 0)
36 vz = doc.addVector ( 0, 0, 1)
37 vx = doc.addVector ( 1 ,0, 0)
46 c1 = doc.makeCylindrical (ori, vx,vz,dr, phi,dl, nr,na,nl, False);
49 doc.saveVtk ("bugs_hexa_ab1.vtk")
51 qa = c1.getQuadJK (0, 0, 0);
52 qb = c1.getQuadJK (0, 4, 0);
53 hexa = doc.addHexa2Quads (qa, qb);
58 doc.saveVtk ("bugs_hexa_ab2.vtk")
61 # ======================================================= bug_quad3
64 doc = hexablock.addDocument("quad3")
66 ori = doc.addVertex ( 0, 0, 0)
67 vz = doc.addVector ( 0, 0, 1)
68 vx = doc.addVector ( 1 ,0, 0)
77 c1 = doc.makeCylindrical (ori, vx,vz,dr, phi,dl, nr,na,nl, False);
80 doc.saveVtk ("bugs_hexa_acd1.vtk")
82 qc = c1.getQuadJK (0, 0, 0);
83 qa = c1.getQuadJK (0, 1, 0);
84 qd = c1.getQuadJK (0, 2, 0);
86 hexa = doc.addHexa3Quads (qa, qc, qd);
91 doc.saveVtk ("bugs_hexa_acd2.vtk")
95 # ======================================================= bug_quad3
98 doc = hexablock.addDocument("quad1")
99 centre = doc.addVertex(0, 0, 0)
100 vecteur_px = doc.addVector(1, 0, 0)
101 vecteur_pz = doc.addVector(0, 0, 1)
103 grille = doc.makeCylindrical(centre, vecteur_px, vecteur_pz, 1, 360, 1, 3, 8, 1, False)
105 quad_1 = grille.getQuadIK(0, 1, 0)
106 quad_5 = grille.getQuadIK(0, 5, 0)
108 quad_1 = grille.getQuadJK(0, 1, 0)
109 quad_5 = grille.getQuadJK(0, 4, 0)
112 doc.saveVtk ("bugs_hexa_ab1.vtk")
113 doc.addHexa2Quads(quad_1, quad_5)
114 doc.saveVtk ("bugs_hexa_ab2.vtk")
118 # ================================================================= Begin
122 law = doc.addLaw("Uniform", 4)
124 for j in range(doc.countPropagation()):
125 propa = doc.getPropagation(j)
128 mesh_hexas = hexablock.mesh(doc, "maillage:hexas")