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

« back to all changes in this revision

Viewing changes to src/bin/cints/Default_Deriv1/rot_inv.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 Routines for determining the rotational invariance of gradients.
 
4
*/
 
5
#include <cstdio>
 
6
#include <cstdlib>
 
7
#include <libipv1/ip_lib.h>
 
8
#include <cmath>
 
9
#include <masses.h>
 
10
#include <libint/libint.h>
 
11
#include <psifiles.h>
 
12
 
 
13
#include "defines.h"
 
14
#define EXTERN
 
15
#include "global.h"
 
16
 
 
17
namespace psi { namespace CINTS {
 
18
void check_rot_inv()
 
19
{
 
20
  int atom;
 
21
  double cross[] = {0.0, 0.0, 0.0} ;
 
22
  double mod_cross;
 
23
 
 
24
  for(atom=0; atom<Molecule.num_atoms; atom++) {
 
25
    cross[0] += (Molecule.centers[atom].y*Grad[atom][2] - Molecule.centers[atom].z*Grad[atom][1]);
 
26
    cross[1] += (Molecule.centers[atom].z*Grad[atom][0] - Molecule.centers[atom].x*Grad[atom][2]);
 
27
    cross[2] += (Molecule.centers[atom].x*Grad[atom][1] - Molecule.centers[atom].y*Grad[atom][0]);
 
28
  }
 
29
 
 
30
  mod_cross = sqrt(cross[0]*cross[0] + cross[1]*cross[1] + cross[2]*cross[2]);
 
31
 
 
32
  if (mod_cross > ROT_INV_TOLER) {
 
33
    printf("  Rotational invariance of the energy derivative is violated!\n\n");
 
34
    fprintf(outfile,"  Rotational invariance of the energy derivative is violated!\n");
 
35
    fprintf(outfile,"  |X cross Grad| = %15.12lf\n\n",mod_cross);
 
36
    abort();
 
37
  }
 
38
  else {
 
39
    fprintf(outfile,"  Rotational invariance condition satisfied.\n");
 
40
    fprintf(outfile,"  |X cross Grad| = %15.12lf   (it is the accuracy of the computed forces)\n",mod_cross);
 
41
    fprintf(outfile,"  So long..\n\n");
 
42
  }
 
43
  
 
44
  return;
 
45
}
 
46
};};