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

Bug in the implementation of the Gay-Berne potential #2229

Closed
Kischy opened this issue Sep 5, 2018 · 1 comment · Fixed by #2424
Closed

Bug in the implementation of the Gay-Berne potential #2229

Kischy opened this issue Sep 5, 2018 · 1 comment · Fixed by #2424
Assignees

Comments

@Kischy
Copy link
Contributor

Kischy commented Sep 5, 2018

There is a error in gb.hpp (Gay-Berne potential) that makes it impossible to use other values for \sigma_0 other than 1:

Line 83 and 84

X = 1/(dist - Sigma + ia_params->GB_sig);
Xcut = 1/(ia_params->GB_cut - Sigma + ia_params->GB_sig);

should really be

X = ia_params->GB_sig / (dist - Sigma + ia_params->GB_sig);
Xcut = ia_params->GB_sig / (ia_params->GB_cut - Sigma + ia_params->GB_sig);

according to the manual (http://espressomd.org/html/doc4.0/inter_non-bonded.html#gay-berne-interaction) (see the second equation).

This error also occurs in lines 196 and 197.

@RudolfWeeber
Copy link
Contributor

Thanks for reporting this. Pull request #2424 applies these corrections.
We now also test a Python version of the expression in the user's guide against the code.

Since there is no test for the forces/torques (we did not find analytical expressions) the PR downgrades Gay-Berne to an experimental feature.
You need
#define EXPERIMENTAL_FEATURES
in myconfig.hpp to use it.

fweik pushed a commit that referenced this issue Jan 7, 2019
* core: gb refactor

* Work on gb test

* Testsuite: Gay Berne pair potential (no forces/torques)

* Core: Apply corrections suggested in #2229 to forces/torques

* GAY_BERNE depends on EXPERIMENTAL_FEATURES

* Testsuite: Gay-Berne,  avoid dipole hack to set orientation

* Formatting

* Testsuite: Fix gb energy test (ia deactivation)

* Testsuite: Gay-Berne on 3 cores and silent
RudolfWeeber added a commit to RudolfWeeber/espresso that referenced this issue Jan 7, 2019
* core: gb refactor

* Work on gb test

* Testsuite: Gay Berne pair potential (no forces/torques)

* Core: Apply corrections suggested in espressomd#2229 to forces/torques

* GAY_BERNE depends on EXPERIMENTAL_FEATURES

* Testsuite: Gay-Berne,  avoid dipole hack to set orientation

* Formatting

* Testsuite: Fix gb energy test (ia deactivation)

* Testsuite: Gay-Berne on 3 cores and silent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants