Class molecular.TwoEnsembles
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----java.applet.Applet
|
+----sTools.SApplet
|
+----molecular.TwoEnsembles
- public class TwoEnsembles
- extends SApplet
TwoEnsembles()
-
addParticleDataSource(int)
-
addParticleL(double,
double, double, double, double)
- Adds one particle to the ensemble
addParticleR(double,
double, double, double, double)
- Adds one particle to the ensemble
createParticlesL(int)
-
createParticlesR(int)
-
forward()
- Start the animation
getAppletInfo()
-
getBWPos()
- Returns the bottom wall position
getEnsembleLeftID()
- Returns the id of the left ensemble.
getEnsembleRightID()
- Returns the id of the right ensemble.
getHistogramLeftID(int, double,
double)
- Returns the id of the velocity histogram of the left ensemble.
getHistogramRightID(int,
double, double)
- Returns the id of the velocity histogram of the right ensemble.
getLWPos()
- Returns the left wall position
getParameter(String,
String)
-
getParameterInfo()
-
getRWPos()
- Returns the right wall position
getTWPos()
- Returns the top wall position
init()
-
pause()
- Stop the animation
removeParticle(int)
- Removes ith particle from ensemble
removeWallTemp(String)
-
setAutoRefresh(boolean)
-
setBackgroundRGBL(int, int, int)
- Sets Background color inside left ensemble
setBackgroundRGBR(int, int, int)
- Sets Background color inside right ensemble
setBoltzmann(double)
-
setDefault()
-
setDefaultColor(int, int, int)
- Sets default color when adding new particles.
setDefaultMass(double)
- Sets default mass when adding new particles.
setDefaultSize(double)
- Sets default size when adding new particles.
setDefaultTemp(double)
-
setDt(double)
- Sets calculation time step
setFPS(int)
- Sets frames per second of animation
setMaxParticles(int)
- Sets maximum number of particles that can be stored in arrays of each ensemble
setParticleMass(int, double)
- Sets mass of particle default value is 1 unit.
setParticlePos(int, double, double)
- Sets Position of particle
setParticleRGBL(int, int, int, int)
- Sets color of particles in Right ensemble
setParticleRGBR(int, int, int, int)
- Sets color of particles in left ensemble
setParticleSize(int, double)
- Sets size of particle default value is 1 in world units.
setParticlesL(int)
-
setParticlesR(int)
-
setParticleVel(int, double, double)
- Sets Velocity of particle
setPeriodicH(boolean)
- Sets Periodic periodic boundary conditions in horizontal direction
setPeriodicV(boolean)
- Sets Periodic periodic boundary conditions ion vertical direction
setPistonMass(double)
- Sets mass of piston between two ensembles
setPistonWidth(double)
- Sets width of piston between two ensembles
setPpu(int)
- Sets pixels per unit of ensemble
setShowControls(boolean)
- Shows or hides control panel
setTemperatureL(double, int)
- Set the temperature of the ensemble in n steps.
setTemperatureR(double, int)
- Set the temperature of the right ensemble in n steps.
setTempL(double)
- Set the temperature of the ensemble in one step.
setTempR(double)
- Set the temperature of the ensemble in one step.
setWallTempL(String, double)
- Sets wall temperature for walls in left ensemble
setWallTempR(String, double)
- Sets wall temperature for walls in right ensemble
start()
-
stepForward()
- Steps simulation forward one time step

TwoEnsembles
public TwoEnsembles()

getParameter
public String getParameter(String key,
String def)

init
public void init()
- Overrides:
- init in class Applet

getAppletInfo
public String getAppletInfo()
- Overrides:
- getAppletInfo in class Applet

getParameterInfo
public String[][] getParameterInfo()
- Overrides:
- getParameterInfo in class
Applet

start
public void start()
- Overrides:
- start in class Applet

setShowControls
public void setShowControls(boolean s)
- Shows or hides control panel
- Parameters:
- s - boolean

setDefault
public void setDefault()

pause
public void pause()
- Stop the animation

forward
public void forward()
- Start the animation

stepForward
public void stepForward()
- Steps simulation forward one time step

addParticleL
public int addParticleL(double xin,
double yin,
double xvel,
double yvel,
double r)
- Adds one particle to the ensemble
- Parameters:
- xin - double initial xposition
- yin - double initial yposition
- xvel - double initial x-velocity
- yvel - double initial y-velocity
- r - double particle radius
- Returns:
- s int new particle number

addParticleR
public int addParticleR(double xin,
double yin,
double xvel,
double yvel,
double r)
- Adds one particle to the ensemble
- Parameters:
- xin - double initial xposition
- yin - double initial yposition
- xvel - double initial x-velocity
- yvel - double initial y-velocity
- r - double particle radius
- Returns:
- s int new particle number

createParticlesL
public void createParticlesL(int n)

createParticlesR
public void createParticlesR(int n)

removeParticle
public void removeParticle(int i)
- Removes ith particle from ensemble
- Parameters:
- i - int particle number

setParticlesL
public void setParticlesL(int n)

setParticlesR
public void setParticlesR(int n)

setMaxParticles
public void setMaxParticles(int p)
- Sets maximum number of particles that can be stored in arrays of each ensemble
- Parameters:
- p - max particles

setPistonWidth
public void setPistonWidth(double w)
- Sets width of piston between two ensembles
- Parameters:
- w - double default is 3.

setPistonMass
public void setPistonMass(double m)
- Sets mass of piston between two ensembles
- Parameters:
- m - double default is 100.

