|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
electronDensity.ElectronDensity
public class ElectronDensity
Electron Density Plot
Copyright (c) 2000-2001,2009 David N. Blauch
ElectronDensity.class is an applet that displays electron density plots for a wave function.
Applet Parameters
| NAME | Variable Type | Default | Description |
|---|---|---|---|
| AutoPlot | boolean | true | If true, the plot is automatically updated after every change in settings. Otherwise the plot is updated only when the replot method is called. |
| BackgroundMode | boolean | true | If true, the background is black; otherwise, the background is white. |
| Brightness | double | 1.0 | Adjusts the brightness of the display. |
| ComplexMode | int | 0 | This parameter controls the electron density plot when the wave function
itself is being displayed. 0 = display real component of the wave function (default) 1 = display imaginary component of the wave function 2 = display the absolute value of the wave function For mode 2 (absolute value of the wave function), if the display sign option is false, the electron density plot is displayed in the positive color in all regions. If the display sign option is true, the color is based upon the phase angle. The pure positive color represents a purely real wave function (Im = 0); the pure negative color represents a purely imaginary wave function (Re = 0). |
| DensityMode | int | 0 | 0 = display psi*psi (default) (psi = wave function) 1 = display the wave function itself |
| DisplaySign | boolean | true | If true, different colors are used to represent regions where the wave function is positive and negative in value. If false, the same color (that for positive regions) is used throughout the plot. |
| Interpolate | int | -1 | For large displays and complicated wave functions, the time required to create
the electron density plot can be lengthy. To speed execution, the wave function is
evaluated on a coarse grid and interpolation is used to estimate the wave function
at intervening points. The value of the Interpolate parameter is the number of
points in a linear interval that are obtained by interpolation for every explicit
evaluation of the wave function. A value of 0 correponds to no interpolation. A
value of -1 (default) instructs the applet to select a value (0, 1, 2, 3, or 4).
For plots with intricate detail, no interpolation (0) should be employed. Unless a plot is very large, requires extensive computations for the evaluation of the wave function, and has no fine features, interpolations above 2 should be avoided. For problems sufficiently large that the majority of the computational time is required to compute the wave function at each point, the following speed-up factors may be expected: 0 = 1x, 1 = 4x, 2 = 9x, 3 = 16x, and 4 = 25x. For small problems, the performance enhancement will be smaller, because the overhead for computing the pixel map is independent of the degree of interpolation. For even simple wave functions (e.g., 1s orbital), over 95% of the computational time is devoted to computing wave function values when no interpolation (0) is employed. For very complicated problems, more than 99% of the computational time is devoted to computing wave function values. Thus interpolation, even with a setting of 1 or 2, provides a very significant increase in speed. |
| IsReady | String | JavaScript variable that will be set to true when applet has initialized. Must use MAYSCRIPT in APPLET tag to use this feature. | |
| Orbital | String | 1s | This parameter specifies the orbital used to construct the electron density plot. The string follows the usual chemical notation for hydrogen atom orbitals: 1s (default), 2s, 2px, 3dz2, 4dx2-y2, etc. The following hybrid orbitals are available: sp, sp2, sp3, dsp2, dsp3ax (the axial orbital), dsp3eq (the equitorial orbital), and d2sp3. Not all hydrogen orbitals orbitals are available. |
| NegativeColor | String | #00FFFF | This parameter specifies the color used to display regions where the wave function is negative. The string is converted to an integer, which is used to create the color. The default color is a light blue. |
| PositiveColor | String | #FFFF00 | This parameter specifies the color used to display regions where the wave function is positive. The string is converted to an integer, which is used to create the color. The default color is yellow. |
| ShowControls | boolean | true | If true, controls are provided at the bottom of the applet to manually enter values for n, l, and m (i.e., the quantum numbers). If false, no controls are displayed. |
| ShowAxes | boolean | false | If true, vertical and horizontal axes are shown. Regardless of the value of this parameter, no axes are shown if the plot does not lie in the xy, xz, or yz plane. |
| ViewAlong | char | Y | Sets axis (x, y, or z) along which the display is viewed. |
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.BaselineResizeBehavior |
| Field Summary |
|---|
| 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 |
| Constructor Summary | |
|---|---|
ElectronDensity()
|
|
| Method Summary | |
|---|---|
void |
addCircle(double _x,
double _y,
int _dia,
boolean _fill)
Adds a circle to the electron density plot. |
void |
addCircle(double _x,
double _y,
int _dia,
boolean _fill,
int _red,
int _green,
int _blue)
Adds a circle to the electron density plot. |
void |
addGaussian(int id,
double _coefReal,
double _coefImag)
Adds an existing gaussian wave function to the collection of wave functions used to construct the hybrid orbital. |
void |
addNLM(int _n,
int _l,
int _m,
double _coefReal,
double _coefImag)
Adds a new hydrogenic wave function using the user-supplied quantum numbers. |
void |
addWaveFunction(WaveFunction _waveFunction,
double _coefReal,
double _coefImag)
Adds a new wave function to the collection of wave functions used to construct the hybrid orbital. |
void |
clearCircles()
Clears all circles |
void |
createGaussian(int id,
int nbr,
java.lang.String geometry)
Creates a Gaussian basis function with the given id number. |
void |
defineGaussian(int basisID,
int functionID,
double alpha,
double scale,
double coef)
Defines the parameters for a gaussian function in a gaussian basis function |
void |
destroy()
|
java.lang.String |
getAppletInfo()
|
double |
getMaxR()
Returns the current maximum displacement (in units of Zr/a) |
java.lang.String |
getParameter(java.lang.String key,
java.lang.String def)
|
java.lang.String[][] |
getParameterInfo()
|
double |
getRotationAngle()
Returns angle of rotation |
double |
getRotationX()
Returns the x coordinate for the axis of rotation. |
double |
getRotationY()
Returns the y coordinate for the axis of rotation. |
double |
getRotationZ()
Returns the z coordinate for the axis of rotation. |
void |
init()
|
void |
paint(java.awt.Graphics g)
|
void |
replot()
Replots the electron density plot. |
void |
resetView()
Resets the rotation vector to the default xy plane view |
void |
run()
|
void |
setAutoMaxR(boolean _autoMaxR)
Determines whether the maximum displacement is automatically estimated or is supplied by the user (default 3.0) |
void |
setAutoPlot(boolean _autoPlot)
Determines whether the plot is updated after every change in setting. |
void |
setBackgroundMode(boolean _backgroundMode)
Sets the background mode. |
void |
setBrightness(double _brightness)
Sets the brightness factor. |
void |
setColors(java.awt.Color _pos,
java.awt.Color _neg)
Sets the colors used in the electron density plot. |
void |
setColors(int _posRed,
int _posGreen,
int _posBlue,
int _negRed,
int _negGreen,
int _negBlue)
Sets the colors used in the electron density plot. |
void |
setComplexMode(int _mode)
Sets the display mode for complex values (occurs only when the density mode is 1, which displays the wave function itself). |
void |
setDensityMode(int _mode)
Sets the display mode (psi = wave function). |
void |
setDisplaySign(boolean _displaySign)
Determines whether the display shows the sign of the wave function. |
void |
setGaussian(int id)
Sets the wave function to be the previously defined gaussian basis function with the indicated id. |
void |
setGaussian(int id,
double _coefReal,
double _coefImag)
Sets the wave function to be the previously defined gaussian basis function with the indicated id. |
void |
setGaussianOrigin(int id,
double _r,
double _theta,
double _phi)
Sets the origin (in spherical coordinates) for the gaussian basis function |
void |
setGaussianOriginXYZ(int id,
double _x,
double _y,
double _z)
Sets the origin (in cartesian coordinates) for the gaussian basis function |
void |
setInterpolation(int _nbr)
Sets the interpolation level. |
void |
setMaxR(double _maxR)
Sets the maximum displacement to be used is autoMaxR = false. |
void |
setNLM(int _n,
int _l,
int _m)
Creates a new hydrogenic wave function using the user-supplied quantum numbers. |
void |
setNLM(int _n,
int _l,
int _m,
double _coefReal,
double _coefImag)
Creates a new hydrogenic wave function using the user-supplied quantum numbers. |
void |
setOrbital(java.lang.String _orbital)
Sets the orbital to be displayed. |
void |
setRotation(double _x,
double _y,
double _z,
double _a)
Sets the rotation parameters for the display. |
void |
setShowAxes(boolean _showAxes)
Sets the showAxes property. |
void |
setViewXY()
Sets the plot to display the xy plane |
void |
setViewXZ()
Sets the plot to display the xz plane |
void |
setViewYZ()
Sets the plot to display the xz plane |
void |
setWaveFunction(WaveFunction _waveFunction,
double _coefReal,
double _coefImag)
Creates a new hybrid wave function using the user-supplied wave function. |
void |
start()
|
void |
stop()
|
| Methods inherited from class java.applet.Applet |
|---|
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
| 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, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ElectronDensity()
| Method Detail |
|---|
public java.lang.String getParameter(java.lang.String key,
java.lang.String def)
public void init()
init in class java.applet.Appletpublic void start()
start in class java.applet.Appletpublic void stop()
stop in class java.applet.Appletpublic void paint(java.awt.Graphics g)
paint in class java.awt.Containerpublic void run()
run in interface java.lang.Runnablepublic void destroy()
destroy in class java.applet.Appletpublic java.lang.String getAppletInfo()
getAppletInfo in class java.applet.Appletpublic java.lang.String[][] getParameterInfo()
getParameterInfo in class java.applet.Applet
public void addCircle(double _x,
double _y,
int _dia,
boolean _fill)
_x - x position of circle center in normalized coordinates_y - y position of circle center in normalized coordinates_dia - diameter of circle in pixels_fill - if true the circle is filled
public void addCircle(double _x,
double _y,
int _dia,
boolean _fill,
int _red,
int _green,
int _blue)
_x - x position of circle center in normalized coordinates_y - y position of circle center in normalized coordinates_dia - diameter of circle in pixels_fill - if true the circle is filled_red - red component of the color_green - green component of the color_blue - blue component of the color
public void addGaussian(int id,
double _coefReal,
double _coefImag)
id - id number for a previously created gaussian basis function_coefReal - real component of the coefficient for constructing the hybrid wave function_coefImag - imaginary component of the coefficient for constructing the hybrid wave function
public void addNLM(int _n,
int _l,
int _m,
double _coefReal,
double _coefImag)
_n - principal quantum number_l - angular momentum quantum number_m - magnetic quantum number_coefReal - real component of the coefficient for constructing the hybrid wave function_coefImag - imaginary component of the coefficient for constructing the hybrid wave functionreplot()
public void addWaveFunction(WaveFunction _waveFunction,
double _coefReal,
double _coefImag)
The electron density plot for the new hybrid wave function is NOT displayed.
_coefReal - real component of the coefficient for constructing the hybrid wave function_coefImag - imaginary component of the coefficient for constructing the hybrid wave functionreplot()public void clearCircles()
public void createGaussian(int id,
int nbr,
java.lang.String geometry)
id - identification number for this gaussian basis functionnbr - number of gaussian functions in the basis functiongeometry - basis function geometry: s, x, y, z, xx, xy, xz, yy, yz, zzdefineGaussian(int, int, double, double, double)
public void defineGaussian(int basisID,
int functionID,
double alpha,
double scale,
double coef)
basisID - id of the gaussian basis functionfunctionID - id of the gaussian function in the gaussian basis functionalpha - alpha parameter in exp argumentscale - scale factorcoef - coefficient for this gaussian functionpublic double getMaxR()
public double getRotationAngle()
public double getRotationX()
public double getRotationY()
public double getRotationZ()
public void replot()
public void resetView()
public void setAutoMaxR(boolean _autoMaxR)
public void setAutoPlot(boolean _autoPlot)
replot()public void setBackgroundMode(boolean _backgroundMode)
public void setBrightness(double _brightness)
public void setColors(java.awt.Color _pos,
java.awt.Color _neg)
_pos - Color for the regions where the wave function is positive_neg - Color for the regions where the wave function is negative
public void setColors(int _posRed,
int _posGreen,
int _posBlue,
int _negRed,
int _negGreen,
int _negBlue)
_posRed - red component for positive regions_posGreen - green component for positive regions_posBlue - blue component for positive regions_negRed - red component for negative regions_negGreen - green component for negative regions_negBlue - blue component for negative regionspublic void setComplexMode(int _mode)
0 = Display the real component of the wave function
1 = Display the imaginary component of the wave function
2 = Display the absolute value of the wave function
For mode 2 (absolute value of the wave function), if the display sign option is false, the electron density plot is displayed in the positive color in all regions. If the display sign option is true, the color is based upon the phase angle. The pure positive color represents a purely real wave function (Im = 0); the pure negative color represents a purely imaginary wave function (Re = 0).
setDensityMode(int),
setDisplaySign(boolean)public void setDensityMode(int _mode)
0 = Display psi*psi (that is, the electron density)
1 = Display psi
setComplexMode(int),
setDisplaySign(boolean)public void setDisplaySign(boolean _displaySign)
public void setGaussian(int id)
public void setGaussian(int id,
double _coefReal,
double _coefImag)
_coefReal - real component of the coefficient_coefImag - imaginary component of the coefficient
public void setGaussianOrigin(int id,
double _r,
double _theta,
double _phi)
id - id for the gaussian basis function
public void setGaussianOriginXYZ(int id,
double _x,
double _y,
double _z)
id - id for the gaussian basis functionpublic void setInterpolation(int _nbr)
-1 = computer selects an "appropriate" value
0 = no interpolation
1 = 5/9 of the points are interpolated
2 = 11/16 of the points are interpolated, etc.
public void setMaxR(double _maxR)
public void setNLM(int _n,
int _l,
int _m)
_n - principal quantum number_l - angular momentum quantum number_m - magnetic quantum number
public void setNLM(int _n,
int _l,
int _m,
double _coefReal,
double _coefImag)
_n - principal quantum number_l - angular momentum quantum number_m - magnetic quantum number_coefReal - real component of the coefficient for constructing the hybrid wave function_coefImag - imaginary component of the coefficient for constructing the hybrid wave functionpublic void setOrbital(java.lang.String _orbital)
1s, 2s, 2px, 2py, 2pz, 3s, 3px, 3py, 3pz, 3dz2, 3dxz, 3dyz, 3dxy, 3dx2-y2, 4s, 4px, 4py, 4pz, 4dz2, 4dxz, 4dyz, 4dxy, 4dx2-y2, 4f5xz2-xr2, 4f5yz2-yr2, 4f5z3-3zr2, 4fx3-3xy2, 4fxyz, 4fy3-3yx2, 4fzx2-zy2, sp, sp2, sp3, dsp2, dsp3ax, dsp3eq, d2sp3
_orbital - String identifying the orbital (from the above list) to be displayed
public void setRotation(double _x,
double _y,
double _z,
double _a)
public void setShowAxes(boolean _showAxes)
setViewXY(),
setViewXZ(),
setViewYZ(),
resetView()public void setViewXY()
public void setViewXZ()
public void setViewYZ()
public void setWaveFunction(WaveFunction _waveFunction,
double _coefReal,
double _coefImag)
The electron density plot for the new hybrid wave function is NOT displayed.
_coefReal - real component of the coefficient for constructing the hybrid wave function_coefImag - imaginary component of the coefficient for constructing the hybrid wave functionreplot()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||