molecular
Class MolecularMembrane

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byjava.applet.Applet
                  extended byedu.davidson.tools.SApplet
                      extended bymolecular.MolecularMembrane
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class MolecularMembrane
extends SApplet

Class MolecularMembrane

See Also:
Serialized Form

Field Summary
 
Fields inherited from class edu.davidson.tools.SApplet
destroyed
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Method Summary
 void addCaption(java.lang.String cap)
          Adds a title to ensemble in top-center
 int addParticleDataSourceL(int i)
          Make a particle in the left ensemble into a data source.
 int addParticleDataSourceR(int i)
          Make a particle in the right ensemble into a data source.
 int addParticleL(double xin, double yin, double xvel, double yvel, double r)
          Adds one particle to the ensemble
 int addParticleR(double xin, double yin, double xvel, double yvel, double r)
          Adds one particle to the ensemble
 void createParticlesL(int n)
          Method createParticlesL
 void createParticlesR(int n)
          Method createParticlesR
 void forward()
          Start the animation
 double getBWPos()
          Returns the bottom wall position
 int getEnsembleLeftID()
          Returns the id of the left ensemble.
 int getEnsembleRightID()
          Returns the id of theright ensemble.
 int getHistogramLeftID(int nbins, double vmin, double vmax)
          Returns the id of the velocity histogram of the left ensemble.
 int getHistogramRightID(int nbins, double vmin, double vmax)
          Returns the id of the velocity histogram of the right ensemble.
 double getLWPos()
          Returns the left wall position
 double getRWPos()
          Returns the right wall position
 double getTWPos()
          Returns the top wall position
 void pause()
          Stop the animation
 void removeParticle(int i)
          Removes ith particle from ensemble
 void removeWallTemp(java.lang.String wall)
          Method removeWallTemp
 void setAutoRefresh(boolean ar)
          Method setAutoRefresh
 void setBackgroundRGBL(int r, int g, int b)
          Sets Background color inside left ensemble
 void setBackgroundRGBR(int r, int g, int b)
          Sets Background color inside right ensemble
 void setBoltzmann(double kb)
          Method setBoltzmann
 void setDefault()
          Method setDefault
 void setDefaultColor(int r, int g, int b)
          Sets default color when adding new particles.
 void setDefaultMass(double m)
          Sets default mass when adding new particles.
 void setDefaultSize(double r)
          Sets default size when adding new particles.
 void setDefaultTemp(double t)
          Method setDefaultTemp
 void setDisplayOffset(int xoff, int yoff)
          Sets offsets for title
 void setDt(double dt)
          Sets calculation time step
 void setFPS(int f)
          Sets frames per second of animation
 void setMaxParticles(int p)
          Sets maximum number of particles that can be stored in arrays of each ensemble
 void setMessage(java.lang.String msg)
          Adds a message to small yellow box opposite coordinate display.
 void setParticleMassL(int i, double m)
          Sets mass of a particle in the left ensemble Default mass is 1.
 void setParticleMassR(int i, double m)
          Sets mass of a particle in the right ensemble Default mass is 1.
 void setParticlePosL(int i, double xin, double yin)
          Sets Position of a particle in the left ensemble
 void setParticlePosR(int i, double xin, double yin)
          Sets Position of a particle in the right ensemble
 void setParticleRGBL(int i, int rd, int gr, int bl)
          Sets color of particles in Right ensemble
 void setParticleRGBR(int i, int rd, int gr, int bl)
          Sets color of particles in left ensemble
 void setParticleSizeL(int i, double s)
          Sets size of a particle in the left ensemble.
 void setParticleSizeR(int i, double s)
          Sets size of a particle in the left ensemble.
 void setParticlesL(int n)
          Method setParticlesL
 void setParticlesR(int n)
          Method setParticlesR
 void setParticleVelL(int i, double xvel, double yvel)
          Sets Velocity of a particle in the left ensemble.
 void setParticleVelR(int i, double xvel, double yvel)
          Sets Velocity of a particle in the right ensemble.
 void setPeriodicV(boolean p)
          Sets Periodic periodic boundary conditions ion vertical direction
 void setPistonWidth(double w)
          Sets width of piston between two ensembles
 void setPpu(int p)
          Sets pixels per unit of ensemble
 void setProbabilityFunction(java.lang.String str)
          Sets probability of particle passing through membrane function must go between 0 and 1.
 void setRGB(int r, int g, int b)
          Sets color of title
 void setShowControls(boolean s)
          Shows or hides control panel
 void setTemperatureL(double temp, int steps)
          Set the temperature of the ensemble in n steps.
 void setTemperatureR(double temp, int steps)
          Set the temperature of the right ensemble in n steps.
 void setTempL(double temp)
          Set the temperature of the ensemble in one step.
 void setTempR(double temp)
          Set the temperature of the ensemble in one step.
 void setWallTempL(java.lang.String wall, double t)
          Sets wall temperature for walls in left ensemble
 void setWallTempR(java.lang.String wall, double t)
          Sets wall temperature for walls in right ensemble
 void stepForward()
          Steps simulation forward one time step
 
Methods inherited from class edu.davidson.tools.SApplet
addDataListener, addDataSource, checkAppletNames, cleanupDataConnections, clearAllData, clearData, deleteDataConnection, deleteDataConnections, formatValue, getAppletName, getClockID, getClockTime, getDataFromDS, getDataListener, getDataSource, getDataSource, getDebugLevel, getID, getSourceData, getSourceVariables, isClockRunning, isValidFunction, makeDataConnection, removeDataListener, removeDataSource, reset, reverse, sendDataToListener, setClockContinous, setClockCycle, setClockOneShot, setClockTime, setConnectionBlock, setConnectionListener, setConnectionSmoothing, setConnectionSource, setConnectionStride, setConnectionWindowX, setConnectionWindowY, setDebugLevel, setExternalClock, setFPS, setIndependentClock, setTimeContinuous, setTimeCycle, setTimeOneShot, startClock, stepClock, stepTime, stepTimeBack, stepTimeForward, stop, stopClock, updateDataConnection, updateDataConnections
 
