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

« back to all changes in this revision

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