setBackgroundRGBL
public void setBackgroundRGBL(int r,
int g,
int b)
- Sets Background color inside left ensemble
- Parameters:
- r - int red
- g - int green
- b - int blue

setBackgroundRGBR
public void setBackgroundRGBR(int r,
int g,
int b)
- Sets Background color inside right ensemble
- Parameters:
- r - int red
- g - int green
- b - int blue

setDefaultMass
public void setDefaultMass(double m)
- Sets default mass when adding new particles. All particles created after calling this
method will have this mass
- Parameters:
- m - double mass

setDefaultSize
public void setDefaultSize(double r)
- Sets default size when adding new particles. All particles created after calling this
method will have this radius
- Parameters:
- r - double radius

setDefaultColor
public void setDefaultColor(int r,
int g,
int b)
- Sets default color when adding new particles. All particles created after calling this
method will have this color
- Parameters:
- r - int red
- g - int green
- b - int blue

setTempL
public void setTempL(double temp)
- Set the temperature of the ensemble in one step.
- Parameters:
- temp - double The new temperature.

setTemperatureL
public void setTemperatureL(double temp,
int steps)
- Set the temperature of the ensemble in n steps. Data will be sent to data listeners
after each step.
- Parameters:
- temp - double The new temperature.
- steps - int The number of steps.

setTempR
public void setTempR(double temp)
- Set the temperature of the ensemble in one step.
- Parameters:
- temp - double The new temperature.

setTemperatureR
public void setTemperatureR(double temp,
int steps)
- Set the temperature of the right ensemble in n steps. Data will be sent to data
listeners after each step.
- Parameters:
- temp - double The new temperature.
- steps - int The number of steps.

setDefaultTemp
public void setDefaultTemp(double t)

setParticleRGBR
public void setParticleRGBR(int i,
int rd,
int gr,
int bl)
- Sets color of particles in left ensemble
- Parameters:
- i - int particle number
- rd - int red value (
gr - int green value (
bl - int blue value (
setParticleRGBL
public void setParticleRGBL(int i,
int rd,
int gr,
int bl)
- Sets color of particles in Right ensemble
- Parameters:
- i - int particle number
- rd - int red value (
gr - int green value (
bl - int blue value (
setParticleMass
public void setParticleMass(int i,
double m)
- Sets mass of particle default value is 1 unit.
- Parameters:
- i - int particle number
- m - double mass.
setParticlePos
public void setParticlePos(int i,
double xin,
double yin)
- Sets Position of particle
- Parameters:
- i - int particle number
- xin - double initial x-position
- yin - double initial y-position
setParticleVel
public void setParticleVel(int i,
double xvel,
double yvel)
- Sets Velocity of particle
- Parameters:
- i - int particle number
- xvel - double initial x-velocity
- yvel - double initial y-velocity
setParticleSize
public void setParticleSize(int i,
double s)
- Sets size of particle default value is 1 in world units.
- Parameters:
- i - int particle number
- s - double size.
addParticleDataSource
public int addParticleDataSource(int i)
setFPS
public void setFPS(int f)
- Sets frames per second of animation
- Parameters:
- f - int
setAutoRefresh
public void setAutoRefresh(boolean ar)
setDt
public void setDt(double d)
- Sets calculation time step
- Parameters:
- d - double timestep dt
setBoltzmann
public void setBoltzmann(double kb)
setWallTempR
public void setWallTempR(String wall,
double t)
- Sets wall temperature for walls in right ensemble
setWallTempL
public void setWallTempL(String wall,
double t)
- Sets wall temperature for walls in left ensemble
removeWallTemp
public void removeWallTemp(String wall)
setPpu
public void setPpu(int p)
- Sets pixels per unit of ensemble
- Parameters:
- p - int
setPeriodicH
public void setPeriodicH(boolean p)
- Sets Periodic periodic boundary conditions in horizontal direction
- Parameters:
- p - boolean
setPeriodicV
public void setPeriodicV(boolean p)
- Sets Periodic periodic boundary conditions ion vertical direction
- Parameters:
- p - boolean
getRWPos
public double getRWPos()
- Returns the right wall position
- Returns:
- double
getLWPos
public double getLWPos()
- Returns the left wall position
- Returns:
- double
getTWPos
public double getTWPos()
- Returns the top wall position
- Returns:
- double
getBWPos
public double getBWPos()
- Returns the bottom wall position
- Returns:
- double
getEnsembleLeftID
public int getEnsembleLeftID()
- Returns the id of the left ensemble. This id can be used to make data connections.
- Returns:
- int The id.
getEnsembleRightID
public int getEnsembleRightID()
- Returns the id of the right ensemble. This id can be used to make data connections.
- Returns:
- int The id.
getHistogramLeftID
public int getHistogramLeftID(int nbins,
double vmin,
double vmax)
- Returns the id of the velocity histogram of the left ensemble. This id can be used to
make data connections.
- Parameters:
- nbins - int The number of bins in the histogram.
- min - double The minimum velocity
- max - double The maximum velocity
- Returns:
- int The id.
getHistogramRightID
public int getHistogramRightID(int nbins,
double vmin,
double vmax)
- Returns the id of the velocity histogram of the right ensemble. This id can be used to
make data connections.
- Parameters:
- nbins - int The number of bins in the histogram.
- min - double The minimum velocity
- max - double The maximum velocity
- Returns:
- int The id.