]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Ensure that charts do not map from higher into lower dimensional spaces.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 8 Jul 2016 16:42:12 +0000 (11:42 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Mon, 11 Jul 2016 12:24:30 +0000 (07:24 -0500)
tests/manifold/chart_manifold_05_embedded.cc
tests/manifold/chart_manifold_06_embedded.cc

index 552854fd5ed02c809613fcbfa6e73cf5744dbfe8..a208dd2440348a92aea19e2f9a6afce036c5c9a7 100644 (file)
 
 
 template <int dim, int spacedim>
-class MyFlatManifold : public ChartManifold<dim,spacedim,spacedim+1>
+class MyFlatManifold : public ChartManifold<dim,spacedim,spacedim>
 {
 public:
   virtual
-  Point<spacedim+1>
+  Point<spacedim>
   pull_back(const Point<spacedim> &space_point) const
   {
-    Point<spacedim+1> p;
+    Point<spacedim> p;
     for (unsigned int d=0; d<spacedim; ++d)
       p[d] = space_point[d];
     return p;
@@ -38,7 +38,7 @@ public:
 
   virtual
   Point<spacedim>
-  push_forward(const Point<spacedim+1> &chart_point) const
+  push_forward(const Point<spacedim> &chart_point) const
   {
     Point<spacedim> p;
     for (unsigned int d=0; d<spacedim; ++d)
@@ -47,10 +47,10 @@ public:
   }
 
   virtual
-  DerivativeForm<1,spacedim+1,spacedim>
-  push_forward_gradient(const Point<spacedim+1> &chart_point) const
+  DerivativeForm<1,spacedim,spacedim>
+  push_forward_gradient(const Point<spacedim> &chart_point) const
   {
-    DerivativeForm<1,spacedim+1,spacedim> x;
+    DerivativeForm<1,spacedim,spacedim> x;
     for (unsigned int d=0; d<spacedim; ++d)
       x[d][d] = 1;
     return x;
index 96a3789d06bd0c2f5f2cfd5a785927272674270b..62f9ef60d76a8522632a6c32307e45eb8ba71539 100644 (file)
@@ -12,8 +12,6 @@
 // Test direction vector of flat manifold with periodicity, where the
 // flat manifold is implemented as a ChartManifold with identity
 // pull-back and push-forward
-//
-// make the chart higher dimensional
 
 #include "../tests.h"
 #include <fstream>
 
 
 template <int dim, int spacedim>
-class MyFlatManifold : public ChartManifold<dim,spacedim,spacedim+1>
+class MyFlatManifold : public ChartManifold<dim,spacedim,spacedim>
 {
 public:
-  MyFlatManifold (const Tensor<1,spacedim+1> &periodicity)
+  MyFlatManifold (const Tensor<1,spacedim> &periodicity)
     :
-    ChartManifold<dim,spacedim,spacedim+1>(periodicity)
+    ChartManifold<dim,spacedim,spacedim>(periodicity)
   {}
 
   virtual
-  Point<spacedim+1>
+  Point<spacedim>
   pull_back(const Point<spacedim> &space_point) const
   {
-    Point<spacedim+1> p;
+    Point<spacedim> p;
     for (unsigned int d=0; d<spacedim; ++d)
       p[d] = space_point[d];
     return p;
@@ -44,7 +42,7 @@ public:
 
   virtual
   Point<spacedim>
-  push_forward(const Point<spacedim+1> &chart_point) const
+  push_forward(const Point<spacedim> &chart_point) const
   {
     Point<spacedim> p;
     for (unsigned int d=0; d<spacedim; ++d)
@@ -53,10 +51,10 @@ public:
   }
 
   virtual
-  DerivativeForm<1,spacedim+1,spacedim>
-  push_forward_gradient(const Point<spacedim+1> &chart_point) const
+  DerivativeForm<1,spacedim,spacedim>
+  push_forward_gradient(const Point<spacedim> &chart_point) const
   {
-    DerivativeForm<1,spacedim+1,spacedim> x;
+    DerivativeForm<1,spacedim,spacedim> x;
     for (unsigned int d=0; d<spacedim; ++d)
       x[d][d] = 1;
     return x;
@@ -74,7 +72,7 @@ void test()
           << ", spacedim="<< spacedim << std::endl;
 
   // make the domain periodic in the first direction with periodicity 1.1
-  Tensor<1,spacedim+1> periodicity;
+  Tensor<1,spacedim> periodicity;
   periodicity[0] = 1.1;
   MyFlatManifold<dim,spacedim> manifold(periodicity);
 

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.