/**
* Constructor
*/
- HyperBallBoundary (const Point<dim> p=Point<dim>(), const double radius=1.0) :
- center(p), radius(radius) {};
+ HyperBallBoundary (const Point<dim> p = Point<dim>(),
+ const double radius = 1.0);
/**
* Refer to the general documentation of
get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
- private:
+ protected:
/**
* Center point of the hyperball.
*/
const double radius;
};
+
+
+/**
+ * Variant of #HyperBallBoundary# which denotes a half hyper ball
+ * where the first coordinate is restricted to the range $x>=0$ (or
+ * $x>=center(0)$). In two dimensions, this equals the right half
+ * circle, in three space dimensions it is a half ball.
+ *
+ * @author Wolfgang Bangerth, 1999
+ */
+template <int dim>
+class HalfHyperBallBoundary : public HyperBallBoundary<dim> {
+ public:
+ /**
+ * Constructor
+ */
+ HalfHyperBallBoundary (const Point<dim> p = Point<dim>(),
+ const double radius = 1.0);
+
+ /**
+ * Check if on the line #x==0#,
+ * otherwise pass to the base
+ * class.
+ */
+ virtual Point<dim>
+ get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const;
+
+ /**
+ * Check if on the line #x==0#,
+ * otherwise pass to the base
+ * class.
+ */
+ virtual Point<dim>
+ get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
+};
+
+template <int dim>
+HyperBallBoundary<dim>::HyperBallBoundary (const Point<dim> p,
+ const double radius) :
+ center(p), radius(radius)
+{};
+
+
+
template <int dim>
Point<dim>
HyperBallBoundary<dim>::get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
+template <int dim>
+HalfHyperBallBoundary<dim>::HalfHyperBallBoundary (const Point<dim> center,
+ const double radius) :
+ HyperBallBoundary<dim> (center, radius)
+{};
+
+
+
+template <int dim>
+Point<dim>
+HalfHyperBallBoundary<dim>::
+get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const
+{
+ const Point<dim> line_center = line->center();
+ if (line_center(0) == center(0))
+ return line_center;
+ else
+ return HyperBallBoundary<dim>::get_new_point_on_line (line);
+};
+
+
+
+
+template <int dim>
+Point<dim>
+HalfHyperBallBoundary<dim>::
+get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const
+{
+ const Point<dim> quad_center = quad->center();
+ if (quad_center(0) == center(0))
+ return quad_center;
+ else
+ return HyperBallBoundary<dim>::get_new_point_on_quad (quad);
+};
+
+
template <int dim>
HyperShellBoundary<dim>::HyperShellBoundary (const Point<dim> ¢er) :
// explicit instantiations
template class HyperBallBoundary<deal_II_dimension>;
+template class HalfHyperBallBoundary<deal_II_dimension>;
template class HyperShellBoundary<deal_II_dimension>;