2013-02-12 20:37:44 +06:00
|
|
|
# Create a Group on Geometry
|
|
|
|
|
|
|
|
import salome
|
2021-08-12 14:38:10 +05:00
|
|
|
salome.salome_init_without_session()
|
2013-04-04 13:08:19 +06:00
|
|
|
|
2022-04-13 12:01:14 +05:00
|
|
|
from salome.geom import geomBuilder
|
2013-04-04 13:08:19 +06:00
|
|
|
from salome.smesh import smeshBuilder
|
2022-04-13 12:01:14 +05:00
|
|
|
|
|
|
|
geom_builder = geomBuilder.New()
|
|
|
|
smesh_builder = smeshBuilder.New()
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# create a box
|
2022-04-13 12:01:14 +05:00
|
|
|
box = geom_builder.MakeBox(0., 0., 0., 100., 100., 100.)
|
|
|
|
geom_builder.addToStudy(box, "box")
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# add the first face of the box to the study
|
2022-04-13 12:01:14 +05:00
|
|
|
subShapeList = geom_builder.SubShapeAll(box, geom_builder.ShapeType["FACE"])
|
2013-02-12 20:37:44 +06:00
|
|
|
face = subShapeList[0]
|
2022-04-13 12:01:14 +05:00
|
|
|
geom_builder.addToStudyInFather(box, face, "face 1")
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# create group of edges on the face
|
2022-04-13 12:01:14 +05:00
|
|
|
aGeomGroupE = geom_builder.CreateGroup(face, geom_builder.ShapeType["EDGE"])
|
|
|
|
geom_builder.AddObject(aGeomGroupE, 3)
|
|
|
|
geom_builder.AddObject(aGeomGroupE, 6)
|
|
|
|
geom_builder.AddObject(aGeomGroupE, 8)
|
|
|
|
geom_builder.AddObject(aGeomGroupE, 10)
|
|
|
|
geom_builder.addToStudyInFather(face, aGeomGroupE, "Group of Edges")
|
2013-02-12 20:37:44 +06:00
|
|
|
|
|
|
|
# create quadrangle 2D mesh on the box
|
2022-04-13 12:01:14 +05:00
|
|
|
quadra = smesh_builder.Mesh(box, "Box : quadrangle 2D mesh")
|
2013-02-12 20:37:44 +06:00
|
|
|
algo1D = quadra.Segment()
|
|
|
|
quadra.Quadrangle()
|
|
|
|
algo1D.NumberOfSegments(7)
|
|
|
|
|
|
|
|
# compute the mesh
|
|
|
|
quadra.Compute()
|
|
|
|
|
|
|
|
# create SMESH group on the face with name "SMESHGroup1"
|
|
|
|
aSmeshGroup1 = quadra.GroupOnGeom(face, "SMESHGroup1")
|
|
|
|
|
|
|
|
# create SMESH group on <aGeomGroupE> with default name
|
|
|
|
aSmeshGroup2 = quadra.GroupOnGeom(aGeomGroupE)
|