Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > media > contrib > by-pkgid > 263386785cefb9ae5d63b926d214d809 > files > 1335

mpqc-2.1.2-4mdk.ppc.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta name="robots" content="noindex">
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>scf.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body bgcolor="#ffffff">
<!-- Generated by Doxygen 1.2.5 on Mon Oct 14 14:16:38 2002 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; <a class="qindex" href="pages.html">Related Pages</a> &nbsp; </center>
<hr><h1>scf.h</h1><div class="fragment"><pre>00001 <font class="comment">//</font>
00002 <font class="comment">// scf.h --- definition of the SCF abstract base class</font>
00003 <font class="comment">//</font>
00004 <font class="comment">// Copyright (C) 1996 Limit Point Systems, Inc.</font>
00005 <font class="comment">//</font>
00006 <font class="comment">// Author: Edward Seidl &lt;seidl@janed.com&gt;</font>
00007 <font class="comment">// Maintainer: LPS</font>
00008 <font class="comment">//</font>
00009 <font class="comment">// This file is part of the SC Toolkit.</font>
00010 <font class="comment">//</font>
00011 <font class="comment">// The SC Toolkit is free software; you can redistribute it and/or modify</font>
00012 <font class="comment">// it under the terms of the GNU Library General Public License as published by</font>
00013 <font class="comment">// the Free Software Foundation; either version 2, or (at your option)</font>
00014 <font class="comment">// any later version.</font>
00015 <font class="comment">//</font>
00016 <font class="comment">// The SC Toolkit is distributed in the hope that it will be useful,</font>
00017 <font class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</font>
00018 <font class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</font>
00019 <font class="comment">// GNU Library General Public License for more details.</font>
00020 <font class="comment">//</font>
00021 <font class="comment">// You should have received a copy of the GNU Library General Public License</font>
00022 <font class="comment">// along with the SC Toolkit; see the file COPYING.LIB.  If not, write to</font>
00023 <font class="comment">// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.</font>
00024 <font class="comment">//</font>
00025 <font class="comment">// The U.S. Government is granted a limited license as per AL 91-7.</font>
00026 <font class="comment">//</font>
00027 
00028 <font class="preprocessor">#ifndef _chemistry_qc_scf_scf_h</font>
00029 <font class="preprocessor"></font><font class="preprocessor">#define _chemistry_qc_scf_scf_h</font>
00030 <font class="preprocessor"></font>
00031 <font class="preprocessor">#ifdef __GNUC__</font>
00032 <font class="preprocessor"></font><font class="preprocessor">#pragma interface</font>
00033 <font class="preprocessor"></font><font class="preprocessor">#endif</font>
00034 <font class="preprocessor"></font>
00035 <font class="preprocessor">#include &lt;util/group/thread.h&gt;</font>
00036 
00037 <font class="preprocessor">#include &lt;math/optimize/scextrap.h&gt;</font>
00038 
00039 <font class="preprocessor">#include &lt;chemistry/qc/basis/tbint.h&gt;</font>
00040 <font class="preprocessor">#include &lt;chemistry/qc/wfn/accum.h&gt;</font>
00041 <font class="preprocessor">#include &lt;chemistry/qc/wfn/obwfn.h&gt;</font>
00042 
00043 <font class="keyword">namespace </font>sc {
00044 
00045 <font class="comment">// //////////////////////////////////////////////////////////////////////////</font>
00046 
<a name="l00049"></a><a class="code" href="class_sc__SCF.html">00049</a> <font class="keyword">class </font>SCF: <font class="keyword">public</font> OneBodyWavefunction {
00050   <font class="keyword">protected</font>:
00051     <font class="keywordtype">int</font> need_vec_;
00052     <font class="keywordtype">int</font> compute_guess_;
00053 
00054     <font class="keywordtype">int</font> keep_guess_wfn_;
00055     Ref&lt;OneBodyWavefunction&gt; guess_wfn_;
00056 
00057     <font class="keywordtype">int</font> always_use_guess_wfn_;
00058     
00059     Ref&lt;SelfConsistentExtrapolation&gt; extrap_;
00060     
00061     Ref&lt;AccumH&gt; accumdih_;
00062     Ref&lt;AccumH&gt; accumddh_;
00063     
00064     <font class="keywordtype">int</font> maxiter_;
00065     <font class="keywordtype">int</font> dens_reset_freq_;
00066     <font class="keywordtype">int</font> reset_occ_;
00067     <font class="keywordtype">int</font> local_dens_;
00068     size_t storage_;
00069     <font class="keywordtype">int</font> print_all_evals_;
00070     <font class="keywordtype">int</font> print_occ_evals_;
00071     
00072     <font class="keywordtype">double</font> level_shift_;
00073 
00074     Ref&lt;MessageGrp&gt; scf_grp_;
00075     Ref&lt;ThreadGrp&gt; threadgrp_;
00076     <font class="keywordtype">int</font> local_;
00077 
00078     Ref&lt;TwoBodyInt&gt;* tbis_; <font class="comment">// a two body integral evaluator for each thread</font>
00079     <font class="keyword">virtual</font> <font class="keywordtype">void</font> init_threads();
00080     <font class="keyword">virtual</font> <font class="keywordtype">void</font> done_threads();
00081     
00082     <font class="comment">// implement the Compute::compute() function</font>
00083     <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="class_sc__SCF.html#b2">compute</a>();
00084 
00085     <font class="comment">// calculate the scf vector, returning the accuracy</font>
00086     <font class="keyword">virtual</font> <font class="keywordtype">double</font> compute_vector(<font class="keywordtype">double</font>&amp;);
00087 
00088     <font class="comment">// return the DIIS error matrices</font>
00089     <font class="keyword">virtual</font> Ref&lt;SCExtrapError&gt; extrap_error();
00090 
00091     <font class="comment">// calculate the scf gradient</font>
00092     <font class="keyword">virtual</font> <font class="keywordtype">void</font> compute_gradient(<font class="keyword">const</font> RefSCVector&amp;);
00093     
00094     <font class="comment">// calculate the scf hessian</font>
00095     <font class="keyword">virtual</font> <font class="keywordtype">void</font> compute_hessian(<font class="keyword">const</font> RefSymmSCMatrix&amp;);
00096     
00097     <font class="comment">// returns the log of the max density element in each shell block</font>
00098     <font class="keywordtype">signed</font> <font class="keywordtype">char</font> * init_pmax(<font class="keywordtype">double</font> *);
00099     
00100     <font class="comment">// given a matrix, this will convert the matrix to a local matrix if</font>
00101     <font class="comment">// it isn't one already, and return that local matrix.  it will also</font>
00102     <font class="comment">// set the double* to point to the local matrix's data.</font>
00103     <font class="keyword">enum</font> Access { Read, Write, Accum };
00104     RefSymmSCMatrix get_local_data(<font class="keyword">const</font> RefSymmSCMatrix&amp;, <font class="keywordtype">double</font>*&amp;, Access);
00105     
00106     <font class="comment">// create the initial scf vector.  either use the eigenvectors in</font>
00107     <font class="comment">// guess_wfn_, or use a core Hamiltonian guess.  Call this with needv</font>
00108     <font class="comment">// equal to 0 if you expect to call it twice with the same geometry</font>
00109     <font class="comment">// (eg. when calling from both set_occupations() and init_vector()).</font>
00110     <font class="keyword">virtual</font> <font class="keywordtype">void</font> initial_vector(<font class="keywordtype">int</font> needv=1);
00111     
00112     <font class="comment">// given the total number of density and fock matrices, figure out</font>
00113     <font class="comment">// how much memory that will require and then set the local_dens_</font>
00114     <font class="comment">// variable accordingly</font>
00115     <font class="keywordtype">void</font> init_mem(<font class="keywordtype">int</font>);
00116     
00117     <font class="keywordtype">void</font> so_density(<font class="keyword">const</font> RefSymmSCMatrix&amp; d, <font class="keywordtype">double</font> occ, <font class="keywordtype">int</font> alp=1);
00118 
00119     <font class="comment">// Returns a new'ed allocation vector if it is in the input,</font>
00120     <font class="comment">// otherwise null.</font>
00121     <font class="keywordtype">int</font> *read_occ(<font class="keyword">const</font> Ref&lt;KeyVal&gt; &amp;, <font class="keyword">const</font> <font class="keywordtype">char</font> *name, <font class="keywordtype">int</font> nirrep);
00122   <font class="keyword">public</font>:
00123     <a class="code" href="class_sc__SCF.html#a1">SCF</a>(StateIn&amp;);
00176     <a class="code" href="class_sc__SCF.html#a1">SCF</a>(<font class="keyword">const</font> Ref&lt;KeyVal&gt;&amp;);
00177     ~SCF();
00178 
00179     <font class="keywordtype">void</font> <a class="code" href="class_sc__SCF.html#a3">save_data_state</a>(StateOut&amp;);
00180 
00181     RefSCMatrix <a class="code" href="class_sc__SCF.html#a4">oso_eigenvectors</a>();
00182     RefDiagSCMatrix <a class="code" href="class_sc__SCF.html#a5">eigenvalues</a>();
00183 
00184     <font class="keywordtype">int</font> <a class="code" href="class_sc__SCF.html#a6">spin_unrestricted</a>(); <font class="comment">// return 0</font>
00185     
00186     <font class="comment">// return the number of AO Fock matrices needed</font>
00187     <font class="keyword">virtual</font> <font class="keywordtype">int</font> n_fock_matrices() <font class="keyword">const</font> =0;
00188 
00189     <font class="comment">// returns the n'th AO Fock matrix</font>
00190     <font class="keyword">virtual</font> RefSymmSCMatrix fock(<font class="keywordtype">int</font>) =0;
00191 
00192     <font class="comment">// return the effective MO fock matrix</font>
00193     <font class="keyword">virtual</font> RefSymmSCMatrix effective_fock() =0;
00194 
00195     <font class="keyword">virtual</font> <font class="keywordtype">double</font> one_body_energy();
00196     <font class="keyword">virtual</font> <font class="keywordtype">void</font> two_body_energy(<font class="keywordtype">double</font> &amp;ec, <font class="keywordtype">double</font> &amp;ex);
00197 
00198     <font class="keywordtype">void</font> <a class="code" href="class_sc__SCF.html#a12">symmetry_changed</a>();
00199 
00200     <font class="keywordtype">void</font> <a class="code" href="class_sc__SCF.html#a13">obsolete</a>();
00201 
00202     <font class="keywordtype">void</font> <a class="code" href="class_sc__SCF.html#a14">print</a>(std::ostream&amp;o=ExEnv::out0()) <font class="keyword">const</font>;
00203 
00204   <font class="keyword">protected</font>:
00205     <font class="comment">// the following are scratch and are not checkpointed</font>
00206     RefSCMatrix oso_scf_vector_;
00207     RefSCMatrix oso_scf_vector_beta_; <font class="comment">// only used if !spin_restricted</font>
00208     RefSymmSCMatrix hcore_;
00209 
00210     <font class="comment">// //////////////////////////////////////////////////////////////////////</font>
00211     <font class="comment">// pure virtual member functions follow</font>
00212     
00213     <font class="comment">// tries to automagically guess the MO occupations</font>
00214     <font class="keyword">virtual</font> <font class="keywordtype">void</font> set_occupations(<font class="keyword">const</font> RefDiagSCMatrix&amp;) =0;
00215     
00216     <font class="comment">// //////////////////////////////////////////////////////////////////////</font>
00217     <font class="comment">// do setup for SCF calculation</font>
00218     <font class="keyword">virtual</font> <font class="keywordtype">void</font> init_vector() =0;
00219     <font class="keyword">virtual</font> <font class="keywordtype">void</font> done_vector() =0;
00220 
00221     <font class="comment">// calculate new density matrices, returns the rms density difference</font>
00222     <font class="keyword">virtual</font> <font class="keywordtype">double</font> new_density() =0;
00223 
00224     <font class="comment">// reset density diff matrix and zero out delta G matrix</font>
00225     <font class="keyword">virtual</font> <font class="keywordtype">void</font> reset_density() =0;
00226 
00227     <font class="comment">// return the scf electronic energy</font>
00228     <font class="keyword">virtual</font> <font class="keywordtype">double</font> scf_energy() =0;
00229     
00230     <font class="comment">// return the DIIS data matrices</font>
00231     <font class="keyword">virtual</font> Ref&lt;SCExtrapData&gt; extrap_data() =0;
00232     
00233     <font class="comment">// form the AO basis fock matrices</font>
00234     <font class="keyword">virtual</font> <font class="keywordtype">void</font> ao_fock(<font class="keywordtype">double</font> accuracy) =0;
00235 
00236     <font class="comment">// //////////////////////////////////////////////////////////////////////</font>
00237     <font class="comment">// do setup for gradient calculation</font>
00238     <font class="keyword">virtual</font> <font class="keywordtype">void</font> init_gradient() =0;
00239     <font class="keyword">virtual</font> <font class="keywordtype">void</font> done_gradient() =0;
00240 
00241     <font class="keyword">virtual</font> RefSymmSCMatrix lagrangian() =0;
00242     <font class="keyword">virtual</font> RefSymmSCMatrix gradient_density() =0;
00243     <font class="keyword">virtual</font> <font class="keywordtype">void</font> two_body_deriv(<font class="keywordtype">double</font>*) =0;
00244     
00245     <font class="comment">// //////////////////////////////////////////////////////////////////////</font>
00246     <font class="comment">// do setup for hessian calculation</font>
00247     <font class="keyword">virtual</font> <font class="keywordtype">void</font> init_hessian() =0;
00248     <font class="keyword">virtual</font> <font class="keywordtype">void</font> done_hessian() =0;
00249 };
00250 
00251 }
00252 
00253 <font class="preprocessor">#endif</font>
00254 <font class="preprocessor"></font>
00255 <font class="comment">// Local Variables:</font>
00256 <font class="comment">// mode: c++</font>
00257 <font class="comment">// c-file-style: "ETS"</font>
00258 <font class="comment">// End:</font>
</div></pre><hr>
<address>
<small>

Generated at Mon Oct 14 14:16:38 2002 for <a
href="http://aros.ca.sandia.gov/~cljanss/mpqc">MPQC</a>
2.1.2 using the documentation package <a
href="http://www.stack.nl/~dimitri/doxygen/index.html">Doxygen</a>
1.2.5.

</small>
</address>
</body>
</html>