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

Fix OIF force summary function #4813

Merged
merged 3 commits into from
Nov 6, 2023
Merged

Fix OIF force summary function #4813

merged 3 commits into from
Nov 6, 2023

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Oct 20, 2023

Description of changes:

  • bugfix: OifCell.elastic_forces() no longer throws a TypeError
  • add a smoke test for that function

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]
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

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

@jngrad jngrad requested a review from RudolfWeeber October 23, 2023 17:45
@jngrad jngrad added the automerge Merge with kodiak label Nov 6, 2023
@kodiakhq kodiakhq bot merged commit 1a7a439 into espressomd:python Nov 6, 2023
5 checks passed
@jngrad jngrad deleted the fix-oif branch November 6, 2023 16:16
jngrad pushed a commit to jngrad/espresso that referenced this pull request Dec 5, 2023
Description of changes:
- bugfix: `OifCell.elastic_forces()` no longer throws a `TypeError`
- add a smoke test for that function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants