From 0a6dd5e6813f283c8644223d95b4bc88d57d361d Mon Sep 17 00:00:00 2001
From: Stephane Del Pino <stephane.delpino44@gmail.com>
Date: Tue, 19 Nov 2024 22:22:19 +0100
Subject: [PATCH] Fix reconstrcution for DiscreteFunctionDPkVector of
 TinyVector

---
 src/scheme/PolynomialReconstruction.cpp | 4 +---
 tests/test_PolynomialReconstruction.cpp | 4 ----
 2 files changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/scheme/PolynomialReconstruction.cpp b/src/scheme/PolynomialReconstruction.cpp
index 783ec01ad..0e0b2a5af 100644
--- a/src/scheme/PolynomialReconstruction.cpp
+++ b/src/scheme/PolynomialReconstruction.cpp
@@ -1261,8 +1261,6 @@ PolynomialReconstruction::_build(
           Givens::solveCollectionInPlace(A, X, B);
         }
 
-        std::clog << "X = " << X << '\n';
-
         column_begin = 0;
         for (size_t i_dpk_variant = 0; i_dpk_variant < mutable_discrete_function_dpk_variant_list.size();
              ++i_dpk_variant) {
@@ -1381,7 +1379,7 @@ PolynomialReconstruction::_build(
                         }
 
                         for (size_t i = 0; i < basis_dimension - 1; ++i) {
-                          auto& dpk_j_ip1 = dpk_j[i + 1];
+                          auto& dpk_j_ip1 = dpk_j[component_begin + i + 1];
                           for (size_t k = 0; k < DataType::Dimension; ++k) {
                             dpk_j_ip1[k] = X(i, column_begin + k);
                           }
diff --git a/tests/test_PolynomialReconstruction.cpp b/tests/test_PolynomialReconstruction.cpp
index 1c078129b..3fd31d952 100644
--- a/tests/test_PolynomialReconstruction.cpp
+++ b/tests/test_PolynomialReconstruction.cpp
@@ -295,8 +295,6 @@ TEST_CASE("PolynomialReconstruction", "[scheme]")
                         const double reconstructed_slope = (1 / 0.2) * (dpk_Vh(cell_id, 0)(R1{0.1} + xj[cell_id])[i] -
                                                                         dpk_Vh(cell_id, 0)(xj[cell_id] - R1{0.1})[i]);
 
-                        std::clog << "reconstructed_slop0[" << i << "]=" << reconstructed_slope << " | expected slope0["
-                                  << i << "]=" << slope0[i] << '\n';
                         max_slope_error = std::max(max_slope_error, std::abs(reconstructed_slope - slope0[i]));
                       }
                     }
@@ -310,8 +308,6 @@ TEST_CASE("PolynomialReconstruction", "[scheme]")
                         const double reconstructed_slope = (1 / 0.2) * (dpk_Vh(cell_id, 1)(R1{0.1} + xj[cell_id])[i] -
                                                                         dpk_Vh(cell_id, 1)(xj[cell_id] - R1{0.1})[i]);
 
-                        std::clog << "reconstructed_slop1[" << i << "]=" << reconstructed_slope << " | expected slope1["
-                                  << i << "]=" << slope1[i] << '\n';
                         max_slope_error = std::max(max_slope_error, std::abs(reconstructed_slope - slope1[i]));
                       }
                     }
-- 
GitLab