diff --git a/tests/lbm/CMakeLists.txt b/tests/lbm/CMakeLists.txt index 221d6ff7330bfa83a3f437aaaa5db25ae024dd0a..cea5da0c890d1415d0eacb68cdf98b5ae57605c2 100644 --- a/tests/lbm/CMakeLists.txt +++ b/tests/lbm/CMakeLists.txt @@ -68,7 +68,8 @@ waLBerla_compile_test( FILES initializer/PdfFieldInitializerTest.cpp ) waLBerla_execute_test( NAME PdfFieldInitializerTest COMMAND $<TARGET_FILE:PdfFieldInitializerTest> ${CMAKE_CURRENT_SOURCE_DIR}/PdfFieldInitializerTest.prm PROCESSES 4 CONFIGURATIONS Release RelWithDbgInfo ) waLBerla_compile_test( FILES SuViscoelasticityTest.cpp DEPENDS field blockforest timeloop) -waLBerla_execute_test( NAME SuViscoelasticityTest COMMAND $<TARGET_FILE:SuViscoelasticityTest> ${CMAKE_CURRENT_SOURCE_DIR}/Su.prm ) +waLBerla_execute_test( NAME SuViscoelasticityLongTest COMMAND $<TARGET_FILE:SuViscoelasticityTest> ${CMAKE_CURRENT_SOURCE_DIR}/Su.prm LABELS longrun) +waLBerla_execute_test( NAME SuViscoelasticityShortTest COMMAND $<TARGET_FILE:SuViscoelasticityTest> -Parameters.shortrun=true ${CMAKE_CURRENT_SOURCE_DIR}/Su.prm ) # Code Generation if( WALBERLA_BUILD_WITH_CODEGEN ) diff --git a/tests/lbm/Su.prm b/tests/lbm/Su.prm index 88a9bfe3baaa384708a746f6ac8a98dd8aa42727..4b0207ecd1708e84b8ddb70624c43f61bc3445a8 100644 --- a/tests/lbm/Su.prm +++ b/tests/lbm/Su.prm @@ -12,6 +12,7 @@ Parameters uMax 1.28737; t0 370; t1 326; + shortrun false; } DomainSetup diff --git a/tests/lbm/SuViscoelasticityTest.cpp b/tests/lbm/SuViscoelasticityTest.cpp index b29b3678c712c2fe00578e4c310a463bba11dade..8ca9d0464c55550be342ec3a717b64d091208197 100644 --- a/tests/lbm/SuViscoelasticityTest.cpp +++ b/tests/lbm/SuViscoelasticityTest.cpp @@ -244,15 +244,16 @@ int main(int argc, char ** argv ){ auto parameters = env.config()->getOneBlock( "Parameters" ); // extract some constants from the parameters - const real_t eta_s = parameters.getParameter< real_t > ("eta_s"); - const real_t force = parameters.getParameter< real_t > ("force"); - const real_t eta_p = parameters.getParameter< real_t > ("eta_p"); - const real_t lambda_p = parameters.getParameter< real_t > ("lambda_p"); - const uint_t period = parameters.getParameter< uint_t > ("period"); - const real_t L = parameters.getParameter< real_t > ("L"); - const real_t H = parameters.getParameter< real_t > ("H"); - const uint_t blockSize = parameters.getParameter< uint_t > ("blockSize"); - const uint_t timesteps = parameters.getParameter< uint_t > ("timesteps"); + const real_t eta_s = parameters.getParameter< real_t > ("eta_s"); + const real_t force = parameters.getParameter< real_t > ("force"); + const real_t eta_p = parameters.getParameter< real_t > ("eta_p"); + const real_t lambda_p = parameters.getParameter< real_t > ("lambda_p"); + const uint_t period = parameters.getParameter< uint_t > ("period"); + const real_t L = parameters.getParameter< real_t > ("L"); + const real_t H = parameters.getParameter< real_t > ("H"); + const uint_t blockSize = parameters.getParameter< uint_t > ("blockSize"); + const bool shortrun = parameters.getParameter< bool > ("shortrun"); + const uint_t timesteps = shortrun ? uint_t(2) : parameters.getParameter< uint_t > ("timesteps"); // reference data const real_t uExpected = force*H*H/(real_c(8.0)*(eta_s + eta_p)); @@ -293,26 +294,31 @@ int main(int argc, char ** argv ){ timeloop.run(); - // compare to reference data - real_t errSteady = real_c(fabs(testData->getUSteady() - real_c(1.0))/real_c(1.0)); - real_t errMax = real_c(fabs(testData->getUMax() - uMax)/uMax); - real_t errt0 = real_c(fabs(testData->getT0() - t0)/t0); - real_t errt1 = real_c(fabs(testData->getT1() - t1)/t1); - - WALBERLA_LOG_RESULT("Steady State Velocity Error: " << errSteady ); - WALBERLA_LOG_RESULT("Maximum Velocity Error: " << errMax ); - WALBERLA_LOG_RESULT("Time of Maximum Error: " << errt0 ); - WALBERLA_LOG_RESULT("Decay Time Error: " << errt1 ); - - // check that errors < 1% - if (errSteady < 0.01 && errMax < 0.01 && errt0 < 0.01 && errt1 < 0.01){ - WALBERLA_LOG_RESULT("Success" ); + if(!shortrun) + { + // compare to reference data + real_t errSteady = real_c(fabs(testData->getUSteady() - real_c(1.0))/real_c(1.0)); + real_t errMax = real_c(fabs(testData->getUMax() - uMax)/uMax); + real_t errt0 = real_c(fabs(testData->getT0() - t0)/t0); + real_t errt1 = real_c(fabs(testData->getT1() - t1)/t1); + + WALBERLA_LOG_RESULT("Steady State Velocity Error: " << errSteady ); + WALBERLA_LOG_RESULT("Maximum Velocity Error: " << errMax ); + WALBERLA_LOG_RESULT("Time of Maximum Error: " << errt0 ); + WALBERLA_LOG_RESULT("Decay Time Error: " << errt1 ); + + // check that errors < 1% + if (errSteady < 0.01 && errMax < 0.01 && errt0 < 0.01 && errt1 < 0.01){ + WALBERLA_LOG_RESULT("Success" ); + return EXIT_SUCCESS; + } + else { + WALBERLA_LOG_RESULT("Failure" ); + return EXIT_FAILURE; + } + } else{ return EXIT_SUCCESS; } - else { - WALBERLA_LOG_RESULT("Failure" ); - return EXIT_FAILURE; - } } diff --git a/tests/pe_coupling/partially_saturated_cells_method/DragForceSpherePSMRefinement.cpp b/tests/pe_coupling/partially_saturated_cells_method/DragForceSpherePSMRefinement.cpp index 115bcaffab070ba8c5d7c82290bd107ec2574177..e974330128b4eee25abc3cc6a49804be89123729 100644 --- a/tests/pe_coupling/partially_saturated_cells_method/DragForceSpherePSMRefinement.cpp +++ b/tests/pe_coupling/partially_saturated_cells_method/DragForceSpherePSMRefinement.cpp @@ -488,7 +488,7 @@ int main( int argc, char **argv ) const real_t omega = real_c(1) / setup.tau; setup.visc = lbm::collision_model::viscosityFromOmega( omega ); const real_t dx = real_c(1); - const uint_t timesteps = funcTest ? 2 : ( shortrun ? uint_c(150) : uint_c( 1000000 ) ); // maximum number of time steps for the whole simulation + const uint_t timesteps = funcTest ? 1 : ( shortrun ? uint_c(150) : uint_c( 1000000 ) ); // maximum number of time steps for the whole simulation /////////////////////////// // BLOCK STRUCTURE SETUP //