AlexandriaChemistry / AlexandriaChemistry/ACT
Fix custom long-range correction handling in `act_openmm.py`
- 主要语言
- C++
- 星标
- 18
- 派生
- 3
- 平均合并
- 42 分钟
- 30 天内合并 PR
- 12
描述
`do_force_settings()` has two issues around `CustomNonbondedForce` long-range corrections.
First, there was a typo/mismatched method check:
```python
elif hasattr(force, 'setLongRangeCorrection'):
force.setUseLongRangeCorrection(useDispCorr)
```
The OpenMM method is setUseLongRangeCorrection(), so the check should be:
elif hasattr(force, 'setUseLongRangeCorrection'):
Second, after fixing that typo, useDispersionCorrection = True enables long-range correction for all custom nonbonded forces, including:
```
CoulombGAUSSIAN
UseLongRangeCorrection True
```
For PME with Gaussian charges, this seems wrong because PME already handles long-range electrostatics?
Suggested fix:
```
elif hasattr(force, 'setUseLongRangeCorrection'):
force.setUseLongRangeCorrection(
useDispCorr and force.getName().startswith("VanderWaals")
)
```
so it only enables LongRangeCorrection for VanderWaals.
Also note: a .dat key like useLongRangeCorrection = True is currently ignored; only useDispersionCorrection is read.
So maybe change that as well?
贡献指南
这个仓库没有索引到贡献指南
评估
这个 Issue 还没有评估数据。