Skip to content

Commit

Permalink
account for the particle mass in the RE MC move
Browse files Browse the repository at this point in the history
  • Loading branch information
thepith committed Nov 27, 2018
1 parent a28b747 commit 670a4df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/core/reaction_ensemble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -832,10 +832,10 @@ bool ReactionAlgorithm::do_global_mc_move_for_particles_of_type(
// change particle position
new_pos = get_random_position_in_box();
double vel[3];
// we use mass=1 for all particles, think about adapting this
vel[0] = std::sqrt(temperature) * gaussian_random();
vel[1] = std::sqrt(temperature) * gaussian_random();
vel[2] = std::sqrt(temperature) * gaussian_random();
auto const &p = get_particle_data(p_id);
vel[0] = std::sqrt(temperature / p.p.mass) * gaussian_random();
vel[1] = std::sqrt(temperature / p.p.mass) * gaussian_random();
vel[2] = std::sqrt(temperature / p.p.mass) * gaussian_random();
set_particle_v(p_id, vel);
// new_pos=get_random_position_in_box_enhanced_proposal_of_small_radii();
// //enhanced proposal of small radii
Expand Down
5 changes: 3 additions & 2 deletions src/python/espressomd/reaction_ensemble.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ cdef class ReactionAlgorithm(object):
reaction algorithm by setting the standard pressure, temperature, and the
exclusion radius.
Note: When setting the velocities of the particles according the the
Maxwell distribution the mass of all particles is assumed to equal 1.
Note: When creating particles the velocities the new particles are set
according the Maxwell distribution. In this step the mass of the new particle
is assumed to equal 1.
Parameters
Expand Down

0 comments on commit 670a4df

Please sign in to comment.