From 0df64145d49d2519119e59af7d7cf3c14d7f10b2 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Thu, 17 Dec 2020 11:25:13 -0500 Subject: [PATCH] Allow read access to data in Interpolated*Function --- include/deal.II/base/function_lib.h | 12 ++++++++++++ source/base/function_lib.cc | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/include/deal.II/base/function_lib.h b/include/deal.II/base/function_lib.h index e4b9a83c60..d6f48579e1 100644 --- a/include/deal.II/base/function_lib.h +++ b/include/deal.II/base/function_lib.h @@ -1441,6 +1441,12 @@ namespace Functions virtual std::size_t memory_consumption() const override; + /** + * Return a reference to the internally stored data. + */ + const Table & + get_data() const; + protected: /** * Find the index in the table of the rectangle containing an input point @@ -1552,6 +1558,12 @@ namespace Functions virtual std::size_t memory_consumption() const override; + /** + * Return a reference to the internally stored data. + */ + const Table & + get_data() const; + private: /** * The set of interval endpoints in each of the coordinate directions. diff --git a/source/base/function_lib.cc b/source/base/function_lib.cc index 6f25f9df57..4df376fc24 100644 --- a/source/base/function_lib.cc +++ b/source/base/function_lib.cc @@ -2551,6 +2551,15 @@ namespace Functions + template + const Table & + InterpolatedTensorProductGridData::get_data() const + { + return data_values; + } + + + template double InterpolatedTensorProductGridData::value( @@ -2745,6 +2754,15 @@ namespace Functions + template + const Table & + InterpolatedUniformGridData::get_data() const + { + return data_values; + } + + + /* ---------------------- Polynomial ----------------------- */ -- 2.39.5