Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

cpmdlogplugin.c File Reference

#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <time.h>
#include <math.h>
#include "gaussianplugin.h"
#include "periodic_table.h"
#include "unit_conversion.h"
#include "vmdconio.h"

Go to the source code of this file.

Defines

#define THISPLUGIN   plugin
#define CPMDLOG_DEBUG   0
#define CPMDLOG_BASIS_DEBUG   1
#define PRINTERR   (void)(0)
#define GET_LINE(x, y)   if (!fgets(x, sizeof(x), y)) return FALSE
#define SAFE_FREE(ptr)   free(ptr); ptr=NULL
#define SAFE_CALLOC(ptr, type, count)
#define UNK_SHELL   -666
#define SPD_D_SHELL   -5
#define SPD_P_SHELL   -4
#define SPD_S_SHELL   -3
#define SP_S_SHELL   -2
#define SP_P_SHELL   -1
#define S_SHELL   0
#define P_SHELL   1
#define D_SHELL   2
#define F_SHELL   3
#define G_SHELL   4
#define H_SHELL   5
#define I_SHELL   6
#define SPIN_ALPHA   0
#define SPIN_BETA   1
#define STATUS_UNKNOWN   -1
#define STATUS_CONVERGED   0
#define STATUS_SCF_NOT_CONV   1
#define STATUS_TOO_MANY_STEPS   2
#define STATUS_BROKEN_OFF   3
#define ORBSPERBLOCK   8

Functions

int parse_static_data (gaussiandata *, int *)
int have_cpmd (gaussiandata *)
int get_internal_basis (gaussiandata *)
int shellsymm_int (char *symm)
int fill_basis_arrays (gaussiandata *)
int read_first_frame (gaussiandata *)
int get_traj_frame (gaussiandata *)
int find_traj_end (gaussiandata *)
int get_wavefunction (gaussiandata *, qm_timestep_t *, qm_wavefunction_t *)
int get_population (gaussiandata *, qm_timestep_t *)
void fix_fortran_exp (char *string)
void * open_cpmdlog_read (const char *filename, const char *filetype, int *natoms)
int read_cpmdlog_structure (void *mydata, int *optflags, molfile_atom_t *atoms)
int read_cpmdlog_metadata (void *mydata, molfile_qm_metadata_t *gaussian_metadata)
int read_cpmdlog_rundata (void *mydata, molfile_qm_t *qm_data)
void close_cpmdlog_read (void *mydata)
int get_final_info (gaussiandata *data)
VMDPLUGIN_API int VMDPLUGIN_init (void)
VMDPLUGIN_API int VMDPLUGIN_register (void *v, vmdplugin_register_cb cb)
VMDPLUGIN_API int VMDPLUGIN_fini (void)

Variables

const char * runtypes []
const char * scftypes []


Define Documentation

#define CPMDLOG_BASIS_DEBUG   1
 

Definition at line 39 of file cpmdlogplugin.c.

#define CPMDLOG_DEBUG   0
 

Definition at line 37 of file cpmdlogplugin.c.

#define D_SHELL   2
 

Definition at line 78 of file cpmdlogplugin.c.

Referenced by get_internal_basis, and shellsymm_int.

#define F_SHELL   3
 

Definition at line 79 of file cpmdlogplugin.c.

Referenced by get_internal_basis, and shellsymm_int.

#define G_SHELL   4
 

Definition at line 80 of file cpmdlogplugin.c.

Referenced by shellsymm_int.

#define GET_LINE x,
     if (!fgets(x, sizeof(x), y)) return FALSE
 

Definition at line 57 of file cpmdlogplugin.c.

#define H_SHELL   5
 

Definition at line 81 of file cpmdlogplugin.c.

#define I_SHELL   6
 

Definition at line 82 of file cpmdlogplugin.c.

#define ORBSPERBLOCK   8
 

#define P_SHELL   1
 

Definition at line 77 of file cpmdlogplugin.c.

Referenced by get_internal_basis, and shellsymm_int.

#define PRINTERR   (void)(0)
 

