From: heltai Date: Wed, 21 Aug 2013 16:09:41 +0000 (+0000) Subject: Added manifold_lib and ManifoldChart X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=40e2bc044dd8f97fa9dc1396223c602430204272;p=dealii-svn.git Added manifold_lib and ManifoldChart git-svn-id: https://svn.dealii.org/branches/branch_manifold_id@30376 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/grid/manifold_lib.h b/deal.II/include/deal.II/grid/manifold_lib.h index 2aab365c68..3b1d7ac599 100644 --- a/deal.II/include/deal.II/grid/manifold_lib.h +++ b/deal.II/include/deal.II/grid/manifold_lib.h @@ -31,7 +31,7 @@ DEAL_II_NAMESPACE_OPEN * and returns its space representation. */ template -class PolarManifold : public FlatManifold +class PolarManifold : public ManifoldChart { public: PolarManifold(const Point center = Point()); @@ -40,9 +40,17 @@ class PolarManifold : public FlatManifold get_new_point (const std::vector > &surrounding_points, const std::vector &weights) const; + + virtual Point + pull_back (const Point &space_point) const; + + virtual Point + push_forward (const Point &chart_point) const; + private: Point center; -} +}; + // // /** diff --git a/deal.II/source/grid/manifold.cc b/deal.II/source/grid/manifold.cc index eff55fa9ce..07a76418aa 100644 --- a/deal.II/source/grid/manifold.cc +++ b/deal.II/source/grid/manifold.cc @@ -68,25 +68,27 @@ get_new_point (const std::vector > &surrounding_points, /* -------------------------- ManifoldChart --------------------- */ -template -ManifoldChart::~ManifoldChart () +template +ManifoldChart::~ManifoldChart () {} -template +template Point -FlatManifold:: +ManifoldChart:: get_new_point (const std::vector > &surrounding_points, const std::vector &weights) const { Assert(surrounding_points.size() == weights.size(), ExcDimensionMismatch(surrounding_points.size(), weights.size())); + chart_points.resize(surrounding_points.size()); - Point p; - for(unsigned int i=0; i p_chart = sub_manifold.get_new_point(chart_points, weights); - return p; + return push_forward(p_chart); } diff --git a/deal.II/source/grid/manifold_lib.cc b/deal.II/source/grid/manifold_lib.cc index 16c8f61769..d69c3164af 100644 --- a/deal.II/source/grid/manifold_lib.cc +++ b/deal.II/source/grid/manifold_lib.cc @@ -21,8 +21,9 @@ #include #include +DEAL_II_NAMESPACE_OPEN + template -Point PolarManifold::PolarManifold(const Point center): center(center) {} @@ -30,29 +31,16 @@ PolarManifold::PolarManifold(const Point center): template Point -PolarManifold::get_new_point (const std::vector > &sp, - const std::vector &sw) const +PolarManifold::push_forward (const Point &chart_point) const { - AssertDimension(sp.size(), sw.size()); - - std::vector > sp_(sp.size()); - std::vector sw_(sp.size()); - - - Point middle = StraightBoundary::get_new_point_on_line (line); - - middle -= center; + return chart_point; +} - double r=0; - if (compute_radius_automatically) - { - const Point 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 +Point +PolarManifold::pull_back (const Point &space_point) const +{ + return space_point; } + +DEAL_II_NAMESPACE_CLOSE