Salome HOME
Updated copyright comment
[modules/hexablock.git] / src / TEST_PY / test_unit / test_carre.py
1 # -*- coding: latin-1 -*-
2 # Copyright (C) 2009-2024  CEA, EDF
3 #
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.
8 #
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.
13 #
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
17 #
18 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #
20
21 # Hexa : Creation d'hexaedres 
22
23 import hexablock
24 import os
25
26 #---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
27
28
29 # ======================================================= test_croix
30 def test_croix () :
31
32     nom  = "test_croix"
33     doc  = hexablock.addDocument(nom)
34     doc.setLevel (1)
35     nvtk = 0
36
37     ori = doc.addVertex ( 0, 0, 0)
38     vz  = doc.addVector ( 0, 0, 1)
39     vx  = doc.addVector ( 1 ,0, 0)
40
41     dr    = 1.0
42     angle = 360.0
43     dl    = 1.0
44
45     nr = 1
46     na = 4
47     nl = 5
48     fill = True
49
50     grid = doc.makeCylindrical (ori, vx, vz, dr, angle, dl, nr, na, nl, fill)
51
52     doc.saveVtk ("carre.vtk")
53     return doc
54
55 # ================================================================= Begin
56
57 doc = test_croix  ()
58 ###  doc = test_pipes  ()
59
60 law = doc.addLaw("Uniform", 4)
61
62 for j in range(doc.countPropagation()):
63     propa = doc.getPropagation(j)
64     propa.setLaw(law) 
65
66 mesh_hexas = hexablock.mesh(doc)
67 muv, mue, muq, muh = hexablock.dump(doc, mesh_hexas)