00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #include "ResizeArray.h"
00022 #include "Molecule.h"
00023
00024 class AtomSel;
00025 class Matrix4;
00026 class MoleculeList;
00027
00028 #define MEASURE_NOERR 0
00029 #define MEASURE_ERR_NOSEL -1
00030 #define MEASURE_ERR_NOATOMS -2
00031 #define MEASURE_ERR_BADWEIGHTNUM -3
00032 #define MEASURE_ERR_NOWEIGHT -4
00033 #define MEASURE_ERR_NOCOM -4
00034 #define MEASURE_ERR_NOMINMAXCOORDS -4
00035 #define MEASURE_ERR_NORGYR -4
00036 #define MEASURE_ERR_BADWEIGHTSUM -5
00037 #define MEASURE_ERR_NOMOLECULE -6
00038 #define MEASURE_ERR_BADWEIGHTPARM -7
00039 #define MEASURE_ERR_NONNUMBERPARM -8
00040 #define MEASURE_ERR_MISMATCHEDCNT -9
00041 #define MEASURE_ERR_RGYRMISMATCH -10
00042 #define MEASURE_ERR_NOFRAMEPOS -11
00043 #define MEASURE_ERR_NONZEROJACOBI -12
00044 #define MEASURE_ERR_GENERAL -13
00045 #define MEASURE_ERR_NORADII -14
00046 #define MEASURE_ERR_BADORDERINDEX -15
00047 #define MEASURE_ERR_NOTSUP -16
00048 #define MEASURE_ERR_BADFRAMERANGE -17
00049 #define MEASURE_ERR_MISMATCHEDMOLS -18
00050 #define MEASURE_ERR_REPEATEDATOM -19
00051 #define MEASURE_ERR_NOFRAMES -20
00052 #define MEASURE_ERR_BADATOMID -21
00053 #define MEASURE_ERR_BADCUTOFF -22
00054 #define MEASURE_ERR_ZEROGRIDSIZE -23
00055
00056 #define MEASURE_BOND 2
00057 #define MEASURE_ANGLE 3
00058 #define MEASURE_DIHED 4
00059 #define MEASURE_IMPRP 5
00060 #define MEASURE_VDW 6
00061 #define MEASURE_ELECT 7
00062
00063
00064 enum {MEASURE_DIST_RMSD=0,
00065 MEASURE_DIST_FITRMSD,
00066 MEASURE_DIST_RGYRD,
00067 MEASURE_DIST_CUSTOM,
00068 MEASURE_NUM_DIST};
00069
00070 extern const char *measure_error(int errnum);
00071
00072
00073 extern int measure_move(const AtomSel *sel, float *framepos,
00074 const Matrix4 &mat);
00075
00076
00077 extern int measure_avpos(const AtomSel *sel, MoleculeList *mlist,
00078 int start, int end, int step, float *avpos);
00079
00080
00081
00082
00083 extern int measure_center(const AtomSel *sel, const float *framepos,
00084 const float *weight, float *com);
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096 extern int measure_dipole(const AtomSel *sel, MoleculeList *mlist,
00097 float *dipole, int unitsdebye, int usecenter);
00098
00099
00100
00101
00102
00103
00104
00105 extern int measure_fit(const AtomSel *sel1, const AtomSel *sel2,
00106 const float *x, const float *y, const float *weight,
00107 const int *order, Matrix4 *mat);
00108
00109
00110
00111
00112
00113 extern int measure_minmax(int num, const int *on, const float *framepos,
00114 const float *radii,
00115 float *min_coord, float *max_coord);
00116
00117
00118
00119 extern int measure_rgyr(const AtomSel *sel, MoleculeList *mlist,
00120 const float *weight, float *rgyr);
00121
00122
00123
00124
00125 extern int measure_rmsd(const AtomSel *sel1, const AtomSel *sel2,
00126 int num, const float *f1, const float *f2,
00127 float *weight, float *rmsd);
00128
00129
00130 extern int measure_rmsf(const AtomSel *sel, MoleculeList *mlist,
00131 int start, int end, int step, float *rmsf);
00132
00133 extern int measure_sumweights(const AtomSel *sel, int numweights,
00134 const float *weights, float *weightsum);
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 extern int measure_sasa(const AtomSel *sel, const float *framepos,
00147 const float *radius, float srad, float *sasa, ResizeArray<float> *pts,
00148 const AtomSel *restrictsel, const int *nsamples);
00149
00150
00151 extern int measure_cluster(AtomSel *sel, MoleculeList *mlist,
00152 const int numcluster, const int algorithm,
00153 const int likeness, const double cutoff,
00154 int *clustersize, int **clusterlist,
00155 int first, int last, int step, int selupdate,
00156 float *weights);
00157
00158
00159 extern int measure_clustsize(const AtomSel *sel, MoleculeList *mlist,
00160 const double cutoff, int *clustersize,
00161 int *clusternum, int *clusteridx,
00162 int minsize, int numshared, int usepbc);
00163
00164
00165 extern int measure_gofr(AtomSel *sel1, AtomSel *sel2,
00166 MoleculeList *mlist,
00167 const int count_h, double *gofr, double *numint,
00168 double *histog, const float delta,
00169 int first, int last, int step, int *framecntr,
00170 int usepbc, int selupdate);
00171
00172
00173 extern int measure_rdf(VMDApp *app,
00174 AtomSel *sel1, AtomSel *sel2,
00175 MoleculeList *mlist,
00176 const int count_h, double *gofr, double *numint,
00177 double *histog, const float delta,
00178 int first, int last, int step, int *framecntr,
00179 int usepbc, int selupdate);
00180
00181 int measure_geom(MoleculeList *mlist, int *molid, int *atmid, ResizeArray<float> *gValues,
00182 int frame, int first, int last, int defmolid, int geomtype);
00183
00184
00185 int calculate_bond(MoleculeList *mlist, int *molid, int *atmid, float *value);
00186
00187
00188 int calculate_angle(MoleculeList *mlist, int *molid, int *atmid, float *value);
00189
00190
00191 int calculate_dihed(MoleculeList *mlist, int *molid, int *atmid, float *value);
00192
00193
00194
00195 int check_mol(Molecule *mol, int a);
00196
00197
00198
00199 int normal_atom_coord(Molecule *m, int a, float *pos);
00200
00201 int measure_energy(MoleculeList *mlist, int *molid, int *atmid, int natoms, ResizeArray<float> *gValues,
00202 int frame, int first, int last, int defmolid, double *params, int geomtype);
00203 int compute_bond_energy(MoleculeList *mlist, int *molid, int *atmid, float *energy,
00204 float k, float x0);
00205 int compute_angle_energy(MoleculeList *mlist, int *molid, int *atmid, float *energy,
00206 float k, float x0, float kub, float s0);
00207 int compute_dihed_energy(MoleculeList *mlist, int *molid, int *atmid, float *energy,
00208 float k, int n, float delta);
00209 int compute_imprp_energy(MoleculeList *mlist, int *molid, int *atmid, float *energy,
00210 float k, float x0);
00211 int compute_vdw_energy(MoleculeList *mlist, int *molid, int *atmid, float *energy,
00212 float rmin1, float eps1, float rmin2, float eps2, float cutoff, float switchdist);
00213 int compute_elect_energy(MoleculeList *mlist, int *molid, int *atmid, float *energy,
00214 float q1, float q2, bool flag1, bool flag2, float cutoff);
00215
00216
00217
00218 int measure_pbc2onc(MoleculeList *mlist, int molid, int frame, const float *center, Matrix4 &transform);
00219
00220
00221 void get_transform_to_orthonormal_cell(const float *cell, const float center[3], Matrix4 &transform);
00222
00223
00224 int measure_pbc_neighbors(MoleculeList *mlist, AtomSel *sel, int molid,
00225 int frame, const Matrix4 *alignment,
00226 const float *center, const float *cutoff, const float *box,
00227 ResizeArray<float> *extcoord_array,
00228 ResizeArray<int> *indexmap_array);
00229
00230
00231 int compute_pbcminmax(MoleculeList *mlist, int molid, int frame,
00232 const float *center, const Matrix4 *transform,
00233 float *min, float *max);
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243 extern int measure_surface(AtomSel *sel, MoleculeList *mlist,
00244 const float *framepos,
00245 const double gridsz,
00246 const double radius,
00247 const double sel_dist,
00248 int **surface, int *n_surf);
00249
00250
00251
00252
00253
00254 extern int measure_inertia(AtomSel *sel, MoleculeList *mlist, const float *coor, float rcom[3],
00255 float priaxes[3][3], float itensor[4][4], float evalue[3]);
00256