1 # -*- coding: latin-1 -*-
2 # Copyright (C) 2009-2016 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 # ======================================================= bug_quad2
32 doc = hexablock.addDocument ("default")
34 ori = doc.addVertex ( 0, 0, 0)
35 vz = doc.addVector ( 0, 0, 1)
36 vx = doc.addVector ( 1 ,0, 0)
45 c1 = doc.makeCylindrical (ori, vx,vz,dr, phi,dl, nr,na,nl, False);
48 doc.saveVtk ("bugs_hexa_ab1.vtk")
50 qa = c1.getQuadJK (0, 0, 0);
51 qb = c1.getQuadJK (0, 4, 0);
52 hexa = doc.addHexa2Quads (qa, qb);
57 doc.saveVtk ("bugs_hexa_ab2.vtk")
60 # ======================================================= bug_quad3
63 doc = hexablock.addDocument("quad3")
65 ori = doc.addVertex ( 0, 0, 0)
66 vz = doc.addVector ( 0, 0, 1)
67 vx = doc.addVector ( 1 ,0, 0)
76 c1 = doc.makeCylindrical (ori, vx,vz,dr, phi,dl, nr,na,nl, False);
79 doc.saveVtk ("bugs_hexa_acd1.vtk")
81 qc = c1.getQuadJK (0, 0, 0);
82 qa = c1.getQuadJK (0, 1, 0);
83 qd = c1.getQuadJK (0, 2, 0);
85 hexa = doc.addHexa3Quads (qa, qc, qd);
90 doc.saveVtk ("bugs_hexa_acd2.vtk")
94 # ======================================================= bug_quad3
97 doc = hexablock.addDocument("quad1")
98 centre = doc.addVertex(0, 0, 0)
99 vecteur_px = doc.addVector(1, 0, 0)
100 vecteur_pz = doc.addVector(0, 0, 1)
102 grille = doc.makeCylindrical(centre, vecteur_px, vecteur_pz, 1, 360, 1, 3, 8, 1, False)
104 quad_1 = grille.getQuadIK(0, 1, 0)
105 quad_5 = grille.getQuadIK(0, 5, 0)
107 quad_1 = grille.getQuadJK(0, 1, 0)
108 quad_5 = grille.getQuadJK(0, 4, 0)
111 doc.saveVtk ("bugs_hexa_ab1.vtk")
112 doc.addHexa2Quads(quad_1, quad_5)
113 doc.saveVtk ("bugs_hexa_ab2.vtk")
117 # ================================================================= Begin
121 law = doc.addLaw("Uniform", 4)
123 for j in range(doc.countPropagation()):
124 propa = doc.getPropagation(j)
127 mesh_hexas = hexablock.mesh(doc, "maillage:hexas")