Salome HOME
2ae8e11cb759007932eaaad9e60ac877993b20c4
[plugins/hexoticplugin.git] / doc / salome / examples / hexoticdemo_vl.py
1 # Copyright (C) 2015-2016  CEA/DEN, EDF R&D, OPEN CASCADE
2 #
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.
7 #
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.
12 #
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
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 import salome
21 salome.salome_init()
22 theStudy = salome.myStudy
23
24 from salome.geom import geomBuilder
25 geompy = geomBuilder.New(salome.myStudy)
26
27 import SMESH, SALOMEDS
28 from salome.smesh import smeshBuilder
29 smesh =  smeshBuilder.New(salome.myStudy)
30
31 # Create geometry
32 Box_1 = geompy.MakeBoxDXDYDZ(50, 50, 50)
33 geompy.addToStudy( Box_1, 'Box_1' )
34
35 # Create mesh
36 Mesh_mghexa_vl = smesh.Mesh(Box_1, "Mesh_mghexa_vl")
37
38 Regular_1D = Mesh_mghexa_vl.Segment()
39 Local_Length_1 = Regular_1D.LocalLength(8.66025,None,1e-07)
40
41 MEFISTO_2D = Mesh_mghexa_vl.Triangle(algo=smeshBuilder.MEFISTO)
42
43 MG_Hexa = Mesh_mghexa_vl.Hexahedron(algo=smeshBuilder.MG_Hexa)
44 MG_Hexa_Parameters = MG_Hexa.Parameters()
45 MG_Hexa.SetViscousLayers(5,5,3,smeshBuilder.Inward,[13,23])
46 MG_Hexa_Parameters.SetMinSize( 2 )
47 MG_Hexa_Parameters.SetMaxSize( 4 )
48 MG_Hexa_Parameters.SetHexesMinLevel( 2 )
49 MG_Hexa_Parameters.SetHexesMaxLevel( 4 )
50
51 # Compute
52 Mesh_mghexa_vl.Compute()
53
54 # End of script