]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Added normal to test. 2272/head
authorLuca Heltai <luca.heltai@sissa.it>
Wed, 6 Apr 2016 17:58:45 +0000 (19:58 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Wed, 6 Apr 2016 17:58:45 +0000 (19:58 +0200)
source/fe/mapping_manifold.cc
source/grid/manifold.cc
tests/fe/mapping_manifold_06.cc
tests/fe/mapping_manifold_06.output

index 0137b9e2b973a67b8d701a11481548bd39ccee89..fa516e13d9ea1db84ae33363ea573c022f41072c 100644 (file)
@@ -173,6 +173,7 @@ initialize_face (const UpdateFlags      update_flags,
 }
 
 
+
 template<int dim, int spacedim>
 MappingManifold<dim,spacedim>::MappingManifold ()
 {}
@@ -223,6 +224,7 @@ transform_unit_to_real_cell (const typename Triangulation<dim,spacedim>::cell_it
 }
 
 
+
 // In the code below, GCC tries to instantiate MappingManifold<3,4> when
 // seeing which of the overloaded versions of
 // do_transform_real_to_unit_cell_internal() to call. This leads to bad
@@ -235,6 +237,7 @@ class MappingManifold<3,4>
 {};
 
 
+
 template<int dim, int spacedim>
 UpdateFlags
 MappingManifold<dim,spacedim>::requires_update_flags (const UpdateFlags in) const
@@ -363,6 +366,8 @@ namespace internal
       return cell->get_manifold();
     }
 
