org.opensourcephysics.sip.ch08.md
Class LJParticlesApp

java.lang.Object
  extended by org.opensourcephysics.controls.AbstractAnimation
      extended by org.opensourcephysics.controls.AbstractSimulation
          extended by org.opensourcephysics.sip.ch08.md.LJParticlesApp
All Implemented Interfaces:
java.lang.Runnable, Animation, Simulation

public class LJParticlesApp
extends AbstractSimulation

LJParticlesApp simulates a two-dimensional system of interacting particles via the Lennard-Jones potential.


Field Summary
 
Fields inherited from class org.opensourcephysics.controls.AbstractSimulation
control, showStepsPerDisplay, stepCounter, stepsPerDisplay
 
Fields inherited from class org.opensourcephysics.controls.AbstractAnimation
animationThread, decimalFormat, delayTime, mainFrame
 
Constructor Summary
LJParticlesApp()
           
 
Method Summary
 void doStep()
          Does a simulation step and appends data to the views.
static XML.ObjectLoader getLoader()
          Returns an XML.ObjectLoader to save and load data for this program.
 void initialize()
          Initializes the model by reading the number of particles.
static void main(java.lang.String[] args)
          Starts the Java application.
 void reset()
          Resets the LJ model to its default state.
 void resetData()
          Resets the LJ model and the data graphs.
 void startRunning()
          Reads adjustable parameters before the program starts running.
 void stop()
          Prints the LJ model's data after the simulation has stopped.
 
Methods inherited from class org.opensourcephysics.controls.AbstractSimulation
enableStepsPerDisplay, getControl, getStepCounter, getStepsPerDisplay, initializeAnimation, resetAnimation, run, setControl, setStepsPerDisplay, start, startAnimation, startSimulation, stepAnimation, stopAnimation, stopRunning, stopSimulation
 
Methods inherited from class org.opensourcephysics.controls.AbstractAnimation
addChildFrame, clearChildFrames, getChildFrames, getDelayTime, getMainFrame, getOSPApp, isRunning, setDelayTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensourcephysics.controls.Simulation
isRunning
 

Constructor Detail

LJParticlesApp

public LJParticlesApp()
Method Detail

initialize

public void initialize()
Initializes the model by reading the number of particles.

Overrides:
initialize in class AbstractSimulation

doStep

public void doStep()
Does a simulation step and appends data to the views.

Specified by:
doStep in class AbstractAnimation

stop

public void stop()
Prints the LJ model's data after the simulation has stopped.

Overrides:
stop in class AbstractSimulation

startRunning

public void startRunning()
Reads adjustable parameters before the program starts running.

Overrides:
startRunning in class AbstractSimulation

reset

public void reset()
Resets the LJ model to its default state.

Overrides:
reset in class AbstractSimulation

resetData

public void resetData()
Resets the LJ model and the data graphs. This method is invoked using a custom button.


getLoader

public static XML.ObjectLoader getLoader()
Returns an XML.ObjectLoader to save and load data for this program. LJParticle data can now be saved using the Save menu item in the control.

Returns:
the object loader

main

public static void main(java.lang.String[] args)
Starts the Java application.

Parameters:
args - command line parameters