Definition at line 46 of file cpmdlogplugin.c.

Referenced by get_population, get_wavefunction, and open_cpmdlog_read.

#define S_SHELL   0
 

Definition at line 76 of file cpmdlogplugin.c.

Referenced by get_internal_basis, and shellsymm_int.

#define SAFE_CALLOC ptr,
type,
count   
 

Value:

ptr = (type *)calloc(count,sizeof(type));                         \
  if (ptr == NULL) {                                                \
    PRINTERR;                                                       \
    return MOLFILE_ERROR;                                           \
  }

Definition at line 63 of file cpmdlogplugin.c.

Referenced by fill_basis_arrays, get_basis, get_internal_basis, get_traj_frame, get_wavefunction, read_first_frame, read_hoomd_structure, and write_hoomd_bonds.

#define SAFE_FREE ptr       free(ptr); ptr=NULL
 

Definition at line 61 of file cpmdlogplugin.c.

Referenced by close_hoomd_read, get_basis, and open_hoomd_read.

#define SP_P_SHELL   -1
 

Definition at line 75 of file cpmdlogplugin.c.

Referenced by get_internal_basis, and shellsymm_int.

#define SP_S_SHELL   -2
 

Definition at line 74 of file cpmdlogplugin.c.

Referenced by get_internal_basis, and shellsymm_int.

#define SPD_D_SHELL   -5
 

Definition at line 71 of file cpmdlogplugin.c.

#define SPD_P_SHELL   -4
 

Definition at line 72 of file cpmdlogplugin.c.

#define SPD_S_SHELL   -3
 

Definition at line 73 of file cpmdlogplugin.c.

Referenced by get_internal_basis, and shellsymm_int.

#define SPIN_ALPHA   0
 

Definition at line 84 of file cpmdlogplugin.c.

Referenced by get_wavefunction.

#define SPIN_BETA   1
 

Definition at line 85 of file cpmdlogplugin.c.

#define STATUS_BROKEN_OFF   3
 

Definition at line 91 of file cpmdlogplugin.c.

#define STATUS_CONVERGED   0
 

Definition at line 88 of file cpmdlogplugin.c.

#define STATUS_SCF_NOT_CONV   1
 

Definition at line 89 of file cpmdlogplugin.c.

#define STATUS_TOO_MANY_STEPS   2
 

Definition at line 90 of file cpmdlogplugin.c.

#define STATUS_UNKNOWN   -1
 

Definition at line 87 of file cpmdlogplugin.c.

Referenced by find_traj_end.

#define THISPLUGIN   plugin
 

Definition at line 30 of file cpmdlogplugin.c.

#define UNK_SHELL   -666
 

Definition at line 70 of file cpmdlogplugin.c.

Referenced by shellsymm_int.


Function Documentation

void close_cpmdlog_read void *    mydata [static]
 

Clean up when done and free all memory to avoid memory leaks.

Definition at line 519 of file cpmdlogplugin.c.

References gaussiandata::angular_momentum, gaussiandata::basis, gaussiandata::basis_set, gaussiandata::file, gaussiandata::file_name, qm_timestep_t::gradient, gaussiandata::initatoms, gaussiandata::intensities, gaussiandata::internal_coordinates, qm_timestep_t::mulliken_charges, gaussiandata::mulliken_charges, gaussiandata::normal_modes, gaussiandata::num_frames_read, gaussiandata::num_prim_per_shell, gaussiandata::num_shells_per_atom, gaussiandata::numatoms, basis_atom_t::numshells, qm_timestep_t::numwave, qm_wavefunction_t::orb_energies, shell_t::prim, gaussiandata::qm_timestep, qm_timestep_t::scfenergies, basis_atom_t::shell, gaussiandata::shell_symmetry, qm_timestep_t::wave, qm_wavefunction_t::wave_coeffs, and gaussiandata::wavenumbers.

Referenced by VMDPLUGIN_init.

int fill_basis_arrays gaussiandata   data [static]
 

Populate the flat arrays containing the basis set data.

Definition at line 1173 of file cpmdlogplugin.c.

