From 9428e43d09ed224d8b7c816c307ee49262bcdc2b Mon Sep 17 00:00:00 2001 From: Patrick Kreissl Date: Fri, 4 Feb 2022 13:47:07 +0100 Subject: [PATCH] Use in samples and tests. --- samples/chamber_game.py | 2 +- samples/visualization_cellsystem.py | 2 +- samples/visualization_charged.py | 2 +- testsuite/python/CMakeLists.txt | 2 +- testsuite/python/brownian_dynamics.py | 2 +- testsuite/python/brownian_dynamics_stats.py | 2 +- testsuite/python/cellsystem.py | 7 ++++--- testsuite/python/collision_detection.py | 2 +- testsuite/python/coulomb_mixed_periodicity.py | 4 ++-- testsuite/python/ek_eof_one_species.py | 2 +- testsuite/python/elc_vs_analytic.py | 2 +- testsuite/python/langevin_thermostat.py | 2 +- testsuite/python/langevin_thermostat_stats.py | 2 +- testsuite/python/lj.py | 5 +++-- testsuite/python/mass-and-rinertia_per_particle.py | 2 +- testsuite/python/mmm1d.py | 2 +- testsuite/python/p3m_tuning_exceptions.py | 8 ++++---- testsuite/python/pairs.py | 4 ++-- testsuite/python/particle.py | 2 +- testsuite/python/random_pairs.py | 2 +- .../{domain_decomposition.py => regular_decomposition.py} | 4 ++-- testsuite/python/virtual_sites_relative.py | 4 ++-- 22 files changed, 34 insertions(+), 32 deletions(-) rename testsuite/python/{domain_decomposition.py => regular_decomposition.py} (97%) diff --git a/samples/chamber_game.py b/samples/chamber_game.py index 3a192fac16b..63621e72ad2 100644 --- a/samples/chamber_game.py +++ b/samples/chamber_game.py @@ -156,7 +156,7 @@ # CELLSYSTEM system.cell_system.skin = 3.0 -system.cell_system.set_domain_decomposition(use_verlet_lists=False) +system.cell_system.set_regular_decomposition(use_verlet_lists=False) # BONDS diff --git a/samples/visualization_cellsystem.py b/samples/visualization_cellsystem.py index 2eb015ddf44..c675088d88f 100644 --- a/samples/visualization_cellsystem.py +++ b/samples/visualization_cellsystem.py @@ -42,7 +42,7 @@ draw_cells=True) system.time_step = 0.0005 -system.cell_system.set_domain_decomposition(use_verlet_lists=True) +system.cell_system.set_regular_decomposition(use_verlet_lists=True) system.cell_system.skin = 0.4 #system.cell_system.node_grid = [i, j, k] diff --git a/samples/visualization_charged.py b/samples/visualization_charged.py index a3786933a1f..6375c2aac6d 100644 --- a/samples/visualization_charged.py +++ b/samples/visualization_charged.py @@ -29,7 +29,7 @@ box = [40, 40, 40] system = espressomd.System(box_l=box) -system.cell_system.set_domain_decomposition(use_verlet_lists=True) +system.cell_system.set_regular_decomposition(use_verlet_lists=True) visualizer = espressomd.visualization_opengl.openGLLive( system, background_color=[1, 1, 1], drag_enabled=True, drag_force=10) diff --git a/testsuite/python/CMakeLists.txt b/testsuite/python/CMakeLists.txt index 492a642c719..98ad4076ee2 100644 --- a/testsuite/python/CMakeLists.txt +++ b/testsuite/python/CMakeLists.txt @@ -143,7 +143,7 @@ python_test(FILE nsquare.py MAX_NUM_PROC 4) python_test(FILE virtual_sites_relative.py MAX_NUM_PROC 2) python_test(FILE virtual_sites_tracers.py MAX_NUM_PROC 2) python_test(FILE virtual_sites_tracers_gpu.py MAX_NUM_PROC 2 LABELS gpu) -python_test(FILE domain_decomposition.py MAX_NUM_PROC 4) +python_test(FILE regular_decomposition.py MAX_NUM_PROC 4) python_test(FILE integrator_npt.py MAX_NUM_PROC 4) python_test(FILE integrator_npt_stats.py MAX_NUM_PROC 4 LABELS long) python_test(FILE integrator_steepest_descent.py MAX_NUM_PROC 4) diff --git a/testsuite/python/brownian_dynamics.py b/testsuite/python/brownian_dynamics.py index b8e25c149eb..bdc663f5bd7 100644 --- a/testsuite/python/brownian_dynamics.py +++ b/testsuite/python/brownian_dynamics.py @@ -26,7 +26,7 @@ class BrownianThermostat(ut.TestCase): """Test Brownian Dynamics""" system = espressomd.System(box_l=[1.0, 1.0, 1.0]) - system.cell_system.set_domain_decomposition(use_verlet_lists=True) + system.cell_system.set_regular_decomposition(use_verlet_lists=True) system.cell_system.skin = 0 system.periodicity = [0, 0, 0] diff --git a/testsuite/python/brownian_dynamics_stats.py b/testsuite/python/brownian_dynamics_stats.py index 470e48fdeaf..c614c17a7cc 100644 --- a/testsuite/python/brownian_dynamics_stats.py +++ b/testsuite/python/brownian_dynamics_stats.py @@ -30,7 +30,7 @@ class BrownianThermostat(ut.TestCase, thermostats_common.ThermostatsCommon): """Tests velocity distributions and diffusion for Brownian Dynamics""" system = espressomd.System(box_l=[1.0, 1.0, 1.0]) - system.cell_system.set_domain_decomposition(use_verlet_lists=True) + system.cell_system.set_regular_decomposition(use_verlet_lists=True) system.cell_system.skin = 0 system.periodicity = [0, 0, 0] diff --git a/testsuite/python/cellsystem.py b/testsuite/python/cellsystem.py index a5a2b5358f9..c7f4b72070a 100644 --- a/testsuite/python/cellsystem.py +++ b/testsuite/python/cellsystem.py @@ -30,14 +30,15 @@ def test_cell_system(self): self.system.cell_system.set_n_square(use_verlet_lists=False) s = self.system.cell_system.get_state() self.assertEqual([s['use_verlet_list'], s['type']], [0, "nsquare"]) - self.system.cell_system.set_domain_decomposition(use_verlet_lists=True) + self.system.cell_system.set_regular_decomposition( + use_verlet_lists=True) s = self.system.cell_system.get_state() self.assertEqual( - [s['use_verlet_list'], s['type']], [1, "domain_decomposition"]) + [s['use_verlet_list'], s['type']], [1, "regular_decomposition"]) @ut.skipIf(n_nodes == 1, "Skipping test: only runs for n_nodes >= 2") def test_node_grid(self): - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() for i in range(3): node_grid_ref = [1, 1, 1] node_grid_ref[i] = self.n_nodes diff --git a/testsuite/python/collision_detection.py b/testsuite/python/collision_detection.py index e1ef7838f25..8a5930c97a1 100644 --- a/testsuite/python/collision_detection.py +++ b/testsuite/python/collision_detection.py @@ -637,7 +637,7 @@ def test_bind_three_particles(self): system.part.add(id=4, pos=e) system.part.add(id=1, pos=b) - system.cell_system.set_domain_decomposition() + system.cell_system.set_regular_decomposition() system.integrator.run(1, recalc_forces=True) self.verify_triangle_binding(cutoff, system.bonded_inter[2], res) system.cell_system.set_n_square() diff --git a/testsuite/python/coulomb_mixed_periodicity.py b/testsuite/python/coulomb_mixed_periodicity.py index d5b276094ea..706f6774690 100644 --- a/testsuite/python/coulomb_mixed_periodicity.py +++ b/testsuite/python/coulomb_mixed_periodicity.py @@ -76,7 +76,7 @@ def test_elc(self): for p in self.system.part: assert p.pos[2] >= 0. and p.pos[2] <= 9., f'particle {p.id} in gap' - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.system.cell_system.node_grid = sorted( self.system.cell_system.node_grid, key=lambda x: -x) self.system.periodicity = [1, 1, 1] @@ -95,7 +95,7 @@ def test_elc(self): 'Skipping test: missing feature SCAFACOS or p2nfft method') def test_scafacos_p2nfft(self): self.system.periodicity = [1, 1, 0] - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() scafacos = espressomd.electrostatics.Scafacos( prefactor=1, diff --git a/testsuite/python/ek_eof_one_species.py b/testsuite/python/ek_eof_one_species.py index bc2aa3ed084..38af417e236 100644 --- a/testsuite/python/ek_eof_one_species.py +++ b/testsuite/python/ek_eof_one_species.py @@ -156,7 +156,7 @@ def bisection(): pntm = pnt0 + size else: sys.exit("Bisection method fails:\n" - "Tuning of domain boundaries may be required.") + "Tuning of regular boundaries may be required.") return pntm diff --git a/testsuite/python/elc_vs_analytic.py b/testsuite/python/elc_vs_analytic.py index 7805e8a26d6..333061ba6ad 100644 --- a/testsuite/python/elc_vs_analytic.py +++ b/testsuite/python/elc_vs_analytic.py @@ -54,7 +54,7 @@ def test_elc(self): q=-self.q[0]) self.system.box_l = [self.box_l, self.box_l, self.box_l + self.elc_gap] - self.system.cell_system.set_domain_decomposition( + self.system.cell_system.set_regular_decomposition( use_verlet_lists=True) self.system.periodicity = [1, 1, 1] p3m = espressomd.electrostatics.P3M(prefactor=self.prefactor, diff --git a/testsuite/python/langevin_thermostat.py b/testsuite/python/langevin_thermostat.py index 86f19538ab6..ed931f8ccbb 100644 --- a/testsuite/python/langevin_thermostat.py +++ b/testsuite/python/langevin_thermostat.py @@ -26,7 +26,7 @@ class LangevinThermostat(ut.TestCase): """Test Langevin Dynamics""" system = espressomd.System(box_l=[1.0, 1.0, 1.0]) - system.cell_system.set_domain_decomposition(use_verlet_lists=True) + system.cell_system.set_regular_decomposition(use_verlet_lists=True) system.cell_system.skin = 0 system.periodicity = [0, 0, 0] diff --git a/testsuite/python/langevin_thermostat_stats.py b/testsuite/python/langevin_thermostat_stats.py index 604ef46f7a9..6a865bca844 100644 --- a/testsuite/python/langevin_thermostat_stats.py +++ b/testsuite/python/langevin_thermostat_stats.py @@ -30,7 +30,7 @@ class LangevinThermostat(ut.TestCase, thermostats_common.ThermostatsCommon): """Tests velocity distributions and diffusion for Langevin Dynamics""" system = espressomd.System(box_l=[1.0, 1.0, 1.0]) - system.cell_system.set_domain_decomposition(use_verlet_lists=True) + system.cell_system.set_regular_decomposition(use_verlet_lists=True) system.cell_system.skin = 0 system.periodicity = [0, 0, 0] diff --git a/testsuite/python/lj.py b/testsuite/python/lj.py index 9631323c22c..aaa6ad46e52 100644 --- a/testsuite/python/lj.py +++ b/testsuite/python/lj.py @@ -54,14 +54,15 @@ def check(self): self.assertLess(max_deviation, 1e-5) def test_dd(self): - self.system.cell_system.set_domain_decomposition( + self.system.cell_system.set_regular_decomposition( use_verlet_lists=False) self.system.integrator.run(recalc_forces=True, steps=0) self.check() def test_dd_vl(self): - self.system.cell_system.set_domain_decomposition(use_verlet_lists=True) + self.system.cell_system.set_regular_decomposition( + use_verlet_lists=True) # Build VL and calc ia self.system.integrator.run(recalc_forces=True, steps=0) diff --git a/testsuite/python/mass-and-rinertia_per_particle.py b/testsuite/python/mass-and-rinertia_per_particle.py index d3c1d7c5b34..89fea0d1f63 100644 --- a/testsuite/python/mass-and-rinertia_per_particle.py +++ b/testsuite/python/mass-and-rinertia_per_particle.py @@ -60,7 +60,7 @@ class ThermoTest(ut.TestCase): @classmethod def setUpClass(cls): np.random.seed(seed=15) - cls.system.cell_system.set_domain_decomposition(use_verlet_lists=True) + cls.system.cell_system.set_regular_decomposition(use_verlet_lists=True) cls.system.cell_system.skin = 5.0 def setUp(self): diff --git a/testsuite/python/mmm1d.py b/testsuite/python/mmm1d.py index 2c66dd9c83f..a63c56afa09 100644 --- a/testsuite/python/mmm1d.py +++ b/testsuite/python/mmm1d.py @@ -114,7 +114,7 @@ def test_exceptions(self): if self.MMM1D is espressomd.electrostatics.MMM1D: with self.assertRaisesRegex(Exception, "MMM1D requires the N-square cellsystem"): mmm1d = self.MMM1D(prefactor=1.0, maxPWerror=1e-2) - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.system.actors.add(mmm1d) self.system.cell_system.set_n_square() self.system.actors.clear() diff --git a/testsuite/python/p3m_tuning_exceptions.py b/testsuite/python/p3m_tuning_exceptions.py index 52c1b8e97ba..85e9c2b7a3b 100644 --- a/testsuite/python/p3m_tuning_exceptions.py +++ b/testsuite/python/p3m_tuning_exceptions.py @@ -210,10 +210,10 @@ def test_04_invalid_params_p3m_cpu(self): self.system.periodicity = (1, 1, 1) # check cell system exceptions - with self.assertRaisesRegex(Exception, "P3M requires the domain decomposition cell system"): + with self.assertRaisesRegex(Exception, "P3M requires the regular decomposition cell system"): self.system.cell_system.set_n_square() self.system.analysis.energy() - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.system.actors.clear() @utx.skipIfMissingGPU() @@ -259,10 +259,10 @@ def test_04_invalid_params_dp3m_cpu(self): self.system.periodicity = (1, 1, 1) # check cell system exceptions - with self.assertRaisesRegex(Exception, "dipolar P3M requires the domain decomposition cell system"): + with self.assertRaisesRegex(Exception, "dipolar P3M requires the regular decomposition cell system"): self.system.cell_system.set_n_square() self.system.analysis.energy() - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.system.actors.clear() @utx.skipIfMissingFeatures("P3M") diff --git a/testsuite/python/pairs.py b/testsuite/python/pairs.py index 8f032b50f3b..a466936980d 100644 --- a/testsuite/python/pairs.py +++ b/testsuite/python/pairs.py @@ -104,13 +104,13 @@ def test_nsquare_partial_z(self): self.run_and_check() def test_dd(self): - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.system.periodicity = [1, 1, 1] self.run_and_check() self.check_range_exception() def test_dd_partial_z(self): - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.system.periodicity = [1, 1, 0] self.run_and_check() self.check_range_exception() diff --git a/testsuite/python/particle.py b/testsuite/python/particle.py index d68e391d3ae..812b60e0d0c 100644 --- a/testsuite/python/particle.py +++ b/testsuite/python/particle.py @@ -344,7 +344,7 @@ def test_zz_remove_all(self): def test_coord_fold_corner_cases(self): system = self.system system.time_step = .5 - system.cell_system.set_domain_decomposition(use_verlet_lists=False) + system.cell_system.set_regular_decomposition(use_verlet_lists=False) system.cell_system.skin = 0 system.min_global_cut = 3 system.part.clear() diff --git a/testsuite/python/random_pairs.py b/testsuite/python/random_pairs.py index e08b01956b9..5c4b19d2e7c 100644 --- a/testsuite/python/random_pairs.py +++ b/testsuite/python/random_pairs.py @@ -82,7 +82,7 @@ def check_pairs(self, n2_pairs): self.assertEqual(n2_pairs ^ set(cs_pairs), set()) def check_dd(self, n2_pairs): - self.system.cell_system.set_domain_decomposition() + self.system.cell_system.set_regular_decomposition() self.check_pairs(n2_pairs) def check_n_squared(self, n2_pairs): diff --git a/testsuite/python/domain_decomposition.py b/testsuite/python/regular_decomposition.py similarity index 97% rename from testsuite/python/domain_decomposition.py rename to testsuite/python/regular_decomposition.py index 741a79ed13a..55b2ee62f29 100644 --- a/testsuite/python/domain_decomposition.py +++ b/testsuite/python/regular_decomposition.py @@ -23,12 +23,12 @@ np.random.seed(42) -class DomainDecomposition(ut.TestCase): +class RegularDecomposition(ut.TestCase): system = espressomd.System(box_l=3 * [50.0]) original_node_grid = tuple(system.cell_system.node_grid) def setUp(self): - self.system.cell_system.set_domain_decomposition( + self.system.cell_system.set_regular_decomposition( use_verlet_lists=False) self.system.cell_system.node_grid = self.original_node_grid self.system.time_step = 1e-3 diff --git a/testsuite/python/virtual_sites_relative.py b/testsuite/python/virtual_sites_relative.py index 9d0f2fc87a8..cefc2d2b86c 100644 --- a/testsuite/python/virtual_sites_relative.py +++ b/testsuite/python/virtual_sites_relative.py @@ -307,9 +307,9 @@ def test_lj(self): system.cell_system.skin = 0.4 system.cell_system.set_n_square(use_verlet_lists=True) self.run_test_lj() - system.cell_system.set_domain_decomposition(use_verlet_lists=True) + system.cell_system.set_regular_decomposition(use_verlet_lists=True) self.run_test_lj() - system.cell_system.set_domain_decomposition(use_verlet_lists=False) + system.cell_system.set_regular_decomposition(use_verlet_lists=False) self.run_test_lj() @utx.skipIfMissingFeatures("EXTERNAL_FORCES")