~ubuntu-branches/ubuntu/karmic/psicode/karmic

« back to all changes in this revision

Viewing changes to src/bin/cscf/rdone.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Banck, Michael Banck, Daniel Leidert
  • Date: 2009-02-23 00:12:02 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20090223001202-rutldoy3dimfpesc
Tags: 3.4.0-1
* New upstream release.

[ Michael Banck ]
* debian/patches/01_DESTDIR.dpatch: Refreshed.
* debian/patches/02_FHS.dpatch: Removed, applied upstream.
* debian/patches/03_debian_docdir: Likewise.
* debian/patches/04_man.dpatch: Likewise.
* debian/patches/06_466828_fix_gcc_43_ftbfs.dpatch: Likewise.
* debian/patches/07_464867_move_executables: Fixed and refreshed.
* debian/patches/00list: Adjusted.
* debian/control: Improved description.
* debian/patches-held: Removed.
* debian/rules (install/psi3): Do not ship the ruby bindings for now.

[ Daniel Leidert ]
* debian/rules: Fix txtdir via DEB_MAKE_INSTALL_TARGET.
* debian/patches/01_DESTDIR.dpatch: Refreshed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*! \file
 
2
    \ingroup CSCF
 
3
    \brief Enter brief description of file here 
 
4
*/
 
5
/* $Log$
 
6
 * Revision 1.7  2004/10/08 17:33:41  nruss
 
7
 * Modified iwl_rdone() to acept boolean for deleteing one-electron ints. -NJR
 
8
 *
 
9
/* Revision 1.6  2002/12/06 15:50:32  crawdad
 
10
/* Changed all exit values to PSI_RETURN_SUCCESS or PSI_RETURN_FAILURE as
 
11
/* necessary.  This is new for the PSI3 execution driver.
 
12
/* -TDC
 
13
/*
 
14
/* Revision 1.5  2002/04/03 02:06:01  janssen
 
15
/* Finish changes to use new include paths for libraries.
 
16
/*
 
17
/* Revision 1.4  2002/03/06 22:44:41  sherrill
 
18
/* Add new keyword orthog_only = true to just orthogonalize orbitals and do
 
19
/* nothing else.
 
20
/*
 
21
/* Revision 1.3  2001/06/21 21:00:37  crawdad
 
22
/* I have simplified the libiwl functions iwl_rdone() and iwl_wrtone() to only
 
23
/* read and write one-electron quantities and to more explicitly use the libpsio
 
24
/* structure to allow multiple quantities in a single one-electron IWL file.
 
25
/* The frozen-core energy is no longer dealt with in these functions, but is
 
26
/* now handled in libfile30.  The argument lists for these functions have
 
27
/* therefore changed quite a lot, and I've tried to correct all the PSI3
 
28
/* codes that are affected.
 
29
/* -TDC
 
30
/*
 
31
/* Revision 1.2  2000/10/13 19:51:21  evaleev
 
32
/* Cleaned up a lot of stuff in order to get CSCF working with the new "Mo-projection-capable" INPUT.
 
33
/*
 
34
/* Revision 1.1.1.1  2000/02/04 22:52:31  evaleev
 
35
/* Started PSI 3 repository
 
36
/*
 
37
/* Revision 1.3  1999/11/02 18:10:14  evaleev
 
38
/* Direct SCF improved
 
39
/*
 
40
/* Revision 1.2  1999/08/17 19:04:16  evaleev
 
41
/* Changed the default symmetric orthogonalization to the canonical
 
42
/* orthogonalization. Now, if near-linear dependencies in the basis are found,
 
43
/* eigenvectors of the overlap matrix with eigenvalues less than 1E-6 will be
 
44
/* left out. This will lead to num_mo != num_so, i.e. SCF eigenvector is no
 
45
/* longer a square matrix. Had to rework some routines in libfile30, and add some.
 
46
/* The progrem prints out a warning if near-linear dependencies are found. TRANSQT
 
47
/* and a whole bunch of other codes has to be fixed to work with such basis sets.
 
48
/*
 
49
/* Revision 1.1.1.1  1999/04/12 16:59:27  evaleev
 
50
/* Added a version of CSCF that can work with CINTS.
 
51
/* -Ed
 
52
 * */
 
53
 
 
54
#define EXTERN
 
55
#include "includes.h"
 
56
#include "common.h"
 
57
#include <libiwl/iwl.h>
 
58
 
 
59
namespace psi { namespace cscf {
 
60
 
 
61
void rdone_iwl()
 
62
{
 
63
  int stat;
 
64
  int ntri = ioff[nbasis];
 
65
  int i,j,k,jj,kk;
 
66
  int max,off;
 
67
  double *ints;
 
68
  double e_fzc;
 
69
 
 
70
  /* If it's a direct SCF run - tell CINTS to compute one-electron integrals */
 
71
  if (direct_scf) {
 
72
    stat = system("cints --oeints");
 
73
    switch (stat) {
 
74
    case 0:
 
75
      /* CINTS ran successfully - continue */
 
76
      break;
 
77
 
 
78
    default:
 
79
      /* Something went wrong */
 
80
      fprintf(outfile,"  rdone_iwl: System call to CINTS failed. Check to see if it's in your PATH\n");
 
81
      fprintf(stderr,"System call to CINTS failed. Check to see if it's in your PATH.\n");
 
82
      exit(PSI_RETURN_FAILURE);
 
83
    }
 
84
  }
 
85
 
 
86
  ints = init_array(ntri);
 
87
 
 
88
  /* S integrals */
 
89
  stat = iwl_rdone(itapS,PSIF_SO_S,ints,ntri,0, 0, outfile); 
 
90
  for(i=0;i<num_ir;i++) {
 
91
    max = scf_info[i].num_so;
 
92
    off = scf_info[i].ideg;
 
93
    for(j=0;j<max;j++) {
 
94
      jj = j + off;
 
95
      for(k=0;k<=j;k++) {
 
96
        kk = k + off;
 
97
        scf_info[i].smat[ioff[j]+k] = ints[ioff[jj]+kk];
 
98
      }
 
99
    }
 
100
  }
 
101
 
 
102
  /* T integrals */
 
103
  stat = iwl_rdone(itapT,PSIF_SO_T,ints,ntri, 0, 0, outfile);
 
104
  for(i=0;i<num_ir;i++) {
 
105
    max = scf_info[i].num_so;
 
106
    off = scf_info[i].ideg;
 
107
    for(j=0;j<max;j++) {
 
108
      jj = j + off;
 
109
      for(k=0;k<=j;k++) {
 
110
        kk = k + off;
 
111
        scf_info[i].tmat[ioff[j]+k] = ints[ioff[jj]+kk];
 
112
      }
 
113
    }
 
114
  }
 
115
 
 
116
  /* V integrals */
 
117
  stat = iwl_rdone(itapV,PSIF_SO_V,ints,ntri,0, 0, outfile);
 
118
  for(i=0;i<num_ir;i++) {
 
119
    max = scf_info[i].num_so;
 
120
    off = scf_info[i].ideg;
 
121
    for(j=0;j<max;j++) {
 
122
      jj = j + off;
 
123
      for(k=0;k<=j;k++) {
 
124
        kk = k + off;
 
125
        scf_info[i].hmat[ioff[j]+k] = ints[ioff[jj]+kk] + scf_info[i].tmat[ioff[j]+k];
 
126
      }
 
127
    }
 
128
  }
 
129
  free(ints);
 
130
}
 
131
 
 
132
}} // namespace psi::cscf