From: David Wells Date: Tue, 14 Mar 2023 19:26:23 +0000 (-0400) Subject: Add parse and create functions for simplices. X-Git-Tag: v9.5.0-rc1~478^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cb08f32a59d520e8f244b26ebc85cc80edddb656;p=dealii.git Add parse and create functions for simplices. --- diff --git a/source/grid/grid_generator_from_name.cc b/source/grid/grid_generator_from_name.cc index a6aa62a15b..5747c96aed 100644 --- a/source/grid/grid_generator_from_name.cc +++ b/source/grid/grid_generator_from_name.cc @@ -230,6 +230,21 @@ namespace GridGenerator double, unsigned int, bool>(concentric_hyper_shells, arguments, tria); + + else if (name == "subdivided_hyper_cube_with_simplices") + parse_and_create( + subdivided_hyper_cube_with_simplices, arguments, tria); + + else if (name == "subdivided_hyper_rectangle_with_simplices") + parse_and_create &, + const Point &, + const Point &, + bool>(subdivided_hyper_rectangle_with_simplices, + arguments, + tria); + else return false; diff --git a/tests/grid/grid_generator_from_name_and_argument_02.cc b/tests/grid/grid_generator_from_name_and_argument_02.cc index 4ef5fd1b3c..610daf7585 100644 --- a/tests/grid/grid_generator_from_name_and_argument_02.cc +++ b/tests/grid/grid_generator_from_name_and_argument_02.cc @@ -54,4 +54,12 @@ main() test<2, 2>("hyper_ball_balanced", "0,0 : 1"); test<3, 3>("hyper_ball_balanced", "0,0,0 : 1"); + + test<2, 2>("subdivided_hyper_cube_with_simplices", "2 : 0.0 : 1.0 : false"); + test<3, 3>("subdivided_hyper_cube_with_simplices", "2 : 0.0 : 1.0 : false"); + + test<2, 2>("subdivided_hyper_rectangle_with_simplices", + "2, 2 : 0.0, 0.0 : 1.0, 2.0 : false"); + test<3, 3>("subdivided_hyper_rectangle_with_simplices", + "2, 2, 3 : 0.0, 0.0, 1.0 : 1.0, 2.0, 3.0 : false"); } diff --git a/tests/grid/grid_generator_from_name_and_argument_02.output b/tests/grid/grid_generator_from_name_and_argument_02.output index 5119b643ca..49262b9e5a 100644 --- a/tests/grid/grid_generator_from_name_and_argument_02.output +++ b/tests/grid/grid_generator_from_name_and_argument_02.output @@ -191,3 +191,228 @@ $ELM 31 5 0 0 8 18 16 38 37 27 25 52 53 32 5 0 0 8 43 36 48 50 37 38 52 53 $ENDELM +DEAL::Generating Triangulation<2, 2> : subdivided_hyper_cube_with_simplices(2 : 0.0 : 1.0 : false) +$NOD +9 +1 0.00000 0.00000 0 +2 0.500000 0.00000 0 +3 1.00000 0.00000 0 +4 0.00000 0.500000 0 +5 0.500000 0.500000 0 +6 1.00000 0.500000 0 +7 0.00000 1.00000 0 +8 0.500000 1.00000 0 +9 1.00000 1.00000 0 +$ENDNOD +$ELM +8 +1 2 0 0 3 1 2 4 +2 2 0 0 3 5 4 2 +3 2 0 0 3 2 3 5 +4 2 0 0 3 6 5 3 +5 2 0 0 3 4 5 7 +6 2 0 0 3 8 7 5 +7 2 0 0 3 5 6 8 +8 2 0 0 3 9 8 6 +$ENDELM +DEAL::Generating Triangulation<3, 3> : subdivided_hyper_cube_with_simplices(2 : 0.0 : 1.0 : false) +$NOD +27 +1 0.00000 0.00000 0.00000 +2 0.500000 0.00000 0.00000 +3 1.00000 0.00000 0.00000 +4 0.00000 0.500000 0.00000 +5 0.500000 0.500000 0.00000 +6 1.00000 0.500000 0.00000 +7 0.00000 1.00000 0.00000 +8 0.500000 1.00000 0.00000 +9 1.00000 1.00000 0.00000 +10 0.00000 0.00000 0.500000 +11 0.500000 0.00000 0.500000 +12 1.00000 0.00000 0.500000 +13 0.00000 0.500000 0.500000 +14 0.500000 0.500000 0.500000 +15 1.00000 0.500000 0.500000 +16 0.00000 1.00000 0.500000 +17 0.500000 1.00000 0.500000 +18 1.00000 1.00000 0.500000 +19 0.00000 0.00000 1.00000 +20 0.500000 0.00000 1.00000 +21 1.00000 0.00000 1.00000 +22 0.00000 0.500000 1.00000 +23 0.500000 0.500000 1.00000 +24 1.00000 0.500000 1.00000 +25 0.00000 1.00000 1.00000 +26 0.500000 1.00000 1.00000 +27 1.00000 1.00000 1.00000 +$ENDNOD +$ELM +40 +1 4 0 0 4 1 2 4 10 +2 4 0 0 4 4 2 5 14 +3 4 0 0 4 2 10 11 14 +4 4 0 0 4 4 10 14 13 +5 4 0 0 4 2 4 10 14 +6 4 0 0 4 2 3 6 12 +7 4 0 0 4 2 6 5 14 +8 4 0 0 4 2 11 12 14 +9 4 0 0 4 6 12 15 14 +10 4 0 0 4 2 6 14 12 +11 4 0 0 4 4 5 8 14 +12 4 0 0 4 4 8 7 16 +13 4 0 0 4 4 13 14 16 +14 4 0 0 4 8 14 17 16 +15 4 0 0 4 4 8 16 14 +16 4 0 0 4 5 6 8 14 +17 4 0 0 4 8 6 9 18 +18 4 0 0 4 6 14 15 18 +19 4 0 0 4 8 14 18 17 +20 4 0 0 4 6 8 14 18 +21 4 0 0 4 10 11 14 20 +22 4 0 0 4 10 14 13 22 +23 4 0 0 4 10 19 20 22 +24 4 0 0 4 14 20 23 22 +25 4 0 0 4 10 14 22 20 +26 4 0 0 4 11 12 14 20 +27 4 0 0 4 14 12 15 24 +28 4 0 0 4 12 20 21 24 +29 4 0 0 4 14 20 24 23 +30 4 0 0 4 12 14 20 24 +31 4 0 0 4 13 14 16 22 +32 4 0 0 4 16 14 17 26 +33 4 0 0 4 14 22 23 26 +34 4 0 0 4 16 22 26 25 +35 4 0 0 4 14 16 22 26 +36 4 0 0 4 14 15 18 24 +37 4 0 0 4 14 18 17 26 +38 4 0 0 4 14 23 24 26 +39 4 0 0 4 18 24 27 26 +40 4 0 0 4 14 18 26 24 +$ENDELM +DEAL::Generating Triangulation<2, 2> : subdivided_hyper_rectangle_with_simplices(2, 2 : 0.0, 0.0 : 1.0, 2.0 : false) +$NOD +9 +1 0.00000 0.00000 0 +2 0.500000 0.00000 0 +3 1.00000 0.00000 0 +4 0.00000 1.00000 0 +5 0.500000 1.00000 0 +6 1.00000 1.00000 0 +7 0.00000 2.00000 0 +8 0.500000 2.00000 0 +9 1.00000 2.00000 0 +$ENDNOD +$ELM +8 +1 2 0 0 3 1 2 4 +2 2 0 0 3 5 4 2 +3 2 0 0 3 2 3 5 +4 2 0 0 3 6 5 3 +5 2 0 0 3 4 5 7 +6 2 0 0 3 8 7 5 +7 2 0 0 3 5 6 8 +8 2 0 0 3 9 8 6 +$ENDELM +DEAL::Generating Triangulation<3, 3> : subdivided_hyper_rectangle_with_simplices(2, 2, 3 : 0.0, 0.0, 1.0 : 1.0, 2.0, 3.0 : false) +$NOD +36 +1 0.00000 0.00000 1.00000 +2 0.500000 0.00000 1.00000 +3 1.00000 0.00000 1.00000 +4 0.00000 1.00000 1.00000 +5 0.500000 1.00000 1.00000 +6 1.00000 1.00000 1.00000 +7 0.00000 2.00000 1.00000 +8 0.500000 2.00000 1.00000 +9 1.00000 2.00000 1.00000 +10 0.00000 0.00000 1.66667 +11 0.500000 0.00000 1.66667 +12 1.00000 0.00000 1.66667 +13 0.00000 1.00000 1.66667 +14 0.500000 1.00000 1.66667 +15 1.00000 1.00000 1.66667 +16 0.00000 2.00000 1.66667 +17 0.500000 2.00000 1.66667 +18 1.00000 2.00000 1.66667 +19 0.00000 0.00000 2.33333 +20 0.500000 0.00000 2.33333 +21 1.00000 0.00000 2.33333 +22 0.00000 1.00000 2.33333 +23 0.500000 1.00000 2.33333 +24 1.00000 1.00000 2.33333 +25 0.00000 2.00000 2.33333 +26 0.500000 2.00000 2.33333 +27 1.00000 2.00000 2.33333 +28 0.00000 0.00000 3.00000 +29 0.500000 0.00000 3.00000 +30 1.00000 0.00000 3.00000 +31 0.00000 1.00000 3.00000 +32 0.500000 1.00000 3.00000 +33 1.00000 1.00000 3.00000 +34 0.00000 2.00000 3.00000 +35 0.500000 2.00000 3.00000 +36 1.00000 2.00000 3.00000 +$ENDNOD +$ELM +60 +1 4 0 0 4 1 2 4 10 +2 4 0 0 4 4 2 5 14 +3 4 0 0 4 2 10 11 14 +4 4 0 0 4 4 10 14 13 +5 4 0 0 4 2 4 10 14 +6 4 0 0 4 2 3 6 12 +7 4 0 0 4 2 6 5 14 +8 4 0 0 4 2 11 12 14 +9 4 0 0 4 6 12 15 14 +10 4 0 0 4 2 6 14 12 +11 4 0 0 4 4 5 8 14 +12 4 0 0 4 4 8 7 16 +13 4 0 0 4 4 13 14 16 +14 4 0 0 4 8 14 17 16 +15 4 0 0 4 4 8 16 14 +16 4 0 0 4 5 6 8 14 +17 4 0 0 4 8 6 9 18 +18 4 0 0 4 6 14 15 18 +19 4 0 0 4 8 14 18 17 +20 4 0 0 4 6 8 14 18 +21 4 0 0 4 10 11 14 20 +22 4 0 0 4 10 14 13 22 +23 4 0 0 4 10 19 20 22 +24 4 0 0 4 14 20 23 22 +25 4 0 0 4 10 14 22 20 +26 4 0 0 4 11 12 14 20 +27 4 0 0 4 14 12 15 24 +28 4 0 0 4 12 20 21 24 +29 4 0 0 4 14 20 24 23 +30 4 0 0 4 12 14 20 24 +31 4 0 0 4 13 14 16 22 +32 4 0 0 4 16 14 17 26 +33 4 0 0 4 14 22 23 26 +34 4 0 0 4 16 22 26 25 +35 4 0 0 4 14 16 22 26 +36 4 0 0 4 14 15 18 24 +37 4 0 0 4 14 18 17 26 +38 4 0 0 4 14 23 24 26 +39 4 0 0 4 18 24 27 26 +40 4 0 0 4 14 18 26 24 +41 4 0 0 4 19 20 22 28 +42 4 0 0 4 22 20 23 32 +43 4 0 0 4 20 28 29 32 +44 4 0 0 4 22 28 32 31 +45 4 0 0 4 20 22 28 32 +46 4 0 0 4 20 21 24 30 +47 4 0 0 4 20 24 23 32 +48 4 0 0 4 20 29 30 32 +49 4 0 0 4 24 30 33 32 +50 4 0 0 4 20 24 32 30 +51 4 0 0 4 22 23 26 32 +52 4 0 0 4 22 26 25 34 +53 4 0 0 4 22 31 32 34 +54 4 0 0 4 26 32 35 34 +55 4 0 0 4 22 26 34 32 +56 4 0 0 4 23 24 26 32 +57 4 0 0 4 26 24 27 36 +58 4 0 0 4 24 32 33 36 +59 4 0 0 4 26 32 36 35 +60 4 0 0 4 24 26 32 36 +$ENDELM