1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--****************************************************************************
* *
* Viewmol *
* *
* N O D E 3 0 . H T M L *
* *
* Copyright (c) Joerg-R. Hill, December 2000 *
* *
********************************************************************************
*-->
<!--Converted with LaTeX2HTML 99.2beta8 (1.46)
original version by: Nikos Drakos, CBLU, University of Leeds
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>Programming Your Own Input Filter</TITLE>
<META NAME="description" CONTENT="Programming Your Own Input Filter">
<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=iso-8859-1">
<META NAME="Generator" CONTENT="LaTeX2HTML v99.2beta8">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="viewmol.css">
</HEAD>
<BODY LANG="EN" BGCOLOR="#FFFFFF">
<H1><A NAME="SECTION000130000000000000000">
Programming Your Own Input Filter</A>
</H1>
V<SMALL>IEWMOL</SMALL> can be easily adapted to read outputs of other programs or
other file formats. All you have to do is to write a new input filter which
extracts the data from the corresponding file. These input filter are
stand-alone programs and can be written in every programming language you
want. Examples in C and awk are included.
<P>
The input filter has to read the following data from the output file and write
them to its standard output in the format described below. This format follows
the file format of T<SMALL>URBOMOLE</SMALL> very closely. A few sections had to be
extended to allow data which are currently not supported by T<SMALL>URBOMOLE</SMALL>
(e. g. unit cells).
<UL>
<LI>the Cartesian coordinates and atom symbols (required)
<BR>
Write to standard output in the following format:
<PRE>
$coord factor
x1 y1 z1 symbol1 xyz
x2 y2 z2 symbol2 xyz
...
</PRE>
<code>factor</code> is the conversion factor the coordinates have to be multiplied
with to convert them to ngstrms. Any combination of x, y, and z at the
end of the line (optional) indicates that the corresponding atom has been kept
fixed in that direction during a geometry optimization. Consequently, V<SMALL>IEWMOL</SMALL>
will not draw the forces acting on this atom in the fixed direction.
</LI>
<LI>the title (optional)
<BR>
Write to standard output in the following format:
<PRE>
$title
title
</PRE>
</LI>
<LI>the wave numbers and intensities (optional)
<BR>
Write to standard output in the following format:
<PRE>
$vibrational spectrum
symmetry1 wavenumber1 IR-intensity1 Raman-intensity1
symmetry2 wavenumber2 IR-intensity2 Raman-intensity2
...
</PRE>
<code>symmetry</code> is the symmetry label for the vibrational mode,
<code>wavenumber</code> is its wave number and <code>IR-intensity</code> and
<code>Raman-intensity</code> are its IR and Raman intensity, respectively. If the
symmetry labels for the vibrational modes are unknown they should be set to a
default (e. g. A1).
</LI>
<LI>normal coordinates (optional)
<BR>
Write to standard output in the following format:
<PRE>
$vibrational normal modes
i1 i2 nm(1,1) nm(2,1) nm(3,1) nm(4,1) nm(5,1)
i1 i2 nm(6,1) ... nm(3*natom,1)
i1 i2 nm(1,2) nm(2,2) nm(3,2) nm(4,2) nm(5,2)
i1 i2 nm(6,2) ... nm(3*natom,2)
...
i1 i2 nm(1,nmodes) ... nm(5,nmodes)
i1 i2 nm(6,nmodes) ... nm(3*natom,nmodes)
</PRE>
<code>i1</code> and <code>i2</code> are integers which are skipped during reading.
<code>nm(i,j)</code> are the normal mode coefficients. They have to be provided
ordered by Cartesian coordinates (all x components of the first atom first,
then all y components of the first atom etc.).
</LI>
<LI>optimization history or MD trajectory (optional)
<BR>
Write to standard output in the following format:
<PRE>
$grad cartesian gradients
cycle = nc SCF energy = E_nc |dE/dxyz| = gradnorm_nc
[unitcell a b c alpha beta gamma]
x1 y1 z1 symbol1
x2 y2 z2 symbol2
...
xn yn zn symboln
gx1 gy1 gz1
gx2 gy2 gz2
...
gxn gyn gzn
cycle = nc+1 SCF energy = E_nc+1 |dE/dxyz| = gradnorm_nc+1
...
</PRE>
<code>nc</code> is a counter for the cycle, <code>E_nc</code> is the energy for the
configuration of cycle nc, and <code>gradnorm_nc</code> is the gradient norm of cycle
nc. The line starting with <code>unitcell</code> is optional and can be used to
specify the current unit cell e. g. during a constant pressure MD run. The
<code>x</code>, <code>y</code>, and <code>z</code> are the Cartesian coordinates for each atom,
<code>symbol</code> is the atomic symbol. The <code>gx</code>, <code>gy</code>, and <code>gz</code>
are the gradients for each atom. This structure can be repeated for as many
cycles as necessary.
</LI>
<LI>MO energies and coefficients (optional)
<BR>
Write to standard output in the following format:
<PRE>
$scfmo [symmetrized] [gaussian]
n symmetry_label_n eigenvalue=MO_E_n nsaos=norb
moc(n,1) moc(n,2) moc(n,3) moc(n,4)
moc(n,5) ... moc(n,norb)
n+1 symmetry_label_n+1 eigenvalue=MO_E_n+1 nsaos=norb
...
</PRE>
The string <code>symmetrized</code> after <code>$scfmo</code> is optional and can be used to
notify V<SMALL>IEWMOL</SMALL> of the fact that the MO coefficients are with respect to
symmetrized AOs rather than with respect to AOs. V<SMALL>IEWMOL</SMALL> needs moloch from
the T<SMALL>URBOMOLE</SMALL> package to handle symmetrized AOs. If moloch is not
installed and symmetrized AOs are input, MOs and electron densities cannot be
drawn. The string <code>gaussian</code> is also optional and notifies V<SMALL>IEWMOL</SMALL>
that the MO coefficients are normalized and ordered G<SMALL>AUSSIAN</SMALL> style.
<code>n</code> is a counter counting the MOs, <code>symmetry_label_n</code> is the symmetry
label for MO n, <code>MO_E_n</code> is the MO energy for MO n, and <code>norb</code> is the
total number of orbitals. The <code>moc(n,i)</code> are the MO coefficients for MO n.
</LI>
<LI>basis functions and occupation numbers (optional)
<BR>
Write to standard output in the following format:
<PRE>
$atoms
atom_symbol1 list_of_indices1 \
basis=basis_set_name1
atom_symbol2 list_of_indices2 \
basis=basis_set_name2
...
$basis
*
basis_set_name1
*
number_of_primitives angular_momentum
exponent1 coefficient1
exponent2 coefficient2
...
exponentn coefficientn
number_of_primitives angular_momentum
...
*
basis_set_name2
*
...
*
$closed shells
symmetry_label list_of_indices (2)
$pople [6d/10f/15g]
</PRE>
<code>atom_symbol</code> is the atom symbol of an element and <code>list_of_indices</code>
contains the indices of all atoms of the particular element according to the
list of coordinates read in under <code>$coord</code>. The list can be either comma
separated and/or contain hyphens for indicating ranges (e. g. c 1,3,7-10 is a
valid descriptor). <code>Basis_set_name</code> can be an arbitrary string describing
a particular basis set. It is only used to find the corresponding basis set in
the list read under <code>basis</code>. This list simply states the name for a basis
set and then lists the primitive functions which make up a contracted Gaussians
starting with the number of primitives in that particular contracted Gaussian
and its angular momentum (s, p, d, f, ...). Than the exponents and contraction
coefficients are listed line by line. This is repeated for all contracted
Gaussians of that particular basis set. <code>$closed shells</code> is used to tell
V<SMALL>IEWMOL</SMALL> which MOs are occupied and which are not. <code>symmetry_label</code>
is the symmetry label for a number of MOs and <code>list_of_indices</code> is a list
of integers stating which of the MOs of that particular symmetry are occupied.
This list can be either comma-separated or contain hyphens to indicate ranges
of MOs. <B>Note:</B> <code>$closed shells</code> has to appear after <code>$scfmo</code> in
the output written by the input filter. <code>$pople</code> is used to indicate that
d, f, or g functions have 6, 10, or 15 components instead of 5, 7, or 9.
<B>Note:</B> This data group has to appear after the <code>$coord</code> or <code>$grad</code>
in the output. Otherwise V<SMALL>IEWMOL</SMALL> will fail.
</LI>
<LI>the unit cell (optional)
<BR>
Write to standard output in the following form:
<PRE>
$unitcell a b c alpha beta gamma
</PRE>
</LI>
<LI>errors occuring during file processing (optional)
<BR>
Write to standard output in the following form:
<PRE>
$error errorLabel severity additionalInformation
</PRE>
<code>errorLabel</code> is an arbitrary one word label which refers to an error
message in the resources. <code>severity</code> is a label for the severity of the
error. Set it to 0 if the program can continue despite this error. Set it to
1 if the program must stop. <code>additionalInformation</code> is any additional
information you want to be displayed in the error message (e. g. the name of a
file which was not found). Currently, the following errorLabels are in use:
<code>noFile</code>, <code>notConverged</code>, <code>unsupportedVersion</code>,
<code>wrongFiletype</code>, <code>noCoordinates</code>, <code>noEnergy</code>, and
<code>unknownErrorMessage</code>. If your input filter wants to
return an error because it is missing coordinates in the input file "dummy.inp"
you can have it writing the following line to standard output:
<PRE>
$error missingCoordinates 1 dummy.inp
</PRE>
Then you have to specify a resource for the error message
in
<BR><code>$HOME/.Xdefaults</code>:
<PRE>
Viewmol.missingCoordinates: The file %s does not
contain any coordinates.
</PRE>
With these two lines in place any encounter of no coordinates in an input file
will lead to the display of the error dialog in
<A HREF="node30.html#errorExample">the Figure</A>. There
is no need to recompile V<SMALL>IEWMOL</SMALL> to achieve this.
</LI>
</UL>
The last line of the data written to standard output by the input filter must be
<code>$end</code>.
<P>
<P></P>
<DIV ALIGN="CENTER">
<A NAME="errorExample">
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 15:</STRONG>
The error dialog produced by the sample error
message</CAPTION>
<TR><TD>
<DIV ALIGN="CENTER">
<IMG
WIDTH="423" HEIGHT="169" ALIGN="BOTTOM" BORDER="0"
SRC="error.png"
ALT="error">
</DIV></TD></TR>
</TABLE>
</DIV><P></P>
<P>
The input filter can be installed by adding a line to the <code>viewmolrc</code> file.
<P>
<BR><HR>
<ADDRESS>
<A HREF="mailto:joehill@users.sourceforge.net"><I>Jrg-Rdiger Hill</I></A><BR>Sun Dec 10 17:38:35 MET 2000
</ADDRESS>
</BODY>
</HTML>
|