From: guido Date: Fri, 12 Mar 1999 09:27:44 +0000 (+0000) Subject: refinement works / new tests in fe_tables X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=392d0883c76617f3d6a594ec75c9baf24680217d;p=dealii-svn.git refinement works / new tests in fe_tables git-svn-id: https://svn.dealii.org/trunk@998 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/deal.II/constraints.cc b/tests/deal.II/constraints.cc index 219431fec2..d343a4f051 100644 --- a/tests/deal.II/constraints.cc +++ b/tests/deal.II/constraints.cc @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include @@ -74,7 +74,7 @@ void make_tria (Triangulation<3> &tria, int step) tria.last_active()->set_refine_flag(); else tria.begin_active()->set_refine_flag(); - tria.execute_refinement (); + tria.execute_coarsening_and_refinement (); break; }; @@ -115,7 +115,7 @@ void make_tria (Triangulation<3> &tria, int step) tria.last_active()->set_refine_flag(); else tria.begin_active()->set_refine_flag(); - tria.execute_refinement (); + tria.execute_coarsening_and_refinement (); break; }; @@ -156,7 +156,7 @@ void make_tria (Triangulation<3> &tria, int step) tria.last_active()->set_refine_flag(); else tria.begin_active()->set_refine_flag(); - tria.execute_refinement (); + tria.execute_coarsening_and_refinement (); break; }; @@ -224,7 +224,7 @@ void make_tria (Triangulation<3> &tria, int step) break; }; - tria.execute_refinement (); + tria.execute_coarsening_and_refinement (); break; }; diff --git a/tests/deal.II/dof_test.cc b/tests/deal.II/dof_test.cc index 626dab3bf9..f10cfb5a18 100644 --- a/tests/deal.II/dof_test.cc +++ b/tests/deal.II/dof_test.cc @@ -222,11 +222,11 @@ void TestCases::run (const unsigned int test_case) { { // refine first cell tria->begin_active()->set_refine_flag(); - tria->execute_refinement (); + tria->execute_coarsening_and_refinement (); // refine first active cell // on coarsest level tria->begin_active()->set_refine_flag (); - tria->execute_refinement (); + tria->execute_coarsening_and_refinement (); Triangulation::active_cell_iterator cell; for (int i=0; i<(dim==2 ? 12 : 7); ++i) @@ -237,7 +237,7 @@ void TestCases::run (const unsigned int test_case) { cell = tria->last_active(tria->n_levels()-1); --cell; cell->set_refine_flag (); - tria->execute_refinement (); + tria->execute_coarsening_and_refinement (); }; break; @@ -260,7 +260,7 @@ void TestCases::run (const unsigned int test_case) { // refine once tria->begin_active()->set_refine_flag(); - tria->execute_refinement (); + tria->execute_coarsening_and_refinement (); Triangulation::active_cell_iterator cell, endc; for (int i=0; i<5-dim; ++i) @@ -274,7 +274,7 @@ void TestCases::run (const unsigned int test_case) { if (cell->at_boundary()) cell->set_refine_flag(); - tria->execute_refinement(); + tria->execute_coarsening_and_refinement(); }; break; diff --git a/tests/deal.II/fe_tables.cc b/tests/deal.II/fe_tables.cc index 8309e2c82e..0f0e9e3578 100644 --- a/tests/deal.II/fe_tables.cc +++ b/tests/deal.II/fe_tables.cc @@ -1,18 +1,52 @@ // $Id$ -// deal_II_libraries.g=-ldeal_II_2d.g +// deal_II_libraries.g=-ldeal_II_2d.g -ldeal_II_1d.g // deal_II_libraries=-ldeal_II_2d +#include +#include +#include #include #include #include +#include +#include +#include +#include +#include +#include #include #include +#define TEST_ELEMENT(e) { deallog.push(#e); e el;\ + print_fe_statistics(el); deallog.pop(); deallog << endl; } +#define TEST_MULTIPLE(e,n,d) { deallog.push(#e "x" #n); e eb; FESystem el(eb,n); \ + print_fe_statistics(el); deallog.pop(); deallog << endl; } +#define TEST_MIXED2(e1,n1,e2,n2,d) { deallog.push(#e1 "x" #n1 "-" #e2 "x" #n2);\ + e1 eb1; e2 eb2; FESystem el(eb1,n1,eb2,n2);\ + print_fe_statistics(el); deallog.pop(); deallog << endl; } + + template inline void print_fe_statistics(const FiniteElement& fe) { + Triangulation tr; + tr.create_hypercube(-1,1); + DoFHandler dof(&tr); + dof.distribute_dofs(fe); + StraightBoundary boundary; + DoFHandler::active_cell_iterator cell = dof.begin_active(); + DoFHandler::active_face_iterator face = dof.begin_active_face(); + + vector > unit_points(fe.total_dofs); + vector > support_points(fe.total_dofs); + vector > face_support_points(fe.dofs_per_face); + +// fe.get_unit_support_points(unit_points); +// fe.get_support_points(cell, boundary, support_points); + fe.get_face_support_points(face, boundary, face_support_points); + deallog << "total_dofs" << " " << fe.total_dofs; deallog << ": vertex" << " " << fe.dofs_per_vertex; deallog << " line" << " " << fe.dofs_per_line; @@ -24,13 +58,26 @@ print_fe_statistics(const FiniteElement& fe) { pair p = fe.system_to_component_index(i); deallog << "Index " << i << " (" - << p.first << "," << p.second << ")" << endl; + << p.first << "," << p.second << ") -> " + << fe.component_to_system_index(p.first, p.second) + << " support " << support_points[i] << " unit: " << unit_points[i] + << endl; + } + for (unsigned i=0;i p = fe.face_system_to_component_index(i); + deallog << "FaceIndex " << i << " (" + << p.first << "," << p.second << ") -> " + << fe.face_component_to_system_index(p.first, p.second) + << " support " << face_support_points[i] + << endl; } deallog.pop(); } main() { + deallog.push("GeometryInfo"); deallog.push("1D"); @@ -67,80 +114,24 @@ main() deallog.pop(); - FEDGConstant<2> dg0; - FEDGLinear<2> dg1; - FELinear<2> q1; - FEQuadraticSub<2> q2; - FECubicSub<2> q3; - - FESystem<2> q2_3(q2,3); - FESystem<2> q3_3(q3,3); - - - deallog.push("Q0 "); - print_fe_statistics(dg0); - deallog.pop(); - deallog << endl; - - deallog.push("Q1 "); - print_fe_statistics(q1); - deallog.pop(); - deallog << endl; - - deallog.push("Q2 "); - print_fe_statistics(q2); - deallog.pop(); - deallog << endl; - - deallog.push("Q3 "); - print_fe_statistics(q3); - deallog.pop(); - deallog << endl; - - deallog.push("DG1 "); - print_fe_statistics(dg1); - deallog.pop(); - deallog << endl; - - { - FESystem<2> q1_3(q1,3); - deallog.push("Q1^3"); - print_fe_statistics(q1_3); - deallog.pop(); - } - deallog << endl; - - deallog.push("Q2^3"); - print_fe_statistics(q2_3); - deallog.pop(); - deallog << endl; - - deallog.push("Q3^3"); - print_fe_statistics(q3_3); - deallog.pop(); - deallog << endl; + TEST_ELEMENT(FEDGConstant<2>); + TEST_ELEMENT(FEDGLinear<2>); - { - FESystem<2> q1_2q0(q1,2,dg0,1); - deallog.push("Q1^2 Q0"); - print_fe_statistics(q1_2q0); - deallog.pop(); - } - deallog << endl; + TEST_ELEMENT(FELinear<2>); + TEST_ELEMENT(FEQuadraticSub<2>); + TEST_ELEMENT(FECubicSub<2>); + TEST_ELEMENT(FEQuarticSub<2>); +/* + TEST_ELEMENT(FELinear<1>); + TEST_ELEMENT(FEQuadraticSub<1>); + TEST_ELEMENT(FECubicSub<1>); + TEST_ELEMENT(FEQuarticSub<1>); +*/ + TEST_MULTIPLE(FELinear<2>,3,2); + TEST_MULTIPLE(FEQuadraticSub<2>,3,2); + TEST_MULTIPLE(FECubicSub<2>,3,2); - { - FESystem<2> q2_2q1(q2,2,q1,1); - deallog.push("Q2^2 Q1"); - print_fe_statistics(q2_2q1); - deallog.pop(); - } - deallog << endl; - - { - FESystem<2> q2_2dg1(q2,2,dg1,1); - deallog.push("Q2^2 DG1"); - print_fe_statistics(q2_2dg1); - deallog.pop(); - } - deallog << endl; + TEST_MIXED2(FELinear<2>,1,FEDGConstant<2>,1,2); + TEST_MIXED2(FEQuadraticSub<2>,3,FELinear<2>,1,2); + TEST_MIXED2(FECubicSub<2>,3,FEQuadraticSub<2>,2,2); } diff --git a/tests/deal.II/grid_test.cc b/tests/deal.II/grid_test.cc index e5da77e45c..57fd9902cd 100644 --- a/tests/deal.II/grid_test.cc +++ b/tests/deal.II/grid_test.cc @@ -178,12 +178,12 @@ void test (const int test_case) { // refine first cell tria.begin_active()->set_refine_flag(); - tria.execute_refinement (); + tria.execute_coarsening_and_refinement (); // refine first active cell // on coarsest level tria.begin_active()->set_refine_flag (); - tria.execute_refinement (); + tria.execute_coarsening_and_refinement (); Triangulation::active_cell_iterator cell; for (int i=0; i<(dim==2 ? 13 : 7); ++i) @@ -194,7 +194,7 @@ void test (const int test_case) { cell = tria.last_active(tria.n_levels()-1); --cell; cell->set_refine_flag (); - tria.execute_refinement (); + tria.execute_coarsening_and_refinement (); }; break; @@ -220,7 +220,7 @@ void test (const int test_case) { // refine once tria.begin_active()->set_refine_flag(); - tria.execute_refinement (); + tria.execute_coarsening_and_refinement (); Triangulation::active_cell_iterator cell, endc; const unsigned int steps[4] = { 0, 10, 5, 2 }; @@ -235,7 +235,7 @@ void test (const int test_case) { if (cell->at_boundary()) cell->set_refine_flag(); - tria.execute_refinement(); + tria.execute_coarsening_and_refinement(); }; tria.set_boundary (0);