~ubuntu-branches/ubuntu/precise/psicode/precise

« back to all changes in this revision

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