/**
* Return an estimate for the memory consumption, in bytes, of this object.
- * This is not exact (but will usually be close) because calculating the
- * memory usage of trees (e.g., <tt>std::map</tt>) is difficult.
+ *
+ * This function is virtual and can be overloaded by derived classes.
*/
- std::size_t
+ virtual std::size_t
memory_consumption() const;
};
laplacian(const Point<dim> & point,
const unsigned int component = 0) const override;
- std::size_t
- memory_consumption() const;
+ virtual std::size_t
+ memory_consumption() const override;
protected:
/**
/**
* Return an estimate for the memory consumption, in bytes, of this object.
- * This is not exact (but will usually be close) because calculating the
- * memory usage of trees (e.g., <tt>std::map</tt>) is difficult.
*/
- std::size_t
- memory_consumption() const;
+ virtual std::size_t
+ memory_consumption() const override;
protected:
/**
gradient(const Point<dim> & p,
const unsigned int component = 0) const override;
+ /**
+ * Return an estimate for the memory consumption, in bytes, of this object.
+ */
+ virtual std::size_t
+ memory_consumption() const override;
+
protected:
/**
* Find the index in the table of the rectangle containing an input point
gradient(const Point<dim> & p,
const unsigned int component = 0) const override;
+ /**
+ * Return an estimate for the memory consumption, in bytes, of this object.
+ */
+ virtual std::size_t
+ memory_consumption() const override;
+
private:
/**
* The set of interval endpoints in each of the coordinate directions.
gradient(const Point<dim> & p,
const unsigned int component = 0) const override;
+ /**
+ * Return an estimate for the memory consumption, in bytes, of this object.
+ */
+ virtual std::size_t
+ memory_consumption() const override;
+
private:
/**
* The set of exponents.
+ template <int dim>
+ std::size_t
+ InterpolatedTensorProductGridData<dim>::memory_consumption() const
+ {
+ return sizeof(*this) +
+ MemoryConsumption::memory_consumption(coordinate_values) -
+ sizeof(coordinate_values) +
+ MemoryConsumption::memory_consumption(data_values) -
+ sizeof(data_values);
+ }
+
+
+
template <int dim>
double
InterpolatedTensorProductGridData<dim>::value(
+ template <int dim>
+ std::size_t
+ InterpolatedUniformGridData<dim>::memory_consumption() const
+ {
+ return sizeof(*this) + data_values.memory_consumption() -
+ sizeof(data_values);
+ }
+
+
+
/* ---------------------- Polynomial ----------------------- */
}
+
+ template <int dim>
+ std::size_t
+ Polynomial<dim>::memory_consumption() const
+ {
+ return sizeof(*this) + exponents.memory_consumption() - sizeof(exponents) +
+ MemoryConsumption::memory_consumption(coefficients) -
+ sizeof(coefficients);
+ }
+
+
+
// explicit instantiations
template class SquareFunction<1>;
template class SquareFunction<2>;