*/
double measure () const;
+ /**
+ * Compute and return the number of
+ * children of this line. Actually,
+ * this function only counts the number
+ * of active children, i.e. the number
+ * if lines which are not further
+ * refined. Thus, if both of the two
+ * children of a line are further
+ * refined exactly once, the returned
+ * number will be four, not six.
+ *
+ * If the present cell is not refined,
+ * one is returned.
+ */
+ unsigned int number_of_children () const;
+
private:
/**
* Copy operator. This is normally
*/
void operator = (const LineAccessor &);
+
+
public:
// protected:
// would be better to make this private,
*/
double measure () const;
+ /**
+ * Compute and return the number of
+ * children of this quad. Actually,
+ * this function only counts the number
+ * of active children, i.e. the number
+ * if quads which are not further
+ * refined. Thus, if all of the four
+ * children of a quad are further
+ * refined exactly once, the returned
+ * number will be 16, not 20.
+ *
+ * If the present cell is not refined,
+ * one is returned.
+ */
+ unsigned int number_of_children () const;
+
private:
/**
* Copy operator. This is normally
double LineAccessor<dim>::measure () const {
return sqrt((vertex(1)-vertex(0)).square());
};
-
+
+
+
+template <int dim>
+unsigned int LineAccessor<dim>::number_of_children () const {
+ if (!has_children())
+ return 1;
+ else
+ {
+ unsigned int sum = 0;
+ for (unsigned int c=0; c<2; ++c)
+ sum += child(c)->number_of_children();
+ return sum;
+ };
+};
+
+template <int dim>
+unsigned int QuadAccessor<dim>::number_of_children () const {
+ if (!has_children())
+ return 1;
+ else
+ {
+ unsigned int sum = 0;
+ for (unsigned int c=0; c<4; ++c)
+ sum += child(c)->number_of_children();
+ return sum;
+ };
+};
+
+
+