References gaussiandata::basis, gaussiandata::basis_set, prim_t::contraction_coeff, prim_t::exponent, gaussiandata::num_basis_funcs, gaussiandata::num_prim_per_shell, gaussiandata::num_shells, gaussiandata::num_shells_per_atom, gaussiandata::numatoms, shell_t::numprims, basis_atom_t::numshells, shell_t::prim, SAFE_CALLOC, basis_atom_t::shell, gaussiandata::shell_symmetry, and shell_t::symmetry.

int find_traj_end gaussiandata   data [static]
 

count number of QM dataset frames.

Definition at line 570 of file cpmdlogplugin.c.

References gaussiandata::file, gaussiandata::num_frames, gaussiandata::opt_status, and STATUS_UNKNOWN.

void fix_fortran_exp char *    string [static]
 

Definition at line 144 of file cpmdlogplugin.c.

int get_final_info gaussiandata   [static]
 

the function get_initial_info provides the atom number, coordinates, and atom types and stores them temporarily.

Definition at line 589 of file cpmdlogplugin.c.

References gaussiandata::file, find_traj_end, get_esp_charges, gaussiandata::runtyp, RUNTYP_DYNAMICS, RUNTYP_OPTIMIZE, and VMDCON_INFO.

int get_internal_basis gaussiandata   [static]
 

Definition at line 931 of file cpmdlogplugin.c.

References qm_atom_t::atomicnum, gaussiandata::basis_set, prim_t::contraction_coeff, D_SHELL, prim_t::exponent, F_SHELL, fill_basis_arrays, fix_fortran_exp, gaussiandata::gbasis, get_pte_label, gaussiandata::have_basis, gaussiandata::initatoms, MOLFILE_BUFSIZ, basis_atom_t::name, gaussiandata::num_basis_funcs, gaussiandata::num_shells, gaussiandata::num_shells_per_atom, gaussiandata::numatoms, shell_t::numprims, basis_atom_t::numshells, P_SHELL, shell_t::prim, S_SHELL, SAFE_CALLOC, basis_atom_t::shell, shellsymm_int, SP_P_SHELL, SP_S_SHELL, SPD_S_SHELL, shell_t::symmetry, VMDCON_INFO, and gaussiandata::wavef_size.

int get_population gaussiandata  ,
qm_timestep_t  
[static]
 

read in mulliken charges

Definition at line 1526 of file cpmdlogplugin.c.

References gaussiandata::file, GET_LINE, gaussiandata::have_mulliken, qm_timestep_t::mulliken_charges, gaussiandata::numatoms, and PRINTERR.

int get_traj_frame gaussiandata   data [static]
 

this function extracts the trajectory information from the output file

Definition at line 1221 of file cpmdlogplugin.c.

References qm_atom_t::atomicnum, BOHR_TO_ANGS, gaussiandata::end_of_trajectory, gaussiandata::file, GET_LINE, get_population, get_pte_idx, get_wavefunction, gaussiandata::have_wavefunction, gaussiandata::initatoms, MOLFILE_BUFSIZ, gaussiandata::num_frames_read, gaussiandata::numatoms, gaussiandata::qm_timestep, qm_atom_t::type, VMDCON_INFO, qm_atom_t::x, qm_atom_t::y, and qm_atom_t::z.

int get_wavefunction gaussiandata  ,
qm_timestep_t  ,
qm_wavefunction_t  
[static]
 

Definition at line 1362 of file cpmdlogplugin.c.

References gaussiandata::angular_momentum, gaussiandata::file, GET_LINE, MOLFILE_BUFSIZ, MOLFILE_WAVE_CANON, gaussiandata::occ_orbitals_A, gaussiandata::occ_orbitals_B, PRINTERR, SAFE_CALLOC, gaussiandata::scftyp, SCFTYP_UHF, qm_wavefunction_t::spin, SPIN_ALPHA, qm_wavefunction_t::type, VMDCON_INFO, and gaussiandata::wavef_size.

int have_cpmd gaussiandata   [static]
 

Check if the current run is an actual CPMD run; returns true/false

