00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 import salome
00031 import geompy
00032 import smesh
00033
00034
00035 Box_inf = geompy.MakeBox(0., 0., 0., 200., 200., 50.)
00036
00037
00038 Psup1=geompy.MakeVertex(100., 100., 50.)
00039 Fsup1=geompy.GetFaceNearPoint(Box_inf, Psup1)
00040
00041 Pinf1=geompy.MakeVertex(100., 100., 0.)
00042 Finf1=geompy.GetFaceNearPoint(Box_inf, Pinf1)
00043
00044
00045 Box_sup = geompy.MakeBox(100., 100., 50., 200., 200., 100.)
00046
00047
00048 Psup2=geompy.MakeVertex(150., 150., 100.)
00049 Fsup2=geompy.GetFaceNearPoint(Box_sup, Psup2)
00050
00051 Pinf2=geompy.MakeVertex(150., 150., 50.)
00052 Finf2=geompy.GetFaceNearPoint(Box_sup, Pinf2)
00053
00054
00055 geompy.addToStudy(Box_inf, "Box_inf")
00056 geompy.addToStudyInFather(Box_inf, Fsup1, "Fsup")
00057 geompy.addToStudyInFather(Box_inf, Finf1, "Finf")
00058
00059 geompy.addToStudy(Box_sup, "Box_sup")
00060 geompy.addToStudyInFather(Box_sup, Fsup2, "Fsup")
00061 geompy.addToStudyInFather(Box_sup, Finf2, "Finf")
00062
00063 smesh.SetCurrentStudy(salome.myStudy)
00064
00065
00066 Mesh_inf = smesh.Mesh(Box_inf, "Mesh_inf")
00067 algo1D_1=Mesh_inf.Segment()
00068 algo1D_1.NumberOfSegments(10)
00069 algo2D_1=Mesh_inf.Quadrangle()
00070 algo3D_1=Mesh_inf.Hexahedron()
00071 Mesh_inf.Compute()
00072
00073
00074 Gsup1=Mesh_inf.Group(Fsup1, "Sup")
00075
00076 Ginf1=Mesh_inf.Group(Finf1, "Inf")
00077
00078
00079 Mesh_sup = smesh.Mesh(Box_sup, "Mesh_sup")
00080 algo1D_2=Mesh_sup.Segment()
00081 algo1D_2.NumberOfSegments(5)
00082 algo2D_2=Mesh_sup.Quadrangle()
00083 algo3D_2=Mesh_sup.Hexahedron()
00084 Mesh_sup.Compute()
00085
00086
00087 Gsup2=Mesh_sup.Group(Fsup2, "Sup")
00088
00089 Ginf2=Mesh_sup.Group(Finf2, "Inf")
00090
00091
00092
00093
00094 Compound1 = smesh.smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
00095 smesh.SetName(Compound1, 'Compound_with_RenamedGrps_and_MergeElems')
00096
00097
00098 Compound2 = smesh.smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 1, 0, 1e-05, True)
00099 smesh.SetName(Compound2, 'Compound_with_UniteGrps_and_GrpsOfAllElems')
00100