-
Notifications
You must be signed in to change notification settings - Fork 189
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 dipolar direct sum methods #4046
Conversation
offline discussion: the test doesn't pass anymore if the dipoles are relaxed with steepest descent: diff --git a/testsuite/python/dipolar_mdlc_dds_scafacos_direct.py b/testsuite/python/dipolar_mdlc_dds_scafacos_direct.py
index 7ddcb6c65..0a470baff 100644
--- a/testsuite/python/dipolar_mdlc_dds_scafacos_direct.py
+++ b/testsuite/python/dipolar_mdlc_dds_scafacos_direct.py
@@ -157,6 +157,17 @@ class dds(ut.TestCase):
system.integrator.set_steepest_descent(
f_max=1, gamma=0.001, max_displacement=0.01)
system.integrator.run(100)
+ dds_cpu = espressomd.magnetostatics.DipolarDirectSumCpu(
+ prefactor=1.2)
+ system.actors.add(dds_cpu)
+ system.integrator.set_steepest_descent(
+ f_max=5,
+ gamma=0.001,
+ max_displacement=0.01)
+ print(system.analysis.energy()["dipolar"])
+ print(system.integrator.run(100))
+ print(system.analysis.energy()["dipolar"])
+ system.actors.clear()
system.integrator.set_vv()
# compute forces and energies for dawaanr |
The difference between Espresso's and Scafacos' direct sum with replica seems to be that Espresso uses a spherical cutoff, i.e. |
I tried with 2 to 8 replica, with and without DLC, but the deviation to ScaFaCoS did not decrease, while the runtime increased to the order of 1 min. |
It is not possible to make Espressos direct sum with replica agree to scafacos direct sum with replica.
I'm therefore removing this test. |
The DDS with replica method doesn't agree with the ScaFaCoS direct method because a different cutoff scheme is used.
Dipolar direct sum with replica is broken for 0 replica. In that case, it should match with the direct summation for open boundaries, which it doesn't |
Then why does my test pass? |
Also, if you test DDS with replica using 0 replica against ScaFaCoS direct summation, you get the same results after energy minimization (using the diff in the second post of this PR), whereas DDS with open borders doesn't match ScaFaCoS anymore. |
dds_cpu and dds_gpu use minimum image convention in case of perioidic bc, dds with replica and scafacos don't. |
fixes #1569 closes #4046 This is based on #4046, minus the last commit. Description of changes: * Switch tests for dipolar interactions with open boundary conditions from comparing two methods against each other to comparing individual methods against reference data * Use prefactor != 1 in dipolar 2d and 3d periodic tests * Block DipolarDirectSumWithReplicaCpu from n_replica=0 and periodic bc, as it does not apply minimum image convention. Introducing minimum image convention there is not worth it, because that is provided by DipolarDirectSumCpu. The two methods should be merged anyway.
Partial fix for #2071
Description of changes: