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

abinitplugin.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <string.h>
#include "molfile_plugin.h"
#include "periodic_table.h"
#include "unit_conversion.h"

Go to the source code of this file.

Compounds

struct  abinit_binary_header_t
struct  abinit_plugindata_t
struct  binary_t

Defines

#define LINESIZE   2048
#define NATOM_MAX   300
#define DBGPRINT   if(1) fprintf
#define M_PI   3.14159265358979323846

Enumerations

enum  Endianness { little_endian, big_endian }

Functions

int binread (void *, size_t, FILE *, binary_t)
abinit_binary_header_tabinit_header (FILE *)
abinit_binary_header_tabinit_header_malloc ()
abinit_plugindata_tabinit_plugindata_malloc ()
void abinit_header_free (abinit_binary_header_t *hdr)
void abinit_plugindata_free (abinit_plugindata_t *data)
void abinit_buildrotmat (abinit_plugindata_t *data)
char * abinit_readline (char *line, FILE *stream)
int abinit_filetype (abinit_plugindata_t *data, char const *cmp)
int increment_filename (char *filename)
void * GEO_open_file_read (abinit_plugindata_t *data, int *natoms)
int GEO_read_structure (abinit_plugindata_t *data, int *optflags, molfile_atom_t *atomlist)
int GEO_read_next_timestep (abinit_plugindata_t *data, int natoms, molfile_timestep_t *ts)
void * DEN_POT_WFK_open_file_read (abinit_plugindata_t *data, int *natoms)
int DEN_POT_WFK_read_structure (abinit_plugindata_t *data, int *optflags, molfile_atom_t *atomlist)
int DEN_POT_WFK_read_next_timestep (abinit_plugindata_t *data, int natoms, molfile_timestep_t *ts)
int DEN_read_volumetric_metadata (abinit_plugindata_t *data, int *nvolsets, molfile_volumetric_t **metadata)
int DEN_read_volumetric_data (abinit_plugindata_t *data, int set, float *datablock, float *colorblock)
int POT_read_volumetric_metadata (abinit_plugindata_t *data, int *nvolsets, molfile_volumetric_t **metadata)
int POT_read_volumetric_data (abinit_plugindata_t *data, int set, float *datablock, float *colorblock)
int WFK_read_volumetric_metadata (abinit_plugindata_t *data, int *nvolsets, molfile_volumetric_t **metadata)
int WFK_read_volumetric_data (abinit_plugindata_t *data, int set, float *datablock, float *colorblock)
void * open_file_read (const char *filename, const char *filetype, int *natoms)
int read_structure (void *mydata, int *optflags, molfile_atom_t *atomlist)
int read_next_timestep (void *mydata, int natoms, molfile_timestep_t *ts)
void close_file_read (void *mydata)
void * open_file_write (const char *filename, const char *filetype, int natoms)
int write_structure (void *mydata, int optflags, const molfile_atom_t *atoms)
int write_timestep (void *mydata, const molfile_timestep_t *ts)
void close_file_write (void *mydata)
int read_volumetric_metadata (void *mydata, int *nvolsets, molfile_volumetric_t **metadata)
int read_volumetric_data (void *mydata, int set, float *datablock, float *colorblock)
VMDPLUGIN_API int VMDPLUGIN_init ()
VMDPLUGIN_API int VMDPLUGIN_register (void *v, vmdplugin_register_cb cb)
VMDPLUGIN_API int VMDPLUGIN_fini ()

Variables

molfile_plugin_t abinitplugin


Define Documentation

#define DBGPRINT   if(1) fprintf
 

Definition at line 71 of file abinitplugin.c.

Referenced by abinit_buildrotmat, close_file_read, close_file_write, DEN_POT_WFK_open_file_read, DEN_POT_WFK_read_next_timestep, DEN_POT_WFK_read_structure, DEN_read_volumetric_data, DEN_read_volumetric_metadata, GEO_open_file_read, GEO_read_next_timestep, GEO_read_structure, increment_filename, open_file_read, open_file_write, POT_read_volumetric_data, POT_read_volumetric_metadata, read_next_timestep, read_structure, read_volumetric_data, read_volumetric_metadata, WFK_read_volumetric_data, WFK_read_volumetric_metadata, write_structure, and write_timestep.

#define LINESIZE   2048
 

Definition at line 68 of file abinitplugin.c.

Referenced by abinit_filetype, abinit_readline, GEO_open_file_read, GEO_read_next_timestep, and GEO_read_structure.

#define M_PI   3.14159265358979323846
 

Definition at line 74 of file abinitplugin.c.

Referenced by DEN_POT_WFK_read_next_timestep, and GEO_read_next_timestep.

#define NATOM_MAX   300
 

Definition at line 69 of file abinitplugin.c.

Referenced by DEN_POT_WFK_open_file_read, GEO_open_file_read, and write_structure.


Enumeration Type Documentation

enum Endianness
 

Enumeration values:
little_endian 
big_endian 

Definition at line 78 of file abinitplugin.c.

Referenced by binread.


Function Documentation

void abinit_buildrotmat abinit_plugindata_t   data [static]
 

Definition at line 213 of file abinitplugin.c.

References DBGPRINT, abinit_plugindata_t::rotmat, and abinit_plugindata_t::rprimd.

Referenced by DEN_POT_WFK_read_next_timestep, DEN_read_volumetric_metadata, GEO_read_next_timestep, and POT_read_volumetric_metadata.

int abinit_filetype abinit_plugindata_t   data,
char const *    cmp
[static]
 

Definition at line 303 of file abinitplugin.c.

References abinit_header, abinit_readline, abinit_binary_header_t::fform, abinit_plugindata_t::file, abinit_plugindata_t::filetype, abinit_plugindata_t::hdr, and LINESIZE.

Referenced by open_file_read, read_next_timestep, read_structure, read_volumetric_data, and read_volumetric_metadata.

abinit_binary_header_t * abinit_header FILE *    [static]
 

Definition at line 1479 of file abinitplugin.c.

References abinit_header_free, abinit_header_malloc, abinit_binary_header_t::bantot, big_endian, binread, abinit_binary_header_t::bintype, abinit_binary_header_t::codvsn, abinit_binary_header_t::cplex, abinit_binary_header_t::date, abinit_binary_header_t::ecut, abinit_binary_header_t::ecut_eff, abinit_binary_header_t::ecutdg, abinit_binary_header_t::ecutsm, binary_t::endian, abinit_binary_header_t::etotal, abinit_binary_header_t::fermie, abinit_binary_header_t::fform, abinit_binary_header_t::headform, abinit_binary_header_t::intxc, abinit_binary_header_t::istwfk, abinit_binary_header_t::ixc, abinit_binary_header_t::kpt, little_endian, abinit_binary_header_t::lmn_size, abinit_binary_header_t::natom, abinit_binary_header_t::nband, abinit_binary_header_t::ngfft, abinit_binary_header_t::nkpt, abinit_binary_header_t::npsp, abinit_binary_header_t::npwarr, abinit_binary_header_t::nspden, abinit_binary_header_t::nspinor, abinit_binary_header_t::nsppol, abinit_binary_header_t::nsym, abinit_binary_header_t::ntypat, abinit_binary_header_t::occ, abinit_binary_header_t::occopt, abinit_binary_header_t::pertcase, abinit_binary_header_t::pspcod, abinit_binary_header_t::pspdat, abinit_binary_header_t::pspso, abinit_binary_header_t::pspxc, abinit_binary_header_t::qptn, binary_t::recordmarker, abinit_binary_header_t::residm, abinit_binary_header_t::rprimd, abinit_binary_header_t::so_psp, abinit_binary_header_t::stmbias, abinit_binary_header_t::symafm, abinit_binary_header_t::symrel, abinit_binary_header_t::title, abinit_binary_header_t::tnons, abinit_binary_header_t::tphysel, abinit_binary_header_t::tsmear, abinit_binary_header_t::typat, abinit_binary_header_t::usepaw, abinit_binary_header_t::usewvl, abinit_binary_header_t::wtk, abinit_binary_header_t::xred, abinit_binary_header_t::zionpsp, abinit_binary_header_t::znuclpsp, and abinit_binary_header_t::znucltypat.

