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

netcdfplugin.c File Reference

#include <netcdf.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "molfile_plugin.h"

Go to the source code of this file.

Compounds

struct  amberdata
struct  cdfdata
struct  mmtkdata

Defines

#define CDF_TYPE_UNKNOWN   0
#define CDF_TYPE_AMBER   1
#define CDF_TYPE_MMTK   2
#define CDF_SUCCESS   0
#define CDF_ERR   -1

Functions

void close_cdf_read (void *mydata)
int open_amber_cdf_read (cdfdata *cdf)
int open_mmtk_cdf_read (cdfdata *cdf, int conventionsknown)
void * open_cdf_read (const char *filename, const char *filetype, int *natoms)
char * find_closing_bracket (char *s)
void atom_name_replace (char *name, char *substring, char letter)
void atom_name_remove_underscores (char *name)
void set_atom_attributes (molfile_atom_t *atoms, int natoms, char **atom_pointers, char chain_id, char *resname, int resnum, char *start, char *end, int name_correction_type)
int read_mmtk_cdf_structure (void *mydata, int *optflags, molfile_atom_t *atoms)
int read_cdf_structure (void *mydata, int *optflags, molfile_atom_t *atoms)
int read_amber_cdf_timestep (void *mydata, int natoms, molfile_timestep_t *ts)
int read_mmtk_cdf_timestep (void *mydata, int natoms, molfile_timestep_t *ts)
int read_cdf_timestep (void *mydata, int natoms, molfile_timestep_t *ts)
VMDPLUGIN_API int VMDPLUGIN_init (void)
VMDPLUGIN_API int VMDPLUGIN_register (void *v, vmdplugin_register_cb cb)
VMDPLUGIN_API int VMDPLUGIN_fini (void)

Variables

molfile_plugin_t plugin


Define Documentation

#define CDF_ERR   -1
 

Definition at line 34 of file netcdfplugin.c.

Referenced by open_amber_cdf_read, and open_mmtk_cdf_read.

#define CDF_SUCCESS   0
 

Definition at line 33 of file netcdfplugin.c.

Referenced by open_amber_cdf_read, and open_mmtk_cdf_read.

#define CDF_TYPE_AMBER   1
 

Definition at line 30 of file netcdfplugin.c.

Referenced by open_amber_cdf_read, read_cdf_structure, and read_cdf_timestep.

#define CDF_TYPE_MMTK   2
 

Definition at line 31 of file netcdfplugin.c.

Referenced by open_mmtk_cdf_read, read_cdf_structure, and read_cdf_timestep.

#define CDF_TYPE_UNKNOWN   0
 

Definition at line 29 of file netcdfplugin.c.

Referenced by open_cdf_read.


Function Documentation

void atom_name_remove_underscores char *    name [static]
 

Definition at line 592 of file netcdfplugin.c.

References name.

Referenced by set_atom_attributes.

void atom_name_replace char *    name,
char *    substring,
char    letter
[static]
 

Definition at line 584 of file netcdfplugin.c.

References name.

Referenced by set_atom_attributes.

void close_cdf_read void *    mydata [static]
 

Definition at line 109 of file netcdfplugin.c.

References cdfdata::amber, amberdata::application, amberdata::cell_angles_units, amberdata::cell_lengths_units, mmtkdata::comment, cdfdata::conventions, amberdata::conventionversion, amberdata::coordinates_units, cdfdata::mmtk, cdfdata::ncid, amberdata::program, amberdata::programversion, and amberdata::title.

Referenced by open_cdf_read, and VMDPLUGIN_init.

char* find_closing_bracket char *    s [static]
 

Definition at line 571 of file netcdfplugin.c.

Referenced by read_mmtk_cdf_structure.

int open_amber_cdf_read cdfdata   cdf [static]
 

Definition at line 152 of file netcdfplugin.c.

References cdfdata::amber, amberdata::application, amberdata::atomdim, amberdata::atomdimid, CDF_ERR, CDF_SUCCESS, CDF_TYPE_AMBER, amberdata::cell_angles_id, amberdata::cell_angles_scalefactor, amberdata::cell_angles_units, amberdata::cell_angular_id, amberdata::cell_lengths_id, amberdata::cell_lengths_scalefactor, amberdata::cell_lengths_units, amberdata::cell_spatial_id, cdfdata::conventions, amberdata::conventionversion, amberdata::coordinates_id, amberdata::coordinates_scalefactor, amberdata::coordinates_units, amberdata::framedim, amberdata::framedimid, amberdata::has_box, amberdata::is_restart, amberdata::is_trajectory, cdfdata::natoms, cdfdata::ncid, amberdata::program, amberdata::programversion, amberdata::spatial_id, amberdata::spatialdim, amberdata::spatialdimid, amberdata::title, cdfdata::type, and amberdata::velocities_id.

Referenced by open_cdf_read.

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

Definition at line 511 of file netcdfplugin.c.

References CDF_TYPE_UNKNOWN, close_cdf_read, cdfdata::conventions, cdfdata::natoms, cdfdata::ncid, open_amber_cdf_read, open_mmtk_cdf_read, and cdfdata::type.

Referenced by VMDPLUGIN_init.

int open_mmtk_cdf_read cdfdata   cdf,
int    conventionsknown
[static]
 

