36 |
|
entry_plug = &info; |
37 |
|
myFF = the_ff; |
38 |
|
|
39 |
< |
|
39 |
> |
|
40 |
|
c_natoms = info.n_atoms; |
41 |
|
c_atoms = info.atoms; |
42 |
< |
c_sr_interactions = info.sr_interactions; |
43 |
< |
c_n_SRI = info.n_SRI; |
42 |
> |
nMols = info.n_mol; |
43 |
> |
molecules = info.molecules; |
44 |
|
c_is_constrained = 0; |
45 |
|
c_box_x = info.box_x; |
46 |
|
c_box_y = info.box_y; |
67 |
|
|
68 |
|
Constraint *temp_con; |
69 |
|
Constraint *dummy_plug; |
70 |
< |
temp_con = new Constraint[c_n_SRI]; |
70 |
> |
temp_con = new Constraint[info.n_SRI]; |
71 |
|
|
72 |
|
c_n_constrained = 0; |
73 |
|
int constrained = 0; |
74 |
< |
|
75 |
< |
for(int i = 0; i < c_n_SRI; i++){ |
74 |
> |
SRI** theArray; |
75 |
> |
for(int i = 0; i < nMols; i++){ |
76 |
|
|
77 |
< |
constrained = c_sr_interactions[i]->is_constrained(); |
78 |
< |
|
79 |
< |
if(constrained){ |
77 |
> |
theArray = molecules[i].getMyBonds(); |
78 |
> |
for(int j=0; j<molecules[i].getNbonds(); j++){ |
79 |
|
|
80 |
< |
dummy_plug = c_sr_interactions[i]->get_constraint(); |
81 |
< |
temp_con[c_n_constrained].set_a( dummy_plug->get_a() ); |
82 |
< |
temp_con[c_n_constrained].set_b( dummy_plug->get_b() ); |
83 |
< |
temp_con[c_n_constrained].set_dsqr( dummy_plug->get_dsqr() ); |
80 |
> |
constrained = theArray[j]->is_constrained(); |
81 |
> |
|
82 |
> |
if(constrained){ |
83 |
> |
|
84 |
> |
dummy_plug = theArray[j]->get_constraint(); |
85 |
> |
temp_con[c_n_constrained].set_a( dummy_plug->get_a() ); |
86 |
> |
temp_con[c_n_constrained].set_b( dummy_plug->get_b() ); |
87 |
> |
temp_con[c_n_constrained].set_dsqr( dummy_plug->get_dsqr() ); |
88 |
> |
|
89 |
> |
c_n_constrained++; |
90 |
> |
constrained = 0; |
91 |
> |
} |
92 |
> |
} |
93 |
|
|
94 |
< |
c_n_constrained++; |
95 |
< |
constrained = 0; |
94 |
> |
theArray = molecules[i].getMyBends(); |
95 |
> |
for(int j=0; j<molecules[i].getNbends(); j++){ |
96 |
> |
|
97 |
> |
constrained = theArray[j]->is_constrained(); |
98 |
> |
|
99 |
> |
if(constrained){ |
100 |
> |
|
101 |
> |
dummy_plug = theArray[j]->get_constraint(); |
102 |
> |
temp_con[c_n_constrained].set_a( dummy_plug->get_a() ); |
103 |
> |
temp_con[c_n_constrained].set_b( dummy_plug->get_b() ); |
104 |
> |
temp_con[c_n_constrained].set_dsqr( dummy_plug->get_dsqr() ); |
105 |
> |
|
106 |
> |
c_n_constrained++; |
107 |
> |
constrained = 0; |
108 |
> |
} |
109 |
> |
} |
110 |
> |
|
111 |
> |
theArray = molecules[i].getMyTorsions(); |
112 |
> |
for(int j=0; j<molecules[i].getNtorsions(); j++){ |
113 |
> |
|
114 |
> |
constrained = theArray[j]->is_constrained(); |
115 |
> |
|
116 |
> |
if(constrained){ |
117 |
> |
|
118 |
> |
dummy_plug = theArray[j]->get_constraint(); |
119 |
> |
temp_con[c_n_constrained].set_a( dummy_plug->get_a() ); |
120 |
> |
temp_con[c_n_constrained].set_b( dummy_plug->get_b() ); |
121 |
> |
temp_con[c_n_constrained].set_dsqr( dummy_plug->get_dsqr() ); |
122 |
> |
|
123 |
> |
c_n_constrained++; |
124 |
> |
constrained = 0; |
125 |
> |
} |
126 |
|
} |
127 |
+ |
|
128 |
+ |
|
129 |
|
} |
130 |
|
|
131 |
|
if(c_n_constrained > 0){ |
134 |
|
c_constrained_i = new int[c_n_constrained]; |
135 |
|
c_constrained_j = new int[c_n_constrained]; |
136 |
|
c_constrained_dsqr = new double[c_n_constrained]; |
137 |
< |
|
137 |
> |
|
138 |
|
for( int i = 0; i < c_n_constrained; i++){ |
139 |
|
|
140 |
|
/* add 1 to the index for the fortran arrays. */ |
141 |
< |
|
141 |
> |
|
142 |
|
c_constrained_i[i] = temp_con[i].get_a() + 1; |
143 |
|
c_constrained_j[i] = temp_con[i].get_b() + 1; |
144 |
|
c_constrained_dsqr[i] = temp_con[i].get_dsqr(); |