From c00169276bee14e0d5418ac79fc00e3531e185ca Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Thu, 17 Jan 2019 15:20:12 +0100 Subject: Verify mass loss when using linear interpolation for C2F --- src/refinement/coupler2D.hh | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/refinement/coupler2D.hh b/src/refinement/coupler2D.hh index 91a7db8..78aad46 100644 --- a/src/refinement/coupler2D.hh +++ b/src/refinement/coupler2D.hh @@ -130,6 +130,12 @@ Vector order2interpolation(const Vector& f0, const Vector& f1) return 0.5 * (f0 + f1); } +template +Vector order2interpolation(const std::vector>& data, int y) +{ + return 0.5 * (data[y] + data[y+1]); +} + template Vector order3interpolation(const std::vector>& data, int y, bool ascending) { @@ -195,9 +201,9 @@ void FineCoupler2D::couple() } for (int y=1; y < this->_coarseSize-2; ++y) { - const auto rho = order4interpolation(_c2f_rho, y); - const auto u = order4interpolation(_c2f_u, y); - const auto fneq = order4interpolation(_c2f_fneq, y); + const auto rho = order2interpolation(_c2f_rho, y); + const auto u = order2interpolation(_c2f_u, y); + const auto fneq = order2interpolation(_c2f_fneq, y); const T uSqr = u*u; -- cgit v1.2.3