summaryrefslogtreecommitdiff
path: root/apps/adrian/cylinder2d/optimized_grid
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-02-04 22:50:53 +0100
committerAdrian Kummerlaender2019-06-24 15:17:42 +0200
commit27b0c949eda95d0fc97615acee899dd9b67bf781 (patch)
treeb6abaa3a58441c0bb4138155b1a910a23eb0d3d9 /apps/adrian/cylinder2d/optimized_grid
parente7b4bdc064da4340f415ac1e7ddcb6e260d61b0f (diff)
downloadgrid_refinement_openlb-27b0c949eda95d0fc97615acee899dd9b67bf781.tar
grid_refinement_openlb-27b0c949eda95d0fc97615acee899dd9b67bf781.tar.gz
grid_refinement_openlb-27b0c949eda95d0fc97615acee899dd9b67bf781.tar.bz2
grid_refinement_openlb-27b0c949eda95d0fc97615acee899dd9b67bf781.tar.lz
grid_refinement_openlb-27b0c949eda95d0fc97615acee899dd9b67bf781.tar.xz
grid_refinement_openlb-27b0c949eda95d0fc97615acee899dd9b67bf781.tar.zst
grid_refinement_openlb-27b0c949eda95d0fc97615acee899dd9b67bf781.zip
Add support for calling a function for each subgrid of Grid2D
Diffstat (limited to 'apps/adrian/cylinder2d/optimized_grid')
-rw-r--r--apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp b/apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp
index 74ad91b..b01913f 100644
--- a/apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp
+++ b/apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp
@@ -189,17 +189,15 @@ void setBoundaryValues(Grid2D<T,DESCRIPTOR>& grid, int iT)
}
}
-void getResults(const std::string& prefix,
- Grid2D<T,DESCRIPTOR>& grid,
+void getResults(Grid2D<T,DESCRIPTOR>& grid,
+ const std::string& prefix,
int iT)
{
- OstreamManager clout(std::cout,"getResults");
-
auto& converter = grid.getConverter();
auto& sLattice = grid.getSuperLattice();
auto& sGeometry = grid.getSuperGeometry();
- SuperVTMwriter2D<T> vtmWriter(prefix + "cylinder2d");
+ SuperVTMwriter2D<T> vtmWriter(prefix);
SuperLatticePhysVelocity2D<T,DESCRIPTOR> velocity(sLattice, converter);
SuperLatticePhysPressure2D<T,DESCRIPTOR> pressure(sLattice, converter);
SuperLatticeGeometry2D<T,DESCRIPTOR> geometry(sLattice, sGeometry);
@@ -357,12 +355,9 @@ int main(int argc, char* argv[])
timer.update(iT);
timer.printStep();
- getResults("level0_", coarseGrid, iT);
- getResults("level1_outflow_", fineOutflowGrid, iT);
- getResults("level2_outflow_", fineOutflowGrid2, iT);
- getResults("level1_", fineGrid, iT);
- getResults("level2_", fineGrid2, iT);
- getResults("level3_", fineGrid3, iT);
+ coarseGrid.forEachGrid("cylinder2d", [&](Grid2D<T,DESCRIPTOR>& grid, const std::string& id) {
+ getResults(grid, id, iT);
+ });
takeMeasurements(fineGrid3);
}