ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ReactionMethods::ReactionEnsemble Class Reference

Reaction ensemble method. More...

#include <ReactionEnsemble.hpp>

+ Inheritance diagram for ReactionMethods::ReactionEnsemble:
+ Collaboration diagram for ReactionMethods::ReactionEnsemble:

Public Member Functions

 ReactionEnsemble (boost::mpi::communicator const &comm, int seed, double kT, double exclusion_radius, const std::unordered_map< int, double > &exclusion_radius_per_type)
 
- Public Member Functions inherited from ReactionMethods::ReactionAlgorithm
 ReactionAlgorithm (boost::mpi::communicator const &comm, int seed, double kT, double exclusion_range, std::unordered_map< int, double > const &exclusion_radius_per_type)
 
virtual ~ReactionAlgorithm ()=default
 
double get_acceptance_rate_configurational_moves () const
 
auto get_kT () const
 
auto get_exclusion_range () const
 
auto get_volume () const
 
void set_volume (double new_volume)
 
void update_volume ()
 Automatically sets the volume which is used by the reaction ensemble to the volume of a cuboid box.
 
void set_exclusion_radius_per_type (std::unordered_map< int, double > const &map)
 
void remove_constraint ()
 
void set_cyl_constraint (double center_x, double center_y, double radius)
 
void set_slab_constraint (double slab_start_z, double slab_end_z)
 
Utils::Vector2d get_slab_constraint_parameters () const
 
void setup_bookkeeping_of_empty_pids ()
 Cleans the list of empty pids and searches for empty pid in the system.
 
void delete_particle (int p_id)
 Deletes the particle with the given p_id and stores the id if the deletion created a hole in the particle id range.
 
void add_reaction (std::shared_ptr< SingleReaction > const &new_reaction)
 Adds a reaction to the reaction system.
 
void delete_reaction (int reaction_id)
 
bool is_reaction_under_way () const
 
auto const & get_old_system_state () const
 
std::optional< double > create_new_trial_state (int reaction_id)
 Carry out a reaction MC move and calculate the new potential energy.
 
double make_reaction_mc_move_attempt (int reaction_id, double bf, double E_pot_old, double E_pot_new)
 Accept or reject a reaction MC move made by create_new_trial_state based on a probability acceptance bf.
 
bool make_displacement_mc_move_attempt (int type, int n_particles)
 Attempt displacement MC moves for particles of a given type.
 
double calculate_potential_energy () const
 Compute the system potential energy.
 
int i_random (int maxint)
 draws a random integer from the uniform distribution in the range [0,maxint-1]
 

Additional Inherited Members

- Public Attributes inherited from ReactionMethods::ReactionAlgorithm
std::vector< std::shared_ptr< SingleReaction > > reactions
 
std::unordered_map< int, double > charges_of_types
 
double kT
 
double exclusion_range
 Hard sphere radius.
 
std::unordered_map< int, double > exclusion_radius_per_type
 
double volume
 
int non_interacting_type = 100
 
int m_accepted_configurational_MC_moves = 0
 
int m_tried_configurational_MC_moves = 0
 
bool particle_inside_exclusion_range_touched = false
 
bool neighbor_search_order_n = true
 
- Protected Member Functions inherited from ReactionMethods::ReactionAlgorithm
void restore_old_system_state ()
 Restore last valid system state.
 
void clear_old_system_state ()
 Clear last valid system state.
 
auto & make_new_system_state ()
 Open new handle for system state tracking.
 
void displacement_mc_move (int type, int n_particles)
 Carry out displacement MC moves for particles of a given type.
 
void make_reaction_attempt (::ReactionMethods::SingleReaction const &reaction, ParticleChanges &bookkeeping)
 Carry out a chemical reaction and save the old system state.
 
bool all_reactant_particles_exist (SingleReaction const &current_reaction) const
 Checks whether all particles exist for the provided reaction.
 
Utils::Vector3d get_random_position_in_box ()
 Writes a random position inside the central box into the provided array.
 
- Protected Attributes inherited from ReactionMethods::ReactionAlgorithm
std::vector< int > m_empty_p_ids_smaller_than_max_seen_particle
 
std::shared_ptr< ParticleChangesm_system_changes
 

Detailed Description

Reaction ensemble method.

Works for the reaction ensemble at constant volume and temperature. For the reaction ensemble at constant pressure, additionally employ a barostat! NOTE: a chemical reaction consists of a forward and backward reaction. Here both reactions have to be defined separately. The extent of the reaction is here chosen to be +1. If the reaction trial move for a dissociation of HA is accepted then there is one more dissociated ion pair H+ and A-. Implementation of [37].

Definition at line 37 of file core/reaction_methods/ReactionEnsemble.hpp.

Constructor & Destructor Documentation

◆ ReactionEnsemble()

ReactionMethods::ReactionEnsemble::ReactionEnsemble ( boost::mpi::communicator const &  comm,
int  seed,
double  kT,
double  exclusion_radius,
const std::unordered_map< int, double > &  exclusion_radius_per_type 
)
inline

Definition at line 39 of file core/reaction_methods/ReactionEnsemble.hpp.


The documentation for this class was generated from the following file: