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

« back to all changes in this revision

Viewing changes to src/bin/oeprop/connectivity.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
 
#define EXTERN
2
 
#include "includes.h"
3
 
#include "prototypes.h"
4
 
#include "globals.h"
5
 
 
6
 
#define VDW_SCALE 0.5
7
 
 
8
 
void compute_connectivity()
9
 
{
10
 
  int i, j;
11
 
  int zi, zj;
12
 
  double radius_i, radius_j, rij;
13
 
#include <vdw_radii.h>
14
 
 
15
 
  connectivity = init_int_matrix(natom,natom);
16
 
  
17
 
  for(i=0;i<natom;i++) {
18
 
    zi = (int)zvals[i];
19
 
    radius_i = (zi <= LAST_VDW_RADII_INDEX) ? atomic_vdw_radii[zi] : atomic_vdw_radii[0];
20
 
    radius_i /= _bohr2angstroms;
21
 
    for(j=0;j<i;j++) {
22
 
      zj = (int)zvals[j];
23
 
      radius_j = (zj <= LAST_VDW_RADII_INDEX) ? atomic_vdw_radii[zj] : atomic_vdw_radii[0];
24
 
      radius_j /= _bohr2angstroms;
25
 
 
26
 
      rij = sqrt((geom[i][0] - geom[j][0])*(geom[i][0] - geom[j][0]) +
27
 
                 (geom[i][1] - geom[j][1])*(geom[i][1] - geom[j][1]) +
28
 
                 (geom[i][2] - geom[j][2])*(geom[i][2] - geom[j][2]));
29
 
 
30
 
      if (rij <= VDW_SCALE*(radius_i + radius_j))
31
 
        connectivity[i][j] = connectivity[j][i] = 1;
32
 
    }
33
 
  }
34
 
 
35
 
  return;
36
 
}