]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a test that checks the prolongation of Nedelec elements. The results are hand...
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 13 Sep 2002 22:42:38 +0000 (22:42 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 13 Sep 2002 22:42:38 +0000 (22:42 +0000)
git-svn-id: https://svn.dealii.org/trunk@6425 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/fe/fe_nedelec.cc
deal.II/deal.II/source/fe/fe_nedelec_3d.cc
tests/fe/Makefile
tests/fe/nedelec_3.cc [new file with mode: 0644]
tests/fe/nedelec_3.checked [new file with mode: 0644]

index 581758cb4bdec148b417bddf6407f7bceaf3d5de..1d9cf5cfc41d305a132b1c0b65f5ea4f6d71a3b6 100644 (file)
@@ -50,7 +50,27 @@ FE_Nedelec<dim>::FE_Nedelec (const unsigned int degree)
   if ((degree < Matrices::n_embedding_matrices+1) &&
       (Matrices::embedding[degree-1][0] != 0))
     for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
-      this->prolongation[c].fill (Matrices::embedding[degree-1][c]);
+      {
+                                         // copy
+        this->prolongation[c].fill (Matrices::embedding[degree-1][c]);
+                                         // and make sure that the row
+                                         // sum is 0.5 (for usual
+                                         // elements, the row sum must
+                                         // be 1, but here the shape
+                                         // function is multiplied by
+                                         // the inverse of the
+                                         // Jacobian, which introduces
+                                         // a factor of 1/2 when going
+                                         // from mother to child)
+        for (unsigned int row=0; row<this->dofs_per_cell; ++row)
+          {
+            double sum = 0;
+            for (unsigned int col=0; col<this->dofs_per_cell; ++col)
+              sum += this->prolongation[c](row,col);
+            Assert (std::fabs(sum-.5) < 1e-14,
+                    ExcInternalError());
+          };
+      }
   else
     for (unsigned int i=0; i<GeometryInfo<dim>::children_per_cell;++i)
       this->prolongation[i].reinit(0,0);
@@ -66,6 +86,7 @@ FE_Nedelec<dim>::FE_Nedelec (const unsigned int degree)
          {
            case 1:
            {
+//TODO: check!              
                                               // DoF on bottom line
                                               // of coarse cell will
                                               // be mean value of
index 0a90b649619f9856aab3faf1fe39dfaeec35e4b2..38638df49fa7e8aea9ab4c5571a264f4de2858e1 100644 (file)
@@ -38,133 +38,133 @@ namespace FE_Nedelec_3d
 {
   static const double q1_into_q1_refined_0[] =
   {
-       1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-       0., 0.5, 0., 0.5, 0., 0., 0., 0.,0.,0.,0.,0.,
-       0.5, 0., 0.5, 0., 0., 0., 0., 0.,0.,0.,0.,0.,
-       0., 0., 0., 1., 0., 0., 0., 0.,0.,0.,0.,0.,
-       0.5, 0., 0., 0., 0.5, 0., 0., 0.,0.,0.,0.,0.,
-       0., 0.25, 0., 0.25, 0., 0.25, 0., 0.25,0.,0.,0.,0.,
-       0.25, 0., 0.25, 0., 0.25, 0., 0.25, 0.,0.,0.,0.,0.,
-       0., 0., 0., 0.5, 0., 0., 0., 0.5,0.,0.,0.,0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5, 0., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0.25, 0.25,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.5, .0, 0., 0.5,
+       .5, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+       0., 0.25, 0., 0.25, 0., 0., 0., 0.,0.,0.,0.,0.,
+       0.25, 0., 0.25, 0., 0., 0., 0., 0.,0.,0.,0.,0.,
+       0., 0., 0., .5, 0., 0., 0., 0.,0.,0.,0.,0.,
+       0.25, 0., 0., 0., 0.25, 0., 0., 0.,0.,0.,0.,0.,
+       0., 0.125, 0., 0.125, 0., 0.125, 0., 0.125,0.,0.,0.,0.,
+       0.125, 0., 0.125, 0., 0.125, 0., 0.125, 0.,0.,0.,0.,0.,
+       0., 0., 0., 0.25, 0., 0., 0., 0.25,0.,0.,0.,0.,
+       0., 0., 0., 0., 0., 0., 0., 0., .5, 0., 0., 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0., 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.125, 0.125, 0.125, 0.125,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.25, .0, 0., 0.25,
   };
 
   static const double q1_into_q1_refined_1[] =
   {
-       1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-       0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-       0.5, 0., 0.5, 0., 0., 0., 0., 0.,0.,0.,0.,0.,
-       0., 0.5, 0., 0.5, 0., 0., 0., 0.,0.,0.,0.,0.,
-       0.5, 0., 0., 0., 0.5, 0., 0., 0.,0.,0.,0.,0.,
-       0., 0.5, 0., 0., 0., 0.5, 0., 0.,0.,0.,0.,0.,
-       0.25, 0., 0.25, 0., 0.25, 0., 0.25, 0.,0.,0.,0.,0.,
-       0., 0.25, 0., 0.25, 0., 0.25, 0., 0.25,0.,0.,0.,0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5, 0., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5, 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0.25, 0.25,
+       .5, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+       0., .5, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+       0.25, 0., 0.25, 0., 0., 0., 0., 0.,0.,0.,0.,0.,
+       0., 0.25, 0., 0.25, 0., 0., 0., 0.,0.,0.,0.,0.,
+       0.25, 0., 0., 0., 0.25, 0., 0., 0.,0.,0.,0.,0.,
+       0., 0.25, 0., 0., 0., 0.25, 0., 0.,0.,0.,0.,0.,
+       0.125, 0., 0.125, 0., 0.125, 0., 0.125, 0.,0.,0.,0.,0.,
+       0., 0.125, 0., 0.125, 0., 0.125, 0., 0.125,0.,0.,0.,0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0., 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., .5, 0., 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.125, 0.125, 0.125, 0.125,
   };
 
   static const double q1_into_q1_refined_2[] =
   {
-       0.5, 0., 0.5, 0., 0., 0., 0., 0.,0.,0.,0.,0.,
-       0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-       0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-       0., 0.5, 0., 0.5, 0., 0., 0., 0.,0.,0.,0.,0.,
-       0.25, 0., 0.25, 0., 0.25, 0., 0.25, 0.,0.,0.,0.,0.,
-       0., 0.5, 0., 0., 0., 0.5, 0., 0.,0.,0.,0.,0.,
-       0., 0., 0.5, 0., 0., 0., 0.5, 0.,0.,0.,0.,0.,
-       0., 0.25, 0., 0.25, 0., 0.25, 0., 0.25,0.,0.,0.,0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0.25, 0.25,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5, 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5,
+       0.25, 0., 0.25, 0., 0., 0., 0., 0.,0.,0.,0.,0.,
+       0., .5, 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+       0., 0., .5, 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+       0., 0.25, 0., 0.25, 0., 0., 0., 0.,0.,0.,0.,0.,
+       0.125, 0., 0.125, 0., 0.125, 0., 0.125, 0.,0.,0.,0.,0.,
+       0., 0.25, 0., 0., 0., 0.25, 0., 0.,0.,0.,0.,0.,
+       0., 0., 0.25, 0., 0., 0., 0.25, 0.,0.,0.,0.,0.,
+       0., 0.125, 0., 0.125, 0., 0.125, 0., 0.125,0.,0.,0.,0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.125, 0.125, 0.125, 0.125,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .5, 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25,
   };
 
   static const double q1_into_q1_refined_3[] =
   {
-       0.5, 0., 0.5, 0., 0., 0., 0., 0.,0.,0.,0.,0.,
-       0., 0.5, 0., 0.5, 0., 0., 0., 0.,0.,0.,0.,0.,
-       0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0., 0.,
-       0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0., 0.,
-       0.25, 0., 0.25, 0., 0.25, 0., 0.25, 0.,0.,0.,0.,0.,
-       0., 0.25, 0., 0.25, 0., 0.25, 0., 0.25,0.,0.,0.,0.,
-       0., 0., 0.5, 0., 0., 0., 0.5, 0.,0.,0.,0.,0.,
-       0., 0., 0., 0.5, 0., 0., 0., 0.5,0.,0.,0.,0.,
-       0., 0., 0., 0., 0., 0., 0., 0.,0.5,0.,0.,0.5,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0.25, 0.25,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1.,
+       0.25, 0., 0.25, 0., 0., 0., 0., 0.,0.,0.,0.,0.,
+       0., 0.25, 0., 0.25, 0., 0., 0., 0.,0.,0.,0.,0.,
+       0., 0., .5, 0., 0., 0., 0., 0., 0., 0., 0., 0.,
+       0., 0., 0., .5, 0., 0., 0., 0., 0., 0., 0., 0.,
+       0.125, 0., 0.125, 0., 0.125, 0., 0.125, 0.,0.,0.,0.,0.,
+       0., 0.125, 0., 0.125, 0., 0.125, 0., 0.125,0.,0.,0.,0.,
+       0., 0., 0.25, 0., 0., 0., 0.25, 0.,0.,0.,0.,0.,
+       0., 0., 0., 0.25, 0., 0., 0., 0.25,0.,0.,0.,0.,
+       0., 0., 0., 0., 0., 0., 0., 0.,0.25,0.,0.,0.25,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.125, 0.125, 0.125, 0.125,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .5,
   };
 
   static const double q1_into_q1_refined_4[] =
   {
-       0.5, 0., 0., 0., 0.5, 0., 0., 0.,0.,0.,0.,0.,
-       0., 0.25, 0., 0.25, 0., 0.25, 0., 0.25,0.,0.,0.,0.,
-       0.25, 0., 0.25, 0., 0.25, 0., 0.25, 0.,0.,0.,0.,0.,
-       0., 0., 0., 0.5, 0., 0., 0., 0.5, 0., 0., 0., 0.,
-       0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0.,
-       0., 0., 0., 0., 0., 0.5, 0., 0.5,0.,0.,0.,0.,
-       0., 0., 0., 0., 0.5, 0., 0.5, 0.,0.,0.,0.,0.,
-       0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5, 0., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0.25, 0.25,
-       0., 0., 0., 0., 0., 0., 0., 0.,0.5,0.,0.,0.5,
+       0.25, 0., 0., 0., 0.25, 0., 0., 0.,0.,0.,0.,0.,
+       0., 0.125, 0., 0.125, 0., 0.125, 0., 0.125,0.,0.,0.,0.,
+       0.125, 0., 0.125, 0., 0.125, 0., 0.125, 0.,0.,0.,0.,0.,
+       0., 0., 0., 0.25, 0., 0., 0., 0.25, 0., 0., 0., 0.,
+       0., 0., 0., 0., .5, 0., 0., 0., 0., 0., 0., 0.,
+       0., 0., 0., 0., 0., 0.25, 0., 0.25,0.,0.,0.,0.,
+       0., 0., 0., 0., 0.25, 0., 0.25, 0.,0.,0.,0.,0.,
+       0., 0., 0., 0., 0., 0., 0., .5, 0., 0., 0., 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., .5, 0., 0., 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0., 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.125, 0.125, 0.125, 0.125,
+       0., 0., 0., 0., 0., 0., 0., 0.,0.25,0.,0.,0.25,
   };
 
   static const double q1_into_q1_refined_5[] =
   { 
-       0.5, 0., 0., 0., 0.5, 0., 0., 0.,0.,0.,0.,0.,
-       0., 0.5, 0., 0., 0., 0.5, 0., 0.,0.,0.,0.,0.,
-       0.25, 0., 0.25, 0., 0.25, 0., 0.25, 0.,0.,0.,0.,0.,
-       0., 0.25, 0., 0.25, 0., 0.25, 0., 0.25,0.,0.,0.,0.,
-       0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 0.,
-       0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0.,
-       0., 0., 0., 0., 0.5, 0., 0.5, 0.,0.,0.,0.,0.,
-       0., 0., 0., 0., 0., 0.5, 0., 0.5,0.,0.,0.,0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5, 0., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5, 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0.25, 0.25,
+       0.25, 0., 0., 0., 0.25, 0., 0., 0.,0.,0.,0.,0.,
+       0., 0.25, 0., 0., 0., 0.25, 0., 0.,0.,0.,0.,0.,
+       0.125, 0., 0.125, 0., 0.125, 0., 0.125, 0.,0.,0.,0.,0.,
+       0., 0.125, 0., 0.125, 0., 0.125, 0., 0.125,0.,0.,0.,0.,
+       0., 0., 0., 0., .5, 0., 0., 0., 0., 0., 0., 0.,
+       0., 0., 0., 0., 0., .5, 0., 0., 0., 0., 0., 0.,
+       0., 0., 0., 0., 0.25, 0., 0.25, 0.,0.,0.,0.,0.,
+       0., 0., 0., 0., 0., 0.25, 0., 0.25,0.,0.,0.,0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0., 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., .5, 0., 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.125, 0.125, 0.125, 0.125,
 
   };
 
   static const double q1_into_q1_refined_6[] =
   {
-       0.25, 0., 0.25, 0., 0.25, 0., 0.25, 0.,0.,0.,0.,0.,
-       0., 0.5, 0., 0., 0., 0.5, 0., 0.,0.,0.,0.,0.,
-       0., 0., 0.5, 0., 0., 0., 0.5, 0.,0.,0.,0.,0.,
-       0., 0.25, 0., 0.25, 0., 0.25, 0., 0.25,0.,0.,0.,0.,
-       0., 0., 0., 0., 0.5, 0., 0.5, 0.,0.,0.,0.,0.,
-       0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0.,
-       0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0.,
-       0., 0., 0., 0., 0., 0.5, 0., 0.5, 0., 0., 0., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0.25, 0.25,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5, 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 1., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5,
+       0.125, 0., 0.125, 0., 0.125, 0., 0.125, 0.,0.,0.,0.,0.,
+       0., 0.25, 0., 0., 0., 0.25, 0., 0.,0.,0.,0.,0.,
+       0., 0., 0.25, 0., 0., 0., 0.25, 0.,0.,0.,0.,0.,
+       0., 0.125, 0., 0.125, 0., 0.125, 0., 0.125,0.,0.,0.,0.,
+       0., 0., 0., 0., 0.25, 0., 0.25, 0.,0.,0.,0.,0.,
+       0., 0., 0., 0., 0., .5, 0., 0., 0., 0., 0., 0.,
+       0., 0., 0., 0., 0., 0., .5, 0., 0., 0., 0., 0.,
+       0., 0., 0., 0., 0., 0.25, 0., 0.25, 0., 0., 0., 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.125, 0.125, 0.125, 0.125,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., .5, 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25,
        
 
   };
 
   static const double q1_into_q1_refined_7[] =
   {
-       0.25, 0., 0.25, 0., 0.25, 0., 0.25, 0.,0.,0.,0.,0.,
-       0., 0.25, 0., 0.25, 0., 0.25, 0., 0.25,0.,0.,0.,0.,
-       0., 0., 0.5, 0., 0., 0., 0.5, 0.,0.,0.,0.,0.,
-       0., 0., 0., 0.5, 0., 0., 0., 0.5,0.,0.,0.,0.,
-       0., 0., 0., 0., 0.5, 0., 0.5, 0.,0.,0.,0.,0.,
-       0., 0., 0., 0., 0., 0.5, 0., 0.5,0.,0.,0.,0.,
-       0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0.,
-       0., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0.,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0., 0., 0.5,
-       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25, 0.25, 0.25,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5, 0.5,
-       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.1,
+       0.125, 0., 0.125, 0., 0.125, 0., 0.125, 0.,0.,0.,0.,0.,
+       0., 0.125, 0., 0.125, 0., 0.125, 0., 0.125,0.,0.,0.,0.,
+       0., 0., 0.25, 0., 0., 0., 0.25, 0.,0.,0.,0.,0.,
+       0., 0., 0., 0.25, 0., 0., 0., 0.25,0.,0.,0.,0.,
+       0., 0., 0., 0., 0.25, 0., 0.25, 0.,0.,0.,0.,0.,
+       0., 0., 0., 0., 0., 0.25, 0., 0.25,0.,0.,0.,0.,
+       0., 0., 0., 0., 0., 0., .5, 0., 0., 0., 0., 0.,
+       0., 0., 0., 0., 0., 0., 0., .5, 0., 0., 0., 0.,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0., 0., 0.25,
+       0., 0., 0., 0., 0., 0., 0., 0., 0.125, 0.125, 0.125, 0.125,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.25, 0.25,
+       0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.5,
   };
 
 };  // namespace FE_Nedelec_3d
index fc4b15c5288a77ed5842b2abf9b97391b4da2cc6..03f3ae030def65385352559b5061d345677df05b 100644 (file)
@@ -32,6 +32,7 @@ mapping_c1.exe          : mapping_c1.go          $(libraries)
 mapping_q1_eulerian.exe : mapping_q1_eulerian.go $(libraries)
 nedelec.exe             : nedelec.go             $(libraries)
 nedelec_2.exe           : nedelec_2.go           $(libraries)
+nedelec_3.exe           : nedelec_3.go           $(libraries)
 non_primitive_1.exe     : non_primitive_1.go     $(libraries)
 numbering.exe           : numbering.go           $(libraries)
 shapes.exe              : shapes.go              $(libraries)
@@ -40,7 +41,7 @@ transfer.exe          : transfer.go            $(libraries)
 tests = derivatives fe_data_test fe_traits fe_tools_test mapping \
         mapping_c1 shapes numbering mapping_q1_eulerian \
         transfer internals \
-        non_primitive_1 nedelec nedelec_2
+        non_primitive_1 nedelec nedelec_2 nedelec_3
 
 ############################################################
 
diff --git a/tests/fe/nedelec_3.cc b/tests/fe/nedelec_3.cc
new file mode 100644 (file)
index 0000000..44e909d
--- /dev/null
@@ -0,0 +1,117 @@
+// $Id$
+// (c) Wolfgang Bangerth
+//
+// Some more tests with the Nedelec element, this time checking
+// whether embedding matrices work correctly
+
+#include <base/quadrature_lib.h>
+#include <base/logstream.h>
+#include <lac/vector.h>
+#include <grid/tria.h>
+#include <grid/tria_iterator.h>
+#include <dofs/dof_accessor.h>
+#include <dofs/dof_constraints.h>
+#include <dofs/dof_tools.h>
+#include <grid/grid_generator.h>
+#include <grid/grid_tools.h>
+#include <fe/fe_nedelec.h>
+#include <fe/fe_values.h>
+
+#include <vector>
+#include <fstream>
+#include <string>
+
+#define PRECISION 2
+
+
+
+
+template<int dim>
+inline void
+check ()
+{
+  deallog << dim << "-D" << std::endl;
+  
+  Triangulation<dim> tr;
+  GridGenerator::hyper_cube(tr, 0., 1.);
+
+                                   // work on a once-refined grid
+  tr.refine_global (1);
+
+  FE_Nedelec<dim> fe_ned(1);
+  DoFHandler<dim> dof(tr);
+  dof.distribute_dofs(fe_ned);
+
+                                   // generate a function on the
+                                   // coarse grid (with shape function
+                                   // values equal to the index of the
+                                   // line)
+  Vector<double> coarse_grid_values (fe_ned.dofs_per_cell);
+  for (unsigned int i=0; i<coarse_grid_values.size(); ++i)
+    coarse_grid_values(i) = i;
+
+                                   // then transfer this function
+                                   // from the coarse grid to the
+                                   // child cells.
+  Vector<double> values (dof.n_dofs());
+  for (typename DoFHandler<dim>::active_cell_iterator
+         c = dof.begin_active();
+       c!=dof.end(); ++c)
+    {
+      Vector<double> tmp (fe_ned.dofs_per_cell);
+      fe_ned.prolongate (c->index()).vmult (tmp, coarse_grid_values);
+      c->set_dof_values (tmp, values);
+    };
+  
+
+                                   // then output these values at the
+                                   // quadrature points of all cells
+                                   // of the finer grid
+  QTrapez<dim> quadrature;
+  std::vector<Vector<double> > shape_values (quadrature.n_quadrature_points,
+                                             Vector<double>(dim));
+  FEValues<dim> fe(fe_ned, quadrature,
+                   update_values|update_q_points);
+
+  for (typename DoFHandler<dim>::active_cell_iterator
+         c = dof.begin_active();
+       c!=dof.end(); ++c)
+    {
+      deallog << "  CELL " << c << std::endl;
+      fe.reinit(c);
+      fe.get_function_values (values, shape_values);
+
+      for (unsigned int q=0; q<quadrature.n_quadrature_points; ++q)
+        {
+          deallog << "    q=" << q
+                  << ", xq=" << fe.quadrature_point(q)
+                  << ", f=[";
+          for (unsigned int d=0; d<dim; ++d)
+            deallog << (d==0 ? "" : " ")
+                    << shape_values[q](d);
+          
+          deallog << "]" << std::endl;
+        };
+                
+      deallog << std::endl;
+    }
+};
+
+
+int
+main()
+{
+  std::ofstream logfile ("nedelec_3.output");
+  logfile.precision (PRECISION);
+  logfile.setf(std::ios::fixed);  
+  deallog.attach(logfile);
+  deallog.depth_console(0);
+  
+  check<2>();
+  check<3>();
+  
+  return 0;
+}
+
+
+
diff --git a/tests/fe/nedelec_3.checked b/tests/fe/nedelec_3.checked
new file mode 100644 (file)
index 0000000..3a10622
--- /dev/null
@@ -0,0 +1,107 @@
+
+DEAL::2-D
+DEAL::  CELL 1.0
+DEAL::    q=0, xq=0.00 0.00, f=[0.00 3.00]
+DEAL::    q=1, xq=0.00 0.50, f=[1.00 3.00]
+DEAL::    q=2, xq=0.50 0.00, f=[0.00 2.00]
+DEAL::    q=3, xq=0.50 0.50, f=[1.00 2.00]
+DEAL::
+DEAL::  CELL 1.1
+DEAL::    q=0, xq=0.50 0.00, f=[0.00 2.00]
+DEAL::    q=1, xq=0.50 0.50, f=[1.00 2.00]
+DEAL::    q=2, xq=1.00 0.00, f=[0.00 1.00]
+DEAL::    q=3, xq=1.00 0.50, f=[1.00 1.00]
+DEAL::
+DEAL::  CELL 1.2
+DEAL::    q=0, xq=0.50 0.50, f=[1.00 2.00]
+DEAL::    q=1, xq=0.50 1.00, f=[2.00 2.00]
+DEAL::    q=2, xq=1.00 0.50, f=[1.00 1.00]
+DEAL::    q=3, xq=1.00 1.00, f=[2.00 1.00]
+DEAL::
+DEAL::  CELL 1.3
+DEAL::    q=0, xq=0.00 0.50, f=[1.00 3.00]
+DEAL::    q=1, xq=0.00 1.00, f=[2.00 3.00]
+DEAL::    q=2, xq=0.50 0.50, f=[1.00 2.00]
+DEAL::    q=3, xq=0.50 1.00, f=[2.00 2.00]
+DEAL::
+DEAL::3-D
+DEAL::  CELL 1.0
+DEAL::    q=0, xq=0.00 0.00 0.00, f=[0.00 8.00 3.00]
+DEAL::    q=1, xq=0.00 0.00 0.50, f=[1.00 9.50 3.00]
+DEAL::    q=2, xq=0.00 0.50 0.00, f=[2.00 8.00 5.00]
+DEAL::    q=3, xq=0.00 0.50 0.50, f=[3.00 9.50 5.00]
+DEAL::    q=4, xq=0.50 0.00 0.00, f=[0.00 8.50 2.00]
+DEAL::    q=5, xq=0.50 0.00 0.50, f=[1.00 9.50 2.00]
+DEAL::    q=6, xq=0.50 0.50 0.00, f=[2.00 8.50 4.00]
+DEAL::    q=7, xq=0.50 0.50 0.50, f=[3.00 9.50 4.00]
+DEAL::
+DEAL::  CELL 1.1
+DEAL::    q=0, xq=0.50 0.00 0.00, f=[0.00 8.50 2.00]
+DEAL::    q=1, xq=0.50 0.00 0.50, f=[1.00 9.50 2.00]
+DEAL::    q=2, xq=0.50 0.50 0.00, f=[2.00 8.50 4.00]
+DEAL::    q=3, xq=0.50 0.50 0.50, f=[3.00 9.50 4.00]
+DEAL::    q=4, xq=1.00 0.00 0.00, f=[0.00 9.00 1.00]
+DEAL::    q=5, xq=1.00 0.00 0.50, f=[1.00 9.50 1.00]
+DEAL::    q=6, xq=1.00 0.50 0.00, f=[2.00 9.00 3.00]
+DEAL::    q=7, xq=1.00 0.50 0.50, f=[3.00 9.50 3.00]
+DEAL::
+DEAL::  CELL 1.2
+DEAL::    q=0, xq=0.50 0.00 0.50, f=[1.00 9.50 2.00]
+DEAL::    q=1, xq=0.50 0.00 1.00, f=[2.00 10.50 2.00]
+DEAL::    q=2, xq=0.50 0.50 0.50, f=[3.00 9.50 4.00]
+DEAL::    q=3, xq=0.50 0.50 1.00, f=[4.00 10.50 4.00]
+DEAL::    q=4, xq=1.00 0.00 0.50, f=[1.00 9.50 1.00]
+DEAL::    q=5, xq=1.00 0.00 1.00, f=[2.00 10.00 1.00]
+DEAL::    q=6, xq=1.00 0.50 0.50, f=[3.00 9.50 3.00]
+DEAL::    q=7, xq=1.00 0.50 1.00, f=[4.00 10.00 3.00]
+DEAL::
+DEAL::  CELL 1.3
+DEAL::    q=0, xq=0.00 0.00 0.50, f=[1.00 9.50 3.00]
+DEAL::    q=1, xq=0.00 0.00 1.00, f=[2.00 11.00 3.00]
+DEAL::    q=2, xq=0.00 0.50 0.50, f=[3.00 9.50 5.00]
+DEAL::    q=3, xq=0.00 0.50 1.00, f=[4.00 11.00 5.00]
+DEAL::    q=4, xq=0.50 0.00 0.50, f=[1.00 9.50 2.00]
+DEAL::    q=5, xq=0.50 0.00 1.00, f=[2.00 10.50 2.00]
+DEAL::    q=6, xq=0.50 0.50 0.50, f=[3.00 9.50 4.00]
+DEAL::    q=7, xq=0.50 0.50 1.00, f=[4.00 10.50 4.00]
+DEAL::
+DEAL::  CELL 1.4
+DEAL::    q=0, xq=0.00 0.50 0.00, f=[2.00 8.00 5.00]
+DEAL::    q=1, xq=0.00 0.50 0.50, f=[3.00 9.50 5.00]
+DEAL::    q=2, xq=0.00 1.00 0.00, f=[4.00 8.00 7.00]
+DEAL::    q=3, xq=0.00 1.00 0.50, f=[5.00 9.50 7.00]
+DEAL::    q=4, xq=0.50 0.50 0.00, f=[2.00 8.50 4.00]
+DEAL::    q=5, xq=0.50 0.50 0.50, f=[3.00 9.50 4.00]
+DEAL::    q=6, xq=0.50 1.00 0.00, f=[4.00 8.50 6.00]
+DEAL::    q=7, xq=0.50 1.00 0.50, f=[5.00 9.50 6.00]
+DEAL::
+DEAL::  CELL 1.5
+DEAL::    q=0, xq=0.50 0.50 0.00, f=[2.00 8.50 4.00]
+DEAL::    q=1, xq=0.50 0.50 0.50, f=[3.00 9.50 4.00]
+DEAL::    q=2, xq=0.50 1.00 0.00, f=[4.00 8.50 6.00]
+DEAL::    q=3, xq=0.50 1.00 0.50, f=[5.00 9.50 6.00]
+DEAL::    q=4, xq=1.00 0.50 0.00, f=[2.00 9.00 3.00]
+DEAL::    q=5, xq=1.00 0.50 0.50, f=[3.00 9.50 3.00]
+DEAL::    q=6, xq=1.00 1.00 0.00, f=[4.00 9.00 5.00]
+DEAL::    q=7, xq=1.00 1.00 0.50, f=[5.00 9.50 5.00]
+DEAL::
+DEAL::  CELL 1.6
+DEAL::    q=0, xq=0.50 0.50 0.50, f=[3.00 9.50 4.00]
+DEAL::    q=1, xq=0.50 0.50 1.00, f=[4.00 10.50 4.00]
+DEAL::    q=2, xq=0.50 1.00 0.50, f=[5.00 9.50 6.00]
+DEAL::    q=3, xq=0.50 1.00 1.00, f=[6.00 10.50 6.00]
+DEAL::    q=4, xq=1.00 0.50 0.50, f=[3.00 9.50 3.00]
+DEAL::    q=5, xq=1.00 0.50 1.00, f=[4.00 10.00 3.00]
+DEAL::    q=6, xq=1.00 1.00 0.50, f=[5.00 9.50 5.00]
+DEAL::    q=7, xq=1.00 1.00 1.00, f=[6.00 10.00 5.00]
+DEAL::
+DEAL::  CELL 1.7
+DEAL::    q=0, xq=0.00 0.50 0.50, f=[3.00 9.50 5.00]
+DEAL::    q=1, xq=0.00 0.50 1.00, f=[4.00 11.00 5.00]
+DEAL::    q=2, xq=0.00 1.00 0.50, f=[5.00 9.50 7.00]
+DEAL::    q=3, xq=0.00 1.00 1.00, f=[6.00 11.00 7.00]
+DEAL::    q=4, xq=0.50 0.50 0.50, f=[3.00 9.50 4.00]
+DEAL::    q=5, xq=0.50 0.50 1.00, f=[4.00 10.50 4.00]
+DEAL::    q=6, xq=0.50 1.00 0.50, f=[5.00 9.50 6.00]
+DEAL::    q=7, xq=0.50 1.00 1.00, f=[6.00 10.50 6.00]
+DEAL::

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.