From: wolf Date: Tue, 3 Sep 2002 17:26:13 +0000 (+0000) Subject: More and more thorough testing. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a26a62db731f2e6b975ab8c9414e3445ba3e9d6d;p=dealii-svn.git More and more thorough testing. git-svn-id: https://svn.dealii.org/trunk@6354 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/fe/nedelec.cc b/tests/fe/nedelec.cc index 88597efe93..21ddad0ec2 100644 --- a/tests/fe/nedelec.cc +++ b/tests/fe/nedelec.cc @@ -20,7 +20,19 @@ #define PRECISION 2 -char fname[50]; + +Point<2> stretch_coordinates (const Point<2> p) +{ + return Point<2>(2*p(0), p(1)); +}; + + + +Point<2> tilt_coordinates (const Point<2> p) +{ + return Point<2>(p(0)+p(1), p(1)); +}; + void transform_grid (Triangulation<2> &tria, @@ -28,20 +40,33 @@ transform_grid (Triangulation<2> &tria, { switch (transform) { + // first round: take + // original grid case 0: - // first round: take - // original grid break; - case 1: + // second round: rotate // triangulation + case 1: GridTools::rotate (3.14159265358/2, tria); break; - case 2: + // third round: inflate // by a factor of 2 + case 2: GridTools::scale (2, tria); break; + + // third round: scale + // back, rotate back, + // stretch + case 3: + GridTools::scale (.5, tria); + GridTools::rotate (-3.14159265358/2, tria); + GridTools::transform (&stretch_coordinates, tria); + + break; + default: Assert (false, ExcNotImplemented()); }; @@ -61,8 +86,10 @@ plot_shape_functions() // check the following with a // number of transformed // triangulations - for (unsigned int transform=0; transform<3; ++transform) + for (unsigned int transform=0; transform<4; ++transform) { + deallog << "GRID TRANSFORMATION " << transform << std::endl; + transform_grid (tr, transform); DoFHandler dof(tr); @@ -72,26 +99,42 @@ plot_shape_functions() QTrapez<1> q_trapez; const unsigned int div=2; QIterated q(q_trapez, div); - FEValues fe(fe_ned, q, update_values); + FEValues fe(fe_ned, q, update_values|update_gradients|update_q_points); fe.reinit(c); - unsigned int k=0; + unsigned int q_point=0; for (unsigned int mz=0;mz<=((dim>2) ? div : 0) ;++mz) for (unsigned int my=0;my<=((dim>1) ? div : 0) ;++my) for (unsigned int mx=0;mx<=div;++mx) { - deallog << "q_point(" << k << ")=" << q.point(k) + deallog << "q_point(" << q_point << ")=" << fe.quadrature_point(q_point) << std::endl; for (unsigned int i=0;i