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

« back to all changes in this revision

Viewing changes to src/bin/cints/Default_Deriv1/symmetrize_deriv1.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
 
 
6
#include <cstdio>
 
7
 
 
8
#include <cmath>
 
9
#include <vector>
 
10
#include <libipv1/ip_lib.h>
 
11
#include <libciomr/libciomr.h>
 
12
#include <libint/libint.h>
 
13
 
 
14
#include "defines.h"
 
15
#define EXTERN
 
16
#include "global.h"
 
17
using namespace std;
 
18
 
 
19
namespace psi { namespace CINTS {
 
20
 
 
21
void symmetrize_deriv1()
 
22
{
 
23
  int atom, atom2;
 
24
  int symop;
 
25
  double grad[3];
 
26
  vector<vector<double> > symm_grad(Molecule.num_atoms);
 
27
 
 
28
  for(atom=0; atom<Molecule.num_atoms; atom++) {
 
29
    vector<double> vdummy(3);
 
30
    symm_grad[atom]=vdummy;
 
31
    grad[0] = grad[1] = grad[2] = 0.0;
 
32
    for(symop=0;symop<Symmetry.nirreps;symop++) {
 
33
      atom2 = Symmetry.ict[symop][atom]-1;
 
34
      grad[0] += Symmetry.cartrep[symop][0]*Grad[atom2][0] +
 
35
        Symmetry.cartrep[symop][1]*Grad[atom2][1] +
 
36
        Symmetry.cartrep[symop][2]*Grad[atom2][2];
 
37
      grad[1] += Symmetry.cartrep[symop][3]*Grad[atom2][0] +
 
38
        Symmetry.cartrep[symop][4]*Grad[atom2][1] +
 
39
        Symmetry.cartrep[symop][5]*Grad[atom2][2];
 
40
      grad[2] += Symmetry.cartrep[symop][6]*Grad[atom2][0] +
 
41
        Symmetry.cartrep[symop][7]*Grad[atom2][1] +
 
42
        Symmetry.cartrep[symop][8]*Grad[atom2][2];
 
43
    }
 
44
    symm_grad[atom][0] = grad[0]/Symmetry.nirreps;
 
45
    symm_grad[atom][1] = grad[1]/Symmetry.nirreps;
 
46
    symm_grad[atom][2] = grad[2]/Symmetry.nirreps;
 
47
  }
 
48
 
 
49
  for(atom=0;atom<Molecule.num_atoms;atom++) {
 
50
    Grad[atom][0] = symm_grad[atom][0];
 
51
    Grad[atom][1] = symm_grad[atom][1];
 
52
    Grad[atom][2] = symm_grad[atom][2];
 
53
  }
 
54
 
 
55
  return;
 
56
}
 
57
};};