]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Renamed script that generates the mesh of an hexagonal cavity
authormichael <michael@localhost.localdomain>
Sun, 13 Dec 2020 09:56:54 +0000 (10:56 +0100)
committermichael <michael@localhost.localdomain>
Sun, 13 Dec 2020 09:56:54 +0000 (10:56 +0100)
CDMATH/tests/ressources/2DHexagonWithTriangles/HexagonMesh.py [new file with mode: 0644]
CDMATH/tests/ressources/2DHexagonWithTriangles/hexa.py [deleted file]

diff --git a/CDMATH/tests/ressources/2DHexagonWithTriangles/HexagonMesh.py b/CDMATH/tests/ressources/2DHexagonWithTriangles/HexagonMesh.py
new file mode 100644 (file)
index 0000000..70fc6e7
--- /dev/null
@@ -0,0 +1,41 @@
+from __future__ import division\r
+\r
+from salome.geom import geomBuilder\r
+from salome.smesh import smeshBuilder\r
+\r
+import sys\r
+import os\r
+\r
+from math import pi, cos, sin\r
+\r
+geompy = geomBuilder.New()\r
+smesh = smeshBuilder.New()\r
+\r
+\r
+def create_group_from(name, mother_shape, list_elem, type="EDGE"):\r
+    new = geompy.CreateGroup(mother_shape, geompy.ShapeType[type])\r
+    geompy.UnionList(new, list_elem)\r
+    new.SetName(name)\r
+    geompy.addToStudyInFather(mother_shape, new, name)\r
+    return new\r
+\r
+\r
+r = 1.\r
+NumberOfSegments = 200\r
+\r
+points = [geompy.MakeVertex(r * cos(i * pi / 3), r * sin(i * pi / 3), 0) for i in range(7)]\r
+edges = [geompy.MakeEdge(points[i], points[i + 1]) for i in range(6)]\r
+wire = geompy.MakeWire(edges)\r
+hexa = geompy.MakeFace(wire, True)\r
+geompy.addToStudy(hexa, "Hexagon")\r
+g = create_group_from("Hexagon_boundaries", hexa, [geompy.GetInPlace(hexa, wire, 1)])\r
+\r
+mesh = smesh.Mesh(hexa, "Hexagon_mesh"+str(NumberOfSegments))\r
+msurf = mesh.Triangle(algo=smeshBuilder.NETGEN_1D2D)\r
+NETGEN_2D_Simple_Parameters_1 = msurf.Parameters(smeshBuilder.SIMPLE)\r
+NETGEN_2D_Simple_Parameters_1.SetNumberOfSegments( NumberOfSegments )\r
+\r
+mesh.Group(g)\r
+\r
+mesh.Compute()\r
+mesh.ExportMED("meshHexagonWithTriangles"+str(NumberOfSegments)+".med")\r
diff --git a/CDMATH/tests/ressources/2DHexagonWithTriangles/hexa.py b/CDMATH/tests/ressources/2DHexagonWithTriangles/hexa.py
deleted file mode 100644 (file)
index 133d676..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-from __future__ import division\r
-\r
-from salome.geom import geomBuilder\r
-from salome.smesh import smeshBuilder\r
-\r
-import sys\r
-import os\r
-\r
-from math import pi, cos, sin\r
-\r
-geompy = geomBuilder.New()\r
-smesh = smeshBuilder.New()\r
-\r
-\r
-def create_group_from(name, mother_shape, list_elem, type="EDGE"):\r
-    new = geompy.CreateGroup(mother_shape, geompy.ShapeType[type])\r
-    geompy.UnionList(new, list_elem)\r
-    new.SetName(name)\r
-    geompy.addToStudyInFather(mother_shape, new, name)\r
-    return new\r
-\r
-\r
-r = 1.\r
-NumberOfSegments = 200\r
-\r
-points = [geompy.MakeVertex(r * cos(i * pi / 3), r * sin(i * pi / 3), 0) for i in range(7)]\r
-edges = [geompy.MakeEdge(points[i], points[i + 1]) for i in range(6)]\r
-wire = geompy.MakeWire(edges)\r
-hexa = geompy.MakeFace(wire, True)\r
-geompy.addToStudy(hexa, "hexa")\r
-g = create_group_from("boundaries", hexa, [geompy.GetInPlace(hexa, wire, 1)])\r
-\r
-mesh = smesh.Mesh(hexa, "mesh")\r
-msurf = mesh.Triangle(algo=smeshBuilder.NETGEN_1D2D)\r
-NETGEN_2D_Simple_Parameters_1 = msurf.Parameters(smeshBuilder.SIMPLE)\r
-NETGEN_2D_Simple_Parameters_1.SetNumberOfSegments( NumberOfSegments )\r
-\r
-mesh.Group(g)\r
-\r
-mesh.Compute()\r
-mesh.ExportMED("meshHexagonWithTriangles"+str(NumberOfSegments)+".med")\r