From dd2df8003965a8e6bf59041836d82c412ab6db8b Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Sun, 12 Apr 2015 19:54:14 +0200 Subject: [PATCH] Added test and fixed 1d issue. --- source/grid/grid_generator.cc | 9 +-- tests/grid/grid_generator_08.cc | 12 ++-- tests/grid/grid_generator_08.output | 92 +++++++++++++++++++++++++++++ 3 files changed, 103 insertions(+), 10 deletions(-) diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index b4cb0578ad..5dd92b5e48 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -83,13 +83,14 @@ namespace GridGenerator + template void - colorize_subdivided_hyper_rectangle (Triangulation<1> &tria, - const Point<1> &, - const Point<1> &, + colorize_subdivided_hyper_rectangle (Triangulation<1,spacedim> &tria, + const Point &, + const Point &, const double) { - for (Triangulation<1>::cell_iterator cell = tria.begin(); + for (typename Triangulation<1,spacedim>::cell_iterator cell = tria.begin(); cell != tria.end(); ++cell) if (cell->center()(0) > 0) cell->set_material_id(1); diff --git a/tests/grid/grid_generator_08.cc b/tests/grid/grid_generator_08.cc index 740b483ea5..9df022f024 100644 --- a/tests/grid/grid_generator_08.cc +++ b/tests/grid/grid_generator_08.cc @@ -93,12 +93,12 @@ int main() deallog.depth_console(0); deallog.threshold_double(1.e-10); -// deallog.push("1d"); -// test<1,2>(logfile); -// deallog.pop(); -// deallog.push("2d"); -// test<1,3>(logfile); -// deallog.pop(); + deallog.push("1-2"); + test<1,2>(logfile); + deallog.pop(); + deallog.push("1-3"); + test<1,3>(logfile); + deallog.pop(); deallog.push("2-3"); test<2,3>(logfile); deallog.pop(); diff --git a/tests/grid/grid_generator_08.output b/tests/grid/grid_generator_08.output index 455c752ba9..4844213b23 100644 --- a/tests/grid/grid_generator_08.output +++ b/tests/grid/grid_generator_08.output @@ -1,4 +1,96 @@ +DEAL:1-2::hyper_cube +$NOD +2 +1 3.00000 0.00000 0 +2 7.00000 0.00000 0 +$ENDNOD +$ELM +1 +1 1 0 0 2 1 2 +$ENDELM +DEAL:1-2::subdivided_hyper_cube +$NOD +4 +1 1.00000 0.00000 0 +2 3.00000 0.00000 0 +3 5.00000 0.00000 0 +4 7.00000 0.00000 0 +$ENDNOD +$ELM +3 +1 1 0 0 2 1 2 +2 1 0 0 2 2 3 +3 1 0 0 2 3 4 +$ENDELM +DEAL:1-2::hyper_rectangle +$NOD +2 +1 2.00000 0.00000 0 +2 3.00000 0.00000 0 +$ENDNOD +$ELM +1 +1 1 0 0 2 1 2 +$ENDELM +DEAL:1-2::subdivided_hyper_rectangle +$NOD +3 +1 2.00000 0.00000 0 +2 2.50000 0.00000 0 +3 3.00000 0.00000 0 +$ENDNOD +$ELM +2 +1 1 1 0 2 1 2 +2 1 1 0 2 2 3 +$ENDELM +DEAL:1-3::hyper_cube +$NOD +2 +1 3.00000 0.00000 0.00000 +2 7.00000 0.00000 0.00000 +$ENDNOD +$ELM +1 +1 1 0 0 2 1 2 +$ENDELM +DEAL:1-3::subdivided_hyper_cube +$NOD +4 +1 1.00000 0.00000 0.00000 +2 3.00000 0.00000 0.00000 +3 5.00000 0.00000 0.00000 +4 7.00000 0.00000 0.00000 +$ENDNOD +$ELM +3 +1 1 0 0 2 1 2 +2 1 0 0 2 2 3 +3 1 0 0 2 3 4 +$ENDELM +DEAL:1-3::hyper_rectangle +$NOD +2 +1 2.00000 0.00000 0.00000 +2 3.00000 0.00000 0.00000 +$ENDNOD +$ELM +1 +1 1 0 0 2 1 2 +$ENDELM +DEAL:1-3::subdivided_hyper_rectangle +$NOD +3 +1 2.00000 0.00000 0.00000 +2 2.50000 0.00000 0.00000 +3 3.00000 0.00000 0.00000 +$ENDNOD +$ELM +2 +1 1 1 0 2 1 2 +2 1 1 0 2 2 3 +$ENDELM DEAL:2-3::hyper_cube $NOD 4 -- 2.39.5