NWChem/web/doc/user.4.6/node5.html
2006-01-12 21:22:32 +00:00

282 lines
10 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<!--Converted with jLaTeX2HTML 2002 (1.62) JA patch-1.4
patched version by: Kenshi Muto, Debian Project.
LaTeX2HTML 2002 (1.62),
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>3. NWChem Architecture</TITLE>
<META NAME="description" CONTENT="3. NWChem Architecture">
<META NAME="keywords" CONTENT="user">
<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="jLaTeX2HTML v2002 JA patch-1.4">
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
<LINK REL="STYLESHEET" HREF="user.css">
<LINK REL="next" HREF="node6.html">
<LINK REL="previous" HREF="node4.html">
<LINK REL="up" HREF="user.html">
<LINK REL="next" HREF="node6.html">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<!--Navigation Panel-->
<A NAME="tex2html1028"
HREF="node6.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html1024"
HREF="user.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html1018"
HREF="node4.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html1026"
HREF="node2.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html1029"
HREF="node6.html">4. Functionality</A>
<B> Up:</B> <A NAME="tex2html1025"
HREF="user.html">user</A>
<B> Previous:</B> <A NAME="tex2html1019"
HREF="node4.html">2. Getting Started</A>
&nbsp <B> <A NAME="tex2html1027"
HREF="node2.html">Contents</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<!--Table of Child-Links-->
<A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A>
<UL>
<LI><A NAME="tex2html1030"
HREF="node5.html#SECTION00510000000000000000">3.1 Database Structure</A>
<LI><A NAME="tex2html1031"
HREF="node5.html#SECTION00520000000000000000">3.2 Persistence of data and restart</A>
</UL>
<!--End of Table of Child-Links-->
<HR>
<H1><A NAME="SECTION00500000000000000000">
3. NWChem Architecture</A>
</H1>
<A NAME="sec:arch"></A>
<P>
As noted above, NWChem consists of independent modules that perform
the various functions of the code. Examples include the input parser,
self-consistent field (SCF) energy, SCF analytic gradient, and density
functional theory (DFT) energy modules. The independent NWChem
modules can share data only through a disk-resident database, which is
similar to the GAMESS-UK dumpfile or the Gaussian checkpoint file.
This allows the modules to share data, or to share
access to files containing data.
<P>
It is not necessary for the user to be intimately familiar with the
contents of the database in order to run NWChem. However, a nodding
acquaintance with the design of the code will help in clarifying the
logic behind the input requirements, especially when restarting jobs
or performing multiple tasks within one job. Section
<A HREF="node5.html#sec:database">3.1</A> gives a general description of the database.
<P>
As described above (Section <A HREF="node4.html#sec:inputstructure">2.1</A>), all start-up
directives are processed at the beginning of the job by the main
program, and then the input module is invoked. Each input directive
usually results in one or more entries being made in the database.
When a <code>TASK</code> directive is encountered, control is passed to the
appropriate module, which extracts relevant data from the database and
any associated files. Upon completion of the task, the module will
store significant results in the database, and may also modify other
database entries in order to affect the behavior of subsequent
computations.
<P>
<H1><A NAME="SECTION00510000000000000000"></A>
<A NAME="sec:database"></A>
<BR>
3.1 Database Structure
</H1>
<P>
<P>
Data is shared between modules of NWChem by means of the database.
Three main types of information are stored in the data base: (1)
arrays of data, (2) names of files that contain data, and (3) objects.
Arrays are stored directly in the database, and contain the following
information:
<OL>
<LI>the name of the array, which is a string of ASCII characters
(e.g., <code>"reference energies"</code>)
</LI>
<LI>the type of the data in the array (i.e., real, integer, logical,
or character)
</LI>
<LI>the number (N) of data items in the array (Note: A scalar is
stored as an array of unit length.)
</LI>
<LI>the N items of data of the specified type
</LI>
</OL>
<P>
<P>
It is possible to enter data directly into the database using the
<code>SET</code> directive (see Section <A HREF="node7.html#sec:set">5.7</A>). For example, to
store a (64-bit precision) three-element real array with the name
<code>"reference energies"</code> in the database, the directive is as
follows:
<PRE>
set "reference energies" 0.0 1.0 -76.2
</PRE>
NWChem determines the data to be real (based on the type of the first
element, <code>0.0</code>), counts the number of elements in the array, and
enters the array into the database.
<P>
Much of the data stored in the database is internally managed by
NWChem and should not be modified by the user. However, other data,
including some NWChem input options, can be freely modified.
<P>
Objects are built in the database by storing associated data as
multiple entries, using an internally consistent naming convention.
This data is managed exclusively by the subroutines (or methods) that
are associated with the object. Currently, the code has two main
objects: basis sets and geometries. Sections <A HREF="node8.html#sec:geom">6</A> and
<A HREF="node9.html#sec:basis">7</A> present a complete discussion of the input to describe
these objects.
<P>
As an illustration of what comprises a geometry object, the following
table contains a partial listing of the database contents for a water
molecule geometry named <code>"test geom"</code>. Each entry contains the
field <code>test geom</code>, which is the unique name of the object.
<P>
<PRE>
Contents of RTDB h2o.db
-----------------------
Entry Type[nelem]
--------------------------- ----------------------
geometry:test geom:efield double[3]
geometry:test geom:coords double[9]
geometry:test geom:ncenter int[1]
geometry:test geom:charges double[3]
geometry:test geom:tags char[6]
...
</PRE>
<P>
Using this convention, multiple instances of objects may be stored
with different names in the same database. For example, if a user
needed to do calculations considering alternative geometries for the
water molecule, an input file could be constructed containing all the
geometries of interest by storing them in the database under different
names.
<P>
The runtime database contents for the file <code>h2o.db</code> listed above
were generated from the user-specified input directive,
<PRE>
geometry "test geom"
O 0.00000000 0.00000000 0.00000000
H 0.00000000 1.43042809 -1.10715266
H 0.00000000 -1.43042809 -1.10715266
end
</PRE>
The <code>GEOMETRY</code> directive allows the user to specify the
coordinates of the atoms (or centers), and identify the geometry with
a unique name. (Refer to Section <A HREF="node8.html#sec:geom">6</A> for a complete
description of the <TT>GEOMETRY</TT> directive.)
<P>
Unless a specific name is defined for the geometry, (such as the name
<code>"test geom"</code> shown in the example), the default name of
<code>geometry</code> is assigned. This is the geometry name that
computational modules will look for when executing a calculation. The
<TT>SET</TT> directive can be used in the input to force NWChem to look
for a geometry with a name other than <code>geometry</code>. For example,
to specify use of the geometry with the name <code>"test geom"</code> in the
example above, the <code>SET</code> directive is as follows:
<P>
<PRE>
set geometry "test geom"
</PRE>
<P>
NWChem will automatically check for such indirections when loading
geometries. Storage of data associated with basis sets, the other
database resident object, functions in a similar fashion, using the
default name <code>"ao basis"</code>.
<P>
<H1><A NAME="SECTION00520000000000000000"></A>
<A NAME="sec:persist"></A>
<BR>
3.2 Persistence of data and restart
</H1>
<P>
The database is persistent, meaning that all input data and output
data (calculation results) that are not destroyed in the course of
execution are permanently stored. These data are therefore available
to subsequent tasks or jobs. This makes the input for restart jobs
very simple, since only new or changed data must be provided. It also
makes the behavior of successive restart jobs <EM>identical</EM> to that
of multiple tasks within one job.
<P>
Sometimes, however, this persistence is undesirable, and it is
necessary to return an NWChem module to its default behavior by
restoring the database to its input-free state. In such a case, the
<code>UNSET</code> directive (see Section <A HREF="node7.html#sec:unset">5.8</A>) can be used to
delete all database entries associated with a given module (including
both inputs and outputs).
<P>
<HR>
<!--Navigation Panel-->
<A NAME="tex2html1028"
HREF="node6.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html1024"
HREF="user.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html1018"
HREF="node4.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html1026"
HREF="node2.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html1029"
HREF="node6.html">4. Functionality</A>
<B> Up:</B> <A NAME="tex2html1025"
HREF="user.html">user</A>
<B> Previous:</B> <A NAME="tex2html1019"
HREF="node4.html">2. Getting Started</A>
&nbsp <B> <A NAME="tex2html1027"
HREF="node2.html">Contents</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
Edoardo Apra
2004-05-25
</ADDRESS>
</BODY>
</HTML>