summaryrefslogtreecommitdiff
path: root/src/refinement
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-01-17 15:20:12 +0100
committerAdrian Kummerlaender2019-06-24 15:17:09 +0200
commitc00169276bee14e0d5418ac79fc00e3531e185ca (patch)
tree120f989a220d30475aa19af8ea2b6dcbe8086197 /src/refinement
parentd900d8c794bb9d50f528bc8e72ceb594fbc292c8 (diff)
downloadgrid_refinement_openlb-c00169276bee14e0d5418ac79fc00e3531e185ca.tar
grid_refinement_openlb-c00169276bee14e0d5418ac79fc00e3531e185ca.tar.gz
grid_refinement_openlb-c00169276bee14e0d5418ac79fc00e3531e185ca.tar.bz2
grid_refinement_openlb-c00169276bee14e0d5418ac79fc00e3531e185ca.tar.lz
grid_refinement_openlb-c00169276bee14e0d5418ac79fc00e3531e185ca.tar.xz
grid_refinement_openlb-c00169276bee14e0d5418ac79fc00e3531e185ca.tar.zst
grid_refinement_openlb-c00169276bee14e0d5418ac79fc00e3531e185ca.zip
Verify mass loss when using linear interpolation for C2F
Diffstat (limited to 'src/refinement')
-rw-r--r--src/refinement/coupler2D.hh12
1 files changed, 9 insertions, 3 deletions
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
@@ -131,6 +131,12 @@ Vector<T,N> order2interpolation(const Vector<T,N>& f0, const Vector<T,N>& f1)
}
template <typename T, unsigned N>
+Vector<T,N> order2interpolation(const std::vector<Vector<T,N>>& data, int y)
+{
+ return 0.5 * (data[y] + data[y+1]);
+}
+
+template <typename T, unsigned N>
Vector<T,N> order3interpolation(const std::vector<Vector<T,N>>& data, int y, bool ascending)
{
if (ascending) {
@@ -195,9 +201,9 @@ void FineCoupler2D<T,DESCRIPTOR>::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;