Skip to content

Commit 698e74f

Browse files
Add poisson-boltzmann to the SCRF (#450)
* add poisson-boltzmann to the SCRF Add additional input for pb equation, all other tests passing, error with ion_radius variable add a harcoded to pass test for pb fix json error mid debug commit, the run_pb block produces different convergence despite being identical to the standard * PB working as intended (within a reasonable domain) Faster pb and lpb solver and proper test * add test for linearized pb * Rename SCRF to GPESolver in preparation for refactor. Use inheritance to implement PBESolver and LPBESolver Rename GPESolver::solveEquation to iterateEquation * Add new test references to pb and lpb solvent Update tests and Fix correct solvers running Add proper capitalisation to Debye-Huckel Co-authored-by: Roberto Di Remigio Eikås <[email protected]> Remove unused setters in Cavity Co-authored-by: Roberto Di Remigio Eikås <[email protected]> Pass parameters by const reference Co-authored-by: Roberto Di Remigio Eikås <[email protected]> * fix tests for pb solver * Add documentation to the solvent classes * Add DHScreening to the StepFunction hierarchy * Reorder includes * Update python/template.yml Co-authored-by: Roberto Di Remigio Eikås <[email protected]> * Update python/mrchem/api.py Co-authored-by: Roberto Di Remigio Eikås <[email protected]> * Post-rebase fixes * Formatting * debugging * more debugging * even more debugging * BUGFIX in PB_solver.cpp: rho_el was not zero and the ordering of the energy outputs of GPESolver was wrong * real BUGFIX: same as above but relax the thrs, we are running it with 1.0e-3 prec after all * attempt to fix test error * update python version for tests * update python version for singularity images * update python version for circleci config * Use newer base image with CircleCI * update minimum python requirements in installation.rst * create cavity even if we are running pb or lpb * use proper dividor * Be more consistent * Update input for PCM * rebase fix * rebase fix * all tests passing and PB_solver is correct --------- Co-authored-by: Roberto Di Remigio Eikås <[email protected]> Co-authored-by: Roberto Di Remigio Eikås <[email protected]>
1 parent b94438c commit 698e74f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+2885
-470
lines changed

.circleci/config.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
version: 2
22

33
variables:
4-
ubuntu-2004: &ubuntu-2004
4+
ubuntu-2204: &ubuntu-2204
55
docker:
6-
- image: ghcr.io/mrchemsoft/metamr/circleci_ubuntu-20.04:sha-343e011
6+
- image: ghcr.io/mrchemsoft/metamr/circleci_ubuntu-22.04:sha-9f6ecd4
77
name: tsubame
88
user: merzbow
99
working_directory: ~/mrchem
@@ -52,14 +52,14 @@ variables:
5252
5353
jobs:
5454
serial-py3:
55-
<<: *ubuntu-2004
55+
<<: *ubuntu-2204
5656
steps:
5757
- checkout
5858
- *configure-serial
5959
- *build
6060
- *tests
6161
omp-py3:
62-
<<: *ubuntu-2004
62+
<<: *ubuntu-2204
6363
environment:
6464
- OMP_NUM_THREADS: '2'
6565
steps:
@@ -68,7 +68,7 @@ jobs:
6868
- *build
6969
- *tests
7070
mpi-py3:
71-
<<: *ubuntu-2004
71+
<<: *ubuntu-2204
7272
steps:
7373
- checkout
7474
- *configure-mpi

.github/workflows/build-test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,19 +42,19 @@ jobs:
4242
activate-environment: mrchem-gha
4343
environment-file: .github/mrchem-gha.yml
4444
channel-priority: true
45-
python-version: 3.6
45+
python-version: 3.9
4646
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
4747

4848
- name: Configure
4949
shell: bash -l {0}
5050
run: |
5151
python ./setup --type=$BUILD_TYPE --omp --arch-flags=false --generator=Ninja --prefix=$GITHUB_WORKSPACE/Software/MRChem build
52-
52+
5353
- name: Build
5454
shell: bash -l {0}
5555
run: |
5656
cmake --build build --config $BUILD_TYPE --target install -- -v -d stats
57-
57+
5858
- name: Test
5959
shell: bash -l {0}
6060
run: |

.github/workflows/code-coverage.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ jobs:
2626
activate-environment: mrchem-codecov
2727
environment-file: .github/mrchem-codecov.yml
2828
channel-priority: true
29-
python-version: 3.6
29+
python-version: 3.9
3030

3131
- name: Configure
3232
shell: bash -l {0}
3333
run: |
3434
python ./setup --type=$BUILD_TYPE --arch-flags=false --coverage --generator=Ninja --prefix=$GITHUB_WORKSPACE/Software/MRChem build
35-
35+
3636
- name: Build
3737
shell: bash -l {0}
3838
run: |
3939
cmake --build build --config $BUILD_TYPE --target install -- -v -d stats
40-
40+
4141
- name: Test MRChem and generate coverage report
4242
shell: bash -l {0}
4343
run: |

doc/index.rst

+2
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ Features in MRChem-1.1:
4242
- Electric field
4343
+ Solvent effects
4444
- Cavity-free PCM
45+
- Poisson-Boltzmann PCM
46+
- Linearized Poisson-Boltzmann PCM
4547
* Properties:
4648
+ Ground state energy
4749
+ Dipole moment

doc/installation.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Installation
66
Build prerequisites
77
-------------------
88

9-
- Python-3.7 (or later)
9+
- Python-3.9 (or later)
1010
- CMake-3.14 (or later)
1111
- GNU-5.4 or Intel-17 (or later) compilers (C++14 standard)
1212

doc/programmers/code_reference/environment.rst

+29-2
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,38 @@ Permittivity
2121
:protected-members:
2222
:private-members:
2323

24-
SCRF
24+
DHScreening
2525
------------
2626

27-
.. doxygenclass:: mrchem::SCRF
27+
.. doxygenclass:: mrchem::DHScreening
2828
:project: MRChem
2929
:members:
3030
:protected-members:
3131
:private-members:
32+
33+
GPESolver
34+
------------
35+
36+
.. doxygenclass:: mrchem::GPESolver
37+
:project: MRChem
38+
:members:
39+
:protected-members:
40+
:private-members:
41+
42+
PBESolver
43+
------------
44+
45+
.. doxygenclass:: mrchem::PBESolver
46+
:project: MRChem
47+
:members:
48+
:protected-members:
49+
:private-members:
50+
51+
LPBESolver
52+
------------
53+
54+
.. doxygenclass:: mrchem::LPBESolver
55+
:project: MRChem
56+
:members:
57+
:protected-members:
58+
:private-members:

doc/programming.bib

+17-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,6 @@ @article{Fosso-Tande2013
333333
abstract = {We describe and present results of the implementation of the surface and volume polarization for electrostatics (SVPE) solvation model. Unlike most other implementations of the solvation model where the solute and the solvent are described with multiple numerical representations, our implementation uses a multiresolution, adaptive multiwavelet basis to describe both the solute and the solvent. This requires reformulation to use integral equations throughout as well as a conscious management of numerical properties of the basis. {\textcopyright} 2013 Elsevier B.V. All rights reserved.},
334334
author = {Fosso-Tande, Jacob and Harrison, Robert J.},
335335
doi = {10.1016/j.cplett.2013.01.065},
336-
file = {:home/ggerez/.local/share/data/Mendeley Ltd./Mendeley Desktop/Downloaded/Fosso-Tande, Harrison - 2013 - Implicit solvation models in a multiresolution multiwavelet basis.pdf:pdf},
337336
issn = {00092614},
338337
journal = {Chem. Phys. Lett.},
339338
pages = {179--184},
@@ -343,3 +342,20 @@ @article{Fosso-Tande2013
343342
year = {2013}
344343
}
345344

345+
@article{gerez2023,
346+
author = {Gerez S, Gabriel A. and Di Remigio Eikås, Roberto and Jensen, Stig Rune and Bjørgve, Magnar and Frediani, Luca},
347+
title = {Cavity-Free Continuum Solvation: Implementation and Parametrization in a Multiwavelet Framework},
348+
journal = {Journal of Chemical Theory and Computation},
349+
volume = {19},
350+
number = {7},
351+
pages = {1986-1997},
352+
year = {2023},
353+
doi = {10.1021/acs.jctc.2c01098},
354+
note ={PMID: 36933225},
355+
URL = {
356+
https://doi.org/10.1021/acs.jctc.2c01098
357+
},
358+
eprint = {
359+
https://doi.org/10.1021/acs.jctc.2c01098
360+
}
361+
}

doc/users/user_inp.rst

+7-1
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ as the ``world_origin`` is the true origin).
194194
WaveFunction
195195
------------
196196

197-
Here we give the wavefunction method and whether we run spin restricted (alpha
197+
Here we give the wavefunction method, environment used (for solvent models) and whether we run spin restricted (alpha
198198
and beta spins are forced to occupy the same spatial orbitals) or not (method
199199
must be specified, otherwise defaults are shown):
200200

@@ -203,6 +203,7 @@ must be specified, otherwise defaults are shown):
203203
WaveFunction {
204204
method = <wavefunction_method> # Core, Hartree, HF or DFT
205205
restricted = true # Spin restricted/unrestricted
206+
environment = pcm # Environment (pcm, pcm-pb, pcm-lpb) defaults to none
206207
}
207208
208209
There are currently four methods available: Core Hamiltonian, Hartree,
@@ -212,6 +213,11 @@ B3LYP``), *or* you can set ``method = DFT`` and specify a "non-standard"
212213
functional in the separate DFT section (see below). See
213214
:ref:`User input reference` for a list of available default functionals.
214215

216+
The solvent model implemented is a cavity free PCM, described in :cite:`gerez2023`.
217+
In this model we have implemented the Generalized Poisson equation solver, keyword ``pcm``, a
218+
Poisson-Boltzmann solver, keyword ``pcm-pb`` and a Linearized Poisson-Boltzmann solver, keyword ``pcm-lpb``.
219+
Further details for the calculation have to be included in the ``PCM`` section, see :ref: `User input reference` for details.
220+
215221
.. note::
216222

217223
Restricted open-shell wavefunctions are not supported.

0 commit comments

Comments
 (0)