const std::array<unsigned int, dim> & n_subintervals,
const Table<dim, double> & data_values);
+ /**
+ * Like the previous constructor, but take the arguments as rvalue
+ * references and *move*, instead of *copy* the data. This is often useful
+ * in cases where the data stored in these tables is large and the
+ * information used to initialize the current object is no longer needed
+ * separately. In other words, there is no need to keep the original object
+ * from which this object could copy its information, but it might as well
+ * take over ("move") the data.
+ */
+ InterpolatedUniformGridData(
+ std::array<std::pair<double, double>, dim> &&interval_endpoints,
+ std::array<unsigned int, dim> && n_subintervals,
+ Table<dim, double> && data_values);
+
/**
* Compute the value of the function set by bilinear interpolation of the
* given data set.
}
+
+ template <int dim>
+ InterpolatedUniformGridData<dim>::InterpolatedUniformGridData(
+ std::array<std::pair<double, double>, dim> &&interval_endpoints,
+ std::array<unsigned int, dim> && n_subintervals,
+ Table<dim, double> && data_values)
+ : interval_endpoints(std::move(interval_endpoints))
+ , n_subintervals(std::move(n_subintervals))
+ , data_values(std::move(data_values))
+ {
+ for (unsigned int d = 0; d < dim; ++d)
+ {
+ Assert(this->n_subintervals[d] >= 1,
+ ExcMessage("There needs to be at least one subinterval in each "
+ "coordinate direction."));
+ Assert(this->interval_endpoints[d].first <
+ this->interval_endpoints[d].second,
+ ExcMessage("The interval in each coordinate direction needs "
+ "to have positive size"));
+ Assert(this->data_values.size()[d] == this->n_subintervals[d] + 1,
+ ExcMessage("The data table does not have the correct size."));
+ }
+ }
+
+
+
template <int dim>
double
InterpolatedUniformGridData<dim>::value(const Point<dim> & p,