Salome HOME
Merge from V6_5_BR 05/06/2012
[modules/smesh.git] / src / SMESH_SWIG / ex31_dimGroup.py
1 #  -*- coding: iso-8859-1 -*-
2 # Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
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.
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 import sys
22 import salome
23 import geompy
24 import math
25 import SALOMEDS
26 import SMESH
27 import smesh
28
29 salome.salome_init()
30 aStudyId = salome.myStudy._get_StudyId()
31
32 geompy.init_geom(salome.myStudy)
33
34 geompy.init_geom(salome.myStudy)
35 global Box_1
36 Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
37 geompy.addToStudy( Box_1, "Box_1" )
38
39 smesh.SetCurrentStudy(salome.myStudy)
40 import StdMeshers
41 Mesh_1 = smesh.Mesh(Box_1)
42 Regular_1D = Mesh_1.Segment()
43 Nb_Segments_1 = Regular_1D.NumberOfSegments(10)
44 Nb_Segments_1.SetDistrType( 0 )
45 Quadrangle_2D = Mesh_1.Quadrangle()
46 Hexa_3D = Mesh_1.Hexahedron()
47 isDone = Mesh_1.Compute()
48
49 ### CreateDimGroup()
50
51 aListOf3d_1=range(721,821)
52
53 aGrp3D_1=Mesh_1.GetMesh().CreateGroup( smesh.VOLUME, "Src 3D 1" )
54 aGrp3D_1.Add( aListOf3d_1 )
55
56 aListOf3d_2=range(821, 921)
57 aGrp3D_2=Mesh_1.GetMesh().CreateGroup( smesh.VOLUME, "Src 3D 2" )
58 aGrp3D_2.Add( aListOf3d_2 )
59
60 aGrp2D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], smesh.FACE, "Faces" )
61
62 aGrp1D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], smesh.EDGE, "Edges" )
63
64 aGrp0D = Mesh_1.CreateDimGroup( [aGrp3D_1, aGrp3D_2], smesh.NODE, "Nodes" )
65
66 salome.sg.updateObjBrowser( 1 )
67