Methods inherited from class java.applet.Applet
destroy, getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, init, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

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.

setShowControls

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

Parameters:
s - boolean

setMessage

public void setMessage(java.lang.String msg)
Adds a message to small yellow box opposite coordinate display.

Parameters:
msg - String

setDisplayOffset

public void setDisplayOffset(int xoff,
                             int yoff)
Sets offsets for title

Parameters:
xoff -
yoff -

setRGB

public void setRGB(int r,
                   int g,
                   int b)
Sets color of title

Parameters:
r - int red
g - int green
b - int blue

addCaption

public void addCaption(java.lang.String cap)
Adds a title to ensemble in top-center

Parameters:
cap - String

setDefault

public void setDefault()
Method setDefault

Overrides:
setDefault in class SApplet

pause

public void pause()
Stop the animation

Overrides:
pause in class SApplet

forward

public void forward()
Start the animation

Overrides:
forward in class SApplet

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:
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:
int new particle number

createParticlesL

public void createParticlesL(int n)
Method createParticlesL

Parameters:
n -

createParticlesR

public void createParticlesR(int n)
Method createParticlesR

Parameters:
n -

removeParticle

public void removeParticle(int i)
Removes ith particle from ensemble

Parameters:
i - int particle number

setParticlesL

public void setParticlesL(int n)
Method setParticlesL

Parameters:
n -

setParticlesR

public void setParticlesR(int n)
Method setParticlesR

Parameters:
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.

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

setDefaultTemp

public void setDefaultTemp(double t)
Method setDefaultTemp

Parameters:
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 (<256)
gr - int green value (<256)
bl - int blue value (<256)

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 (<256)
gr - int green value (<256)
bl - int blue value (<256)

setParticleMassL

public void setParticleMassL(int i,
                             double m)
Sets mass of a particle in the left ensemble Default mass is 1.

Parameters:
i - int particle number
m - double mass.

setParticleMassR

public void setParticleMassR(int i,
                             double m)
Sets mass of a particle in the right ensemble Default mass is 1.

Parameters:
i - int particle number
m - double mass.

setProbabilityFunction

public void setProbabilityFunction(java.lang.String str)
Sets probability of particle passing through membrane function must go between 0 and 1.

Parameters:
str - String function of mass

setParticlePosL

public void setParticlePosL(int i,
                            double xin,
                            double yin)
Sets Position of a particle in the left ensemble

Parameters:
i - int particle number
xin - double initial x-position
yin - double initial y-position

setParticlePosR

public void setParticlePosR(int i,
                            double xin,
                            double yin)
Sets Position of a particle in the right ensemble

Parameters:
i - int particle number
xin - double initial x-position
yin - double initial y-position

setParticleVelL

public void setParticleVelL(int i,
                            double xvel,
                            double yvel)
Sets Velocity of a particle in the left ensemble.

Parameters:
i - int particle number
xvel - double initial x-velocity
yvel - double initial y-velocity

setParticleVelR

public void setParticleVelR(int i,
                            double xvel,
                            double yvel)
Sets Velocity of a particle in the right ensemble.

Parameters:
i - int particle number
xvel - double initial x-velocity
yvel - double initial y-velocity

setParticleSizeL

public void setParticleSizeL(int i,
                             double s)
Sets size of a particle in the left ensemble. Default size is 1 in world units.

Parameters:
i - int particle number
s - double size.

setParticleSizeR

public void setParticleSizeR(int i,
                             double s)
Sets size of a particle in the left ensemble. Default size is 1 in world units.

Parameters:
i - int particle number
s - double size.

addParticleDataSourceL

public int addParticleDataSourceL(int i)
Make a particle in the left ensemble into a data source.

Parameters:
i - int particle number
Returns:
the id

addParticleDataSourceR

public int addParticleDataSourceR(int i)
Make a particle in the right ensemble into a data source.

Parameters:
i - int particle number
Returns:
the data source id

setFPS

public void setFPS(int f)
Sets frames per second of animation

Parameters:
f - int

setAutoRefresh

public void setAutoRefresh(boolean ar)
Method setAutoRefresh

Overrides:
setAutoRefresh in class SApplet
Parameters:
ar -

setDt

public void setDt(double dt)
Sets calculation time step

Overrides:
setDt in class SApplet
Parameters:
dt - double timestep

setBoltzmann

public void setBoltzmann(double kb)
Method setBoltzmann

Parameters:
kb -

setWallTempR

public void setWallTempR(java.lang.String wall,
                         double t)
Sets wall temperature for walls in right ensemble

Parameters:
wall -
t -

setWallTempL

public void setWallTempL(java.lang.String wall,
                         double t)
Sets wall temperature for walls in left ensemble

Parameters:
wall -
t -

removeWallTemp

public void removeWallTemp(java.lang.String wall)
Method removeWallTemp

Parameters:
wall -

setPpu

public void setPpu(int p)
Sets pixels per unit of ensemble

Parameters:
p - int

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 theright 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.
vmin -
vmax -
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.
vmin -
vmax -
Returns:
int The id.


Visit the Davidson College Physlet Site for additional information.