<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!--**************************************************************************** * * * Viewmol * * * * N O D E 2 5 . H T M L * * * * Copyright (c) Joerg-R. Hill, October 2003 * * * ******************************************************************************** *--> <html> <head> <title>10.7 The molecule module</title> <META NAME="description" CONTENT="10.7 The molecule module"> <META NAME="keywords" CONTENT="viewmol"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="STYLESHEET" href="viewmol.css"> <link rel="first" href="viewmol.html"> </head> <body> <H2><A NAME="SECTION0001070000000000000000"> 10.7 The <TT>molecule</TT> module</A> </H2> <dl><dt><b><a name="l2h-38"><tt class="function">molecule</tt></a></b>() <dd> Creates a new instance of a molecule object and returns a reference to it. Note: To obtain object references to molecules already loaded into V<SMALL>IEWMOL</SMALL> use the <code>getMolecules</code> function of the <code>viewmol</code> module. </dl> <dl><dt><b><a name="l2h-39"><tt class="function">translate</tt></a></b>(<var>x, y, z</var>) <dd> Translates (shifts) molecule by <var>x</var>, <var>y</var>, and <var>z</var> along the x, y, and z axis, respectively. <var>x</var>, <var>y</var>, and <var>z</var> have to be integers and are measured in pixels of the screen. </dl> <dl><dt><b><a name="l2h-40"><tt class="function">rotate</tt></a></b>(<var>x, y, z</var>) <dd> Rotates molecule by <var>x</var>, <var>y</var>, and <var>z</var> about x, y, and z axis, respectively. <var>x</var>, <var>y</var>, and <var>z</var> have to be integers and are measured in degrees. </dl> <dl><dt><b><a name="l2h-41"><tt class="function">getSpectrum</tt></a></b>() <dd> Creates a new instance of a spectrum object and returns a reference to it if there is spectral information associated with this molecule. </dl> <dl><dt><b><a name="l2h-42"><tt class="function">getEnergyLevels</tt></a></b>() <dd> Creates a new instance of an energy level object and returns a reference to it if there is information about energy levels associated with this molecule. </dl> <dl><dt><b><a name="l2h-43"><tt class="function">getHistory</tt></a></b>() <dd> Creates a new instance of a history object and returns a reference to it if there is information about the optimization history associated with this molecule. </dl> <dl><dt><b><a name="l2h-44"><tt class="function">showForces</tt></a></b>(<var>status</var>) <dd> Sets the display of forces for all molecules to <var>status</var>. <var>status</var> has to be one of the integer constants <code>ON</code> or <code>OFF</code> defined in the <code>viewmol</code> module. </dl> <dl><dt><b><a name="l2h-45"><tt class="function">getAtoms</tt></a></b>() <dd> Returns a list containing references to all atom objects the molecule is composed off. </dl> <dl><dt><b><a name="l2h-46"><tt class="function">getBonds</tt></a></b>() <dd> Returns a list of tupels describing all bonds in the molecule. The tupels consists of three integers <code>(atom1, atom2, order)</code> where <code>atom1</code> and <code>atom2</code> are the indices of the two atoms forming the bond and <code>order</code> is the bond order. The bond order can be one of the constants <code>HYDROGENBOND, CONJUGATED, SINGLE, DOUBLE</code>, or <code>TRIPLE</code> for hydrogen/Van der Waals, conjugated, single, double, and triple bonds, respectively. These constants are defined in the <code>molecule</code> module. </dl> <dl><dt><b><a name="l2h-47"><tt class="function">getWavenumbers</tt></a></b>() <dd> Returns a list of tupels describing all wave numbers of the molecule. The tupel consists of four floats and one string <code>(waveNumber, IRIntensity,</code> <code>RamanIntensity, INSIntensity, symmetry)</code> where <code>waveNumber</code> is the wave number in cm<SUP>-1</SUP>, <code>IRIntensity</code>, <code>RamanIntensity</code>, and <code>INSIntensity</code> are the IR, Raman, and inelastic neutron scattering intensities in per cent, and <code>symmetry</code> is a label describing the symmetry of the mode. </dl> <dl><dt><b><a name="l2h-48"><tt class="function">getMOEnergies</tt></a></b>() <dd> Returns a list of tupels providing information about all molecular orbitals of the molecule. The tupel consists of two floats, one integer, and one string <code>(energy, occupation, spin, symmetry)</code> where <code>energy</code> is the energy of the molecular orbital in Hartrees, <code>occupation</code> is the number of electrons in this orbital, <code>spin</code> in one of the constants <code>ALPHA+BETA, ALPHA</code>, or <code>BETA</code> describing what spin has been assigned to this orbital, and <code>symmetry</code> is a label describing the symmetry of the molecular orbital. The constants are defined in the <code>molecule</code> module. </dl> <dl><dt><b><a name="l2h-49"><tt class="function">title</tt></a></b>(<big>[</big><var>title</var><big>]</big>) <dd> Sets or returns the title of a molecule. <var>title</var> has to be a string. The maximum length of the title is limited to 255 characters. </dl> <dl><dt><b><a name="l2h-50"><tt class="function">bondAverage</tt></a></b>(<var>atom</var>) <dd> Returns the average of the lengths of all bonds involving atom <var>atom</var> in Ångstrøms. <var>atom</var> is an atom object. </dl> <dl><dt><b><a name="l2h-51"><tt class="function">bondLength</tt></a></b>(<var>atom1, atom2, </var><big>[</big><var>length, unit</var><big>]</big>) <dd> Returns or sets the length of the bond between atoms <var>atom1</var> and <var>atom2</var>. <var>atom1</var> and <var>atom2</var> have to be atom objects, the bond length is returned in Ångstrøms. If <var>length</var> and <var>unit</var> are given, the bond length is set. <var>length</var> is a double, <var>unit</var> a string containing either <code>Ang</code>, <code>au</code> or <code>bohr</code>, or <code>pm</code> for Ångstrøms, atomic units, or picometers. Everything else is interpreted as Ångstrøms. </dl> <dl><dt><b><a name="l2h-52"><tt class="function">bondAngle</tt></a></b>(<var>atom1, atom2, atom3, </var><big>[</big><var>angle</var><big>]</big>) <dd> Returns or sets the bond angle <var>atom1</var>-<var>atom2</var>-<var>atom3</var>. <var>atom1</var>, <var>atom2</var>, <var>atom3</var> are atom objects. If <var>angle</var> is given the bond angle is set. <var>angle</var> has to be a double and is measured in degrees. </dl> <dl><dt><b><a name="l2h-53"><tt class="function">torsionAngle</tt></a></b>(<var>atom1, atoms2, atom3, atom4, </var><big>[</big><var>torsionAngle</var><big>]</big>) <dd> Returns or sets the torsion angle <var>atom1</var>-<var>atom2</var>-<var>atom3</var>-<var>atom4</var>. <var>atom1</var>, <var>atom2</var>, <var>atom3</var>, <var>atom4</var> are atom objects. If <var>torsionAngle</var> is given the torsion angle is set. <var>torsionAngle</var> has to be a double and is measured in degrees. </dl> <dl><dt><b><a name="l2h-54"><tt class="function">getThermodynamics</tt></a></b>(<var>property, type</var>) <dd> Returns a thermodynamical property of the molecule. <var>property</var> and <var>type</var> are integers. <var>property</var> can be one of the integer constants <code>ENTHALPY</code>, <code>ENTROPY</code>, <code>GIBBS_ENERGY</code>, or <code>HEAT_CAPACITY</code> defined in the <code>molecule</code> module. <var>type</var> can be one of the integer constants <code>TRANSLATION</code>, <code>PV</code>, <code>ROTATION</code>, <code>VIBRATION</code>, or <code>TOTAL</code> also defined in the <code>molecule</code> module. The returned thermodynamic property will be in SI units. </dl> <dl><dt><b><a name="l2h-55"><tt class="function">reaction</tt></a></b>(<big>[</big><var>side</var><big>]</big>) <dd> Sets or returns whether the molecule is a reactant or a product in a reaction. <var>side</var> is an integer and can be set to one of the integer constants <code>REACTANT</code>, <code>PRODUCT</code>, or <code>ALLREACTIONS</code> defined in the <code>molecule</code> module. </dl> <dl><dt><b><a name="l2h-56"><tt class="function">showElectrons</tt></a></b>(<var>type, </var><big>[</big><var>gridResolution, interpolation</var><big>]</big>) <dd> Displays wave function related properties of the molecule. <var>type</var> is an integer and can be set to one of the integer constants <code>BASIS_FUNCTION</code>, <code>BASIS_IN_MO</code>, <code>MO</code>, or <code>DENSITY</code> defined in the <code>molecule</code> module. <var>gridResolution</var> is a double specifying the resolution of the grid used to calculate the isosurface. Larger values for <var>gridResolution</var> result in smoother displays. <var>interpolation</var> is an optional integer and can be one of the integer constants <code>IP_NONE</code> (no interpolation), <code>IP_LINEAR</code> (linear interpolation), or <code>IP_LOG</code> (logarithmic interpolation) defined in the <code>molecule</code> module. </dl> <dl><dt><b><a name="l2h-57"><tt class="function">showGrid</tt></a></b>(<var>which, </var><big>[</big><var>interpolation</var><big>]</big>) <dd> Displays a property which has been read as a grid. <var>which</var> is an integer between 1 and the number of grids which have been read for this molecule and identifies the grid to be shown. <var>interpolation</var> is an optional integer and can be one of the integer constants <code>IP_NONE</code> (no interpolation), <code>IP_LINEAR</code> (linear interpolation), or <code>IP_LOG</code> (logarithmic interpolation) defined in the <code>molecule</code> module. </dl> <dl><dt><b><a name="l2h-58"><tt class="function">selectBasisfunction</tt></a></b>(<var>atom, name, count</var>) <dd> Selects a basis function for display. <var>atom</var> is an atom object specifying which atom the basis function belongs to. <var>name</var> is a string specifying what kind of basis function (s, p, d, etc.) to select. <var>count</var> is an integer specifying which of the s, p, d, etc. functions to select. Assume atom 1 is a carbon atom in a calculation using a DZVP basis set. It therefore has three s functions. <code>selectBasisfunction(1, "s", 1)</code> would select the 1s function, <code>selectBasisfunction(1, "s", 2)</code> the first 2s function, and <code>selectBasisfunction(1, "s", 3)</code> the second 2s function. </dl> <dl><dt><b><a name="l2h-59"><tt class="function">unitCell</tt></a></b>(<var>visible, </var><big>[</big><var>afac, bfac, cfac</var><big>]</big>) <dd> Sets visibility and number of replicas of unit cell. <var>visible</var> has to be one of the integer constants <code>ON</code> or <code>OFF</code> defined in the <code>viewmol</code> module to turn display of the unit cell on or off. <var>afac</var>, <var>bfac</var>, and <var>cfac</var> are doubles specifying the number of replicas of the unit cell to be displayed along the a, b, and c axis, respectively. Fractions are allowed for <var>afac</var>, <var>bfac</var>, and <var>cfac</var>. </dl> <dl><dt><b><a name="l2h-60"><tt class="function">millerPlane</tt></a></b>(<var>visible, </var><big>[</big><var>h, k, l</var><big>]</big>) <dd> Sets visibility and orientation of Miller plane. <var>visible</var> has to be one of the integer constants <code>ON</code> or <code>OFF</code> defined in the <code>viewmol</code> module to turn display of a Miller plane on or off. <var>h</var>, <var>k</var>, and <var>l</var> are integers specifying the Miller indices of the plane to display. </dl> <dl><dt><b><a name="l2h-61"><tt class="function">addAtom</tt></a></b>(<var>symbol, </var><big>[</big><var>attach</var><big>]</big>) <dd> Adds an atom to the molecule. <var>symbol</var> is a string containing the element symbol of the atom to add. <var>attach</var> is an atom object specifying the atom the newly added atom should be attached to. <var>attach</var> can be omitted, but this is only useful for adding the first atom to a molecule. </dl> <P> <p><hr> <ADDRESS> <a href="mailto:joehill@users.sourceforge.net"><i>Jörg-Rüdiger Hill</i></a> Fri Oct 31 14:19:21 CET 2003 </ADDRESS> </BODY> </HTML>