Definition at line 815 of file cpmdlogplugin.c.

References gaussiandata::file, gaussiandata::file_name, GET_LINE, MOLFILE_BUFSIZ, gaussiandata::version, gaussiandata::version_string, and VMDCON_INFO.

Referenced by open_cpmdlog_read.

void* open_cpmdlog_read const char *    filename,
const char *    filetype,
int *    natoms
[static]
 

Definition at line 167 of file cpmdlogplugin.c.

References gaussiandata::file, gaussiandata::file_name, have_cpmd, parse_static_data, PRINTERR, gaussiandata::runtyp, RUNTYP_UNKNOWN, gaussiandata::scftyp, SCFTYP_UNKNOWN, gaussiandata::version, and gaussiandata::version_string.

Referenced by VMDPLUGIN_init.

int parse_static_data gaussiandata  ,
int *   
[static]
 

Top level CPMD log file parser. Responsible for static, i.e. non-trajectory information.

Definition at line 619 of file cpmdlogplugin.c.

References qm_atom_t::atomicnum, gaussiandata::basis_string, BOHR_TO_ANGS, gaussiandata::file, gaussiandata::gbasis, get_final_info, GET_LINE, get_pte_idx, gaussiandata::have_basis, gaussiandata::have_wavefunction, gaussiandata::initatoms, gaussiandata::initcell, MOLFILE_BUFSIZ, gaussiandata::multiplicity, gaussiandata::num_electrons, gaussiandata::num_frames, gaussiandata::num_frames_read, gaussiandata::num_frames_sent, gaussiandata::numatoms, gaussiandata::occ_orbitals_A, gaussiandata::occ_orbitals_B, read_first_frame, gaussiandata::runtyp, RUNTYP_DYNAMICS, RUNTYP_OPTIMIZE, RUNTYP_PROPERTIES, RUNTYP_UNKNOWN, runtypes, gaussiandata::scftyp, SCFTYP_RHF, SCFTYP_UHF, scftypes, gaussiandata::totalcharge, qm_atom_t::type, gaussiandata::version, VMDCON_INFO, qm_atom_t::x, qm_atom_t::y, and qm_atom_t::z.

int read_cpmdlog_metadata void *    mydata,
molfile_qm_metadata_t   gaussian_metadata
[static]
 

Definition at line 275 of file cpmdlogplugin.c.

References molfile_qm_metadata_t::have_carthessian, molfile_qm_metadata_t::have_normalmodes, molfile_qm_metadata_t::ncart, molfile_qm_metadata_t::nimag, molfile_qm_metadata_t::nintcoords, gaussiandata::num_basis_funcs, molfile_qm_metadata_t::num_basis_funcs, gaussiandata::num_shells, molfile_qm_metadata_t::num_shells, gaussiandata::wavef_size, and molfile_qm_metadata_t::wavef_size.

Referenced by VMDPLUGIN_init.

int read_cpmdlog_rundata void *    mydata,
molfile_qm_t   qm_data
[static]
 

Definition at line 308 of file cpmdlogplugin.c.

References gaussiandata::angular_momentum, molfile_qm_basis_t::angular_momentum, gaussiandata::basis, molfile_qm_basis_t::basis, molfile_qm_t::basis, gaussiandata::basis_string, molfile_qm_sysinfo_t::basis_string, gaussiandata::geometry, molfile_qm_sysinfo_t::geometry, gaussiandata::memory, molfile_qm_sysinfo_t::memory, gaussiandata::nproc, molfile_qm_sysinfo_t::nproc, gaussiandata::num_basis_funcs, gaussiandata::num_electrons, molfile_qm_sysinfo_t::num_electrons, molfile_qm_sysinfo_t::num_occupied_A, molfile_qm_sysinfo_t::num_occupied_B, gaussiandata::num_prim_per_shell, molfile_qm_basis_t::num_prim_per_shell, gaussiandata::num_shells, gaussiandata::num_shells_per_atom, molfile_qm_basis_t::num_shells_per_atom, gaussiandata::numatoms, gaussiandata::occ_orbitals_A, gaussiandata::occ_orbitals_B, molfile_qm_t::run, gaussiandata::runtitle, molfile_qm_sysinfo_t::runtitle, gaussiandata::runtyp, molfile_qm_sysinfo_t::runtype, gaussiandata::scftyp, molfile_qm_sysinfo_t::scftype, gaussiandata::shell_symmetry, gaussiandata::totalcharge, molfile_qm_sysinfo_t::totalcharge, gaussiandata::version_string, molfile_qm_sysinfo_t::version_string, and gaussiandata::wavef_size.

