Пример #1
0
        public void LShapePeriodicBoundaries()
        {
            byte[] tags = { 1, 1, 181, 1, 1, 181 };
            SortedList <byte, string> tagNames = new SortedList <byte, string>(2)
            {
                { 1, "Dirichlet" },
                { 181, "Periodic" }
            };

            MultidimensionalArray nodes = MultidimensionalArray.Create(6, 2);

            nodes.SetRow(0, new double[] { -0.5, 0.5 });
            nodes.SetRow(1, new double[] { -0.8, -0.4 });
            nodes.SetRow(2, new double[] { 0, 0 });
            nodes.SetRow(3, new double[] { 0.8, 0.8 });
            nodes.SetRow(4, new double[] { 0.9, 0.2 });
            nodes.SetRow(5, new double[] { 0.5, -0.6 });

            VoronoiBoundary gridBoundary = new VoronoiBoundary
            {
                Polygon      = GridShapes.LShape(),
                EdgeTags     = tags,
                EdgeTagNames = tagNames
            };

            VoronoiGrid grid = VoronoiGrid2D.Polygonal(nodes, gridBoundary, 0, 1);
        }
Пример #2
0
        public void LShapedGrid()
        {
            var LShapePolygon = GridShapes.LShape();

            int[] NodeSeedsNumbers = { 20 };
            for (int i = 0; i < NodeSeedsNumbers.Length; ++i)
            {
                int   ammountOfNodeSeeds = NodeSeedsNumbers[i];
                IGrid grid = VoronoiGrid2D.Polygonal(LShapePolygon, 5, ammountOfNodeSeeds);
            }
        }
Пример #3
0
        public void LShapePeriodicBoundariesLarge()
        {
            byte[] tags = { 1, 1, 181, 1, 1, 181 };
            SortedList <byte, string> tagNames = new SortedList <byte, string>(2)
            {
                { 1, "Dirichlet" },
                { 181, "Periodic" }
            };

            VoronoiBoundary gridBoundary = new VoronoiBoundary
            {
                Polygon      = GridShapes.LShape(),
                EdgeTags     = tags,
                EdgeTagNames = tagNames
            };

            VoronoiGrid grid = VoronoiGrid2D.Polygonal(gridBoundary, 10, 500);
        }