From: michael Date: Sun, 11 Oct 2020 18:25:19 +0000 (+0200) Subject: Added mesh of a hexagon to prepare an integration test with some geometry and visuali... X-Git-Tag: V9_6_0~13 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ce8deeb8dc080a492a7936b4d04b2cd0ddcacae2;p=tools%2Fsolverlab.git Added mesh of a hexagon to prepare an integration test with some geometry and visualisation --- diff --git a/CDMATH/tests/ressources/2DHexagonWithTriangles/hexa.py b/CDMATH/tests/ressources/2DHexagonWithTriangles/hexa.py new file mode 100644 index 0000000..133d676 --- /dev/null +++ b/CDMATH/tests/ressources/2DHexagonWithTriangles/hexa.py @@ -0,0 +1,41 @@ +from __future__ import division + +from salome.geom import geomBuilder +from salome.smesh import smeshBuilder + +import sys +import os + +from math import pi, cos, sin + +geompy = geomBuilder.New() +smesh = smeshBuilder.New() + + +def create_group_from(name, mother_shape, list_elem, type="EDGE"): + new = geompy.CreateGroup(mother_shape, geompy.ShapeType[type]) + geompy.UnionList(new, list_elem) + new.SetName(name) + geompy.addToStudyInFather(mother_shape, new, name) + return new + + +r = 1. +NumberOfSegments = 200 + +points = [geompy.MakeVertex(r * cos(i * pi / 3), r * sin(i * pi / 3), 0) for i in range(7)] +edges = [geompy.MakeEdge(points[i], points[i + 1]) for i in range(6)] +wire = geompy.MakeWire(edges) +hexa = geompy.MakeFace(wire, True) +geompy.addToStudy(hexa, "hexa") +g = create_group_from("boundaries", hexa, [geompy.GetInPlace(hexa, wire, 1)]) + +mesh = smesh.Mesh(hexa, "mesh") +msurf = mesh.Triangle(algo=smeshBuilder.NETGEN_1D2D) +NETGEN_2D_Simple_Parameters_1 = msurf.Parameters(smeshBuilder.SIMPLE) +NETGEN_2D_Simple_Parameters_1.SetNumberOfSegments( NumberOfSegments ) + +mesh.Group(g) + +mesh.Compute() +mesh.ExportMED("meshHexagonWithTriangles"+str(NumberOfSegments)+".med") diff --git a/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles10.med b/CDMATH/tests/ressources/2DHexagonWithTriangles/meshHexagonWithTriangles10.med new file mode 100644 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 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 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 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 index 0000000..c63ca1a Binary files /dev/null and b/CDMATH/tests/ressources/meshHexagonWithTriangles.med differ