~ubuntu-branches/ubuntu/vivid/psicode/vivid

« back to all changes in this revision

Viewing changes to src/bin/detcas/ints.c

  • 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
 
/*
2
 
** INTS.C
3
 
**
4
 
** Return values of one and two-electron integrals
5
 
**
6
 
** C. David Sherrill
7
 
** University of California, Berkeley
8
 
**
9
 
** Based on code from the DETCI program
10
 
** April 1998
11
 
*/
12
 
 
13
 
#include <stdlib.h>
14
 
#include <stdio.h>
15
 
#include <libiwl/iwl.h>
16
 
#include <libciomr/libciomr.h>
17
 
#include <libqt/qt.h>
18
 
#include <psifiles.h>
19
 
#include "globaldefs.h"
20
 
#include "globals.h"
21
 
 
22
 
void read_integrals()
23
 
{
24
 
  int i, j, ij, k, l, kl, ijkl;
25
 
  int nbstri;
26
 
  double value;
27
 
 
28
 
  /* allocate memory for one and two electron integrals */
29
 
  nbstri = CalcInfo.nbstri;
30
 
  CalcInfo.onel_ints = init_array(nbstri);
31
 
  CalcInfo.twoel_ints = init_array(nbstri * (nbstri + 1) / 2);
32
 
 
33
 
  /* now read them in */
34
 
 
35
 
  if (Params.use_fzc_h) {
36
 
    if (Params.print_lvl > 3) 
37
 
      fprintf(outfile, "\n\tOne-electron integrals (frozen core operator):\n");
38
 
    iwl_rdone(Params.oei_file, PSIF_MO_FZC, CalcInfo.onel_ints, nbstri, 
39
 
              Params.oei_erase, (Params.print_lvl>3), outfile);
40
 
  }
41
 
  else {
42
 
    if (Params.print_lvl > 3) 
43
 
      fprintf(outfile, "\n\tOne-electron integrals (bare):\n");
44
 
    iwl_rdone(Params.oei_file, PSIF_MO_OEI, CalcInfo.onel_ints, nbstri, 
45
 
              Params.oei_erase, (Params.print_lvl>3), outfile);
46
 
  }
47
 
 
48
 
  if (Params.print_lvl > 4) 
49
 
    fprintf(outfile, "\n\tTwo-electron integrals:\n");
50
 
 
51
 
  iwl_rdtwo(Params.tei_file, CalcInfo.twoel_ints, ioff, 
52
 
     CalcInfo.nmo, Params.filter_ints ? CalcInfo.num_fzc_orbs : 0, 
53
 
     Params.filter_ints ? CalcInfo.num_fzv_orbs : 0, 
54
 
     (Params.print_lvl>4), outfile);
55
 
 
56
 
57
 
 
58
 
 
59
 
 
60
 
double get_onel(int i, int j)
61
 
{
62
 
  int ij;
63
 
 
64
 
  ij = INDEX(i,j);
65
 
  return(CalcInfo.onel_ints[ij]);
66
 
}
67
 
 
68
 
 
69
 
double get_twoel(int i, int j, int k, int l)
70
 
{
71
 
  int ij, kl, ijkl;
72
 
 
73
 
  ij = INDEX(i,j);
74
 
  kl = INDEX(k,l);
75
 
  ijkl = INDEX(ij,kl);
76
 
 
77
 
  return(CalcInfo.twoel_ints[ijkl]);
78
 
}
79
 
 
80
 
 
81
 
/*
82
 
** get_mat_block()
83
 
**
84
 
** This function gets an irrep block of a full matrix
85
 
**
86
 
** C. David Sherrill
87
 
** May 1998
88
 
*/
89
 
void get_mat_block(double **src, double **dst, int dst_dim, int dst_offset,
90
 
                   int *dst2src)
91
 
{
92
 
 
93
 
  int P, Q, p, q;
94
 
 
95
 
  for (P=0; P<dst_dim; P++) {
96
 
    p = dst2src[P+dst_offset];
97
 
    for (Q=0; Q<dst_dim; Q++) {
98
 
      q = dst2src[Q+dst_offset];
99
 
      dst[P][Q] = src[p][q];
100
 
    } 
101
 
  }
102
 
 
103
 
}
104
 
 
105