ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/freemol/trunk/smi23d/src/mengine/attach.c
Revision: 3
Committed: Mon Jun 9 21:38:26 2008 UTC (11 years, 4 months ago) by tjod
File size: 2878 byte(s)
Log Message:
test

Line File contents
1 #define EXTERN extern
2
3 #include "pcwin.h"
4 #include "pcmod.h"
5
6
7 struct t_attached {
8 int *n13, *n14;
9 int **i13, **i14; //**i13[12][MAXATOM ], **i14[144][MAXATOM ];
10 } attached;
11
12 EXTERN struct t_minim_control {
13 int type, method, field, added_const;
14 char added_path[256],added_name[256];
15 } minim_control;
16
17 void attach(void);
18
19 void attach()
20 {
21 int i,j,k,m,p;
22 int jj,kk,mm, jji;
23
24 for (i=1; i <= natom; i++)
25 {
26 attached.n13[i] = 0;
27 for (j=0; j < MAXIAT; j++)
28 {
29 jj = atom[i].iat[j];
30 jji = 0;
31 for (mm = 0; mm < MAXIAT; mm++)
32 {
33 if (atom[jj].iat[mm] != 0 && atom[jj].bo[mm] != 9)
34 jji++;
35 }
36
37 if ( atom[jj].type < 300 && jji < 7 )
38 {
39 if (jj != 0 && atom[i].bo[j] != 9)
40 {
41 for(k=0; k < MAXIAT; k++)
42 {
43 kk = atom[jj].iat[k];
44 if (kk != i && kk != 0 && atom[jj].bo[k] != 9)
45 {
46 for (m=0; m < MAXIAT; m++)
47 {
48 if (kk == atom[i].iat[m])
49 break;
50 }
51 attached.i13[attached.n13[i]][i] = kk;
52 attached.n13[i]++;
53 }
54 }
55 }
56 }
57 }
58 }
59 // find 14 relations
60 for (i=1; i <= natom; i++)
61 {
62 attached.n14[i] = 0;
63 for (j=0; j < MAXIAT; j++)
64 {
65 jj = atom[i].iat[j];
66 if (jj != 0 && atom[i].bo[j] != 9 && atom[jj].type < 300)
67 {
68 for(k=0; k < MAXIAT; k++)
69 {
70 kk = atom[jj].iat[k];
71 if (kk != 0 && atom[jj].bo[k] != 9 && atom[kk].type < 300)
72 {
73 for (m = 0; m < MAXIAT; m++)
74 {
75 mm = atom[kk].iat[m];
76 if (mm != i && mm != 0 && atom[kk].bo[m] != 9)
77 {
78 for (p=0; p < MAXIAT; p++)
79 {
80 if (mm == atom[i].iat[p])
81 goto L_20;
82 }
83 for (p=0; p < attached.n13[i]; p++)
84 {
85 if (mm == attached.i13[p][i])
86 goto L_20;
87 }
88 attached.i14[attached.n14[i]][i] = mm;
89 attached.n14[i]++;
90 }
91 L_20:
92 continue;
93 }
94 }
95 }
96 }
97 }
98 }
99 }