template <int dim>
-class MyBoundary : public Boundary<dim>
+class MyBoundary : public Manifold<dim>
{
virtual Point<dim>
- get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
+ get_new_point (const std::vector<Point<dim> > &p,
+ const std::vector<double> &w) const
{
- deallog << "Finding point between "
- << line->vertex(0) << " and "
- << line->vertex(1) << std::endl;
-
- // in 2d, find a point that
- // lies on the opposite side
- // of the quad. in 3d, choose
- // the midpoint of the edge
- if (dim == 2)
- return Point<dim>(0,1.25);
- else
- return (line->vertex(0) + line->vertex(1)) / 2;
- }
-
- virtual Point<dim>
- get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const
- {
- deallog << "Finding point between "
- << quad->vertex(0) << " and "
- << quad->vertex(1) << " and "
- << quad->vertex(2) << " and "
- << quad->vertex(3) << std::endl;
-
- return Point<dim>(0,0,1.25);
- }
-
- virtual
- Point<dim>
- project_to_surface (const typename Triangulation<dim>::line_iterator &,
- const Point<dim> &p) const
- {
- deallog << "Projecting line point " << p << std::endl;
-
- if (dim == 2)
- return Point<dim>(p[0], 1.25-2.25*std::fabs(p[0]));
- else
- return p;
- }
-
- virtual
- Point<dim>
- project_to_surface (const typename Triangulation<dim>::quad_iterator &,
- const Point<dim> &p) const
- {
- deallog << "Projecting quad point " << p << std::endl;
-
- Assert (dim == 3, ExcInternalError());
-
- return Point<dim>(p[0], p[1],
- 1.25-2.25*std::max(std::fabs(p[0]),
- std::fabs(p[1])));
- }
-
+ switch(p.size()) {
+ case 2:
+ {
+ deallog << "Finding point between "
+ << p[0] << " and "
+ << p[1] << std::endl;
+
+ // in 2d, find a point that
+ // lies on the opposite side
+ // of the quad. in 3d, choose
+ // the midpoint of the edge
+ if (dim == 2)
+ return Point<dim>(0,1.25);
+ else
+ return (p[0] + p[1]) / 2;
+ }
+ break;
+ default:
+ {
+ deallog << "Finding point between "
+ << p[0] << " and "
+ << p[1] << " and "
+ << p[2] << " and "
+ << p[3] << std::endl;
+
+ return Point<dim>(0,0,1.25);
+ }
+ break;
+ }
+ };
+
+
virtual
Point<dim>
- project_to_surface (const typename Triangulation<dim>::hex_iterator &,
- const Point<dim> &) const
+ project_to_manifold (const std::vector<Point<dim> > &v,
+ const Point<dim> &p) const
{
- Assert (false, ExcInternalError());
- return Point<dim>();
- }
+ switch(v.size()) {
+ case 2:
+ {
+ deallog << "Projecting line point " << p << std::endl;
+
+ if (dim == 2)
+ return Point<dim>(p[0], 1.25-2.25*std::fabs(p[0]));
+ else
+ return p;
+ }
+ break;
+ case 4:
+ {
+ deallog << "Projecting quad point " << p << std::endl;
+
+ Assert (dim == 3, ExcInternalError());
+
+ return Point<dim>(p[0], p[1],
+ 1.25-2.25*std::max(std::fabs(p[0]),
+ std::fabs(p[1])));
+ }
+ break;
+ default:
+ {
+ Assert (false, ExcInternalError());
+ return Point<dim>();
+ }
+ }
+ };
};
template <int dim>
-class MyBoundary : public Boundary<dim>
+class MyBoundary : public Manifold<dim>
{
virtual Point<dim>
- get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
+ get_new_point (const std::vector<Point<dim> > &p,
+ const std::vector<double> &w) const
{
- deallog << "Finding point between "
- << line->vertex(0) << " and "
- << line->vertex(1) << std::endl;
-
- return Point<dim>(0,0.5,0.9);
- }
-
- virtual Point<dim>
- get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &) const
- {
- Assert (false, ExcInternalError());
- return Point<dim>(0,0,1.25);
- }
+ switch(p.size()) {
+ case 2:
+ {
+ deallog << "Finding point between "
+ << p[0] << " and "
+ << p[1] << std::endl;
+ return Point<dim>(0,0.5,0.9);
+ }
+ break;
+ default:
+ {
+ Assert (false, ExcInternalError());
+ return Point<dim>(0,0,1.25);
+ }
+ break;
+ }
+ };
};