From: Nils Much Date: Thu, 7 Mar 2024 13:51:00 +0000 (+0100) Subject: Add test for subdivided_hyper_rectangle_with_simplices() X-Git-Tag: v9.6.0-rc1~492^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13bd970aeadc9c4cd820dabf25473a43c4c49d03;p=dealii.git Add test for subdivided_hyper_rectangle_with_simplices() --- diff --git a/tests/grid/grid_generator_11.cc b/tests/grid/grid_generator_11.cc new file mode 100644 index 0000000000..fea42fcfbb --- /dev/null +++ b/tests/grid/grid_generator_11.cc @@ -0,0 +1,78 @@ +// ------------------------------------------------------------------------ +// +// SPDX-License-Identifier: LGPL-2.1-or-later +// Copyright (C) 2016 - 2024 by the deal.II authors +// +// This file is part of the deal.II library. +// +// Part of the source code is dual licensed under Apache-2.0 WITH +// LLVM-exception OR LGPL-2.1-or-later. Detailed license information +// governing the source code and code contributions can be found in +// LICENSE.md and CONTRIBUTING.md at the top level directory of deal.II. +// +// ------------------------------------------------------------------------ + + + +// Test GridGenerator::subdivided_hyper_rectangle_with_simplices + +#include + +#include +#include +#include + +#include "../tests.h" + + + +template +void +test(std::ostream &out) +{ + Point p1; + p1[0] = 2.; + if (dim > 1) + p1[1] = -1.; + if (dim > 2) + p1[2] = 0.; + Point p2; + p2[0] = 3.; + if (dim > 1) + p2[1] = 2.; + if (dim > 2) + p2[2] = 4.; + + GridOut go; + go.set_flags(GridOutFlags::Msh(true)); + + if (dim > 1) + { + deallog << "subdivided_hyper_rectangle_with_simplices" << std::endl; + Triangulation tr; + std::vector sub(dim); + sub[0] = 2; + if (dim > 1) + sub[1] = 3; + if (dim > 2) + sub[2] = 4; + GridGenerator::subdivided_hyper_rectangle_with_simplices( + tr, sub, p1, p2, true); + if (tr.n_cells() > 0) + go.write_msh(tr, out); + } +} + + +int +main() +{ + initlog(); + + deallog.push("2d"); + test<2>(deallog.get_file_stream()); + deallog.pop(); + deallog.push("3d"); + test<3>(deallog.get_file_stream()); + deallog.pop(); +} diff --git a/tests/grid/grid_generator_11.output b/tests/grid/grid_generator_11.output new file mode 100644 index 0000000000..8a74419ab6 --- /dev/null +++ b/tests/grid/grid_generator_11.output @@ -0,0 +1,306 @@ + +DEAL:2d::subdivided_hyper_rectangle_with_simplices +$NOD +12 +1 2.00000 -1.00000 0 +2 2.50000 -1.00000 0 +3 3.00000 -1.00000 0 +4 2.00000 0.00000 0 +5 2.50000 0.00000 0 +6 3.00000 0.00000 0 +7 2.00000 1.00000 0 +8 2.50000 1.00000 0 +9 3.00000 1.00000 0 +10 2.00000 2.00000 0 +11 2.50000 2.00000 0 +12 3.00000 2.00000 0 +$ENDNOD +$ELM +19 +1 2 1 0 3 1 2 4 +2 2 1 0 3 5 4 2 +3 2 1 0 3 2 3 5 +4 2 1 0 3 6 5 3 +5 2 3 0 3 4 5 7 +6 2 3 0 3 8 7 5 +7 2 3 0 3 5 6 8 +8 2 3 0 3 9 8 6 +9 2 3 0 3 7 8 10 +10 2 3 0 3 11 10 8 +11 2 3 0 3 8 9 11 +12 2 3 0 3 12 11 9 +13 1 2 2 2 1 2 +14 1 2 2 2 2 3 +15 1 1 1 2 3 6 +16 1 1 1 2 6 9 +17 1 1 1 2 9 12 +18 1 3 3 2 11 10 +19 1 3 3 2 12 11 +$ENDELM +DEAL:3d::subdivided_hyper_rectangle_with_simplices +$NOD +60 +1 2.00000 -1.00000 0.00000 +2 2.50000 -1.00000 0.00000 +3 3.00000 -1.00000 0.00000 +4 2.00000 0.00000 0.00000 +5 2.50000 0.00000 0.00000 +6 3.00000 0.00000 0.00000 +7 2.00000 1.00000 0.00000 +8 2.50000 1.00000 0.00000 +9 3.00000 1.00000 0.00000 +10 2.00000 2.00000 0.00000 +11 2.50000 2.00000 0.00000 +12 3.00000 2.00000 0.00000 +13 2.00000 -1.00000 1.00000 +14 2.50000 -1.00000 1.00000 +15 3.00000 -1.00000 1.00000 +16 2.00000 0.00000 1.00000 +17 2.50000 0.00000 1.00000 +18 3.00000 0.00000 1.00000 +19 2.00000 1.00000 1.00000 +20 2.50000 1.00000 1.00000 +21 3.00000 1.00000 1.00000 +22 2.00000 2.00000 1.00000 +23 2.50000 2.00000 1.00000 +24 3.00000 2.00000 1.00000 +25 2.00000 -1.00000 2.00000 +26 2.50000 -1.00000 2.00000 +27 3.00000 -1.00000 2.00000 +28 2.00000 0.00000 2.00000 +29 2.50000 0.00000 2.00000 +30 3.00000 0.00000 2.00000 +31 2.00000 1.00000 2.00000 +32 2.50000 1.00000 2.00000 +33 3.00000 1.00000 2.00000 +34 2.00000 2.00000 2.00000 +35 2.50000 2.00000 2.00000 +36 3.00000 2.00000 2.00000 +37 2.00000 -1.00000 3.00000 +38 2.50000 -1.00000 3.00000 +39 3.00000 -1.00000 3.00000 +40 2.00000 0.00000 3.00000 +41 2.50000 0.00000 3.00000 +42 3.00000 0.00000 3.00000 +43 2.00000 1.00000 3.00000 +44 2.50000 1.00000 3.00000 +45 3.00000 1.00000 3.00000 +46 2.00000 2.00000 3.00000 +47 2.50000 2.00000 3.00000 +48 3.00000 2.00000 3.00000 +49 2.00000 -1.00000 4.00000 +50 2.50000 -1.00000 4.00000 +51 3.00000 -1.00000 4.00000 +52 2.00000 0.00000 4.00000 +53 2.50000 0.00000 4.00000 +54 3.00000 0.00000 4.00000 +55 2.00000 1.00000 4.00000 +56 2.50000 1.00000 4.00000 +57 3.00000 1.00000 4.00000 +58 2.00000 2.00000 4.00000 +59 2.50000 2.00000 4.00000 +60 3.00000 2.00000 4.00000 +$ENDNOD +$ELM +200 +1 4 5 0 4 1 2 4 13 +2 4 5 0 4 4 2 5 17 +3 4 5 0 4 2 13 14 17 +4 4 5 0 4 4 13 17 16 +5 4 5 0 4 2 4 13 17 +6 4 5 0 4 2 3 6 15 +7 4 5 0 4 2 6 5 17 +8 4 5 0 4 2 14 15 17 +9 4 5 0 4 6 15 18 17 +10 4 5 0 4 2 6 17 15 +11 4 7 0 4 4 5 8 17 +12 4 7 0 4 4 8 7 19 +13 4 7 0 4 4 16 17 19 +14 4 7 0 4 8 17 20 19 +15 4 7 0 4 4 8 19 17 +16 4 7 0 4 5 6 8 17 +17 4 7 0 4 8 6 9 21 +18 4 7 0 4 6 17 18 21 +19 4 7 0 4 8 17 21 20 +20 4 7 0 4 6 8 17 21 +21 4 7 0 4 7 8 10 19 +22 4 7 0 4 10 8 11 23 +23 4 7 0 4 8 19 20 23 +24 4 7 0 4 10 19 23 22 +25 4 7 0 4 8 10 19 23 +26 4 7 0 4 8 9 12 21 +27 4 7 0 4 8 12 11 23 +28 4 7 0 4 8 20 21 23 +29 4 7 0 4 12 21 24 23 +30 4 7 0 4 8 12 23 21 +31 4 5 0 4 13 14 17 26 +32 4 5 0 4 13 17 16 28 +33 4 5 0 4 13 25 26 28 +34 4 5 0 4 17 26 29 28 +35 4 5 0 4 13 17 28 26 +36 4 5 0 4 14 15 17 26 +37 4 5 0 4 17 15 18 30 +38 4 5 0 4 15 26 27 30 +39 4 5 0 4 17 26 30 29 +40 4 5 0 4 15 17 26 30 +41 4 7 0 4 16 17 19 28 +42 4 7 0 4 19 17 20 32 +43 4 7 0 4 17 28 29 32 +44 4 7 0 4 19 28 32 31 +45 4 7 0 4 17 19 28 32 +46 4 7 0 4 17 18 21 30 +47 4 7 0 4 17 21 20 32 +48 4 7 0 4 17 29 30 32 +49 4 7 0 4 21 30 33 32 +50 4 7 0 4 17 21 32 30 +51 4 7 0 4 19 20 23 32 +52 4 7 0 4 19 23 22 34 +53 4 7 0 4 19 31 32 34 +54 4 7 0 4 23 32 35 34 +55 4 7 0 4 19 23 34 32 +56 4 7 0 4 20 21 23 32 +57 4 7 0 4 23 21 24 36 +58 4 7 0 4 21 32 33 36 +59 4 7 0 4 23 32 36 35 +60 4 7 0 4 21 23 32 36 +61 4 5 0 4 25 26 28 37 +62 4 5 0 4 28 26 29 41 +63 4 5 0 4 26 37 38 41 +64 4 5 0 4 28 37 41 40 +65 4 5 0 4 26 28 37 41 +66 4 5 0 4 26 27 30 39 +67 4 5 0 4 26 30 29 41 +68 4 5 0 4 26 38 39 41 +69 4 5 0 4 30 39 42 41 +70 4 5 0 4 26 30 41 39 +71 4 7 0 4 28 29 32 41 +72 4 7 0 4 28 32 31 43 +73 4 7 0 4 28 40 41 43 +74 4 7 0 4 32 41 44 43 +75 4 7 0 4 28 32 43 41 +76 4 7 0 4 29 30 32 41 +77 4 7 0 4 32 30 33 45 +78 4 7 0 4 30 41 42 45 +79 4 7 0 4 32 41 45 44 +80 4 7 0 4 30 32 41 45 +81 4 7 0 4 31 32 34 43 +82 4 7 0 4 34 32 35 47 +83 4 7 0 4 32 43 44 47 +84 4 7 0 4 34 43 47 46 +85 4 7 0 4 32 34 43 47 +86 4 7 0 4 32 33 36 45 +87 4 7 0 4 32 36 35 47 +88 4 7 0 4 32 44 45 47 +89 4 7 0 4 36 45 48 47 +90 4 7 0 4 32 36 47 45 +91 4 5 0 4 37 38 41 50 +92 4 5 0 4 37 41 40 52 +93 4 5 0 4 37 49 50 52 +94 4 5 0 4 41 50 53 52 +95 4 5 0 4 37 41 52 50 +96 4 5 0 4 38 39 41 50 +97 4 5 0 4 41 39 42 54 +98 4 5 0 4 39 50 51 54 +99 4 5 0 4 41 50 54 53 +100 4 5 0 4 39 41 50 54 +101 4 7 0 4 40 41 43 52 +102 4 7 0 4 43 41 44 56 +103 4 7 0 4 41 52 53 56 +104 4 7 0 4 43 52 56 55 +105 4 7 0 4 41 43 52 56 +106 4 7 0 4 41 42 45 54 +107 4 7 0 4 41 45 44 56 +108 4 7 0 4 41 53 54 56 +109 4 7 0 4 45 54 57 56 +110 4 7 0 4 41 45 56 54 +111 4 7 0 4 43 44 47 56 +112 4 7 0 4 43 47 46 58 +113 4 7 0 4 43 55 56 58 +114 4 7 0 4 47 56 59 58 +115 4 7 0 4 43 47 58 56 +116 4 7 0 4 44 45 47 56 +117 4 7 0 4 47 45 48 60 +118 4 7 0 4 45 56 57 60 +119 4 7 0 4 47 56 60 59 +120 4 7 0 4 45 47 56 60 +121 2 2 2 3 2 1 13 +122 2 4 4 3 1 2 4 +123 2 2 2 3 3 2 15 +124 2 4 4 3 2 3 6 +125 2 4 4 3 4 2 5 +126 2 2 2 3 2 13 14 +127 2 1 1 3 6 3 15 +128 2 4 4 3 4 5 8 +129 2 4 4 3 2 6 5 +130 2 4 4 3 5 6 8 +131 2 4 4 3 8 6 9 +132 2 1 1 3 9 6 21 +133 2 1 1 3 6 15 18 +134 2 4 4 3 4 8 7 +135 2 4 4 3 7 8 10 +136 2 4 4 3 10 8 11 +137 2 4 4 3 8 9 12 +138 2 1 1 3 12 9 21 +139 2 3 3 3 10 23 22 +140 2 3 3 3 10 11 23 +141 2 4 4 3 8 12 11 +142 2 3 3 3 11 12 23 +143 2 1 1 3 12 21 24 +144 2 2 2 3 14 13 26 +145 2 2 2 3 13 25 26 +146 2 2 2 3 2 14 15 +147 2 2 2 3 15 14 26 +148 2 1 1 3 18 15 30 +149 2 2 2 3 15 26 27 +150 2 1 1 3 6 18 21 +151 2 1 1 3 21 18 30 +152 2 1 1 3 24 21 36 +153 2 1 1 3 21 30 33 +154 2 3 3 3 22 23 34 +155 2 3 3 3 23 36 35 +156 2 3 3 3 12 24 23 +157 2 3 3 3 23 24 36 +158 2 2 2 3 26 25 37 +159 2 2 2 3 27 26 39 +160 2 2 2 3 26 37 38 +161 2 1 1 3 15 27 30 +162 2 1 1 3 30 27 39 +163 2 1 1 3 33 30 45 +164 2 1 1 3 30 39 42 +165 2 1 1 3 21 33 36 +166 2 1 1 3 36 33 45 +167 2 3 3 3 34 47 46 +168 2 3 3 3 23 35 34 +169 2 3 3 3 34 35 47 +170 2 3 3 3 35 36 47 +171 2 1 1 3 36 45 48 +172 2 2 2 3 38 37 50 +173 2 2 2 3 37 49 50 +174 2 2 2 3 26 38 39 +175 2 2 2 3 39 38 50 +176 2 1 1 3 42 39 54 +177 2 2 2 3 39 50 51 +178 2 1 1 3 30 42 45 +179 2 1 1 3 45 42 54 +180 2 1 1 3 48 45 60 +181 2 1 1 3 45 54 57 +182 2 3 3 3 46 47 58 +183 2 3 3 3 47 60 59 +184 2 3 3 3 36 48 47 +185 2 3 3 3 47 48 60 +186 2 5 5 3 50 49 52 +187 2 5 5 3 51 50 54 +188 2 5 5 3 53 50 52 +189 2 5 5 3 54 50 53 +190 2 1 1 3 39 51 54 +191 2 5 5 3 56 52 55 +192 2 5 5 3 53 52 56 +193 2 5 5 3 54 53 56 +194 2 5 5 3 57 54 56 +195 2 5 5 3 56 55 58 +196 2 5 5 3 59 56 58 +197 2 5 5 3 60 56 59 +198 2 1 1 3 45 57 60 +199 2 5 5 3 57 56 60 +200 2 3 3 3 47 59 58 +$ENDELM