+
+
     /**
      * Some specialization for face Manifolds. The mapping argument is
      * only used to help the compiler infer dim and spacedim.
@@ -376,6 +381,8 @@ namespace internal
       return cell->face(face_no)->get_manifold();
     }
 
+
+
     /**
      * Compute the locations of quadrature points on the object described by
      * the first argument (and the cell for which the mapping support points
@@ -404,6 +411,7 @@ namespace internal
     }
 
 
+
     /**
      * Update the co- and contravariant matrices as well as their determinant, for the cell
      * described stored in the data object, but only if the update_flags of the @p data
@@ -763,8 +771,8 @@ namespace internal
 
                     if (subface_no!=numbers::invalid_unsigned_int)
                       {
-                        const double area_ratio=GeometryInfo<dim>::subface_ratio(
-                                                  cell->subface_case(face_no), subface_no);
+                        const double area_ratio=GeometryInfo<dim>::subface_ratio(cell->subface_case(face_no),
+                                                                                 subface_no);
                         output_data.JxW_values[i] *= area_ratio;
                       }
                   }
index 361057fbf9f87ba520b7bc94d50daa028cc7f850..64ab4cddb5d30073d9e8fd803053baf37267c849 100644 (file)
@@ -423,8 +423,6 @@ get_new_point (const Quadrature<spacedim> &quad) const
     if (periodicity[d] > 0)
       for (unsigned int i=0; i<surrounding_points.size(); ++i)
         {
-          if (weights[i] > tolerance)
-            minP[d] = std::min(minP[d], surrounding_points[i][d]);
           Assert( (surrounding_points[i][d] < periodicity[d]+tolerance*periodicity.norm()) ||
                   (surrounding_points[i][d] >= -tolerance*periodicity.norm()),
                   ExcPeriodicBox(d, surrounding_points[i], periodicity, tolerance*periodicity.norm()));
index c8bd6af93d10aa28b6bc669b48a2400901b093dd..99c20549b319bc1b070547654937fff3d1178ee8 100644 (file)
@@ -52,8 +52,8 @@ void test()
   FE_Q<dim,spacedim> fe(1);
   const QGauss<dim-1> quad(5);
 
-  FEFaceValues<dim,spacedim> fe_v(map_manifold, fe, quad,
-                                  update_quadrature_points);
+  FEFaceValues<dim,spacedim> fe_v(map_manifold,  fe, quad,
+                                  update_quadrature_points | update_normal_vectors);
 
   out << "set size ratio -1" << std::endl
       << "set terminal aqua " << dim+spacedim << std::endl
@@ -66,6 +66,7 @@ void test()
         {
           fe_v.reinit(cell, f);
           const std::vector<Point<spacedim> > &qps = fe_v.get_quadrature_points();
+          const std::vector<Point<spacedim> > &nps = fe_v.get_normal_vectors();
           for (unsigned int i=0; i<qps.size(); ++i)
             {
               out << qps[i] << std::endl;
@@ -74,7 +75,32 @@ void test()
             }
           out << std::endl;
         }
+
+  out << "e" << std::endl << std::endl
+      << std::endl
+      << "set terminal aqua " << 2*(dim+spacedim) +1 << std::endl
+      << (spacedim == 3 ? "s" : "") << "plot '-' with vectors " << std::endl;
+
+  for (typename Triangulation<dim,spacedim>::active_cell_iterator cell =
+         triangulation.begin_active(); cell != triangulation.end(); ++cell)
+    for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
+      if (cell->face(f)->at_boundary())
+        {
+          fe_v.reinit(cell, f);
+          const std::vector<Point<spacedim> > &qps = fe_v.get_quadrature_points();
+          const std::vector<Point<spacedim> > &nps = fe_v.get_normal_vectors();
+          for (unsigned int i=0; i<qps.size(); ++i)
+            {
+              out << qps[i] << " " << nps[i] << std::endl;
+              if (std::abs( (center+nps[i]-qps[i]).norm() ) > 1e-10)
+                out << "# Error! The normal vector should be radial! " << std::endl
+                    << "# Got " << center + nps[i]<< " instead of "
+                    << qps[i] << std::endl;
+            }
+          out << std::endl;
+        }
   out << "e" << std::endl << std::endl;
+
 }
 
 
index 97d058a327b9f7068b5c60a0c589764fd924a4c6..da67f6645a9f0d3fe6fea4712bd70a4ed6c72ff6 100644 (file)
@@ -29,6 +29,35 @@ plot '-' w l
 
 e
 
+
+set terminal aqua 9
+plot '-' with vectors 
+0.846869 1.74276 -0.653131 -0.757245
+1.08958 1.58810 -0.410418 -0.911897
+1.50000 1.50000 -2.22045e-16 -1.00000
+1.91042 1.58810 0.410418 -0.911897
+2.15313 1.74276 0.653131 -0.757245
+
+0.742755 1.84687 -0.757245 -0.653131
+0.588103 2.08958 -0.911897 -0.410418
+0.500000 2.50000 -1.00000 0.00000
+0.588103 2.91042 -0.911897 0.410418
+0.742755 3.15313 -0.757245 0.653131
+
+2.25724 1.84687 0.757245 -0.653131
+2.41190 2.08958 0.911897 -0.410418
+2.50000 2.50000 1.00000 0.00000
+2.41190 2.91042 0.911897 0.410418
+2.25724 3.15313 0.757245 0.653131
+
+0.846869 3.25724 -0.653131 0.757245
+1.08958 3.41190 -0.410418 0.911897
+1.50000 3.50000 0.00000 1.00000
+1.91042 3.41190 0.410418 0.911897
+2.15313 3.25724 0.653131 0.757245
+
+e
+
 # dim=3, spacedim=3
 set size ratio -1
 set terminal aqua 6
@@ -191,3 +220,164 @@ splot '-' w l
 
 e
 
+
+set terminal aqua 13
+splot '-' with vectors 
+0.942530 1.94253 -0.615187 -0.557470 -0.557470 -0.615187
+1.12940 1.87632 -0.688247 -0.370600 -0.623676 -0.688247
+1.50000 1.82851 -0.741013 0.00000 -0.671491 -0.741013
+1.87060 1.87632 -0.688247 0.370600 -0.623676 -0.688247
+2.05747 1.94253 -0.615187 0.557470 -0.557470 -0.615187
+0.876324 2.12940 -0.688247 -0.623676 -0.370600 -0.688247
+1.07160 2.07160 -0.795583 -0.428397 -0.428397 -0.795583
+1.50000 2.02589 -0.880468 -4.44089e-16 -0.474105 -0.880468
+1.92840 2.07160 -0.795583 0.428397 -0.428397 -0.795583
+2.12368 2.12940 -0.688247 0.623676 -0.370600 -0.688247
+0.828509 2.50000 -0.741013 -0.671491 -4.44089e-16 -0.741013
+1.02589 2.50000 -0.880468 -0.474105 0.00000 -0.880468
+1.50000 2.50000 -1.00000 0.00000 0.00000 -1.00000
+1.97411 2.50000 -0.880468 0.474105 0.00000 -0.880468
+2.17149 2.50000 -0.741013 0.671491 0.00000 -0.741013
+0.876324 2.87060 -0.688247 -0.623676 0.370600 -0.688247
+1.07160 2.92840 -0.795583 -0.428397 0.428397 -0.795583
+1.50000 2.97411 -0.880468 0.00000 0.474105 -0.880468
+1.92840 2.92840 -0.795583 0.428397 0.428397 -0.795583
+2.12368 2.87060 -0.688247 0.623676 0.370600 -0.688247
+0.942530 3.05747 -0.615187 -0.557470 0.557470 -0.615187
+1.12940 3.12368 -0.688247 -0.370600 0.623676 -0.688247
+1.50000 3.17149 -0.741013 0.00000 0.671491 -0.741013
+1.87060 3.12368 -0.688247 0.370600 0.623676 -0.688247
+2.05747 3.05747 -0.615187 0.557470 0.557470 -0.615187
+
+2.11519 1.94253 -0.557470 0.615187 -0.557470 -0.557470
+2.18825 1.87632 -0.370600 0.688247 -0.623676 -0.370600
+2.24101 1.82851 -8.90587e-18 0.741013 -0.671491 -8.90587e-18
+2.18825 1.87632 0.370600 0.688247 -0.623676 0.370600
+2.11519 1.94253 0.557470 0.615187 -0.557470 0.557470
+2.18825 2.12940 -0.623676 0.688247 -0.370600 -0.623676
+2.29558 2.07160 -0.428397 0.795583 -0.428397 -0.428397
+2.38047 2.02589 -2.11638e-17 0.880468 -0.474105 -2.11638e-17
+2.29558 2.07160 0.428397 0.795583 -0.428397 0.428397
+2.18825 2.12940 0.623676 0.688247 -0.370600 0.623676
+2.24101 2.50000 -0.671491 0.741013 -4.44089e-16 -0.671491
+2.38047 2.50000 -0.474105 0.880468 -8.88178e-16 -0.474105
+2.50000 2.50000 0.00000 1.00000 0.00000 0.00000
+2.38047 2.50000 0.474105 0.880468 0.00000 0.474105
+2.24101 2.50000 0.671491 0.741013 0.00000 0.671491
+2.18825 2.87060 -0.623676 0.688247 0.370600 -0.623676
+2.29558 2.92840 -0.428397 0.795583 0.428397 -0.428397
+2.38047 2.97411 0.00000 0.880468 0.474105 0.00000
+2.29558 2.92840 0.428397 0.795583 0.428397 0.428397
+2.18825 2.87060 0.623676 0.688247 0.370600 0.623676
+2.11519 3.05747 -0.557470 0.615187 0.557470 -0.557470
+2.18825 3.12368 -0.370600 0.688247 0.623676 -0.370600
+2.24101 3.17149 0.00000 0.741013 0.671491 0.00000
+2.18825 3.12368 0.370600 0.688247 0.623676 0.370600
+2.11519 3.05747 0.557470 0.615187 0.557470 0.557470
+
+0.942530 1.94253 0.615187 -0.557470 -0.557470 0.615187
+0.876324 2.12940 0.688247 -0.623676 -0.370600 0.688247
+0.828509 2.50000 0.741013 -0.671491 -4.44089e-16 0.741013
+0.876324 2.87060 0.688247 -0.623676 0.370600 0.688247
+0.942530 3.05747 0.615187 -0.557470 0.557470 0.615187
+1.12940 1.87632 0.688247 -0.370600 -0.623676 0.688247
+1.07160 2.07160 0.795583 -0.428397 -0.428397 0.795583
+1.02589 2.50000 0.880468 -0.474105 0.00000 0.880468
+1.07160 2.92840 0.795583 -0.428397 0.428397 0.795583
+1.12940 3.12368 0.688247 -0.370600 0.623676 0.688247
+1.50000 1.82851 0.741013 0.00000 -0.671491 0.741013
+1.50000 2.02589 0.880468 -4.44089e-16 -0.474105 0.880468
+1.50000 2.50000 1.00000 0.00000 0.00000 1.00000
+1.50000 2.97411 0.880468 0.00000 0.474105 0.880468
+1.50000 3.17149 0.741013 0.00000 0.671491 0.741013
+1.87060 1.87632 0.688247 0.370600 -0.623676 0.688247
+1.92840 2.07160 0.795583 0.428397 -0.428397 0.795583
+1.97411 2.50000 0.880468 0.474105 0.00000 0.880468
+1.92840 2.92840 0.795583 0.428397 0.428397 0.795583
+1.87060 3.12368 0.688247 0.370600 0.623676 0.688247
+2.05747 1.94253 0.615187 0.557470 -0.557470 0.615187
+2.12368 2.12940 0.688247 0.623676 -0.370600 0.688247
+2.17149 2.50000 0.741013 0.671491 0.00000 0.741013
+2.12368 2.87060 0.688247 0.623676 0.370600 0.688247
+2.05747 3.05747 0.615187 0.557470 0.557470 0.615187
+
+0.884813 1.94253 -0.557470 -0.615187 -0.557470 -0.557470
+0.811753 2.12940 -0.623676 -0.688247 -0.370600 -0.623676
+0.758987 2.50000 -0.671491 -0.741013 -4.44089e-16 -0.671491
+0.811753 2.87060 -0.623676 -0.688247 0.370600 -0.623676
+0.884813 3.05747 -0.557470 -0.615187 0.557470 -0.557470
+0.811753 1.87632 -0.370600 -0.688247 -0.623676 -0.370600
+0.704417 2.07160 -0.428397 -0.795583 -0.428397 -0.428397
+0.619532 2.50000 -0.474105 -0.880468 -8.88178e-16 -0.474105
+0.704417 2.92840 -0.428397 -0.795583 0.428397 -0.428397
+0.811753 3.12368 -0.370600 -0.688247 0.623676 -0.370600
+0.758987 1.82851 -8.90587e-18 -0.741013 -0.671491 -8.90587e-18
+0.619532 2.02589 -2.11638e-17 -0.880468 -0.474105 -2.11638e-17
+0.500000 2.50000 0.00000 -1.00000 0.00000 0.00000
+0.619532 2.97411 0.00000 -0.880468 0.474105 0.00000
+0.758987 3.17149 0.00000 -0.741013 0.671491 0.00000
+0.811753 1.87632 0.370600 -0.688247 -0.623676 0.370600
+0.704417 2.07160 0.428397 -0.795583 -0.428397 0.428397
+0.619532 2.50000 0.474105 -0.880468 0.00000 0.474105
+0.704417 2.92840 0.428397 -0.795583 0.428397 0.428397
+0.811753 3.12368 0.370600 -0.688247 0.623676 0.370600
+0.884813 1.94253 0.557470 -0.615187 -0.557470 0.557470
+0.811753 2.12940 0.623676 -0.688247 -0.370600 0.623676
+0.758987 2.50000 0.671491 -0.741013 0.00000 0.671491
+0.811753 2.87060 0.623676 -0.688247 0.370600 0.623676
+0.884813 3.05747 0.557470 -0.615187 0.557470 0.557470
+
+0.942530 1.88481 -0.557470 -0.557470 -0.615187 -0.557470
+0.876324 1.81175 -0.370600 -0.623676 -0.688247 -0.370600
+0.828509 1.75899 -8.90587e-18 -0.671491 -0.741013 -8.90587e-18
+0.876324 1.81175 0.370600 -0.623676 -0.688247 0.370600
+0.942530 1.88481 0.557470 -0.557470 -0.615187 0.557470
+1.12940 1.81175 -0.623676 -0.370600 -0.688247 -0.623676
+1.07160 1.70442 -0.428397 -0.428397 -0.795583 -0.428397
+1.02589 1.61953 -2.11638e-17 -0.474105 -0.880468 -2.11638e-17
+1.07160 1.70442 0.428397 -0.428397 -0.795583 0.428397
+1.12940 1.81175 0.623676 -0.370600 -0.688247 0.623676
+1.50000 1.75899 -0.671491 0.00000 -0.741013 -0.671491
+1.50000 1.61953 -0.474105 -4.44089e-16 -0.880468 -0.474105
+1.50000 1.50000 0.00000 0.00000 -1.00000 0.00000
+1.50000 1.61953 0.474105 0.00000 -0.880468 0.474105
+1.50000 1.75899 0.671491 0.00000 -0.741013 0.671491
+1.87060 1.81175 -0.623676 0.370600 -0.688247 -0.623676
+1.92840 1.70442 -0.428397 0.428397 -0.795583 -0.428397
+1.97411 1.61953 0.00000 0.474105 -0.880468 0.00000
+1.92840 1.70442 0.428397 0.428397 -0.795583 0.428397
+1.87060 1.81175 0.623676 0.370600 -0.688247 0.623676
+2.05747 1.88481 -0.557470 0.557470 -0.615187 -0.557470
+2.12368 1.81175 -0.370600 0.623676 -0.688247 -0.370600
+2.17149 1.75899 0.00000 0.671491 -0.741013 0.00000
+2.12368 1.81175 0.370600 0.623676 -0.688247 0.370600
+2.05747 1.88481 0.557470 0.557470 -0.615187 0.557470
+
+0.942530 3.11519 -0.557470 -0.557470 0.615187 -0.557470
+1.12940 3.18825 -0.623676 -0.370600 0.688247 -0.623676
+1.50000 3.24101 -0.671491 0.00000 0.741013 -0.671491
+1.87060 3.18825 -0.623676 0.370600 0.688247 -0.623676
+2.05747 3.11519 -0.557470 0.557470 0.615187 -0.557470
+0.876324 3.18825 -0.370600 -0.623676 0.688247 -0.370600
+1.07160 3.29558 -0.428397 -0.428397 0.795583 -0.428397
+1.50000 3.38047 -0.474105 -4.44089e-16 0.880468 -0.474105
+1.92840 3.29558 -0.428397 0.428397 0.795583 -0.428397
+2.12368 3.18825 -0.370600 0.623676 0.688247 -0.370600
+0.828509 3.24101 -8.90587e-18 -0.671491 0.741013 -8.90587e-18
+1.02589 3.38047 -2.11638e-17 -0.474105 0.880468 -2.11638e-17
+1.50000 3.50000 0.00000 0.00000 1.00000 0.00000
+1.97411 3.38047 0.00000 0.474105 0.880468 0.00000
+2.17149 3.24101 0.00000 0.671491 0.741013 0.00000
+0.876324 3.18825 0.370600 -0.623676 0.688247 0.370600
+1.07160 3.29558 0.428397 -0.428397 0.795583 0.428397
+1.50000 3.38047 0.474105 0.00000 0.880468 0.474105
+1.92840 3.29558 0.428397 0.428397 0.795583 0.428397
+2.12368 3.18825 0.370600 0.623676 0.688247 0.370600
+0.942530 3.11519 0.557470 -0.557470 0.615187 0.557470
+1.12940 3.18825 0.623676 -0.370600 0.688247 0.623676
+1.50000 3.24101 0.671491 0.00000 0.741013 0.671491
+1.87060 3.18825 0.623676 0.370600 0.688247 0.623676
+2.05747 3.11519 0.557470 0.557470 0.615187 0.557470
+
+e
+

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.