]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fixed Jacobian for square mesh.
authorLuca Heltai <luca.heltai@sissa.it>
Thu, 3 Mar 2016 19:28:10 +0000 (20:28 +0100)
committerLuca Heltai <luca.heltai@sissa.it>
Wed, 6 Apr 2016 11:00:14 +0000 (13:00 +0200)
source/fe/mapping_manifold.cc
tests/fe/mapping_manifold_03.cc
tests/fe/mapping_manifold_03.output

index c017d0b4a3e83356bdb5a4da9479d35f1a365ef4..3a69a9ed25b9ce73ac6b52e74a8387bfe448a224 100644 (file)
@@ -441,7 +441,7 @@ namespace internal
                   Tensor<1,spacedim> T = data.cell->get_manifold().get_tangent_vector(P, NP);
 
                   for (unsigned int d=0; d<spacedim; ++d)
-                    data.contravariant[point][d][i] = T[d]*L;
+                    data.contravariant[point][d][i] = T[d]/L;
                 }
             }
 
index ef42c5e987164761a07b4e2465370b464f037ade..b37b4e7d48d96a46c2f2d42f7383d736d01fce51 100644 (file)
@@ -37,22 +37,9 @@ void test()
 
   Triangulation<dim, spacedim>   triangulation;
 
-  Point<spacedim> center;
-  for (unsigned int i=0; i<spacedim; ++i)
-    center[i] = 5+i;
+  GridGenerator::hyper_cube (triangulation);
 
-  const double inner_radius = 0.5,
-               outer_radius = 1.0;
-  GridGenerator::hyper_shell (triangulation,
-                              center, inner_radius, outer_radius);
-
-
-  static  const SphericalManifold<dim> manifold(center);
-
-  triangulation.set_all_manifold_ids(0);
-  triangulation.set_manifold (0, manifold);
-
-  const QGauss<spacedim> quad(3);
+  const QGauss<dim> quad(5);
 
   FE_Q<dim,spacedim> fe(1);
 
@@ -82,15 +69,19 @@ void test()
 
   for (unsigned int q=0; q<jac_from_mapping_q.size(); ++q)
     {
-
-      deallog << "Jacobian from mapping manifold at point "<< q << std::endl;
-      for (unsigned int d=0; d<dim; ++d)
-        deallog << jac_from_mapping_manifold[q][d] << std::endl;
-
-      deallog << "Jacobian from mapping q at point "<< q << std::endl;
-      for (unsigned int d=0; d<dim; ++d)
-        deallog << jac_from_mapping_q[q][d] << std::endl;
-
+      double dist = 0;
+      for (unsigned int d=0; d<spacedim; ++d)
+        dist += (jac_from_mapping_manifold[q][d] - jac_from_mapping_q[q][d]).norm();
+      if (dist > 1e-10)
+        {
+          deallog << "Jacobian from mapping manifold at point "<< q << std::endl;
+          for (unsigned int d=0; d<spacedim; ++d)
+            deallog << jac_from_mapping_manifold[q][d] << std::endl;
+
+          deallog << "Jacobian from mapping q at point "<< q << std::endl;
+          for (unsigned int d=0; d<spacedim; ++d)
+            deallog << jac_from_mapping_q[q][d] << std::endl;
+        }
     }
 
   deallog << "OK" << std::endl;
@@ -104,7 +95,13 @@ main()
   deallog.attach(logfile);
   deallog.threshold_double(1.e-10);
 
+  test<1,1>();
+  test<1,2>();
+  test<1,3>();
+
   test<2,2>();
+  test<2,3>();
+
   test<3,3>();
 
   return 0;
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..040c04d08b6b773b837fcc82f456f3e6ef104d49 100644 (file)
@@ -0,0 +1,13 @@
+
+DEAL::dim=1, spacedim=1
+DEAL::OK
+DEAL::dim=1, spacedim=2
+DEAL::OK
+DEAL::dim=1, spacedim=3
+DEAL::OK
+DEAL::dim=2, spacedim=2
+DEAL::OK
+DEAL::dim=2, spacedim=3
+DEAL::OK
+DEAL::dim=3, spacedim=3
+DEAL::OK

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.