/*---------------------------- boundary-function.h ---------------------------*/
#include <base/point.h>
+#include <base/subscriptor.h>
#include <grid/geometry_info.h>
-#include <math.h>
* @author Wolfgang Bangerth, 1998
*/
template <int dim>
-class Boundary {
+class Boundary : public Subscriptor {
public:
/**
* Typedef an array of the needed number
// typedef const Point<dim>* PointArray[((dim==1) ?
// 1 :
// GeometryInfo<dim>::vertices_per_face)];
-
+
+ /**
+ * Destructor. Does nothing here, but
+ * needs to be declared to make it
+ * virtual.
+ */
+ virtual ~Boundary ();
+
/**
* This function calculates the position
* of the new vertex.
* This function calculates the position
* of the new vertex.
*/
- virtual Point<dim> in_between (const PointArray &neighbors) const {
- Point<dim> p;
- for (int i=0; i<(1<<(dim-1)); ++i)
- p += *neighbors[i];
- p /= (1<<(dim-1))*1.0;
- return p;
- };
+ virtual Point<dim> in_between (const PointArray &neighbors) const;
};
* This function calculates the position
* of the new vertex.
*/
- virtual Point<dim> in_between (const PointArray &neighbors) const {
- Point<dim> middle = StraightBoundary<dim>::in_between(neighbors);
-
- middle -= center;
- // project to boundary
- middle *= radius / sqrt(middle.square());
-
- middle += center;
- return middle;
- };
+ virtual Point<dim> in_between (const PointArray &neighbors) const;
private: