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