* 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>());
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;
-}
+};
+
//
// /**
/* -------------------------- 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);
}
#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)
{}
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