~ubuntu-branches/ubuntu/quantal/psicode/quantal

« back to all changes in this revision

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