*/
virtual ~Boundary () = default;
+ /**
+ * Clone this Boundary.
+ */
+ virtual std::unique_ptr<Manifold<dim,spacedim> > clone() const override;
/**
* Return intermediate points on a line spaced according to the interior
*/
StraightBoundary ();
+ /**
+ * Clone this Boundary.
+ */
+ virtual std::unique_ptr<Manifold<dim,spacedim> > clone() const override;
+
/**
* Let the new point be the arithmetic mean of the two vertices of the line.
*
* the base class for more information.
*/
virtual Point<spacedim>
- get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const;
+ get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const override;
/**
* Let the new point be the arithmetic mean of the four vertices of this
*/
virtual
Point<spacedim>
- get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const;
+ get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const override;
/**
* Return <tt>n=points.size()</tt> points that split the StraightBoundary
virtual
void
get_intermediate_points_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line,
- std::vector<Point<spacedim> > &points) const;
+ std::vector<Point<spacedim> > &points) const override;
/**
* Return <tt>n=points.size()=m*m</tt> points that splits the
virtual
void
get_intermediate_points_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad,
- std::vector<Point<spacedim> > &points) const;
+ std::vector<Point<spacedim> > &points) const override;
/**
* Implementation of the function declared in the base class.
virtual
Tensor<1,spacedim>
normal_vector (const typename Triangulation<dim,spacedim>::face_iterator &face,
- const Point<spacedim> &p) const;
+ const Point<spacedim> &p) const override;
/**
* Compute the normals to the boundary at the vertices of the given face.
virtual
void
get_normals_at_vertices (const typename Triangulation<dim,spacedim>::face_iterator &face,
- typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const;
+ typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const override;
/**
* Given a candidate point and a line segment characterized by the iterator,
virtual
Point<spacedim>
project_to_surface (const typename Triangulation<dim,spacedim>::line_iterator &line,
- const Point<spacedim> &candidate) const;
+ const Point<spacedim> &candidate) const override;
/**
* Same function as above but for a point that is to be projected onto the
virtual
Point<spacedim>
project_to_surface (const typename Triangulation<dim,spacedim>::quad_iterator &quad,
- const Point<spacedim> &candidate) const;
+ const Point<spacedim> &candidate) const override;
/**
* Same function as above but for a point that is to be projected onto the
virtual
Point<spacedim>
project_to_surface (const typename Triangulation<dim,spacedim>::hex_iterator &hex,
- const Point<spacedim> &candidate) const;
+ const Point<spacedim> &candidate) const override;
};
const Point<spacedim> &direction,
const Point<spacedim> &point_on_axis);
+ /**
+ * Clone this Boundary object.
+ */
+ virtual std::unique_ptr<Manifold<dim,spacedim> > clone() const override;
+
/**
* Refer to the general documentation of this class and the documentation of
* the base class.
*/
virtual Point<spacedim>
- get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const;
+ get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const override;
/**
* Refer to the general documentation of this class and the documentation of
* the base class.
*/
virtual Point<spacedim>
- get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const;
+ get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const override;
/**
* Refer to the general documentation of this class and the documentation of
*/
virtual void
get_intermediate_points_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line,
- std::vector<Point<spacedim> > &points) const;
+ std::vector<Point<spacedim> > &points) const override;
/**
* Refer to the general documentation of this class and the documentation of
*/
virtual void
get_intermediate_points_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad,
- std::vector<Point<spacedim> > &points) const;
+ std::vector<Point<spacedim> > &points) const override;
/**
* Compute the normals to the boundary at the vertices of the given face.
*/
virtual void
get_normals_at_vertices (const typename Triangulation<dim,spacedim>::face_iterator &face,
- typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const;
+ typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const override;
/**
* Return the radius of the cylinder.
const Point<dim> x_0,
const Point<dim> x_1);
+ /**
+ * Clone this Boundary object.
+ */
+ virtual std::unique_ptr<Manifold<dim,dim> > clone() const override;
+
/**
* Return the radius of the (truncated) cone at given point <tt>x</tt> on
* the axis.
*/
virtual
Point<dim>
- get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const;
+ get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const override;
/**
* Refer to the general documentation of this class and the documentation of
*/
virtual
Point<dim>
- get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
+ get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const override;
/**
* Refer to the general documentation of this class and the documentation of
virtual
void
get_intermediate_points_on_line (const typename Triangulation<dim>::line_iterator &line,
- std::vector<Point<dim> > &points) const;
+ std::vector<Point<dim> > &points) const override;
/**
* Refer to the general documentation of this class and the documentation of
virtual
void
get_intermediate_points_on_quad (const typename Triangulation<dim>::quad_iterator &quad,
- std::vector<Point<dim> > &points) const;
+ std::vector<Point<dim> > &points) const override;
/**
* Compute the normals to the boundary at the vertices of the given face.
virtual
void
get_normals_at_vertices (const typename Triangulation<dim>::face_iterator &face,
- typename Boundary<dim>::FaceVertexNormals &face_vertex_normals) const;
+ typename Boundary<dim>::FaceVertexNormals &face_vertex_normals) const override;
/**
* Implementation of the function declared in the base class.
virtual
Tensor<1,dim>
normal_vector (const typename Triangulation<dim>::face_iterator &face,
- const Point<dim> &p) const;
+ const Point<dim> &p) const override;
protected:
HyperBallBoundary (const Point<spacedim> p = Point<spacedim>(),
const double radius = 1.0);
+ /**
+ * Clone this Boundary object.
+ */
+ virtual std::unique_ptr<Manifold<dim,spacedim> > clone() const override;
+
/**
* Refer to the general documentation of this class and the documentation of
* the base class.
*/
virtual
Point<spacedim>
- get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const;
+ get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const override;
/**
* Refer to the general documentation of this class and the documentation of
*/
virtual
Point<spacedim>
- get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const;
+ get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const override;
/**
* Refer to the general documentation of this class and the documentation of
virtual
void
get_intermediate_points_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line,
- std::vector<Point<spacedim> > &points) const;
+ std::vector<Point<spacedim> > &points) const override;
/**
* Refer to the general documentation of this class and the documentation of
virtual
void
get_intermediate_points_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad,
- std::vector<Point<spacedim> > &points) const;
+ std::vector<Point<spacedim> > &points) const override;
/**
* Implementation of the function declared in the base class.
virtual
Tensor<1,spacedim>
normal_vector (const typename Triangulation<dim,spacedim>::face_iterator &face,
- const Point<spacedim> &p) const;
+ const Point<spacedim> &p) const override;
/**
* Compute the normals to the boundary at the vertices of the given face.
virtual
void
get_normals_at_vertices (const typename Triangulation<dim,spacedim>::face_iterator &face,
- typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const;
+ typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const override;
/**
* Return the center of the ball.
HalfHyperBallBoundary (const Point<dim> p = Point<dim>(),
const double radius = 1.0);
+ /**
+ * Clone this Boundary object.
+ */
+ virtual std::unique_ptr<Manifold<dim,dim> > clone() const override;
+
/**
* Check if on the line <tt>x==0</tt>, otherwise pass to the base class.
*/
virtual Point<dim>
- get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const;
+ get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const override;
/**
* Check if on the line <tt>x==0</tt>, otherwise pass to the base class.
*/
virtual Point<dim>
- get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
+ get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const override;
/**
* Refer to the general documentation of this class and the documentation of
*/
virtual void
get_intermediate_points_on_line (const typename Triangulation<dim>::line_iterator &line,
- std::vector<Point<dim> > &points) const;
+ std::vector<Point<dim> > &points) const override;
/**
* Refer to the general documentation of this class and the documentation of
*/
virtual void
get_intermediate_points_on_quad (const typename Triangulation<dim>::quad_iterator &quad,
- std::vector<Point<dim> > &points) const;
+ std::vector<Point<dim> > &points) const override;
/**
* Compute the normals to the boundary at the vertices of the given face.
*/
virtual void
get_normals_at_vertices (const typename Triangulation<dim>::face_iterator &face,
- typename Boundary<dim>::FaceVertexNormals &face_vertex_normals) const;
+ typename Boundary<dim>::FaceVertexNormals &face_vertex_normals) const override;
};
* radius as argument. This radius will be ignored
*/
HyperShellBoundary (const Point<dim> ¢er = Point<dim>());
+
+ /**
+ * Clone this Boundary object.
+ */
+ virtual std::unique_ptr<Manifold<dim,dim> > clone() const override;
};
const double inner_radius = -1,
const double outer_radius = -1);
+ /**
+ * Clone this Boundary object.
+ */
+ virtual std::unique_ptr<Manifold<dim,dim> > clone() const override;
+
/**
* Construct a new point on a line.
*/
virtual Point<dim>
- get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const;
+ get_new_point_on_line (const typename Triangulation<dim>::line_iterator &line) const override;
/**
* Construct a new point on a quad.
*/
virtual Point<dim>
- get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const;
+ get_new_point_on_quad (const typename Triangulation<dim>::quad_iterator &quad) const override;
/**
* Refer to the general documentation of this class and the documentation of
*/
virtual void
get_intermediate_points_on_line (const typename Triangulation<dim>::line_iterator &line,
- std::vector<Point<dim> > &points) const;
+ std::vector<Point<dim> > &points) const override;
/**
* Refer to the general documentation of this class and the documentation of
*/
virtual void
get_intermediate_points_on_quad (const typename Triangulation<dim>::quad_iterator &quad,
- std::vector<Point<dim> > &points) const;
+ std::vector<Point<dim> > &points) const override;
/**
* Compute the normals to the boundary at the vertices of the given face.
*/
virtual void
get_normals_at_vertices (const typename Triangulation<dim>::face_iterator &face,
- typename Boundary<dim>::FaceVertexNormals &face_vertex_normals) const;
+ typename Boundary<dim>::FaceVertexNormals &face_vertex_normals) const override;
private:
/**
*/
TorusBoundary (const double R, const double r);
+ /**
+ * Clone this Boundary object.
+ */
+ virtual std::unique_ptr<Manifold<dim,spacedim> > clone() const override;
+
//Boundary Refinement Functions
/**
* Construct a new point on a line.
*/
virtual Point<spacedim>
- get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const;
+ get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const override;
/**
* Construct a new point on a quad.
*/
virtual Point<spacedim>
- get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const;
+ get_new_point_on_quad (const typename Triangulation<dim,spacedim>::quad_iterator &quad) const override;
/**
* Construct a new points on a line.
*/
virtual void get_intermediate_points_on_line (
const typename Triangulation< dim, spacedim >::line_iterator &line,
- std::vector< Point< spacedim > > &points) const;
+ std::vector< Point< spacedim > > &points) const override;
/**
* Construct a new points on a quad.
*/
virtual void get_intermediate_points_on_quad (
const typename Triangulation< dim, spacedim >::quad_iterator &quad,
- std::vector< Point< spacedim > > &points ) const;
+ std::vector< Point< spacedim > > &points ) const override;
/**
* Get the normal from cartesian coordinates. This normal does not have unit
*/
virtual void get_normals_at_vertices (
const typename Triangulation< dim, spacedim >::face_iterator &face,
- typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const;
+ typename Boundary<dim,spacedim>::FaceVertexNormals &face_vertex_normals) const override;
private:
//Handy functions
#include <deal.II/grid/tria_iterator.h>
#include <deal.II/grid/tria_accessor.h>
#include <deal.II/base/tensor.h>
+#include <deal.II/base/std_cxx14/memory.h>
#include <cmath>
{}
+
+template<int dim, int spacedim>
+std::unique_ptr<Manifold<dim, spacedim> >
+CylinderBoundary<dim,spacedim>::clone() const
+{
+ return std_cxx14::make_unique<CylinderBoundary<dim, spacedim> >(radius, direction, point_on_axis);
+}
+
+
+
template <int dim, int spacedim>
Point<spacedim>
CylinderBoundary<dim,spacedim>::get_axis_vector (const unsigned int axis)
+template<int dim>
+std::unique_ptr<Manifold<dim,dim> > ConeBoundary<dim>::clone() const
+{
+ return std_cxx14::make_unique<ConeBoundary<dim> >(radius_0,radius_1,x_0,x_1);
+}
+
+
+
template <int dim>
double ConeBoundary<dim>::get_radius (Point<dim> x) const
{
+template<int dim, int spacedim>
+std::unique_ptr<Manifold<dim, spacedim> >
+HyperBallBoundary<dim,spacedim>::clone() const
+{
+ return std_cxx14::make_unique<HyperBallBoundary<dim,spacedim> >(center, radius);
+}
+
+
+
template <int dim, int spacedim>
Point<spacedim>
HyperBallBoundary<dim,spacedim>::get_new_point_on_line (const typename Triangulation<dim,spacedim>::line_iterator &line) const
+template<int dim>
+std::unique_ptr<Manifold<dim,dim> > HalfHyperBallBoundary<dim>::clone() const
+{
+ return std_cxx14::make_unique<HalfHyperBallBoundary<dim> >(this->get_center(),
+ this->get_radius());
+}
+
+
+
template <int dim>
Point<dim>
HalfHyperBallBoundary<dim>::
}
+
+template<int dim>
+std::unique_ptr<Manifold<dim,dim> >
+HyperShellBoundary<dim>::clone() const
+{
+ return std_cxx14::make_unique<HyperShellBoundary<dim> >(this->get_center());
+}
+
+
+
/* ---------------------------------------------------------------------- */
+template<int dim>
+std::unique_ptr<Manifold<dim,dim> >
+HalfHyperShellBoundary<dim>::clone() const
+{
+ return std_cxx14::make_unique<HalfHyperShellBoundary<dim> >(this->get_center(),
+ inner_radius,
+ outer_radius);
+}
+
+
+
template <int dim>
Point<dim>
HalfHyperShellBoundary<dim>::
Assert (R>r, ExcMessage("Outer radius must be greater than inner radius."));
}
+template<int dim, int spacedim>
+std::unique_ptr<Manifold<dim, spacedim> >
+TorusBoundary<dim,spacedim>::clone() const
+{
+ return std_cxx14::make_unique<TorusBoundary<dim,spacedim> >(R,r);
+}
+
template <int dim, int spacedim>