]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Added manifold_lib and ManifoldChart
authorheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 21 Aug 2013 16:09:41 +0000 (16:09 +0000)
committerheltai <heltai@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 21 Aug 2013 16:09:41 +0000 (16:09 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@30376 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/grid/manifold_lib.h
deal.II/source/grid/manifold.cc
deal.II/source/grid/manifold_lib.cc

index 2aab365c689708cffcb9770db5ddb47b19c71002..3b1d7ac5995db271299cd006fc0ec8e47e2ca512 100644 (file)
@@ -31,7 +31,7 @@ DEAL_II_NAMESPACE_OPEN
  * and returns its space representation.
  */
 template <int spacedim>
-class PolarManifold : public FlatManifold<spacedim> 
+class PolarManifold : public ManifoldChart<spacedim,spacedim> 
 {
   public:
     PolarManifold(const Point<spacedim> center = Point<spacedim>());
@@ -40,9 +40,17 @@ class PolarManifold : public FlatManifold<spacedim>
     get_new_point (const std::vector<Point<spacedim> > &surrounding_points,
                   const std::vector<double> &weights) const;
 
+    
+    virtual Point<spacedim>
+    pull_back (const Point<spacedim> &space_point) const;
+    
+    virtual Point<spacedim>
+    push_forward (const Point<spacedim> &chart_point) const;
+    
   private:
     Point<spacedim> center;
-}
+};
+
 
 //  
 //  /**
index eff55fa9ce56218b40e34a1e202844d21ceff492..07a76418aadf4ad4a907b1dcaa932f8e1bd77a19 100644 (file)
@@ -68,25 +68,27 @@ get_new_point (const std::vector<Point<spacedim> > &surrounding_points,
 
 /* -------------------------- ManifoldChart --------------------- */
 
-template <int spacedim>
-ManifoldChart<spacedim>::~ManifoldChart ()
+template <int dim, int spacedim>
+ManifoldChart<dim,spacedim>::~ManifoldChart ()
 {}
 
 
-template <int spacedim>
+template <int dim, int spacedim>
 Point<spacedim>
-FlatManifold<spacedim>::
+ManifoldChart<dim, spacedim>::
 get_new_point (const std::vector<Point<spacedim> > &surrounding_points,
               const std::vector<double> &weights) const
 {
   Assert(surrounding_points.size() == weights.size(),
         ExcDimensionMismatch(surrounding_points.size(), weights.size()));
+  chart_points.resize(surrounding_points.size());
   
-  Point<spacedim> p;
-  for(unsigned int i=0; i<surrounding_points.size(); ++i)
-    p += surrounding_points[i]*weights[i];
+  for(unsigned int i=0; i<surrounding_points.size(); ++i) 
+    chart_points[i] = pull_back(surrounding_points[i]);
+      
+  Point<dim> p_chart = sub_manifold.get_new_point(chart_points, weights);
   
-  return p;
+  return push_forward(p_chart);
 }
 
 
index 16c8f6176904121e613fd8db6343454b3c3d2969..d69c3164af0db028e25e264f8bc12ade4101ea96 100644 (file)
@@ -21,8 +21,9 @@
 #include <deal.II/base/tensor.h>
 #include <cmath>
 
+DEAL_II_NAMESPACE_OPEN
+
 template <int spacedim>
-Point<spacedim>
 PolarManifold<spacedim>::PolarManifold(const Point<spacedim> center):
   center(center)
 {}
@@ -30,29 +31,16 @@ PolarManifold<spacedim>::PolarManifold(const Point<spacedim> center):
 
 template <int spacedim>
 Point<spacedim>
-PolarManifold<spacedim>::get_new_point (const std::vector<Point<spacedim> > &sp,
-                                       const std::vector<double> &sw) const
+PolarManifold<spacedim>::push_forward (const Point<spacedim> &chart_point) const
 {
-  AssertDimension(sp.size(), sw.size());
-  
-  std::vector<Point<spacedim> > sp_(sp.size());
-  std::vector<double> sw_(sp.size());
-  
-  
-  Point<spacedim> middle = StraightBoundary<dim,spacedim>::get_new_point_on_line (line);
-
-  middle -= center;
+  return chart_point;  
+}
 
-  double r=0;
-  if (compute_radius_automatically)
-    {
-      const Point<spacedim> vertex_relative = line->vertex(0) - center;
-      r = std::sqrt(vertex_relative.square());
-    }
-  else
-    r=radius;
-  // project to boundary
-  middle *= r / std::sqrt(middle.square());
-  middle += center;
-  return middle;
+template <int spacedim>
+Point<spacedim>
+PolarManifold<spacedim>::pull_back (const Point<spacedim> &space_point) const
+{
+  return space_point;
 }
+
+DEAL_II_NAMESPACE_CLOSE

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.