Skip to content

Commit

Permalink
update forces when LJ parameters change, see #278
Browse files Browse the repository at this point in the history
  • Loading branch information
jbphet committed Jun 10, 2020
1 parent c01df54 commit 658b205
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions js/atomic-interactions/model/DualAtomModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ class DualAtomModel {
this.setEpsilon( interactionStrength );
this.setAdjustableAtomSigma( atomDiameter );
}
this.updateForces();
}
);

Expand Down Expand Up @@ -276,16 +277,10 @@ class DualAtomModel {
*/
step( dt ) {

// If dt is excessively large, ignore it - it probably means the user returned to the tab after the tab or the
// browser was hidden for a while.
if ( dt > 1.0 ) {
return;
}

if ( this.isPlayingProperty.get() ) {

// Using real world time for this results in the atoms moving a little slowly, so the time step is adjusted
// here. The multipliers were empirically determined.
// Using real world time for this results in the atoms moving a little slowly, so the time step is adjusted here.
// The multipliers were empirically determined.
let adjustedTimeStep;
if ( this.timeSpeedProperty.value === TimeSpeed.SLOW ) {
adjustedTimeStep = dt * SLOW_MOTION_TIME_MULTIPLIER;
Expand Down

0 comments on commit 658b205

Please sign in to comment.