get_new_point(const std::vector<Point<spacedim> > &surrounding_points,
const std::vector<double> &weights) const;
+
+ using Manifold<spacedim>::project_to_manifold;
+
/**
* Project to FlatManifold: do nothing. Note however that this
* function can be overloaded by derived classes, which will then
*/
virtual
Point<spacedim> project_to_manifold (const Point<spacedim> &candidate) const;
+
private:
const Point<spacedim> periodicity;
};
{
public:
/**
- * Constructor. The center of the
- * spheres defaults to the
- * origin.
- *
- * This class is really just a proxy of its base class.
+ * Constructor. The center of the spheres defaults to the origin.
*/
HyperShellBoundary (const Point<dim> ¢er = Point<dim>());
+
+ /**
+ * Project to manifold. The vertices are used to compute
+ * automatically the radius.
+ */
+ virtual Point<dim>
+ project_to_manifold(const std::vector<Point<dim> > &vertices,
+ const Point<dim> &p) const;
};
if(periodicity[d] > 0)
p[d] = std::fmod(p[d], periodicity[d]);
- return project_to_manifold(p);
+ return project_to_manifold(surrounding_points, p);
}
template <int spacedim>
:
PolarManifold<dim>(center)
{}
+template <int dim>
+Point<dim>
+HyperShellBoundary<dim>::project_to_manifold(const std::vector<Point<dim> > &vertices,
+ const Point<dim> &p) const {
+ double radius = vertices[0].norm();
+ Point<dim> newp = p-this->center;
+ return (this->center + radius*p/p.norm());
+}
+
/* ---------------------------------------------------------------------- */