00001 /*************************************************************************** 00002 *cr 00003 *cr (C) Copyright 1995-2016 The Board of Trustees of the 00004 *cr University of Illinois 00005 *cr All Rights Reserved 00006 *cr 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * RCS INFORMATION: 00011 * 00012 * $RCSfile: gaussianplugin.h,v $ 00013 * $Author: johns $ $Locker: $ $State: Exp $ 00014 * $Revision: 1.10 $ $Date: 2016/11/28 05:01:54 $ 00015 * 00016 ***************************************************************************/ 00017 /******************************************************************* 00018 * 00019 * headerfile for the gaussianplugin 00020 * 00021 ******************************************************************/ 00022 00023 #ifndef GAUSSIANPLUGIN_H 00024 #define GAUSSIANPLUGIN_H 00025 00026 #include <stdio.h> 00027 #include "molfile_plugin.h" 00028 00029 /* define macros for true/false to make code 00030 * look somewhat nicer; the macro DONE signals 00031 * that we're done with reading an should return 00032 * with what we have */ 00033 #define FALSE 0 00034 #define TRUE 1 00035 00037 #define RUNTYP_UNKNOWN 0 00038 #define RUNTYP_ENERGY 1 00039 #define RUNTYP_OPTIMIZE 2 00040 #define RUNTYP_SADPOINT 3 00041 #define RUNTYP_HESSIAN 4 00042 #define RUNTYP_SURFACE 5 00043 #define RUNTYP_DYNAMICS 6 00044 #define RUNTYP_PROPERTIES 7 00047 #define SCFTYP_UNKNOWN 0 00048 #define SCFTYP_RHF 1 00049 #define SCFTYP_UHF 2 00050 #define SCFTYP_ROHF 3 00051 #define SCFTYP_GVB 4 00052 #define SCFTYP_MCSCF 5 00053 #define SCFTYP_FF 6 00056 #define MAX_NUM_WAVE 10 00057 00058 typedef struct { 00059 float exponent; 00060 float contraction_coeff; 00061 } prim_t; 00062 00063 00064 typedef struct { 00065 int symmetry; /* symmetry of this shell (S, P, D, ...) */ 00066 int numprims; /* number of primitive basis functions */ 00067 prim_t *prim; /* array of primitives */ 00068 } shell_t; 00069 00070 00072 typedef struct { 00073 char name[20]; /* atom name or type (pseudopotentialfile?) */ 00074 int atomicnum; /* atomic number (nuclear charge XXX) */ 00075 int numshells; 00076 shell_t *shell; 00077 } basis_atom_t; 00078 00079 00082 typedef struct 00083 { 00084 char type [8]; /* atom type H,N,O ..... */ 00085 int atomicnum; /* index in PTE. */ 00086 float x,y,z; /* coordinates of atom i */ 00087 } qm_atom_t; 00088 00089 00090 typedef struct { 00091 int idtag; 00092 int type; 00093 int spin; 00094 int cartesian; 00095 int excitation; 00096 char info[MOLFILE_BUFSIZ]; 00098 int num_orbitals; 00100 int *orb_indices; 00101 float *occupancies; 00102 float *orb_energies; 00103 float *wave_coeffs; 00105 } qm_wavefunction_t; 00106 00107 00108 typedef struct { 00109 qm_wavefunction_t *wave; 00110 int numwave; 00111 int num_orbitals; 00112 int num_scfiter; 00113 double *scfenergies; /* scfenergies per trajectory point 00114 * XXX: how about post-HF calculations? 00115 * we have the HF, MP2, CASSCF, CCS, 00116 * CCSD, CCSD(T) energies... */ 00117 00118 double *mulliken_charges; /* per-atom Mulliken charges */ 00119 double *lowdin_charges; /* per-atom Lowdin charges */ 00120 double *esp_charges; /* per-atom esp charges */ 00121 double *npa_charges; /* per-atom npa charges */ 00122 00123 float *gradient; /* energy gradient for each atom */ 00124 } qm_timestep_t; 00125 00126 00128 typedef struct 00129 { 00130 FILE *file; 00131 int numatoms; 00132 int runtyp; /* run type of this job as int for internal use */ 00133 char gbasis[20]; /* canonicalized basis set string 00134 for loading and external basis set. */ 00135 00136 char basis_string[MOLFILE_BUFSIZ]; /* basis name as "nice" string */ 00137 00138 char runtitle[MOLFILE_BUFSIZ]; /* title/info section of run */ 00139 00140 char geometry[MOLFILE_BUFSIZ]; /* either UNIQUE, CART or ZMP/ZMTMPC */ 00141 char guess[MOLFILE_BUFSIZ]; /* type of guess method used */ 00142 00143 char version_string[MOLFILE_BUFSIZ]; /* full version string of binary used for run */ 00144 int version; /* gaussian version code; 00145 * canonicalized and set up for integer comparisons. 00146 * here we keep track the exact Gaussian version, 00147 * since the log file format keeps changing all 00148 * the time. 00149 * Format is Year/Revision/Patchlevel: YYYYRRPP 00150 * with: 00151 * YYYY: g94 -> 1994, g98 -> 1998, g03 -> 2003 00152 * RR: A -> 1, B -> 2, C ->3, ... 00153 * PP: 01, 02, 03, ... 00154 * 00155 * Example: G03RevB.04 -> 20030204 00156 * 00157 * version = 0 => unknown/unreadable version. 00158 */ 00159 00160 char *file_name; 00161 00162 /****************************************************** 00163 * new API functions 00164 *****************************************************/ 00165 00166 int scftyp; /* UHF, RHF, ROHF, as in for 00167 * internal use*/ 00168 char scftyp_string[MOLFILE_BUFSIZ]; /* scftyp as string. XXX: remove */ 00169 int totalcharge; /* Total charge of the system */ 00170 int multiplicity; /* Multiplicity of the system */ 00171 int num_electrons; /* Number of electrons */ 00172 int nimag; /* Number of imaginary frequencies */ 00173 int *nimag_modes; /* List of imaginary modes */ 00174 00175 float *wavenumbers; /* rotational and translational DoF are 00176 * included, but can be removed due to 00177 * their zero frequencies */ 00178 float *intensities; /* Intensities of spectral lines */ 00179 00180 float *normal_modes; /* the normal modes themselves */ 00181 00182 int nproc; /* Number processors used */ 00183 int memory; /* Amount of memory used in MBytes */ 00184 00185 int have_wavefunction; 00191 int have_basis; 00202 int have_cart_basis; 00213 /* arrays with atom charges */ 00214 double *mulliken_charges; 00215 int have_mulliken; 00216 00217 int have_normal_modes; 00221 /****************************************************** 00222 * internal coordinate stuff 00223 *****************************************************/ 00224 00225 int have_internals; /* TRUE/FALSE flag indicating if we 00226 * could properly read the internal 00227 * coordinates + internal hessian */ 00228 00229 int have_cart_hessian; /* TRUE/FALSE flag indicating if the 00230 * cartesian Hessian matrix could 00231 * be read from the output file */ 00232 00233 int nintcoords; /* Number of internal coordinates */ 00234 int nbonds; /* Number of bonds */ 00235 int nangles; /* Number of angles */ 00236 int ndiheds; /* Number of dihedrals */ 00237 int nimprops; /* Number of impropers */ 00238 00239 int *bonds; /* bond list (atom tuples) */ 00240 int *angles; /* angle list (atom triples) */ 00241 int *dihedrals; /* dihedral list (atom quadrupels) */ 00242 int *impropers; /* improper list (atom quadrupels) */ 00243 00244 double *internal_coordinates; /* value of internal coordinates */ 00245 00246 /******************************************************* 00247 * end internal coordinate stuff 00248 *******************************************************/ 00249 00250 double *carthessian; /* Hessian matrix in cartesian coordinates, 00251 * dimension (3*numatoms)*(3*numatoms), 00252 * single array of floats 00253 * (row(1),row(2),...,row(numatoms)) 00254 */ 00255 00256 double *inthessian; /* Hessian matrix in internal coordinates, 00257 * dimension nintcoords*nintcoords, 00258 * single array of floats 00259 * (row(1),row(2),...,row(nintcoords)) 00260 */ 00261 00262 /********************************************************* 00263 * END OF NEW API data members 00264 *********************************************************/ 00265 00266 /* this array of floats stores the contraction coefficients 00267 * and exponents for the basis functions: 00268 * { exp(1), c-coeff(1), exp(2), c-coeff(2), .... } 00269 * This holds also for double-zeta basis functions with 00270 * exp(i) = exp(j) and c-coeff(i) != c-coeff(j). */ 00271 float *basis; 00272 00273 basis_atom_t *basis_set; 00274 00275 int num_basis_funcs; 00276 int num_basis_atoms; 00279 int *atomicnum_per_basisatom; 00280 00282 int num_shells; 00284 int *num_shells_per_atom; 00286 int *num_prim_per_shell; 00288 int *shell_symmetry; 00289 00291 int occ_orbitals_A; 00292 int occ_orbitals_B; 00293 00298 int wavef_size; 00299 int num_orbitals; /* number of orbitals in file. can be less if pure WF. */ 00300 00304 int *angular_momentum; 00305 00307 int converged; 00308 int opt_status; 00309 00310 /* the structure qm_atom_t was defined to read in data from 00311 * the Gaussian output file and store it temporarily; 00312 * it is then copied into the VMD specific arrays at the 00313 * appropriate point in time; 00314 * this was partially implemented since the output file does 00315 * not, e.g., contain the number of atoms per se. One rather 00316 * has to count them by hand - at that point one could as 00317 * well already read in the initial coordinates, atom types ... 00318 * which is not really supported by the way the VMD provided 00319 * function are arranged....this implementation could of 00320 * course be changed later..... */ 00321 qm_atom_t *initatoms; 00322 00325 float initcell[6]; 00326 00328 qm_timestep_t *qm_timestep; 00329 00331 int num_frames; 00332 int num_frames_sent; 00333 int num_frames_read; 00334 00335 int end_of_trajectory; 00336 00337 } gaussiandata; 00338 00339 #endif