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

« back to all changes in this revision

Viewing changes to src/bin/cints/Tools/quartet_data.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 quartet_data.cc
 
2
    \ingroup CINTS
 
3
    \brief Enter brief description of file here 
 
4
*/
 
5
#include<cmath>
 
6
#include<cstdio>
 
7
#include<cstring>
 
8
#include<memory.h>
 
9
#include<cstdlib>
 
10
#include<libint/libint.h>
 
11
 
 
12
#include"defines.h"
 
13
#define EXTERN
 
14
#include"global.h"
 
15
#include <stdexcept>
 
16
#ifdef USE_TAYLOR_FM
 
17
  #include"taylor_fm_eval.h"
 
18
#else
 
19
  #include"int_fjt.h"
 
20
#endif
 
21
 
 
22
namespace psi { namespace CINTS {
 
23
 
 
24
/*!--------------------------------------------------------------------------------
 
25
  This function computes constants used in OSRR for a given quartet of primitives
 
26
 --------------------------------------------------------------------------------*/
 
27
void quartet_data(prim_data *Data, double_array_t *fjt_table, double AB2, double CD2,
 
28
                  struct shell_pair *sp1, struct shell_pair *sp2, 
 
29
                  int am, int pi, int pj, int pk, int pl, double scale)
 
30
{
 
31
#define STATIC_OO2NP1
 
32
#include "static.h"
 
33
 
 
34
  /*----------------
 
35
    Local variables
 
36
   ----------------*/
 
37
  struct coordinates PQ, W;
 
38
#ifdef USE_TAYLOR_FM
 
39
  double F[4*CINTS_MAX_AM];
 
40
#endif
 
41
  int i;
 
42
  double small_T = UserOptions.cutoff;       /*--- Use only one term in Taylor expansion of Fj(T) if T < small_T ---*/
 
43
  double T;
 
44
  double coef1;
 
45
  double PQ2;
 
46
  double oozn;
 
47
  double zeta, eta, rho;
 
48
 
 
49
  zeta = sp1->gamma[pi][pj];
 
50
  eta = sp2->gamma[pk][pl];
 
51
  oozn = 1.0/(zeta+eta);
 
52
  Data->poz = eta*oozn;
 
53
  rho = zeta*Data->poz;
 
54
  coef1 = 2.0*sqrt(rho*M_1_PI)*scale*sp1->Sovlp[pi][pj]*sp2->Sovlp[pk][pl];
 
55
  PQ.x = sp1->P[pi][pj][0] - sp2->P[pk][pl][0];
 
56
  PQ.y = sp1->P[pi][pj][1] - sp2->P[pk][pl][1];
 
57
  PQ.z = sp1->P[pi][pj][2] - sp2->P[pk][pl][2];
 
58
  PQ2 = PQ.x*PQ.x;
 
59
  PQ2 += PQ.y*PQ.y;
 
60
  PQ2 += PQ.z*PQ.z;
 
61
  T = rho*PQ2;
 
62
 
 
63
  if (!am) {
 
64
#ifdef USE_TAYLOR_FM
 
65
    taylor_compute_fm(F,T,0);
 
66
    Data->F[0] = F[0]*coef1;
 
67
#else
 
68
    int_fjt(fjt_table,0,T);
 
69
    Data->F[0] = fjt_table->d[0]*coef1;
 
70
#endif
 
71
  }
 
72
  else {
 
73
    Data->oo2zn = 0.5*oozn;
 
74
    Data->pon = zeta*oozn;
 
75
    Data->oo2z = 0.5/zeta;
 
76
    Data->oo2n = 0.5/eta;
 
77
    W.x = (sp1->P[pi][pj][0]*zeta+sp2->P[pk][pl][0]*eta)*oozn;
 
78
    W.y = (sp1->P[pi][pj][1]*zeta+sp2->P[pk][pl][1]*eta)*oozn;
 
79
    W.z = (sp1->P[pi][pj][2]*zeta+sp2->P[pk][pl][2]*eta)*oozn;
 
80
 
 
81
    if(T < small_T){ 
 
82
      for(i=0; i<=am; i++) 
 
83
        Data->F[i] = oo2np1[i]*coef1;
 
84
    }
 
85
    else {
 
86
#ifdef USE_TAYLOR_FM
 
87
      taylor_compute_fm(F,T,am);
 
88
      for(i=0;i<=am;i++)
 
89
        Data->F[i] = F[i]*coef1;
 
90
#else
 
91
      int_fjt(fjt_table,am,T);
 
92
      for(i=0;i<=am;i++)
 
93
        Data->F[i] = fjt_table->d[i]*coef1;
 
94
#endif
 
95
    }
 
96
 
 
97
    /* PA */
 
98
    Data->U[0][0] = sp1->PA[pi][pj][0];
 
99
    Data->U[0][1] = sp1->PA[pi][pj][1];
 
100
    Data->U[0][2] = sp1->PA[pi][pj][2];
 
101
    /* QC */
 
102
    Data->U[2][0] = sp2->PA[pk][pl][0];
 
103
    Data->U[2][1] = sp2->PA[pk][pl][1];
 
104
    Data->U[2][2] = sp2->PA[pk][pl][2];
 
105
    /* WP */
 
106
    Data->U[4][0] = W.x - sp1->P[pi][pj][0];
 
107
    Data->U[4][1] = W.y - sp1->P[pi][pj][1];
 
108
    Data->U[4][2] = W.z - sp1->P[pi][pj][2];
 
109
    /* WQ */
 
110
    Data->U[5][0] = W.x - sp2->P[pk][pl][0];
 
111
    Data->U[5][1] = W.y - sp2->P[pk][pl][1];
 
112
    Data->U[5][2] = W.z - sp2->P[pk][pl][2];
 
113
  }
 
114
 
 
115
  return;
 
116
}
 
117
 
 
118
 
 
119
};};