Referenced by abinit_filetype, and DEN_POT_WFK_read_next_timestep.

void abinit_header_free abinit_binary_header_t   hdr [static]
 

Definition at line 162 of file abinitplugin.c.

References abinit_binary_header_t::istwfk, abinit_binary_header_t::kpt, abinit_binary_header_t::nband, abinit_binary_header_t::npwarr, abinit_binary_header_t::occ, abinit_binary_header_t::so_psp, abinit_binary_header_t::symafm, abinit_binary_header_t::symrel, abinit_binary_header_t::tnons, abinit_binary_header_t::typat, abinit_binary_header_t::wtk, abinit_binary_header_t::xred, and abinit_binary_header_t::znucltypat.

Referenced by abinit_header, abinit_plugindata_free, and DEN_POT_WFK_read_next_timestep.

abinit_binary_header_t* abinit_header_malloc   [static]
 

Definition at line 136 of file abinitplugin.c.

Referenced by abinit_header.

void abinit_plugindata_free abinit_plugindata_t   data [static]
 

Definition at line 191 of file abinitplugin.c.

References abinit_header_free, abinit_plugindata_t::atomlist, abinit_plugindata_t::file, abinit_plugindata_t::filename, abinit_plugindata_t::hdr, and abinit_plugindata_t::vol.

Referenced by close_file_read, close_file_write, open_file_read, and open_file_write.

abinit_plugindata_t* abinit_plugindata_malloc   [static]
 

Definition at line 149 of file abinitplugin.c.

Referenced by open_file_read, and open_file_write.

char* abinit_readline char *    line,
FILE *    stream
[static]
 

Definition at line 260 of file abinitplugin.c.

References LINESIZE.

Referenced by abinit_filetype, GEO_open_file_read, GEO_read_next_timestep, and GEO_read_structure.

int binread void *   ,
size_t   ,
FILE *   ,
binary_t   
[static]
 

Definition at line 1457 of file abinitplugin.c.

References big_endian, binary_t::endian, Endianness, and little_endian.

Referenced by abinit_header, DEN_read_volumetric_data, and POT_read_volumetric_data.

void close_file_read void *    mydata [static]
 

Definition at line 1228 of file abinitplugin.c.

References abinit_plugindata_free, and DBGPRINT.

Referenced by VMDPLUGIN_init.

void close_file_write void *    mydata [static]
 

Definition at line 1341 of file abinitplugin.c.

References abinit_plugindata_free, and DBGPRINT.

Referenced by VMDPLUGIN_init.

void* DEN_POT_WFK_open_file_read abinit_plugindata_t   data,
int *    natoms
[static]
 

Definition at line 636 of file abinitplugin.c.

References DBGPRINT, abinit_plugindata_t::filetype, abinit_plugindata_t::hdr, abinit_binary_header_t::natom, abinit_plugindata_t::natom, NATOM_MAX, abinit_binary_header_t::typat, and abinit_plugindata_t::typat.

Referenced by open_file_read.

int DEN_POT_WFK_read_next_timestep abinit_plugindata_t   data,
int    natoms,
molfile_timestep_t   ts
[static]
 

Definition at line 691 of file abinitplugin.c.

References molfile_timestep_t::A, abinit_buildrotmat, abinit_header, abinit_header_free, molfile_timestep_t::alpha, molfile_timestep_t::B, molfile_timestep_t::beta, BOHR_TO_ANGS, molfile_timestep_t::C, molfile_timestep_t::coords, DBGPRINT, abinit_plugindata_t::file, abinit_plugindata_t::filename, molfile_timestep_t::gamma, abinit_plugindata_t::hdr, increment_filename, M_PI, MOLFILE_EOF, abinit_plugindata_t::natom, abinit_plugindata_t::rotmat, abinit_binary_header_t::rprimd, abinit_plugindata_t::rprimd, and abinit_binary_header_t::xred.

Referenced by read_next_timestep.

