]> SALOME platform Git repositories - tools/solverlab.git/commitdiff
Salome HOME
Added mesh of a hexagon to prepare an integration test with some geometry and visuali...
authormichael <michael@localhost.localdomain>
Sun, 11 Oct 2020 18:25:19 +0000 (20:25 +0200)
committermichael <michael@localhost.localdomain>
Sun, 11 Oct 2020 18:25:19 +0000 (20:25 +0200)
CDMATH/tests/ressources/2DHexagonWithTriangles/hexa.py [new file with mode: 0644]
CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles10.med [new file with mode: 0644]
CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles100.med [new file with mode: 0644]
CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles200.med [new file with mode: 0644]
CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles50.med [new file with mode: 0644]
CDMATH/tests/ressources/meshHexagonWithTriangles.med [new file with mode: 0644]

diff --git a/CDMATH/tests/ressources/2DHexagonWithTriangles/hexa.py b/CDMATH/tests/ressources/2DHexagonWithTriangles/hexa.py
new file mode 100644 (file)
index 0000000..133d676
--- /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, "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
diff --git a/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles10.med b/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles10.med
new file mode 100644 (file)
index 0000000..c3393b5
Binary files /dev/null and b/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles10.med differ
diff --git a/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles100.med b/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles100.med
new file mode 100644 (file)
index 0000000..592ae02
Binary files /dev/null and b/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles100.med differ
diff --git a/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles200.med b/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles200.med
new file mode 100644 (file)
index 0000000..fc2a153
Binary files /dev/null and b/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles200.med differ
diff --git a/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles50.med b/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles50.med
new file mode 100644 (file)
index 0000000..5240614
Binary files /dev/null and b/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles50.med differ
diff --git a/CDMATH/tests/ressources/meshHexagonWithTriangles.med b/CDMATH/tests/ressources/meshHexagonWithTriangles.med
new file mode 100644 (file)
index 0000000..c63ca1a
Binary files /dev/null and b/CDMATH/tests/ressources/meshHexagonWithTriangles.med differ