From 55d840574e71dc4a56a406a71d00b19698ad2791 Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 8 Jan 2019 20:58:26 +0100 Subject: Fix, test recursive grid refinement --- apps/adrian/poiseuille2d/poiseuille2d.cpp | 41 ++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/adrian/poiseuille2d/poiseuille2d.cpp b/apps/adrian/poiseuille2d/poiseuille2d.cpp index 20d2585..a6d7bd1 100644 --- a/apps/adrian/poiseuille2d/poiseuille2d.cpp +++ b/apps/adrian/poiseuille2d/poiseuille2d.cpp @@ -161,7 +161,7 @@ void getResults(const std::string& prefix, vtmWriter.createMasterFile(); } - if (iT%10==0) { + if (iT%20==0) { vtmWriter.write(iT); } @@ -220,6 +220,19 @@ int main(int argc, char* argv[]) sOnLatticeBoundaryCondition2D fineSBoundaryCondition(fineGrid->getSuperLattice()); createLocalBoundaryCondition2D(fineSBoundaryCondition); + const Vector wantedFineExtend2 {0.4, 0.4}; + const Vector fineOrigin2 = fineGrid->alignToGrid({1.05, (ly-wantedFineExtend2[1])/2}); + const Vector fineExtend2 = fineGrid->alignToGrid(fineOrigin2 + wantedFineExtend2) - fineOrigin2; + + auto fineGrid2 = &fineGrid->refine(fineOrigin2, fineExtend2); + prepareGeometry(fineGrid2->getConverter(), fineGrid2->getSuperGeometry()); + + const T fine2DeltaX = fineGrid->getConverter().getPhysDeltaX(); + + IndicatorCuboid2D refinedOverlap2(fineExtend2 - 4*fine2DeltaX, fineOrigin2 + 2*fine2DeltaX); + fineGrid->getSuperGeometry().rename(1,0,refinedOverlap2); + fineGrid->getSuperGeometry().rename(2,0,refinedOverlap2); + prepareLattice( fineGrid->getConverter(), fineGrid->getSuperLattice(), @@ -227,12 +240,26 @@ int main(int argc, char* argv[]) fineSBoundaryCondition, fineGrid->getSuperGeometry()); + BGKdynamics fineBulkDynamics2( + fineGrid2->getConverter().getLatticeRelaxationFrequency(), + instances::getBulkMomenta()); + + sOnLatticeBoundaryCondition2D fineSBoundaryCondition2(fineGrid2->getSuperLattice()); + createLocalBoundaryCondition2D(fineSBoundaryCondition2); + + prepareLattice( + fineGrid2->getConverter(), + fineGrid2->getSuperLattice(), + fineBulkDynamics2, + fineSBoundaryCondition2, + fineGrid2->getSuperGeometry()); + clout << "starting simulation..." << endl; Timer timer( coarseGrid->getConverter().getLatticeTime(maxPhysT), coarseGrid->getSuperGeometry().getStatistics().getNvoxel()); util::ValueTracer converge( - fineGrid->getConverter().getLatticeTime(physInterval), + fineGrid2->getConverter().getLatticeTime(physInterval), residuum); timer.start(); @@ -260,8 +287,16 @@ int main(int argc, char* argv[]) fineGrid->getSuperGeometry(), timer, converge.hasConverged()); + getResults( + "fine2_", + fineGrid2->getSuperLattice(), + fineGrid2->getConverter(), + iT, + fineGrid2->getSuperGeometry(), + timer, + converge.hasConverged()); - converge.takeValue(fineGrid->getSuperLattice().getStatistics().getAverageEnergy(), true); + converge.takeValue(fineGrid2->getSuperLattice().getStatistics().getAverageEnergy(), true); } timer.stop(); -- cgit v1.2.3