diff --git a/tests/lbm/codegen/FluctuatingMRT.cpp b/tests/lbm/codegen/FluctuatingMRT.cpp index 46ceaea05a58e64249230b5ddbb6d338d41c1d12..9fccc77afe69cd200a65e2ead4fefb4c72a7f5bc 100644 --- a/tests/lbm/codegen/FluctuatingMRT.cpp +++ b/tests/lbm/codegen/FluctuatingMRT.cpp @@ -84,9 +84,11 @@ int main( int argc, char ** argv ) blockforest::communication::UniformBufferedScheme< CommunicationStencil_T > communication( blocks ); communication.addPackInfo( make_shared< lbm::PdfFieldPackInfo< LatticeModel_T > >( pdfFieldId ) ); - // add LBM sweep and communication to time loop + // 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" ) - << BeforeFunction( communication, "communication" ) + << Sweep( [&]( IBlock * block ){ block->getData< PdfField_T >( pdfFieldId )->resetLatticeModel( latticeModel ); }, "set RNG counter" ); + // add LBM sweep and communication to time loop + timeloop.add() << BeforeFunction( communication, "communication" ) << Sweep( LatticeModel_T::Sweep( pdfFieldId ), "LB stream & collide" ); // LBM stability check