removed some functional stuff
This commit is contained in:
1 parent
6288a43da7
commit
ea23ed9d68
7 files changed
+33
-64
No files matched your search
@@ -2,7 +2,6 @@
|
||||
|
||||
#include "UVGrid.h"
|
||||
#include "readdata.h"
|
||||
#include "to_vector.h"
|
||||
|
||||
#define sizeError2 "The sizes of the hydrodynamic data files are different"
|
||||
#define sizeError "The sizes of the hydrodynamicU or -V files does not correspond with the sizes of the grid file"
|
||||
@@ -27,12 +26,11 @@ UVGrid::UVGrid() {
|
||||
throw domain_error(sizeError);
|
||||
}
|
||||
|
||||
uvData = to_vector(views::transform(views::zip(us, vs), [](auto pair){return Vel(pair);}));
|
||||
// uvData = views::zip(us, vs)
|
||||
// | views::transform([](auto pair) {
|
||||
// return Vel(pair);
|
||||
// })
|
||||
// | ranges::to<vector>();
|
||||
uvData.reserve(gridSize);
|
||||
|
||||
for (auto vel: views::zip(us, vs)) {
|
||||
uvData.push_back(Vel(vel));
|
||||
}
|
||||
}
|
||||
|
||||
const Vel &UVGrid::operator[](size_t timeIndex, size_t latIndex, size_t lonIndex) const {
|
||||
@@ -52,12 +50,12 @@ int UVGrid::timeStep() const {
|
||||
return times[1] - times[0];
|
||||
}
|
||||
|
||||
void UVGrid::printSlice(size_t t) {
|
||||
void UVGrid::streamSlice(ostream &os, size_t t) {
|
||||
for (int x = 0; x < latSize; x++) {
|
||||
for (int y = 0; y < lonSize; y++) {
|
||||
auto [u,v] = (*this)[t,x,y];
|
||||
printf("%7.4f, %7.4f", u, v);
|
||||
auto vel = (*this)[t,x,y];
|
||||
os << vel << " ";
|
||||
}
|
||||
cout << endl;
|
||||
os << endl;
|
||||
}
|
||||
}
|
||||