summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-02-06 21:02:21 +0100
committerAdrian Kummerlaender2019-06-24 15:17:42 +0200
commit77869487e437b4050f98c28a24db82e1e83a872c (patch)
tree933c93c9a417a6b6df12104f2544d8865c04a48f /apps
parentf4069563f596b35d90a6a3b941011ebd7cf191b9 (diff)
downloadgrid_refinement_openlb-77869487e437b4050f98c28a24db82e1e83a872c.tar
grid_refinement_openlb-77869487e437b4050f98c28a24db82e1e83a872c.tar.gz
grid_refinement_openlb-77869487e437b4050f98c28a24db82e1e83a872c.tar.bz2
grid_refinement_openlb-77869487e437b4050f98c28a24db82e1e83a872c.tar.lz
grid_refinement_openlb-77869487e437b4050f98c28a24db82e1e83a872c.tar.xz
grid_refinement_openlb-77869487e437b4050f98c28a24db82e1e83a872c.tar.zst
grid_refinement_openlb-77869487e437b4050f98c28a24db82e1e83a872c.zip
Continue cylinder2d refinement setup encapsulation
Diffstat (limited to 'apps')
-rw-r--r--apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp47
1 files changed, 26 insertions, 21 deletions
diff --git a/apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp b/apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp
index e5a934c..d516394 100644
--- a/apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp
+++ b/apps/adrian/cylinder2d/optimized_grid/cylinder2d.cpp
@@ -137,7 +137,6 @@ void prepareLattice(Grid2D<T,DESCRIPTOR>& grid)
instances::getBulkMomenta<T,DESCRIPTOR>())));
sOnLatticeBoundaryCondition2D<T,DESCRIPTOR>& sBoundaryCondition = grid.getOnLatticeBoundaryCondition();
- //createInterpBoundaryCondition2D<T,DESCRIPTOR>(sBoundaryCondition);
createLocalBoundaryCondition2D<T,DESCRIPTOR>(sBoundaryCondition);
const T omega = converter.getLatticeRelaxationFrequency();
@@ -251,26 +250,8 @@ void takeMeasurements(Grid2D<T,DESCRIPTOR>& grid, int iT, bool print=true)
}
}
-int main(int argc, char* argv[])
+void setupRefinement(Grid2D<T,DESCRIPTOR>& coarseGrid, Vector<T,2> domainOrigin, Vector<T,2> domainExtend)
{
- olbInit(&argc, &argv);
- singleton::directories().setOutputDir("./tmp/");
- OstreamManager clout(std::cout,"main");
-
- const Vector<T,2> coarseOrigin {0.0, 0.0};
- const Vector<T,2> coarseExtend {lx, ly};
- IndicatorCuboid2D<T> coarseCuboid(coarseExtend, coarseOrigin);
-
- Grid2D<T,DESCRIPTOR> coarseGrid(
- coarseCuboid,
- RelaxationTime<T>(tau),
- N,
- PhysCharacteristics);
- const Vector<T,2> domainOrigin = coarseGrid.getSuperGeometry().getStatistics().getMinPhysR(0);
- const Vector<T,2> domainExtend = coarseGrid.getSuperGeometry().getStatistics().getPhysExtend(0);
-
- prepareGeometry(coarseGrid, domainOrigin, domainExtend);
-
const auto coarseDeltaX = coarseGrid.getConverter().getPhysDeltaX();
const Vector<T,2> fineOutflowExtend {1*cylinderD, domainExtend[1]};
@@ -331,6 +312,28 @@ int main(int argc, char* argv[])
auto& fineGrid3 = fineGrid2.refine(fineOrigin3, fineExtend3);
prepareGeometry(fineGrid3, domainOrigin, domainExtend);
disableRefinedArea(fineGrid2, fineGrid3);
+}
+
+int main(int argc, char* argv[])
+{
+ olbInit(&argc, &argv);
+ singleton::directories().setOutputDir("./tmp/");
+ OstreamManager clout(std::cout,"main");
+
+ const Vector<T,2> coarseOrigin {0.0, 0.0};
+ const Vector<T,2> coarseExtend {lx, ly};
+ IndicatorCuboid2D<T> coarseCuboid(coarseExtend, coarseOrigin);
+
+ Grid2D<T,DESCRIPTOR> coarseGrid(
+ coarseCuboid,
+ RelaxationTime<T>(tau),
+ N,
+ PhysCharacteristics);
+ const Vector<T,2> domainOrigin = coarseGrid.getSuperGeometry().getStatistics().getMinPhysR(0);
+ const Vector<T,2> domainExtend = coarseGrid.getSuperGeometry().getStatistics().getPhysExtend(0);
+
+ prepareGeometry(coarseGrid, domainOrigin, domainExtend);
+ setupRefinement(coarseGrid, domainOrigin, domainExtend);
coarseGrid.forEachGrid(prepareLattice);
@@ -343,6 +346,8 @@ int main(int argc, char* argv[])
coarseGrid.getSuperGeometry().getStatistics().getNvoxel());
timer.start();
+ Grid2D<T,DESCRIPTOR>& cylinderGrid = coarseGrid.locate({cylinderX, cylinderY});
+
for (int iT = 0; iT <= coarseGrid.getConverter().getLatticeTime(maxPhysT); ++iT) {
setBoundaryValues(coarseGrid, iT);
@@ -356,7 +361,7 @@ int main(int argc, char* argv[])
getResults(grid, id, iT);
});
- takeMeasurements(fineGrid3, iT);
+ takeMeasurements(cylinderGrid, iT);
}
}