Skip to content

Commit

Permalink
Add poisson-boltzmann to the SCRF (#450)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
3 people authored Feb 14, 2024
1 parent b94438c commit 698e74f
Show file tree
Hide file tree
Showing 69 changed files with 2,885 additions and 470 deletions.
10 changes: 5 additions & 5 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2

variables:
ubuntu-2004: &ubuntu-2004
ubuntu-2204: &ubuntu-2204
docker:
- image: ghcr.io/mrchemsoft/metamr/circleci_ubuntu-20.04:sha-343e011
- image: ghcr.io/mrchemsoft/metamr/circleci_ubuntu-22.04:sha-9f6ecd4
name: tsubame
user: merzbow
working_directory: ~/mrchem
Expand Down Expand Up @@ -52,14 +52,14 @@ variables:
jobs:
serial-py3:
<<: *ubuntu-2004
<<: *ubuntu-2204
steps:
- checkout
- *configure-serial
- *build
- *tests
omp-py3:
<<: *ubuntu-2004
<<: *ubuntu-2204
environment:
- OMP_NUM_THREADS: '2'
steps:
Expand All @@ -68,7 +68,7 @@ jobs:
- *build
- *tests
mpi-py3:
<<: *ubuntu-2004
<<: *ubuntu-2204
steps:
- checkout
- *configure-mpi
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ jobs:
activate-environment: mrchem-gha
environment-file: .github/mrchem-gha.yml
channel-priority: true
python-version: 3.6
python-version: 3.9
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

- name: Configure
shell: bash -l {0}
run: |
python ./setup --type=$BUILD_TYPE --omp --arch-flags=false --generator=Ninja --prefix=$GITHUB_WORKSPACE/Software/MRChem build
- name: Build
shell: bash -l {0}
run: |
cmake --build build --config $BUILD_TYPE --target install -- -v -d stats
- name: Test
shell: bash -l {0}
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ jobs:
activate-environment: mrchem-codecov
environment-file: .github/mrchem-codecov.yml
channel-priority: true
python-version: 3.6
python-version: 3.9

- name: Configure
shell: bash -l {0}
run: |
python ./setup --type=$BUILD_TYPE --arch-flags=false --coverage --generator=Ninja --prefix=$GITHUB_WORKSPACE/Software/MRChem build
- name: Build
shell: bash -l {0}
run: |
cmake --build build --config $BUILD_TYPE --target install -- -v -d stats
- name: Test MRChem and generate coverage report
shell: bash -l {0}
run: |
Expand Down
2 changes: 2 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Features in MRChem-1.1:
- Electric field
+ Solvent effects
- Cavity-free PCM
- Poisson-Boltzmann PCM
- Linearized Poisson-Boltzmann PCM
* Properties:
+ Ground state energy
+ Dipole moment
Expand Down
2 changes: 1 addition & 1 deletion doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Installation
Build prerequisites
-------------------

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

Expand Down
31 changes: 29 additions & 2 deletions doc/programmers/code_reference/environment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,38 @@ Permittivity
:protected-members:
:private-members:

SCRF
DHScreening
------------

.. doxygenclass:: mrchem::SCRF
.. doxygenclass:: mrchem::DHScreening
:project: MRChem
:members:
:protected-members:
:private-members:

GPESolver
------------

.. doxygenclass:: mrchem::GPESolver
:project: MRChem
:members:
:protected-members:
:private-members:

PBESolver
------------

.. doxygenclass:: mrchem::PBESolver
:project: MRChem
:members:
:protected-members:
:private-members:

LPBESolver
------------

.. doxygenclass:: mrchem::LPBESolver
:project: MRChem
:members:
:protected-members:
:private-members:
18 changes: 17 additions & 1 deletion doc/programming.bib
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ @article{Fosso-Tande2013
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.},
author = {Fosso-Tande, Jacob and Harrison, Robert J.},
doi = {10.1016/j.cplett.2013.01.065},
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},
issn = {00092614},
journal = {Chem. Phys. Lett.},
pages = {179--184},
Expand All @@ -343,3 +342,20 @@ @article{Fosso-Tande2013
year = {2013}
}

@article{gerez2023,
author = {Gerez S, Gabriel A. and Di Remigio Eikås, Roberto and Jensen, Stig Rune and Bjørgve, Magnar and Frediani, Luca},
title = {Cavity-Free Continuum Solvation: Implementation and Parametrization in a Multiwavelet Framework},
journal = {Journal of Chemical Theory and Computation},
volume = {19},
number = {7},
pages = {1986-1997},
year = {2023},
doi = {10.1021/acs.jctc.2c01098},
note ={PMID: 36933225},
URL = {
https://doi.org/10.1021/acs.jctc.2c01098
},
eprint = {
https://doi.org/10.1021/acs.jctc.2c01098
}
}
8 changes: 7 additions & 1 deletion doc/users/user_inp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ as the ``world_origin`` is the true origin).
WaveFunction
------------

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

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

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

.. note::

Restricted open-shell wavefunctions are not supported.
Expand Down
Loading

0 comments on commit 698e74f

Please sign in to comment.