Definition at line 382 of file netcdfplugin.c.

References mmtkdata::atom_numberdim, mmtkdata::atom_numberdimid, mmtkdata::box_size_id, CDF_ERR, CDF_SUCCESS, CDF_TYPE_MMTK, mmtkdata::comment, mmtkdata::configuration_id, mmtkdata::description_id, mmtkdata::description_lengthdim, mmtkdata::description_lengthdimid, mmtkdata::has_box, mmtkdata::minor_step_numberdim, mmtkdata::minor_step_numberdimid, cdfdata::mmtk, cdfdata::natoms, cdfdata::ncid, mmtkdata::step_numberdim, mmtkdata::step_numberdimid, mmtkdata::trajectorytype, cdfdata::type, mmtkdata::xyzdim, and mmtkdata::xyzdimid.

Referenced by open_cdf_read.

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

Definition at line 917 of file netcdfplugin.c.

References molfile_timestep_t::A, molfile_timestep_t::alpha, cdfdata::amber, amberdata::atomdim, molfile_timestep_t::B, molfile_timestep_t::beta, molfile_timestep_t::C, amberdata::cell_angles_id, amberdata::cell_angles_scalefactor, amberdata::cell_lengths_id, amberdata::cell_lengths_scalefactor, amberdata::coordinates_id, amberdata::coordinates_scalefactor, molfile_timestep_t::coords, cdfdata::curframe, molfile_timestep_t::gamma, amberdata::has_box, amberdata::is_restart, MOLFILE_ERROR, cdfdata::ncid, and amberdata::spatialdim.

Referenced by read_cdf_timestep.

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

Definition at line 901 of file netcdfplugin.c.

References CDF_TYPE_AMBER, CDF_TYPE_MMTK, MOLFILE_ERROR, MOLFILE_NOSTRUCTUREDATA, read_mmtk_cdf_structure, and cdfdata::type.

Referenced by VMDPLUGIN_init.

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

Definition at line 1102 of file netcdfplugin.c.

References CDF_TYPE_AMBER, CDF_TYPE_MMTK, MOLFILE_ERROR, read_amber_cdf_timestep, read_mmtk_cdf_timestep, and cdfdata::type.

Referenced by VMDPLUGIN_init.

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

Definition at line 655 of file netcdfplugin.c.

References molfile_atom_t::chain, cdfdata::curframe, mmtkdata::description, mmtkdata::description_id, mmtkdata::description_lengthdim, find_closing_bracket, cdfdata::mmtk, MOLFILE_ERROR, MOLFILE_NOOPTIONS, name, molfile_atom_t::name, cdfdata::natoms, cdfdata::ncid, molfile_atom_t::resid, molfile_atom_t::resname, molfile_atom_t::segid, set_atom_attributes, and molfile_atom_t::type.

Referenced by read_cdf_structure.

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

Definition at line 1018 of file netcdfplugin.c.

References molfile_timestep_t::A, molfile_timestep_t::alpha, mmtkdata::atom_numberdim, molfile_timestep_t::B, molfile_timestep_t::beta, mmtkdata::box_size_id, molfile_timestep_t::C, mmtkdata::configuration_id, molfile_timestep_t::coords, cdfdata::curframe, molfile_timestep_t::gamma, mmtkdata::has_box, mmtkdata::minor_step_numberdim, cdfdata::mmtk, MOLFILE_ERROR, cdfdata::ncid, and mmtkdata::xyzdim.

Referenced by read_cdf_timestep.

void set_atom_attributes molfile_atom_t   atoms,
int    natoms,
char **    atom_pointers,
char    chain_id,
char *    resname,
int    resnum,
char *    start,
char *    end,
int    name_correction_type
[static]
 

Definition at line 604 of file netcdfplugin.c.

References atom_name_remove_underscores, atom_name_replace, molfile_atom_t::chain, molfile_atom_t::name, molfile_atom_t::resid, and molfile_atom_t::resname.

Referenced by read_mmtk_cdf_structure.

VMDPLUGIN_API int VMDPLUGIN_fini void   
 

Definition at line 1142 of file netcdfplugin.c.

References VMDPLUGIN_API, and VMDPLUGIN_SUCCESS.

VMDPLUGIN_API int VMDPLUGIN_init void   
 

Definition at line 1119 of file netcdfplugin.c.

References close_cdf_read, molfile_plugin_t::close_file_read, molfile_plugin_t::filename_extension, MOLFILE_PLUGIN_TYPE, open_cdf_read, molfile_plugin_t::open_file_read, read_cdf_structure, read_cdf_timestep, molfile_plugin_t::read_next_timestep, molfile_plugin_t::read_structure, vmdplugin_ABIVERSION, VMDPLUGIN_API, VMDPLUGIN_SUCCESS, and VMDPLUGIN_THREADSAFE.

VMDPLUGIN_API int VMDPLUGIN_register void *    v,
vmdplugin_register_cb    cb
 

Definition at line 1137 of file netcdfplugin.c.

References VMDPLUGIN_API, vmdplugin_register_cb, and VMDPLUGIN_SUCCESS.


Variable Documentation

molfile_plugin_t plugin [static]
 

Definition at line 1117 of file netcdfplugin.c.


Generated on Tue Jan 21 02:56:30 2020 for VMD Plugins (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002