19#ifndef REACTION_METHODS_WIDOM_INSERTION_HPP
20#define REACTION_METHODS_WIDOM_INSERTION_HPP
24#include <unordered_map>
33 boost::mpi::communicator
const &comm,
int seed,
double kT,
42 throw std::runtime_error(
"Trying to remove some non-existing particles "
43 "from the system via the inverse Widom scheme.");
53 return E_pot_new - E_pot_old;
Base class for reaction ensemble methods.
double calculate_potential_energy() const
Compute the system potential energy.
void make_reaction_attempt(::ReactionMethods::SingleReaction const &reaction, ParticleChanges &bookkeeping)
Carry out a chemical reaction and save the old system state.
std::unordered_map< int, double > exclusion_radius_per_type
void setup_bookkeeping_of_empty_pids()
Cleans the list of empty pids and searches for empty pid in the system.
void restore_old_system_state()
Restore last valid system state.
bool all_reactant_particles_exist(SingleReaction const ¤t_reaction) const
Checks whether all particles exist for the provided reaction.
auto & make_new_system_state()
Open new handle for system state tracking.
std::vector< std::shared_ptr< SingleReaction > > reactions
double exclusion_range
Hard sphere radius.
WidomInsertion(boost::mpi::communicator const &comm, int seed, double kT, double exclusion_range, const std::unordered_map< int, double > &exclusion_radius_per_type)
double calculate_particle_insertion_potential_energy(int reaction_id)