00001 #ifndef GRAD_H
00002 #define GRAD_H
00003
00004 #include <iostream>
00005 #include <iomanip>
00006 #include <fstream>
00007 #include <cstdio>
00008 #include <vector>
00009 #include <cstring>
00010 #include <math.h>
00011
00012 #include "stringtools.h"
00013 #include "qchem.h"
00014 #include "gaussian.h"
00015 #include "ase.h"
00016 #include "knnr.h"
00017 #include "orca.h"
00018 #include "molpro.h"
00019 #include "qchemsf.h"
00020
00021 class Gradient
00022 {
00023
00024 private:
00025
00026 int runNum;
00027 int runend;
00028 string runends;
00029 string runName;
00030 string runName0;
00031
00032 int natoms;
00033 int N3;
00034 string* anames;
00035 int* anumbers;
00036 int CHARGE;
00037 int MULT;
00038
00039 QChem qchem1;
00040 QChemSF qchemsf1;
00041 GAUSSIAN gaus1;
00042 ASE ase1;
00043 ORCA orca1;
00044 Molpro mp1;
00045
00046 int knn_k;
00047 KNNR knnr1;
00048 int knnr_inited;
00049
00050 int nforce;
00051 int* fa;
00052 double* fv;
00053 double* fk;
00054
00055 int read_nstates();
00056 void read_molpro_settings(int& nstates, int& nclosed, int& nocc, int& nelec, string& basis);
00057 int read_molpro_init(string* &hf_lines);
00058 int force_init(string ffile);
00059
00060
00061 public:
00062
00063 int hessian(double* H);
00064 double grads(double* coords, double* grad, double* Ut, int type);
00065 void add_force(double* coords, double* grad);
00066 void init(string infilename, int natoms, int* anumbers, string* anames, double* coords, int run, int rune, int ncpu, int use_knnr, int q1);
00067 void update_knnr();
00068 void freemem();
00069 void write_xyz_grad(double* coords, double* grad, string filename);
00070 int external_grad(double* coords, double* grads);
00071
00072 int knnr_active;
00073 int always_do_exact;
00074 int write_on;
00075 int wrote_grad;
00076 int xyz_grad;
00077 int gradcalls;
00078 int nscffail;
00079 double V0;
00080 double fdE;
00081
00082 double energy0;
00083 double energy;
00084
00085
00086 int nstates;
00087 int wstate;
00088 int wstate2;
00089 int wstate3;
00090 double** grada;
00091 double* E;
00092
00093 int seedType;
00094
00095 int res_t;
00096
00097 };
00098
00099 #endif