Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test LB profile observables in parallel #4583

Merged
merged 2 commits into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
"import espressomd.observables\n",
"import espressomd.accumulators\n",
"\n",
"espressomd.assert_features([\"LENNARD_JONES\", \"LB_BOUNDARIES\"])\n",
"\n",
"# imports for data handling, plotting, and progress bar\n",
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
Expand Down
4 changes: 0 additions & 4 deletions src/python/espressomd/observables.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,6 @@ class LBVelocityProfile(ProfileObservable):
``sampling_*``. Note that a small delta leads to a large number of sample
points and carries a performance cost.

.. WARNING::
In case of the CPU version of the LB fluid implementation, this observable
currently only works for a single core.

Parameters
----------
n_x_bins : :obj:`int`
Expand Down
4 changes: 2 additions & 2 deletions testsuite/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ python_test(FILE polymer_linear.py MAX_NUM_PROC 4)
python_test(FILE polymer_diamond.py MAX_NUM_PROC 4)
python_test(FILE auto_exclusions.py MAX_NUM_PROC 1)
python_test(FILE observable_cylindrical.py MAX_NUM_PROC 4)
python_test(FILE observable_cylindricalLB.py MAX_NUM_PROC 1 LABELS gpu)
python_test(FILE observable_cylindricalLB.py MAX_NUM_PROC 2 LABELS gpu)
python_test(FILE analyze_chains.py MAX_NUM_PROC 1)
python_test(FILE analyze_distance.py MAX_NUM_PROC 1)
python_test(FILE analyze_acf.py MAX_NUM_PROC 1)
Expand All @@ -247,7 +247,7 @@ python_test(FILE rescale.py MAX_NUM_PROC 2)
python_test(FILE array_properties.py MAX_NUM_PROC 4)
python_test(FILE analyze_distribution.py MAX_NUM_PROC 1)
python_test(FILE observable_profile.py MAX_NUM_PROC 4)
python_test(FILE observable_profileLB.py MAX_NUM_PROC 1 LABELS gpu)
python_test(FILE observable_profileLB.py MAX_NUM_PROC 2 LABELS gpu)
python_test(FILE rotate_system.py MAX_NUM_PROC 4)
python_test(FILE es_math.py MAX_NUM_PROC 1)
python_test(FILE random_pairs.py MAX_NUM_PROC 4)
Expand Down
2 changes: 1 addition & 1 deletion testsuite/python/observable_cylindricalLB.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CylindricalLBObservableCommon:
Testcase for the CylindricalLBObservables.

"""
system = espressomd.System(box_l=3 * [15])
system = espressomd.System(box_l=3 * [14])
system.time_step = 0.01
system.cell_system.skin = 0.4

Expand Down
14 changes: 7 additions & 7 deletions testsuite/python/observable_profileLB.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@

TIME_STEP = 0.1
AGRID = 0.7
BOX_L_X = 17.0 * AGRID
BOX_L_Y = 15.0 * AGRID
BOX_L_Z = 13.0 * AGRID
BOX_L_X = 16.0 * AGRID
BOX_L_Y = 14.0 * AGRID
BOX_L_Z = 12.0 * AGRID
VISC = .7
DENS = 1.7
LB_PARAMS = {'agrid': AGRID,
Expand Down Expand Up @@ -78,9 +78,9 @@ def tearDown(self):

def set_fluid_velocities(self):
"""Set an x dependent fluid velocity."""
for x in range(int(self.system.box_l[0] / AGRID)):
for y in range(int(self.system.box_l[1] / AGRID)):
for z in range(int(self.system.box_l[2] / AGRID)):
for x in range(int(np.around(self.system.box_l[0] / AGRID))):
for y in range(int(np.around(self.system.box_l[1] / AGRID))):
for z in range(int(np.around(self.system.box_l[2] / AGRID))):
self.lbf[x, y, z].velocity = [float(x), 0.0, 0.0]

def test_velocity_profile(self):
Expand All @@ -98,7 +98,7 @@ def test_velocity_profile(self):
for y in range(obs_data.shape[1]):
for z in range(obs_data.shape[2]):
self.assertAlmostEqual(
obs_data[x, y, z, 0], float(x), places=5)
obs_data[x, y, z, 0], float(x), delta=2e-5)
self.assertEqual(np.prod(obs_data.shape),
LB_VELOCITY_PROFILE_PARAMS['n_x_bins'] *
LB_VELOCITY_PROFILE_PARAMS['n_y_bins'] *
Expand Down