Commit 4fba6227 authored by Christopher Subich's avatar Christopher Subich
Browse files

wave_reader: compute hill properly with z-decreasing

Previously, wave_reader computed the hill height as a fixed

  zgrid(:,1,1) - MinZ // matlab notation

which implicitly assumes that z increases along the third index.  If
that assumption is violated, the BPE calculation breaks (in ways that
can cause assertion failures based on roundoff error, at that).

Fixing the calculation as min(zgrid(i,1,:)) at initialization time
alleviates this problem.
parent 471ccd94
......@@ -174,7 +174,9 @@ class userControl : public BaseCase {
// Define topography
// and shift it to match the adjustment made in the PE calculation
// This is also necessary to adjust the voxel sizes properly
topo = zg(all,0,0) - MinZ;
for (int i = topo.lbound(firstDim); i <= topo.ubound(firstDim); i++) {
topo(i) = min(zg(i,0,all)) - MinZ;
/* Initialize velocities */
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment