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

Add new P3M tuning options #5017

Merged
merged 4 commits into from
Dec 12, 2024
Merged

Add new P3M tuning options #5017

merged 4 commits into from
Dec 12, 2024

Conversation

jngrad
Copy link
Member

@jngrad jngrad commented Dec 11, 2024

Description of changes:

  • new feature: mesh tuning can now be constrained to yield a value between two user-specified mesh sizes
  • incompatible FFT domain decompositions are now discarded during CPU tuning to avoid undefined behavior

Use the same variable names in P3M and DP3M influence functions,
move their Brillouin limit to a template parameter, and improve
their documentation. Avoid division by zero in ELC with constant
potential.
Comment on lines +443 to +453
auto const pref1 = g1_DLC_dip(gc, lz - h);
auto const pref2 = g1_DLC_dip(gc, lz + h);
auto const pref0 = g1_DLC_dip(gc, lz);
auto const exp_term = 2. * gc * h;
auto const log_term1 = exp_term + std::log(9. * pref1);
if (exp_term >= exp_max or log_term1 >= log_max or -exp_term <= exp_min) {
// no solution can be found at larger k values due to overflow/underflow
break;
}
auto const fa0 = std::sqrt(9. * std::exp(+exp_term) * pref1 +
9. * std::exp(-exp_term) * pref2 + 22. * pref0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably a task for a coding day, but I think we should investigate where the need for such large values comes from. We either have the same problem in ELC or this situation can be prevented by a proper tuning. Either way I think it's worth taking a look at some point.

@jngrad jngrad added the automerge Merge with kodiak label Dec 12, 2024
@kodiakhq kodiakhq bot merged commit b200c23 into espressomd:python Dec 12, 2024
10 checks passed
@jngrad jngrad deleted the p3m-tuning branch December 12, 2024 15:50
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.

2 participants