diff --git a/src/core/lbgpu_cuda.cu b/src/core/lbgpu_cuda.cu index 16d537e8d51..ec2f7ddfd41 100644 --- a/src/core/lbgpu_cuda.cu +++ b/src/core/lbgpu_cuda.cu @@ -3592,10 +3592,7 @@ __global__ void integrate(LB_nodes_gpu n_a, LB_nodes_gpu n_b, LB_rho_v_gpu *d_v, if (para.fluct) { thermalize_modes(mode, index, &rng); } -#if defined(EXTERNAL_FORCES) || defined(SHANCHEN) - /**if external force is used apply node force */ apply_forces(index, mode, node_f, d_v); -#endif /**lb_calc_n_from_modes_push*/ normalize_modes(mode); /**calc of velocity densities and streaming with pbc*/ diff --git a/src/core/virtual_sites/lb_inertialess_tracers.cpp b/src/core/virtual_sites/lb_inertialess_tracers.cpp index e202f0d4fd6..4aada281858 100644 --- a/src/core/virtual_sites/lb_inertialess_tracers.cpp +++ b/src/core/virtual_sites/lb_inertialess_tracers.cpp @@ -144,11 +144,17 @@ void IBM_UpdateParticlePositions(ParticleRange particles) { Particle *const p = cell->part; for (int j = 0; j < cell->n; j++) if (p[j].p.is_virtual) { +#ifdef EXTERNAL_FORCES if (!(p[j].p.ext_flag & 2)) +#endif p[j].r.p[0] = p[j].r.p[0] + p[j].m.v[0] * time_step; +#ifdef EXTERNAL_FORCES if (!(p[j].p.ext_flag & 4)) +#endif p[j].r.p[1] = p[j].r.p[1] + p[j].m.v[1] * time_step; +#ifdef EXTERNAL_FORCES if (!(p[j].p.ext_flag & 8)) +#endif p[j].r.p[2] = p[j].r.p[2] + p[j].m.v[2] * time_step; // Check if the particle might have crossed a box border (criterion see diff --git a/testsuite/lb.py b/testsuite/lb.py index 4c8283a3a99..7f9bed17638 100644 --- a/testsuite/lb.py +++ b/testsuite/lb.py @@ -230,6 +230,8 @@ def test_viscous_coupling(self): np.testing.assert_allclose( np.copy(self.system.part[0].f), -self.params['friction'] * (v_part - v_fluid), atol=1E-6) + @ut.skipIf(not espressomd.has_features("EXTERNAL_FORCES"), + "Features not available, skipping test!") def test_a_ext_force_density(self): self.system.thermostat.turn_off() self.system.actors.clear()