From 26377b232ad2c73f7eeccb7652cec4f2cb1d24f0 Mon Sep 17 00:00:00 2001
From: Christopher Subich <csubich@uwaterloo.ca>
Date: Tue, 21 Jul 2020 17:23:38 -0400
Subject: [PATCH] Fix reversed boundary-layer mask

---
 src/cases/wave_reader_side/wave_reader_side.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/cases/wave_reader_side/wave_reader_side.cpp b/src/cases/wave_reader_side/wave_reader_side.cpp
index 9250104..72b0b0e 100644
--- a/src/cases/wave_reader_side/wave_reader_side.cpp
+++ b/src/cases/wave_reader_side/wave_reader_side.cpp
@@ -596,8 +596,8 @@ class userControl : public BaseCase {
                 // the config file is the physical extent we're considering the boundary
                 // layer, so mask out this region.  
                 double dz = Lz/Nz;
-                *boundary_mask = 1 - 0.25*( (1 + tanh( ((MinZ + Lz - bl_width) - (*zgrid)(ii,jj,kk))/(0.25*bl_width)))) * // flat wall boundary
-                                        (1 + tanh( ((*zgrid)(ii,jj,kk) - (MinZ + bl_width + topo(ii)))/(0.25*bl_width))); // Bumpy wall boundary
+                *boundary_mask = 0.25*( (1 + tanh( ((MinZ + Lz - bl_width) - (*zgrid)(ii,jj,kk))/(0.25*bl_width)))) * // flat wall boundary
+                                      (1 + tanh( ((*zgrid)(ii,jj,kk) - (MinZ + bl_width + topo(ii)))/(0.25*bl_width))); // Bumpy wall boundary
                 Array<double,1> const & qz = *get_quad_z(); // Keep reference to z-quadrature weights
                 for (int i = boundary_mask_2d->lbound(firstDim); i <= boundary_mask_2d->ubound(firstDim); i++) {
                     for (int k = boundary_mask_2d->lbound(thirdDim); k <= boundary_mask_2d->ubound(thirdDim); k++) {
-- 
GitLab