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

s.cell_system.tune_skin() ignores short range cutoff #2961

Closed
RudolfWeeber opened this issue Jul 1, 2019 · 1 comment · Fixed by #3011
Closed

s.cell_system.tune_skin() ignores short range cutoff #2961

RudolfWeeber opened this issue Jul 1, 2019 · 1 comment · Fixed by #3011
Assignees
Labels
Milestone

Comments

@RudolfWeeber
Copy link
Contributor

The maximum skin considered must be curtailed such that
r_c +skin <0.5 l
where r_c = short range cutoff, l = local box length.
Alternatively, it needs to throw a clear error msg.
To reproduce:

import espressomd
s=espressomd.System(box_l=[1,1,1])
s.time_step=0.01
s.non_bonded_inter[0,0].lennard_jones.set_params(epsilon=1,sigma=0.2,cutoff=0.3,shift="auto")
s.cell_system.tune_skin(min_skin=0.1,max_skin=0.6,tol=0.05, int_steps=3)
@pkreissl
Copy link
Contributor

I can have a look at this at the coding day.

bors bot added a commit that referenced this issue Jul 26, 2019
3011: tune_skin: add adjust_max_skin feature. r=RudolfWeeber a=pkreissl

Fixes #2961

Description of changes:
 - Add `adjust_max_skin` parameter to `tune_skin()` method, which adds the option to automatically adjust `max_skin` if the passed value is larger than permitted (0.5 * local box length - short range cutoff)
 - Rename core variables to match interface.

As a test you can run the following script adjusted from @RudolfWeeber s minimal script in issue #2961
```python
import espressomd
s = espressomd.System(box_l=[1,1,1])
s.time_step = 0.01
s.non_bonded_inter[0,0].lennard_jones.set_params(epsilon=1,sigma=0.2,cutoff=0.3,shift="auto")
print("=> Tune with adjustment:")
s.cell_system.tune_skin(min_skin=0.1,max_skin=0.6,tol=0.05, int_steps=3, adjust_max_skin=True)
print(s.cell_system.skin)
print("=> and fail without:")
s.cell_system.tune_skin(min_skin=0.1,max_skin=0.6,tol=0.05, int_steps=3)
``` 
resulting in the following output:
```
$ ./pypresso tune_skin.py
=> Tune with adjustment:
0.17500000000000002
=> and fail without:
There were unhandled errors.
ERROR: number of cells 1 is smaller than minimum 8 (interaction range too large or min_num_cells too large)
```



Co-authored-by: Patrick Kreissl <[email protected]>
Co-authored-by: Jean-Noël Grad <[email protected]>
bors bot added a commit that referenced this issue Jul 26, 2019
3011: tune_skin: add adjust_max_skin feature. r=RudolfWeeber a=pkreissl

Fixes #2961

Description of changes:
 - Add `adjust_max_skin` parameter to `tune_skin()` method, which adds the option to automatically adjust `max_skin` if the passed value is larger than permitted (0.5 * local box length - short range cutoff)
 - Rename core variables to match interface.

As a test you can run the following script adjusted from @RudolfWeeber s minimal script in issue #2961
```python
import espressomd
s = espressomd.System(box_l=[1,1,1])
s.time_step = 0.01
s.non_bonded_inter[0,0].lennard_jones.set_params(epsilon=1,sigma=0.2,cutoff=0.3,shift="auto")
print("=> Tune with adjustment:")
s.cell_system.tune_skin(min_skin=0.1,max_skin=0.6,tol=0.05, int_steps=3, adjust_max_skin=True)
print(s.cell_system.skin)
print("=> and fail without:")
s.cell_system.tune_skin(min_skin=0.1,max_skin=0.6,tol=0.05, int_steps=3)
``` 
resulting in the following output:
```
$ ./pypresso tune_skin.py
=> Tune with adjustment:
0.17500000000000002
=> and fail without:
There were unhandled errors.
ERROR: number of cells 1 is smaller than minimum 8 (interaction range too large or min_num_cells too large)
```



Co-authored-by: Patrick Kreissl <[email protected]>
Co-authored-by: Jean-Noël Grad <[email protected]>
@bors bors bot closed this as completed in #3011 Jul 26, 2019
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 a pull request may close this issue.

3 participants