-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve terrain search and use bilinear interpolation. (#1328)
- Loading branch information
Showing
14 changed files
with
800 additions
and
587 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#include <fstream> | ||
|
||
#include "amr-wind/utilities/io_utils.H" | ||
|
||
namespace amr_wind::ioutils { | ||
|
||
void read_flat_grid_file( | ||
const std::string& fname, | ||
amrex::Vector<amrex::Real>& xs, | ||
amrex::Vector<amrex::Real>& ys, | ||
amrex::Vector<amrex::Real>& zs) | ||
{ | ||
std::ifstream file(fname, std::ios::in); | ||
|
||
if (!file.good()) { | ||
amrex::Abort("Cannot find file"); | ||
} | ||
|
||
size_t nx = 0; | ||
size_t ny = 0; | ||
file >> nx; | ||
file >> ny; | ||
AMREX_ALWAYS_ASSERT(nx > 0); | ||
AMREX_ALWAYS_ASSERT(ny > 0); | ||
xs.resize(nx); | ||
ys.resize(ny); | ||
zs.resize(nx * ny); | ||
for (size_t n = 0; n < nx; n++) { | ||
file >> xs[n]; | ||
} | ||
for (size_t n = 0; n < ny; n++) { | ||
file >> ys[n]; | ||
} | ||
for (size_t n = 0; n < nx * ny; n++) { | ||
file >> zs[n]; | ||
} | ||
file.close(); | ||
} | ||
} // namespace amr_wind::ioutils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,17 @@ | ||
1024 1024 0 | ||
1040 1024 0 | ||
1056 1024 0 | ||
1072 1024 0 | ||
1088 1024 0 | ||
1104 1024 0 | ||
1120 1024 0 | ||
|
||
7 | ||
1 | ||
1024.0 | ||
1040.0 | ||
1056.0 | ||
1072.0 | ||
1088.0 | ||
1104.0 | ||
1120.0 | ||
1024.0 | ||
0.0 | ||
0.0 | ||
0.0 | ||
0.0 | ||
0.0 | ||
0.0 | ||
0.0 |
Oops, something went wrong.