int DEN_POT_WFK_read_structure abinit_plugindata_t   data,
int *    optflags,
molfile_atom_t   atomlist
[static]
 

Definition at line 657 of file abinitplugin.c.

References molfile_atom_t::atomicnumber, molfile_atom_t::chain, DBGPRINT, get_pte_mass, get_pte_vdw_radius, abinit_plugindata_t::hdr, molfile_atom_t::mass, MOLFILE_ATOMICNUMBER, MOLFILE_MASS, MOLFILE_RADIUS, molfile_atom_t::name, abinit_plugindata_t::natom, molfile_atom_t::radius, molfile_atom_t::resid, molfile_atom_t::resname, molfile_atom_t::segid, abinit_binary_header_t::typat, molfile_atom_t::type, and abinit_binary_header_t::znucltypat.

Referenced by read_structure.

int DEN_read_volumetric_data abinit_plugindata_t   data,
int    set,
float *    datablock,
float *    colorblock
[static]
 

Definition at line 879 of file abinitplugin.c.

References binread, abinit_binary_header_t::bintype, BOHR_TO_ANGS, abinit_binary_header_t::cplex, DBGPRINT, abinit_plugindata_t::file, abinit_plugindata_t::hdr, MOLFILE_ERROR, abinit_binary_header_t::nspden, abinit_plugindata_t::nvolsets, binary_t::recordmarker, abinit_plugindata_t::vol, molfile_volumetric_t::xsize, molfile_volumetric_t::ysize, and molfile_volumetric_t::zsize.

Referenced by read_volumetric_data.

int DEN_read_volumetric_metadata abinit_plugindata_t   data,
int *    nvolsets,
molfile_volumetric_t **    metadata
[static]
 

Definition at line 771 of file abinitplugin.c.

References abinit_buildrotmat, BOHR_TO_ANGS, molfile_volumetric_t::dataname, DBGPRINT, molfile_volumetric_t::has_color, abinit_plugindata_t::hdr, MOLFILE_ERROR, abinit_binary_header_t::ngfft, abinit_binary_header_t::nspden, abinit_plugindata_t::nvolsets, molfile_volumetric_t::origin, abinit_plugindata_t::rotmat, abinit_binary_header_t::rprimd, abinit_plugindata_t::rprimd, abinit_binary_header_t::usepaw, abinit_plugindata_t::vol, molfile_volumetric_t::xaxis, molfile_volumetric_t::xsize, molfile_volumetric_t::yaxis, molfile_volumetric_t::ysize, molfile_volumetric_t::zaxis, and molfile_volumetric_t::zsize.

Referenced by read_volumetric_metadata.

void* GEO_open_file_read abinit_plugindata_t   data,
int *    natoms
[static]
 

Definition at line 434 of file abinitplugin.c.

References abinit_readline, DBGPRINT, abinit_plugindata_t::file, abinit_plugindata_t::filename, abinit_plugindata_t::filetype, LINESIZE, name, abinit_plugindata_t::natom, NATOM_MAX, and abinit_plugindata_t::typat.

Referenced by open_file_read.

int GEO_read_next_timestep abinit_plugindata_t   data,
int    natoms,
molfile_timestep_t   ts
[static]
 

Definition at line 537 of file abinitplugin.c.

References molfile_timestep_t::A, abinit_buildrotmat, abinit_readline, molfile_timestep_t::alpha, molfile_timestep_t::B, molfile_timestep_t::beta, BOHR_TO_ANGS, molfile_timestep_t::C, molfile_timestep_t::coords, DBGPRINT, abinit_plugindata_t::file, abinit_plugindata_t::filename, molfile_timestep_t::gamma, increment_filename, LINESIZE, M_PI, MOLFILE_EOF, abinit_plugindata_t::natom, abinit_plugindata_t::rotmat, and abinit_plugindata_t::rprimd.

Referenced by read_next_timestep.

int GEO_read_structure abinit_plugindata_t   data,
int *    optflags,
molfile_atom_t   atomlist
[static]
 

Definition at line 488 of file abinitplugin.c.