Referenced by VMDPLUGIN_init.

int read_cpmdlog_structure void *    mydata,
int *    optflags,
molfile_atom_t   atoms
[static]
 

Definition at line 224 of file cpmdlogplugin.c.

References qm_atom_t::atomicnum, molfile_atom_t::atomicnumber, molfile_atom_t::chain, molfile_atom_t::charge, get_pte_mass, get_pte_vdw_radius, gaussiandata::have_mulliken, gaussiandata::initatoms, molfile_atom_t::mass, MOLFILE_ATOMICNUMBER, MOLFILE_CHARGE, MOLFILE_MASS, MOLFILE_RADIUS, qm_timestep_t::mulliken_charges, molfile_atom_t::name, gaussiandata::numatoms, gaussiandata::qm_timestep, molfile_atom_t::radius, molfile_atom_t::resid, molfile_atom_t::resname, molfile_atom_t::segid, molfile_atom_t::type, and qm_atom_t::type.

Referenced by VMDPLUGIN_init.

int read_first_frame gaussiandata   data [static]
 

read coordinates for old-style population analysis

Definition at line 866 of file cpmdlogplugin.c.

References gaussiandata::angular_momentum, get_internal_basis, get_wavefunction, gaussiandata::num_frames, gaussiandata::num_frames_read, gaussiandata::qm_timestep, SAFE_CALLOC, gaussiandata::version, VMDCON_INFO, and gaussiandata::wavef_size.

int shellsymm_int char *    symm [static]
 

Definition at line 1126 of file cpmdlogplugin.c.

References D_SHELL, F_SHELL, G_SHELL, P_SHELL, S_SHELL, SP_P_SHELL, SP_S_SHELL, SPD_S_SHELL, and UNK_SHELL.

VMDPLUGIN_API int VMDPLUGIN_fini void   
 

Definition at line 1597 of file cpmdlogplugin.c.

References VMDPLUGIN_API, and VMDPLUGIN_SUCCESS.

VMDPLUGIN_API int VMDPLUGIN_init void   
 

Definition at line 1563 of file cpmdlogplugin.c.

References close_cpmdlog_read, MOLFILE_PLUGIN_TYPE, open_cpmdlog_read, read_cpmdlog_metadata, read_cpmdlog_rundata, read_cpmdlog_structure, vmdplugin_ABIVERSION, VMDPLUGIN_API, VMDPLUGIN_SUCCESS, and VMDPLUGIN_THREADUNSAFE.

VMDPLUGIN_API int VMDPLUGIN_register void *    v,
vmdplugin_register_cb    cb
 

Definition at line 1592 of file cpmdlogplugin.c.

References VMDPLUGIN_API, vmdplugin_register_cb, and VMDPLUGIN_SUCCESS.


Variable Documentation

const char* runtypes[] [static]
 

Initial value:

 { 
  "(unknown)", "ENERGY", "OPTIMIZE", "SADPOINT", "HESSIAN", 
  "SURFACE", "DYNAMICS", "PROPERTIES", NULL}

Definition at line 93 of file cpmdlogplugin.c.

Referenced by parse_static_data.

const char* scftypes[] [static]
 

Initial value:

 { 
  "(unknown)", "RHF", "UHF", "ROHF", "GVB", "MCSCF", "FF", NULL }

Definition at line 97 of file cpmdlogplugin.c.

Referenced by parse_static_data.


Generated on Sat Aug 15 03:07:07 2020 for VMD Plugins (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002