Browse files

Merge pull request #1512 from helvrud/calc_re

reaction ensemble; thanks to Jonas
  • Loading branch information...
fweik committed Oct 11, 2017
2 parents dc65e50 + db61094 commit 3f30deb1ca7b8d7f4fe1b3a4cd1adf5576d43e41
@@ -33,9 +33,11 @@ ReactionEnsemble::~ReactionEnsemble(){
* Performs a randomly selected reaction in the reaction ensemble
int ReactionEnsemble::do_reaction(){
int reaction_id=i_random(m_current_reaction_system.nr_single_reactions);
generic_oneway_reaction(reaction_id, reaction_ensemble_mode);
int ReactionEnsemble::do_reaction(int reaction_steps){
for (int i = 0; i< reaction_steps; i++){
int reaction_id=i_random(m_current_reaction_system.nr_single_reactions);
generic_oneway_reaction(reaction_id, reaction_ensemble_mode);
return 0;
@@ -143,7 +143,7 @@ class ReactionEnsemble {
bool m_system_is_in_1_over_t_regime = false;
void set_cuboid_reaction_ensemble_volume();
int do_reaction();
int do_reaction(int reaction_steps);
int check_reaction_ensemble();
int calculate_nu_bar(int *reactant_coefficients, int len_reactant_types,
int *product_coefficients,
@@ -73,7 +73,7 @@ cdef extern from "reaction_ensemble.hpp" namespace "ReactionEnsemble":
cdef cppclass c_reaction_ensemble "ReactionEnsemble::ReactionEnsemble":
reaction_system m_current_reaction_system
int do_reaction() except +
int do_reaction(int reaction_steps) except +
bool do_global_mc_move_for_particles_of_type(int type, int start_id_polymer, int end_id_polymer, int particle_number_of_type, bool use_wang_landau)
int find_index_of_type(int type) except +
void set_cuboid_reaction_ensemble_volume()
@@ -207,11 +207,17 @@ IF REACTION_ENSEMBLE:
raise ValueError("No dictionary for relation between types and default charges provided.")
def reaction(self):
def reaction(self, reaction_steps = 1):
performs one randomly selected reaction of the provided reaction system
performs randomly selected reactions of the provided reaction system
reaction_steps : int
the number of reactions to be performed at once, defaults to 1
def global_mc_move_for_one_particle_of_type(type_mc):

0 comments on commit 3f30deb

Please sign in to comment.