-
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
Fix OIF force summary function #4813
Conversation
Fix regression introduced in 56e77ed.
cell.mesh.triangles = cell.mesh.triangles[:20] | ||
# smoke test | ||
results = cell.elastic_forces(el_forces=6 * [0], f_metric=6 * [1]) | ||
ref = [0., 1.36730815e-12, 22.4985704, 6838.5749, 7.3767594, 6816.6342] |
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.
where do these nice numbers come from?
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.
It's a verbatim copy of the output of the elastic forces calculation. I get the same values on ESPResSo 4.2.1, so the main branch is consistent with the last release. The second value in the list is sensitive to numerical errors and gives different results on ARM vs x86 architectures, which is why a non-zero absolute tolerance is used. As far as I understand it, these numbers should be fully deterministic on a given hardware.
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.
not the best physics test then but the best we get I guess
Description of changes: - bugfix: `OifCell.elastic_forces()` no longer throws a `TypeError` - add a smoke test for that function
Description of changes:
OifCell.elastic_forces()
no longer throws aTypeError