References abinit_readline, molfile_atom_t::atomicnumber, molfile_atom_t::chain, DBGPRINT, abinit_plugindata_t::file, abinit_plugindata_t::filename, get_pte_idx, get_pte_mass, get_pte_vdw_radius, LINESIZE, molfile_atom_t::mass, MOLFILE_ATOMICNUMBER, MOLFILE_ERROR, MOLFILE_MASS, MOLFILE_RADIUS, molfile_atom_t::name, abinit_plugindata_t::natom, molfile_atom_t::radius, molfile_atom_t::resid, molfile_atom_t::resname, molfile_atom_t::segid, and molfile_atom_t::type.

Referenced by read_structure.

int increment_filename char *    filename [static]
 

Definition at line 367 of file abinitplugin.c.

References DBGPRINT.

Referenced by DEN_POT_WFK_read_next_timestep, and GEO_read_next_timestep.

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

Definition at line 1141 of file abinitplugin.c.

References abinit_filetype, abinit_plugindata_free, abinit_plugindata_malloc, DBGPRINT, DEN_POT_WFK_open_file_read, abinit_plugindata_t::file, abinit_plugindata_t::filename, GEO_open_file_read, and MOLFILE_NUMATOMS_UNKNOWN.

Referenced by VMDPLUGIN_init.

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

Definition at line 1242 of file abinitplugin.c.

References abinit_plugindata_free, abinit_plugindata_malloc, DBGPRINT, abinit_plugindata_t::file, abinit_plugindata_t::filename, and abinit_plugindata_t::natom.

Referenced by VMDPLUGIN_init.

int POT_read_volumetric_data abinit_plugindata_t   data,
int    set,
float *    datablock,
float *    colorblock
[static]
 

Definition at line 1052 of file abinitplugin.c.

References binread, abinit_binary_header_t::bintype, abinit_binary_header_t::cplex, DBGPRINT, abinit_plugindata_t::file, HARTREE_TO_EV, abinit_plugindata_t::hdr, MOLFILE_ERROR, abinit_plugindata_t::nvolsets, binary_t::recordmarker, abinit_plugindata_t::vol, molfile_volumetric_t::xsize, molfile_volumetric_t::ysize, and molfile_volumetric_t::zsize.

Referenced by read_volumetric_data.

int POT_read_volumetric_metadata abinit_plugindata_t   data,
int *    nvolsets,
molfile_volumetric_t **    metadata
[static]
 

Definition at line 974 of file abinitplugin.c.

References abinit_buildrotmat, BOHR_TO_ANGS, molfile_volumetric_t::dataname, DBGPRINT, molfile_volumetric_t::has_color, abinit_plugindata_t::hdr, MOLFILE_ERROR, abinit_binary_header_t::ngfft, abinit_binary_header_t::nspden, abinit_plugindata_t::nvolsets, molfile_volumetric_t::origin, abinit_plugindata_t::rotmat, abinit_binary_header_t::rprimd, abinit_plugindata_t::rprimd, abinit_plugindata_t::vol, molfile_volumetric_t::xaxis, molfile_volumetric_t::xsize, molfile_volumetric_t::yaxis, molfile_volumetric_t::ysize, molfile_volumetric_t::zaxis, and molfile_volumetric_t::zsize.

Referenced by read_volumetric_metadata.

int read_next_timestep void *    mydata,
int    natoms,
molfile_timestep_t   ts
[static]
 

Definition at line 1203 of file abinitplugin.c.

References abinit_filetype, DBGPRINT, DEN_POT_WFK_read_next_timestep, GEO_read_next_timestep, MOLFILE_EOF, and abinit_plugindata_t::natom.

Referenced by VMDPLUGIN_init.

int read_structure void *    mydata,
int *    optflags,
molfile_atom_t   atomlist
[static]
 

Definition at line 1183 of file abinitplugin.c.

References abinit_filetype, DBGPRINT, DEN_POT_WFK_read_structure, GEO_read_structure, and MOLFILE_ERROR.

Referenced by VMDPLUGIN_init.

int read_volumetric_data void *    mydata,
int    set,
float *    datablock,
float *    colorblock
[static]
 

