From deee598b1a38838a30b5156b7613533ebfdf4a47 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Tue, 9 Nov 2010 16:26:19 +0000 Subject: [PATCH] test cochain runs on 2D with local refinement and on 3D with global git-svn-id: https://svn.dealii.org/trunk@22649 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/integrators/cochain_01.cc | 65 ++++++++++++----- tests/integrators/cochain_01/cmp/generic | 91 ++++++++++++++++++++++++ tests/lib/test_grids.h | 4 +- 3 files changed, 142 insertions(+), 18 deletions(-) create mode 100644 tests/integrators/cochain_01/cmp/generic diff --git a/tests/integrators/cochain_01.cc b/tests/integrators/cochain_01.cc index f410187d27..c217acda52 100644 --- a/tests/integrators/cochain_01.cc +++ b/tests/integrators/cochain_01.cc @@ -211,7 +211,7 @@ test_cochain(const Triangulation& tr, const FiniteElement& fe) } } -void run (const Triangulation<2>& tr, unsigned int degree) +void run2d (unsigned int degree) { std::ostringstream prefix; prefix << "d2-p" << degree; @@ -224,12 +224,32 @@ void run (const Triangulation<2>& tr, unsigned int degree) FESystem<2> fe(h1,1,hdiv,1,l2,1); - test_cochain(tr, fe); + if (true) + { + Triangulation<2> tr; + TestGrids::hypercube(tr, 1); + test_cochain(tr, fe); + } + + if (true) + { + Triangulation<2> tr; + TestGrids::hypercube(tr, 2, true); + test_cochain(tr, fe); + } + + if (true) + { + Triangulation<2> tr; + TestGrids::hypercube(tr, 3, true); + test_cochain(tr, fe); + } + deallog.pop(); } -void run (const Triangulation<3>& tr, unsigned int degree) +void run3d (unsigned int degree) { std::ostringstream prefix; prefix << "d3-p" << degree; @@ -247,8 +267,20 @@ void run (const Triangulation<3>& tr, unsigned int degree) FESystem<3> fe(h1,1,hcurl,1,hdiv,1,l2,1); - test_cochain(tr, fe); - deallog.pop(); + if (true) + { + Triangulation<3> tr; + TestGrids::hypercube(tr, 1); + test_cochain(tr, fe); + } + + if (true) + { + Triangulation<3> tr(Triangulation<3>::limit_level_difference_at_vertices); + TestGrids::hypercube(tr, 2, true); + test_cochain(tr, fe); + } +deallog.pop(); } @@ -257,17 +289,16 @@ int main() const std::string logname = JobIdentifier::base_name(__FILE__) + std::string("/output"); std::ofstream logfile(logname.c_str()); deallog.attach(logfile); -// deallog.depth_console(0); -// deallog.threshold_double(1.e-10); - - Triangulation<2> tr2; - TestGrids::hypercube(tr2, 1); - run(tr2, 0); - run(tr2, 1); - run(tr2, 2); + if (!debugging) + { + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + } + + run2d(0); + run2d(1); + run2d(2); - Triangulation<3> tr3; - TestGrids::hypercube(tr3, 1); - run(tr3, 0); - run(tr3, 1); + run3d(0); + run3d(1); } diff --git a/tests/integrators/cochain_01/cmp/generic b/tests/integrators/cochain_01/cmp/generic new file mode 100644 index 0000000000..58aefa2e74 --- /dev/null +++ b/tests/integrators/cochain_01/cmp/generic @@ -0,0 +1,91 @@ + +DEAL:d2-p0::Setup +DEAL:d2-p0::Triangulation hypercube 2D refinement 1 steps 4 active cells 5 total cells +DEAL:d2-p0::Form 0 +DEAL:d2-p0::Difference d*d 0 +DEAL:d2-p0::Form 1 +DEAL:d2-p0::d^2 0 +DEAL:d2-p0::d*d^2 0 +DEAL:d2-p0::Difference d*d 0 +DEAL:d2-p0::Triangulation hypercube 2D refinement 2 local steps 7 active cells 9 total cells +DEAL:d2-p0::Form 0 +DEAL:d2-p0::Difference d*d 0 +DEAL:d2-p0::Form 1 +DEAL:d2-p0::d^2 0 +DEAL:d2-p0::d*d^2 0 +DEAL:d2-p0::Difference d*d 0 +DEAL:d2-p0::Triangulation hypercube 2D refinement 3 local steps 25 active cells 33 total cells +DEAL:d2-p0::Form 0 +DEAL:d2-p0::Difference d*d 0 +DEAL:d2-p0::Form 1 +DEAL:d2-p0::d^2 0 +DEAL:d2-p0::d*d^2 0 +DEAL:d2-p0::Difference d*d 0 +DEAL:d2-p1::Setup +DEAL:d2-p1::Triangulation hypercube 2D refinement 1 steps 4 active cells 5 total cells +DEAL:d2-p1::Form 0 +DEAL:d2-p1::Difference d*d 0 +DEAL:d2-p1::Form 1 +DEAL:d2-p1::d^2 0 +DEAL:d2-p1::d*d^2 0 +DEAL:d2-p1::Difference d*d 0 +DEAL:d2-p1::Triangulation hypercube 2D refinement 2 local steps 7 active cells 9 total cells +DEAL:d2-p1::Form 0 +DEAL:d2-p1::Difference d*d 0 +DEAL:d2-p1::Form 1 +DEAL:d2-p1::d^2 0 +DEAL:d2-p1::d*d^2 0 +DEAL:d2-p1::Difference d*d 0 +DEAL:d2-p1::Triangulation hypercube 2D refinement 3 local steps 25 active cells 33 total cells +DEAL:d2-p1::Form 0 +DEAL:d2-p1::Difference d*d 0 +DEAL:d2-p1::Form 1 +DEAL:d2-p1::d^2 0 +DEAL:d2-p1::d*d^2 0 +DEAL:d2-p1::Difference d*d 0 +DEAL:d2-p2::Setup +DEAL:d2-p2::Triangulation hypercube 2D refinement 1 steps 4 active cells 5 total cells +DEAL:d2-p2::Form 0 +DEAL:d2-p2::Difference d*d 0 +DEAL:d2-p2::Form 1 +DEAL:d2-p2::d^2 0 +DEAL:d2-p2::d*d^2 0 +DEAL:d2-p2::Difference d*d 0 +DEAL:d2-p2::Triangulation hypercube 2D refinement 2 local steps 7 active cells 9 total cells +DEAL:d2-p2::Form 0 +DEAL:d2-p2::Difference d*d 0 +DEAL:d2-p2::Form 1 +DEAL:d2-p2::d^2 0 +DEAL:d2-p2::d*d^2 0 +DEAL:d2-p2::Difference d*d 0 +DEAL:d2-p2::Triangulation hypercube 2D refinement 3 local steps 25 active cells 33 total cells +DEAL:d2-p2::Form 0 +DEAL:d2-p2::Difference d*d 0 +DEAL:d2-p2::Form 1 +DEAL:d2-p2::d^2 0 +DEAL:d2-p2::d*d^2 0 +DEAL:d2-p2::Difference d*d 0 +DEAL:d3-p0::Setup +DEAL:d3-p0::Triangulation hypercube 3D refinement 1 steps 8 active cells 9 total cells +DEAL:d3-p0::Form 0 +DEAL:d3-p0::Difference d*d 0 +DEAL:d3-p0::Form 1 +DEAL:d3-p0::d^2 0 +DEAL:d3-p0::d*d^2 0 +DEAL:d3-p0::Difference d*d 0 +DEAL:d3-p0::Form 2 +DEAL:d3-p0::d^2 0 +DEAL:d3-p0::d*d^2 0 +DEAL:d3-p0::Difference d*d 0 +DEAL:d3-p1::Setup +DEAL:d3-p1::Triangulation hypercube 3D refinement 1 steps 8 active cells 9 total cells +DEAL:d3-p1::Form 0 +DEAL:d3-p1::Difference d*d 0 +DEAL:d3-p1::Form 1 +DEAL:d3-p1::d^2 0 +DEAL:d3-p1::d*d^2 0 +DEAL:d3-p1::Difference d*d 0 +DEAL:d3-p1::Form 2 +DEAL:d3-p1::d^2 0 +DEAL:d3-p1::d*d^2 0 +DEAL:d3-p1::Difference d*d 0 diff --git a/tests/lib/test_grids.h b/tests/lib/test_grids.h index f5e44d56d7..d8b2614b18 100644 --- a/tests/lib/test_grids.h +++ b/tests/lib/test_grids.h @@ -59,7 +59,7 @@ namespace TestGrids unsigned int refinement = 0, bool local = false) { - GridGenerator::hyper_cube(tr); + GridGenerator::hyper_cube(tr, -1., 1.); if (refinement && !local) tr.refine_global(refinement); if (refinement && local) @@ -74,6 +74,8 @@ namespace TestGrids bool negative = true; for (unsigned int d=0;d= 0.)negative = false; + if (negative) + cell->set_refine_flag(); } tr.execute_coarsening_and_refinement(); } -- 2.39.5