-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathicoord.h
197 lines (154 loc) · 4.58 KB
/
icoord.h
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
#ifndef ICOORD_H
#define ICOORD_H
#include "stringtools.h"
#include "pTable.h"
#include <memory>
class ICoord {
private:
int data;
// int* atypes; //array of MM atom types // assign values directly?
double* amasses; //array of atomic masses
// double* charge; //array of MM atomic charges
double* dxm1;
double* bondd;
double* anglev;
double* torv;
double* imptorv;
int* frozen;
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 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();
// 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* grad;
double gradrms;
double pgradrms;
void print_grad();
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);
void vdw_grad_all();
void vdw_grad_1(int i, int j);
//Optimizer
void update_xyz_sd();
void update_xyz_cg();
// ofstream xyzfile;
void print_xyzf(ofstream xyzfile); // print xyz coords to file
public:
ICoord(int natoms); //constructor
~ICoord(void); //destructor
string comment;
int** bonds;
int nbonds;
int** angles;
int nangles;
int** torsions;
int ntor;
int** imptor;
int nskip;
int* skip;
int id; //for geoms[id] in zstruct
int pid; // previous structure id
double seenergy;
double segsmenergy;
double dftenergy;
double dftlstenergy;
double dftgsmenergy;
double dfttsenergy;
int natoms;
double* coords;
double* coordsr;
double* coordsp;
double* coordsi;
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();
int mm_grad();
int mm_grad(ICoord shadow);
void freeze(int natoms0, int* frz0);
int opt();
int opt(string xyzfile, ICoord shadow);
int opt(string xyzfile);
void update_ic();
void update_bonds();
void mm_init();
// help functions for iso
int bond_exists(int b1, int b2);
int bond_num(int b1, int b2);
int hpair(int a1, int a2);
int h2count();
double getR(int i);
int same_struct(double* xyz);
void init(vector<string> & anam, vector<double> & xyz); //for smart pointer
void init(int natoms, vector<string> & anam, vector<double> & xyz);
void initxyz(vector<string> &anam, vector<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 bonds_union(int sokt, int plg, int bond2plg, const unique_ptr<ICoord> & ict, const unique_ptr<ICoord> & icr);
//joint as label as TM in the last element for both ic1 and ic2.
int newpos(int plg, int bond2plg, int pos);
void bonds_ligand_merge(ICoord & ic1, ICoord & ic2, int t2);
void copy_bonds(ICoord & icnow);
void duplicate(ICoord & ic);
int copy_ic(ICoord ic1);
int union_ic(ICoord ic1, ICoord ic2);
int union_ic2(int wb, ICoord ic1, ICoord ic2);
int union_ic3(int wb1, int wb2, ICoord ic1, ICoord ic2);
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();
};
#endif