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

« back to all changes in this revision

Viewing changes to src/bin/cints/Tools/norm_quartet.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
 
#include<math.h>
2
 
#include<stdio.h>
3
 
#include<string.h>
4
 
#include<memory.h>
5
 
#include<stdlib.h>
6
 
#include<libint/libint.h>
7
 
#include"defines.h"
8
 
#define EXTERN
9
 
#include"global.h"
10
 
#include"transform.h"
11
 
 
12
 
/*------------------------------------------------------------------------------------
13
 
  This functions processes the computed integrals quartet:
14
 
  1) Normalizes cartesian components to unity;
15
 
  2) Transforms integrals from cartesian to pure angular momentum basis (if needed);
16
 
 ------------------------------------------------------------------------------------*/
17
 
double *norm_quartet(double *data, double *puream_data, int am[4], int puream)
18
 
{
19
 
  int ii, jj, kk, ll;
20
 
  int ni, nj, nk, nl;
21
 
  double *tmp_ptr;
22
 
  const double *ptr_i, *ptr_j, *ptr_k, *ptr_l;
23
 
  double norm_i, norm_ij, norm_ijk;
24
 
#pragma disjoint (*tmp_ptr,norm_i)
25
 
#pragma disjoint (*tmp_ptr,norm_ij)
26
 
#pragma disjoint (*tmp_ptr,norm_ijk)
27
 
 
28
 
 
29
 
  /*--- numbers of integrals in each shell ---*/
30
 
  ni = ioff[am[0] + 1];
31
 
  nj = ioff[am[1] + 1];
32
 
  nk = ioff[am[2] + 1];
33
 
  nl = ioff[am[3] + 1];
34
 
 
35
 
  /*------------------------------------------------------------------------------------
36
 
    Normalize contracted integrals - right here each cartesian component in the shell
37
 
    has the same normalization coefficient so that only components with radial parts of
38
 
    x^l, y^l, and z^l are normalized to unity. After this block of code all basis
39
 
    functions are normalized to unity. Needed this so that integrals in terms of
40
 
    puream i-functions were computed properly.
41
 
 
42
 
    N.B.: possibly, LIBINT should be rewritten so that all intermediates are computed in
43
 
    terms of normalized functions?!
44
 
   ------------------------------------------------------------------------------------*/
45
 
  ptr_i = GTOs.bf_norm[am[0]];
46
 
  ptr_j = GTOs.bf_norm[am[1]];
47
 
  ptr_k = GTOs.bf_norm[am[2]];
48
 
  ptr_l = GTOs.bf_norm[am[3]];
49
 
  
50
 
  tmp_ptr = data;
51
 
  for(ii=0; ii<ni; ii++) {
52
 
    norm_i = ptr_i[ii];
53
 
    for(jj=0; jj<nj; jj++) {
54
 
      norm_ij = norm_i*ptr_j[jj];
55
 
      for(kk=0; kk<nk; kk++) {
56
 
        norm_ijk = norm_ij*ptr_k[kk];
57
 
        for(ll=0; ll<nl; ll++) {
58
 
          *(tmp_ptr++) *= norm_ijk*ptr_l[ll];
59
 
        }
60
 
      }
61
 
    }
62
 
  }
63
 
 
64
 
 
65
 
  /*--------------------------------------------------
66
 
    Cartesian to pure angular momentum transformation
67
 
   --------------------------------------------------*/
68
 
  if (puream) {
69
 
#if !USE_MM
70
 
    if (am[0]) {
71
 
      ni = 2*am[0]+1;
72
 
      transform_i(data,puream_data,GTOs.cart2pureang[am[0]],am[0],nj,nk,nl);
73
 
      tmp_ptr = data;
74
 
      data = puream_data;
75
 
      puream_data = tmp_ptr;
76
 
    }
77
 
    if (am[1]) {
78
 
      nj = 2*am[1]+1;
79
 
      transform_j(data,puream_data,GTOs.cart2pureang[am[1]],am[1],ni,nk,nl);
80
 
      tmp_ptr = data;
81
 
      data = puream_data;
82
 
      puream_data = tmp_ptr;
83
 
    }
84
 
    if (am[2]) {
85
 
      nk = 2*am[2]+1;
86
 
      transform_k(data,puream_data,GTOs.cart2pureang[am[2]],am[2],ni,nj,nl);
87
 
      tmp_ptr = data;
88
 
      data = puream_data;
89
 
      puream_data = tmp_ptr;
90
 
    }
91
 
    if (am[3]) {
92
 
      nl = 2*am[3]+1;
93
 
      transform_l(data,puream_data,GTOs.cart2pureang[am[3]],am[3],ni,nj,nk);
94
 
      tmp_ptr = data;
95
 
      data = puream_data;
96
 
      puream_data = tmp_ptr;
97
 
    }
98
 
#elif USE_MM && !SPARSE_C2P
99
 
    /*--- N.B. am[0] >= am[1] ---*/
100
 
    if (am[0])
101
 
      data = transform_ijkl(data,puream_data,GTOs.cc2pp[am[0]][am[1]],
102
 
                            GTOs.cc2pp[am[2]][am[3]],1,am[0],am[1],am[2],am[3]);
103
 
    else
104
 
      data = transform_ijkl(data,puream_data,NULL,GTOs.cc2pp[am[2]][am[3]],0,
105
 
                            am[0],am[1],am[2],am[3]);
106
 
#elif USE_MM && SPARSE_C2P
107
 
    /*--- N.B. am[0] >= am[1] ---*/
108
 
    if (am[0])
109
 
      data = transform_ijkl_sparse(data,puream_data,
110
 
                                   GTOs.pp2cc_sparse[am[0]][am[1]],
111
 
                                   GTOs.cc2pp_sparse[am[2]][am[3]],
112
 
                                   GTOs.pp2cc_rowlength[am[0]][am[1]],
113
 
                                   GTOs.cc2pp_rowlength[am[2]][am[3]],
114
 
                                   1,am[0],am[1],am[2],am[3]);
115
 
    else
116
 
      data = transform_ijkl_sparse(data,puream_data,NULL,
117
 
                                   GTOs.cc2pp_sparse[am[2]][am[3]],
118
 
                                   NULL,GTOs.cc2pp_rowlength[am[2]][am[3]],
119
 
                                   0,am[0],am[1],am[2],am[3]);
120
 
#endif
121
 
  }
122
 
 
123
 
  return data;
124
 
}
125