-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathicoord.h
More file actions
320 lines (260 loc) · 7.03 KB
/
icoord.h
File metadata and controls
320 lines (260 loc) · 7.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
#ifndef ICOORD_H
#define ICOORD_H
#include "stringtools.h"
#include "pTable.h"
//#include "grad.h"
class ICoord {
private:
//move gradient back to private!
int g_inited;
// int* atypes; //array of MM atom types
double* amasses; //array of atomic masses
double* amasses3;
// double* charge; //array of MM atomic charges
// string comment;
double* dxm1;
//stepsize controllers
double dEpre;
double smag;
int** imptor;
int nfrags;
int* frags;
int max_bonds;
int max_angles;
int max_torsions;
int max_imptor;
int max_nonbond;
int n_nonbond;
int** nonbond;
double* nonbondd;
void structure_read(string xyzfile);
void alloc_mem();
void make_bonds();
void coord_num();
void make_angles();
void make_torsions();
void hbond_frags();
void linear_ties();
void h2o_torsions();
void tm_ties();
void make_imptor();
// ic creation function when bonds are already made
void make_imptor_nobonds();
int make_nonbond();
//
void update_bonds();
void update_angles();
void update_torsion();
void update_imptor();
void update_nonbond();
void create_xyz();
double close_bond(int i);
double close_angle(int i);
double close_tor(int i);
int ixflag;
// MM force field params
double* ffR;
double* ffeps;
double ffbondd(int i, int j);
double ffbonde(int i, int j);
double ffangled(int i, int j);
double ffanglee(int i, int j);
double fftord(int i, int j, int k, int l);
double fftore(int i, int j, int k, int l);
double fftorm(int i, int j, int k, int l); //multiplicity
double ffimptore(int i, int j, int k, int l);
double ffimptord(int i, int j, int k, int l);
// function to make arrays?
// Gradient terms
double* bmat;
double* bmatti;
void print_grad();
void print_gradq();
void bond_grad_all();
void bond_grad_1(int i, int j);
double bond_stretch(int i, int j);
void angle_grad_all();
void angle_grad_1(int i, int j, int k);
void torsion_grad_all();
void torsion_grad_1(int i, int j, int k, int l);
void imptor_grad_all();
void imptor_grad_1(int i, int j, int k, int l);
double vdw_energy_all();
double vdw_energy_1(int i, int j);
void vdw_grad_all();
void vdw_grad_1(int i, int j);
//Optimizer
//void update_ic_sd();
//void update_ic_cg();
void update_ic_qn();
void update_ic_eigen();
void update_ic_eigen_h(double* C, double* D);
void update_ic_eigen_ts(double* C);
void walk_up();
void force_notbonds();
void bmatp_dqbdx(int a1, int a2, double* dqbdx);
void bmatp_dqadx(int a1, int a2, int a3, double* dqadx);
void bmatp_dqtdx(int a1, int a2, int a3, int a4, double* dqtdx);
// ofstream xyzfile;
void print_xyzf(ofstream xyzfile); // print xyz coords to file
//for avoiding regions of space
int nnodes;
double prima_force();
double* prima;
int* aprima;
double* Cp;
double mdist;
void lin_grad_1(int i, int j, double scale);
char* sbuff;
double* Gmh; //Gm^1/2
double* Gmih; //Gm^-1/2
void get_gm();
void create_mwHint_EV(double* Lm, double* Lme);
public:
int revertOpt;
//Gradient grad1;
string printout;
double FMAG;
double OPTTHRESH;
double MAXAD;
double DMAX;
double DMIN0;
double SCALEQN0;
double SCALEQN;
double V0;
int* frozen;
double farBond;
int isTSnode;
int nneg;
int newHess;
int optCG;
int do_bfgs;
int noptdone;
double path_overlap;
int path_overlap_n;
double path_overlap_e_g;
void update_bfgs();
void update_bfgsp(int makeHint);
void update_bofill();
void save_hess();
double getR(int i);
int nicd;
int nicd0; //before constraint applied
double* bondd;
double* anglev;
double* torv;
double* torv0;
double* torfix;
double* imptorv;
int** bonds;
int nbonds;
int** angles;
int nangles;
int** torsions;
int ntor;
double* grad;
// double* pgrad;
double* gradq;
double* pgradq;
double* gradqprim;
double* pgradqprim;
double* dq0;
double* dqm1;
double* dqprim;
double* Hint;
double* Hintp;
double* Hinv;
double* q;
int useExactH;
int isOpt;
int stage1opt;
double pgradrms;
double gradrms;
void make_Hint();
void Hintp_to_Hint();
int davidson_H(int neigen);
int isDavid;
int id; //for geoms[id] in zstruct
int pid; // previous structure id
int natoms;
double* coords;
double* coordsts;
double* coords0;
string* anames; //array of atomic symbols
int* anumbers; //array of atomic indices
int* coordn; //coordination number
int nimptor;
int ic_create();
int ic_create_nobonds();
double mm_energy();
int mm_grad();
int mm_grad(ICoord shadow);
int grad_to_q();
int ic_to_xyz();
int ic_to_xyz_opt();
// int qchem_init(string infilename, int ncpu, int run, int rune);
int grad_init(string infilename, int ncpu, int run, int rune, int use_knnr, int q1);
string runends;
string runend2;
double* bmatp; // in primitives
int get_tangent();
int distance_matrix_ic(ICoord ic1, ICoord ic2);
int union_ic(ICoord ic1, ICoord ic2);
int copy_ic(ICoord ic1);
void write_ic(string filename);
int read_ics(string filename);
int opt();
int opt(string xyzfile, ICoord shadow);
int opt(string xyzfile);
void opt_constraint(double* C);
double opt_a(int nnewb, int* newb, int nnewt, int* newt, string xyzfile_string, int nsteps);
double opt_b(string xyzfile_string, int nsteps);
double opt_c(string xyzfile_string, int nsteps, double* C, double* C0);
double opt_r(string xyzfile_string, int nsteps, double* C, double* C0, double* D, int type);
double opt_eigen_ts(string xyzfile_string, int nsteps, double* C, double* C0);
void update_ic();
void mm_init();
int bmat_alloc();
int bmat_free();
int bmatp_finite();
int bmatp_create();
int bmatp_to_U();
int bmat_create();
double* Ut;
double* Ut0;
// help functions for iso
int bond_exists(int b1, int b2);
int bond_num(int b1, int b2);
int angle_num(int b1, int b2, int b3);
int tor_num(int b1, int b2, int b3, int b4);
int hpair(int a1, int a2);
int h2count();
int same_struct(double* xyz);
int init(string xyzfile);
int init(int natoms, string* anames, int* anumbers, double* xyz);
int alloc(int size);
int reset(int natoms, string* anames, int* anumbers, double* xyz);
int reset(double* xyz);
void print_q();
void print_ic();
void print_bonds();
void print_xyz();
void print_xyz_save(string filename);
void print_xyz_save(string xyzfile_string, double energy);
double distance(int i, int j);
double angle_val(int i, int j, int k);
double torsion_val(int i, int j, int k, int l); // for imptor and torsion
void freemem();
//for Hessian tangent
int use_constraint;
int ridge;
int create_prima(int nnodes, int nbonds, int nangles, int ntor, double** tangents);
void save_hesspu(string filename);
void save_hessp(string filename);
void read_hessp(string filename);
void read_hessxyz(string filename, int write);
void make_frags();
void bond_frags();
int isTM(int anum);
};
#endif