]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add comments, and cosmetic corrections.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 17 Sep 2002 19:26:13 +0000 (19:26 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 17 Sep 2002 19:26:13 +0000 (19:26 +0000)
git-svn-id: https://svn.dealii.org/trunk@6444 0785d39b-7218-0410-832d-ea1e28bc413d

tests/fe/shapes.cc

index 413c762c3f9b8ce597885cf5f530a38bdf7f8dd8..4ae7d3ae7df4bf2af3e550dd20f0fc2f7e017d58 100644 (file)
@@ -239,6 +239,14 @@ void test_compute_functions (const Mapping<dim> &mapping,
                             const FiniteElement<dim> &fe,
                             const char*)
 {
+                                   // generate a grid with only one
+                                   // cell, which furthermore has the
+                                   // shape of the unit cell. then the
+                                   // values/gradients/... we get from
+                                   // the FEValues object on this cell
+                                   // should really be equal to what
+                                   // we get from the finite element
+                                   // itself on the unit cell:
   Triangulation<dim> tr;
   DoFHandler<dim> dof(tr);
   GridGenerator::hyper_cube(tr, 0., 1.);
@@ -250,11 +258,16 @@ void test_compute_functions (const Mapping<dim> &mapping,
   typename DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
   fe_values.reinit(cell);
 
+                                   // check values
   for (unsigned int x=0; x<q.n_quadrature_points; ++x)
     for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
       {
-       Assert (fabs(fe_values.shape_value(i,x)-fe.shape_value(i,q.point(x))) < 1e-13,
-               ExcInternalError());
+        if (true)
+          {
+            const double val1 = fe_values.shape_value(i,x),
+                         val2 = fe.shape_value(i,q.point(x));
+            Assert (fabs(val1-val2) < 1e-13, ExcInternalError());
+          };
 
        for (unsigned int c=0; c<fe.n_components(); ++c)
          Assert (((c == fe.system_to_component_index(i).first) &&
@@ -264,6 +277,8 @@ void test_compute_functions (const Mapping<dim> &mapping,
                   (fe_values.shape_value_component(i,x,c) == 0)),
                  ExcInternalError());
       };
+
+                                   // check gradients
   for (unsigned int x=0; x<q.n_quadrature_points; ++x)
     for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
       {
@@ -280,6 +295,7 @@ void test_compute_functions (const Mapping<dim> &mapping,
                  ExcInternalError());
       }
 
+                                   // check second derivatives
   double max_diff=0.;
   for (unsigned int x=0; x<q.n_quadrature_points; ++x)
     for (unsigned int i=0; i<fe.dofs_per_cell; ++i)

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.