diff options
author | sotech117 <michael_foiani@brown.edu> | 2024-04-09 22:31:21 -0400 |
---|---|---|
committer | sotech117 <michael_foiani@brown.edu> | 2024-04-09 22:31:21 -0400 |
commit | fd19124693bb32835ad97802ba1950cd5202dbd2 (patch) | |
tree | 9b1b8d8e64793c2c7f0c164b7df59fba91e3bab0 /src | |
parent | 8d27ce5bd6902ba515a1e3bad5f2e4d5abd825d3 (diff) |
fix off by one bug
Diffstat (limited to 'src')
-rw-r--r-- | src/ocean/ocean.cpp | 6 | ||||
-rw-r--r-- | src/ocean/ocean.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/ocean/ocean.cpp b/src/ocean/ocean.cpp index 1b0e23c..eabaa8e 100644 --- a/src/ocean/ocean.cpp +++ b/src/ocean/ocean.cpp @@ -140,8 +140,8 @@ int ocean::k_index_to_negative_k_index int x = k_index % length; int z = k_index / length; - int x_neg = length - x; - int z_neg = width - z; + int x_neg = length - x - 1; + int z_neg = width - z - 1; return z_neg * length + x_neg; } @@ -234,7 +234,7 @@ std::vector<Eigen::Vector3f> ocean::get_vertices() //if (i < length) double amplitude = current_h[i].first; - if (i < length) amplitude = initial_h[i].first; + // if (i < length) amplitude = initial_h[i].first; //if (i==2) std::cout << amplitude << std::endl; diff --git a/src/ocean/ocean.h b/src/ocean/ocean.h index faa0fb2..a576c44 100644 --- a/src/ocean/ocean.h +++ b/src/ocean/ocean.h @@ -27,7 +27,7 @@ private: const int width = 32; // width of grid const int N = length * width; // total number of grid points - const double A = 100; // numeric constant for the Phillips spectrum + const double A = 10; // numeric constant for the Phillips spectrum const double V = 5.0; // wind speed const std::pair<double, double> omega_wind = std::make_pair(1.0, 0.0); // wind direction |