From e73c1fe2f371ac69b86218bba76bc649c12397dc Mon Sep 17 00:00:00 2001 From: Sebastian Eibl <sebastian.eibl@fau.de> Date: Wed, 29 Jan 2020 14:02:26 +0100 Subject: [PATCH] [BUGFIX] error in LubricationCorrection test -fixed relative error calculation -fixed wrong size of linked cells --- tests/lbm_mesapd_coupling/utility/LubricationCorrection.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/lbm_mesapd_coupling/utility/LubricationCorrection.cpp b/tests/lbm_mesapd_coupling/utility/LubricationCorrection.cpp index ce4be90eb..bef4e3e46 100644 --- a/tests/lbm_mesapd_coupling/utility/LubricationCorrection.cpp +++ b/tests/lbm_mesapd_coupling/utility/LubricationCorrection.cpp @@ -254,7 +254,7 @@ int main( int argc, char **argv ) // they can be used to break the O(N^2) complexity math::AABB domain(real_t(0), real_t(0), real_t(0), real_t(10), real_t(10), real_t(10)); - real_t spacing = real_t(1.1) * ( sphereRadius + cutOffDistance ); + real_t spacing = real_t(2.1) * ( sphereRadius + cutOffDistance ); mesa_pd::data::LinkedCells lc(domain.getExtended(spacing), spacing ); mesa_pd::kernel::InsertParticleIntoLinkedCells ipilc; @@ -287,7 +287,7 @@ int main( int argc, char **argv ) real_t analyticalLubForce = (analyticalNonDimForceSphSph(sphereRadius, minimalGapSize) - analyticalNonDimForceSphSph(sphereRadius, cutOffDistance)) * normalizationFactor; WALBERLA_CHECK_GREATER(force1[1], real_t(0), "SpecialCase: Sph1, dir 1, sign check"); - WALBERLA_CHECK_LESS((std::abs(force1[1]) - std::abs(analyticalLubForce))/ std::abs(analyticalLubForce), real_t(0.2), "SpecialCase: Sph1, dir 1, rel error check"); + WALBERLA_CHECK_LESS(std::abs((std::abs(force1[1]) - std::abs(analyticalLubForce))/ analyticalLubForce), real_t(0.2), "SpecialCase: Sph1, dir 1, rel error check"); WALBERLA_CHECK_FLOAT_EQUAL(force1[1], -force3[1], "SpecialCase: Sph1 - Sph3, dir 1"); WALBERLA_CHECK_FLOAT_EQUAL(force3[0], real_t(0), "SpecialCase: Sph3, dir 0"); WALBERLA_CHECK_FLOAT_EQUAL(force3[2], real_t(0), "SpecialCase: Sph3, dir 2"); -- GitLab