Skip to content

Commit

Permalink
docs: Document constant pH implementation details
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed May 18, 2021
1 parent 4ced2c3 commit a37938e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
11 changes: 11 additions & 0 deletions doc/doxygen/bibliography.bib
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,17 @@ @Article{ladd94a
doi = {10.1017/S0022112094001771},
}

@Article{landsgesell17b,
author = {Landsgesell, Jonas and Holm, Christian and Smiatek, Jens},
title = {{Simulation of weak polyelectrolytes: A comparison between the constant pH and the reaction ensemble method}},
journal = {European Physical Journal Special Topics},
year = {2017},
volume = {226},
number = {4},
pages = {725-736},
doi = {10.1140/epjst/e2016-60324-3},
}

@Article{marsili10a,
author = {Marsili, Simone and Signorini, Giorgio Federico and Chelli, Riccardo and Marchi, Massimo and Procacci, Piero},
title = {{{ORAC}: A molecular dynamics simulation program to explore free energy surfaces in biomolecular systems at the atomistic level}},
Expand Down
12 changes: 6 additions & 6 deletions src/core/reaction_methods/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ double calculate_factorial_expression_cpH(
std::map<int, int> const &old_particle_numbers) {
double factorial_expr = 1.0;
// factorial contribution of reactants
for (int i = 0; i < 1; i++) {
int nu_i = -1 * current_reaction.reactant_coefficients[i];
int N_i0 = old_particle_numbers.at(current_reaction.reactant_types[i]);
{
int nu_i = -1 * current_reaction.reactant_coefficients[0];
int N_i0 = old_particle_numbers.at(current_reaction.reactant_types[0]);
factorial_expr *=
factorial_Ni0_divided_by_factorial_Ni0_plus_nu_i(N_i0, nu_i);
}
// factorial contribution of products
for (int i = 0; i < 1; i++) {
int nu_i = current_reaction.product_coefficients[i];
int N_i0 = old_particle_numbers.at(current_reaction.product_types[i]);
{
int nu_i = current_reaction.product_coefficients[0];
int N_i0 = old_particle_numbers.at(current_reaction.product_types[0]);
factorial_expr *=
factorial_Ni0_divided_by_factorial_Ni0_plus_nu_i(N_i0, nu_i);
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/reaction_methods/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ calculate_factorial_expression(SingleReaction const &current_reaction,
* Calculates the factorial expression which occurs in the constant pH method
* with symmetric proposal probability.
*
* See https://arxiv.org/abs/1702.04911 equation 15
* See @cite landsgesell17b
*/
double calculate_factorial_expression_cpH(
SingleReaction const &current_reaction,
Expand Down
8 changes: 8 additions & 0 deletions src/python/espressomd/reaction_ensemble.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,14 @@ cdef class ReactionEnsemble(ReactionAlgorithm):
self._set_params_in_es_core()

cdef class ConstantpHEnsemble(ReactionAlgorithm):
"""
This class implements the constant pH Ensemble.
When adding an acid-base reaction, the acid and base particle types
are always assumed to be at index 0 of the lists passed to arguments
``reactant_types`` and ``product_types``.
"""
cdef unique_ptr[CConstantpHEnsemble] constpHptr

def __init__(self, *args, **kwargs):
Expand Down

0 comments on commit a37938e

Please sign in to comment.