From ddf12d818d90229a0752e2669f7fad1a8a22510e Mon Sep 17 00:00:00 2001 From: Michael Kuron <mkuron@icp.uni-stuttgart.de> Date: Fri, 24 Jul 2020 16:45:52 +0200 Subject: [PATCH] FluctuatingMRT: configure lattice model after resetting it --- tests/lbm/codegen/FluctuatingMRT.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/lbm/codegen/FluctuatingMRT.cpp b/tests/lbm/codegen/FluctuatingMRT.cpp index 9fccc77af..f7657d259 100644 --- a/tests/lbm/codegen/FluctuatingMRT.cpp +++ b/tests/lbm/codegen/FluctuatingMRT.cpp @@ -74,8 +74,9 @@ int main( int argc, char ** argv ) BlockDataID pdfFieldId = lbm::addPdfFieldToStorage( blocks, "pdf field", latticeModel, initialVelocity, real_t(1) ); BlockDataID flagFieldId = field::addFlagFieldToStorage< FlagField_T >( blocks, "flag field" ); - // create and initialize boundary handling + // create and initialize flag field const FlagUID fluidFlagUID( "Fluid" ); + geometry::setNonBoundaryCellsToDomain<FlagField_T>(*blocks, flagFieldId, fluidFlagUID); // create time loop SweepTimeloop timeloop( blocks->getBlockStorage(), timesteps ); @@ -86,7 +87,12 @@ int main( int argc, char ** argv ) // set the RNG counter to match the time step and propagate it to the fields' copies of the lattice model timeloop.add() << BeforeFunction( [&](){ latticeModel.time_step_ = uint32_c(timeloop.getCurrentTimeStep()); }, "set RNG counter" ) - << Sweep( [&]( IBlock * block ){ block->getData< PdfField_T >( pdfFieldId )->resetLatticeModel( latticeModel ); }, "set RNG counter" ); + << Sweep( [&]( IBlock * block ){ + auto field = block->getData< PdfField_T >( pdfFieldId ); + field->resetLatticeModel( latticeModel ); + field->latticeModel().configure( *block, *blocks ); + WALBERLA_ASSERT_EQUAL( field->latticeModel().time_step_, latticeModel.time_step_ ); + }, "set RNG counter" ); // add LBM sweep and communication to time loop timeloop.add() << BeforeFunction( communication, "communication" ) << Sweep( LatticeModel_T::Sweep( pdfFieldId ), "LB stream & collide" ); -- GitLab