-
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
Electrostatic pressure consistency #2409
Electrostatic pressure consistency #2409
Conversation
import espressomd | ||
from espressomd import electrostatics | ||
import tests_common | ||
import numpy.testing as npt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move the external imports to the ones above
num_samples = 100 | ||
pressure_via_volume_scaling = np.nan | ||
for i in range(num_samples): | ||
self.system.integrator.run(100) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can use less integration steps?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will have an impact on the accuracy. it is a statistical equivalence of the pressures only.
|
||
|
||
if __name__ == "__main__": | ||
print("Features: ", espressomd.features()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please remove print statement
|
||
import espressomd | ||
from espressomd import electrostatics | ||
import tests_common |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are not using tests_common
def test_p3m_pressure(self): | ||
pressures_via_virial = [] | ||
pressures_via_volume_scaling = [] | ||
p3m = electrostatics.P3M(prefactor=2.0, accuracy=1e-3) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's a good idea to also check the GPU version?
GPU P3M does not support energy calculations. That would be a good idea -
but not possible without energy calculation.
Am Fr., 7. Dez. 2018, 18:39 hat Kai Szuttor <notifications@github.com>
geschrieben:
… ***@***.**** commented on this pull request.
------------------------------
In testsuite/python/p3m_electrostatic_pressure.py
<#2409 (comment)>:
> + system.change_volume_and_rescale_particles(old_box_lengths[0], "xyz")
+ system.integrator.run(0)
+ DeltaEpot = Epot_new - Epot_old
+ particle_number = len(system.part[:].id)
+ current_value = (new_volume / old_volume)**particle_number * \
+ np.exp(-DeltaEpot / kbT)
+ list_of_previous_values.append(current_value)
+ average_value = np.mean(list_of_previous_values)
+
+ pressure = kbT / dV * np.log(average_value)
+ return pressure
+
+ def test_p3m_pressure(self):
+ pressures_via_virial = []
+ pressures_via_volume_scaling = []
+ p3m = electrostatics.P3M(prefactor=2.0, accuracy=1e-3)
Maybe it's a good idea to also check the GPU version?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2409 (review)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AE8wPW61Qk_3h3FPHFMRHlNyk9Qf6c0mks5u2qe1gaJpZM4ZI1hf>
.
|
|
…landsgesell/espresso into electrostatic_pressure_consistency
Please squash the commits as you merge. |
Codecov Report
@@ Coverage Diff @@
## python #2409 +/- ##
======================================
Coverage 72% 72%
======================================
Files 396 396
Lines 18631 18631
======================================
Hits 13454 13454
Misses 5177 5177 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a docstring to the test, so we know what is being tested and how without reading the code?
…electrostatic_pressure_consistency
…electrostatic_pressure_consistency
* add check * add check * patch * imports * up * Update p3m_electrostatic_pressure.py * format * Update p3m_electrostatic_pressure.py * apply patch * exchange assert code * docstring for test * apply patch * reformulate comparison * year * patch * revert to np testing * changed comparison to maximal 2 percent deviation * changed comparison to maximal 2 percent deviation * patch * empty * add tune skin * add warmup * patch * refactor pressure calculation in small python class * patch * new style class * add LJ to required features * patch
Fixes #2405