Definition at line 1372 of file abinitplugin.c.

References abinit_filetype, DBGPRINT, DEN_read_volumetric_data, MOLFILE_ERROR, POT_read_volumetric_data, and WFK_read_volumetric_data.

Referenced by VMDPLUGIN_init.

int read_volumetric_metadata void *    mydata,
int *    nvolsets,
molfile_volumetric_t **    metadata
[static]
 

Definition at line 1352 of file abinitplugin.c.

References abinit_filetype, DBGPRINT, DEN_read_volumetric_metadata, MOLFILE_ERROR, POT_read_volumetric_metadata, and WFK_read_volumetric_metadata.

Referenced by VMDPLUGIN_init.

VMDPLUGIN_API int VMDPLUGIN_fini void   
 

Definition at line 1441 of file abinitplugin.c.

References VMDPLUGIN_API, and VMDPLUGIN_SUCCESS.

VMDPLUGIN_API int VMDPLUGIN_init void   
 

Definition at line 1400 of file abinitplugin.c.

References close_file_read, molfile_plugin_t::close_file_read, close_file_write, molfile_plugin_t::close_file_write, molfile_plugin_t::filename_extension, MOLFILE_PLUGIN_TYPE, open_file_read, molfile_plugin_t::open_file_read, open_file_write, molfile_plugin_t::open_file_write, molfile_plugin_t::read_bonds, molfile_plugin_t::read_molecule_metadata, read_next_timestep, molfile_plugin_t::read_next_timestep, molfile_plugin_t::read_rawgraphics, read_structure, molfile_plugin_t::read_structure, read_volumetric_data, molfile_plugin_t::read_volumetric_data, read_volumetric_metadata, molfile_plugin_t::read_volumetric_metadata, vmdplugin_ABIVERSION, VMDPLUGIN_API, VMDPLUGIN_SUCCESS, VMDPLUGIN_THREADSAFE, molfile_plugin_t::write_bonds, write_structure, molfile_plugin_t::write_structure, write_timestep, and molfile_plugin_t::write_timestep.

VMDPLUGIN_API int VMDPLUGIN_register void *    v,
vmdplugin_register_cb    cb
 

Definition at line 1435 of file abinitplugin.c.

References VMDPLUGIN_API, vmdplugin_register_cb, and VMDPLUGIN_SUCCESS.

int WFK_read_volumetric_data abinit_plugindata_t   data,
int    set,
float *    datablock,
float *    colorblock
[static]
 

Definition at line 1126 of file abinitplugin.c.

References DBGPRINT, and MOLFILE_ERROR.

Referenced by read_volumetric_data.

int WFK_read_volumetric_metadata abinit_plugindata_t   data,
int *    nvolsets,
molfile_volumetric_t **    metadata
[static]
 

Definition at line 1117 of file abinitplugin.c.

References DBGPRINT, and MOLFILE_ERROR.

Referenced by read_volumetric_metadata.

int write_structure void *    mydata,
int    optflags,
const molfile_atom_t   atoms
[static]
 

Definition at line 1270 of file abinitplugin.c.

References DBGPRINT, abinit_plugindata_t::file, get_pte_idx, MOLFILE_ERROR, abinit_plugindata_t::natom, NATOM_MAX, and abinit_plugindata_t::typat.

Referenced by VMDPLUGIN_init.

int write_timestep void *    mydata,
const molfile_timestep_t   ts
[static]
 

Definition at line 1314 of file abinitplugin.c.

References molfile_timestep_t::A, molfile_timestep_t::alpha, ANGS_TO_BOHR, molfile_timestep_t::B, molfile_timestep_t::beta, molfile_timestep_t::C, molfile_timestep_t::coords, DBGPRINT, abinit_plugindata_t::file, molfile_timestep_t::gamma, MOLFILE_ERROR, and abinit_plugindata_t::natom.

Referenced by VMDPLUGIN_init.


Variable Documentation

molfile_plugin_t abinitplugin [static]
 

Definition at line 1398 of file abinitplugin.c.


Generated on Fri Nov 8 03:09:42 2024 for VMD Plugins (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002