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

hoomdplugin.c File Reference

#include "largefiles.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
#include <math.h>
#include <errno.h>
#include "molfile_plugin.h"
#include "periodic_table.h"
#include "vmdconio.h"
#include <expat.h>

Go to the source code of this file.

Compounds

struct  hoomd_data_t

Defines

#define THISPLUGIN   plugin
#define HOOMD_FORMAT_MAJV   1
#define HOOMD_FORMAT_MINV   4
#define SMALL   1.0e-7f /*! arbitrary small number. "almost zero" */
#define HOOMD_NONE   0 /**< undefined */
#define HOOMD_XML   1 /**< toplevel tag */
#define HOOMD_CONFIG   2 /**< timestep tag */
#define HOOMD_BOX   3 /**< box dimensions tag */
#define HOOMD_POS   4 /**< coordinates tag */
#define HOOMD_IMAGE   5 /**< image counter tag */
#define HOOMD_VEL   6 /**< velocities tag */
#define HOOMD_TYPE   7 /**< atom type tag */
#define HOOMD_BODY   8 /**< body number tag */
#define HOOMD_MASS   9 /**< atom mass tag */
#define HOOMD_CHARGE   10 /**< atom diameter tag */
#define HOOMD_DIAMETER   11 /**< atom diameter tag */
#define HOOMD_BOND   12 /**< bond section tag */
#define HOOMD_ANGLE   13 /**< angle section tag */
#define HOOMD_DIHEDRAL   14 /**< dihedral section tag */
#define HOOMD_IMPROPER   15 /**< improper section tag */
#define HOOMD_WALL   16 /**< wall description */
#define HOOMD_COORD   17 /**< wall coordinate tag */
#define HOOMD_ACCEL   18 /**< accelerations tag */
#define HOOMD_ORIENT   19 /**< orientation tag */
#define HOOMD_UNKNOWN   20 /**< unknown tag */
#define HOOMD_NUMTAGS   21 /**< number of known tags */
#define HOOMD_MAXDEPTH   5
#define HOOMD_DEBUG   0
#define PRINTERR   (void)(0)
#define SAFE_FREE(ptr)   free(ptr); ptr=NULL
#define SAFE_CALLOC(ptr, type, count)
#define XML_ATTR_COPY(a, n, k, v)
#define XML_UNK_ATTR(e, k, v)
#define SECTION_OPEN(tag, num)   fprintf(data->fp, "<%s num=\"%d\">\n", hoomd_tag_name[tag], num)
#define SECTION_CLOSE(tag)   fprintf(data->fp, "</%s>\n", hoomd_tag_name[tag])
#define SECTION_WRITE_ATOMIC(tag, fmt, val)
#define HOOMD_CONV_POS(crd, box, p, i)

Functions

void make_lower (char *s)
int addstring (char ***list, const char *key)
void xml_new_tag (void *data, const XML_Char *elmt, const XML_Char **attr)
void xml_end_tag (void *data, const XML_Char *elmt)
void xml_data_block (void *data, const XML_Char *s, int len)
void xml_comment (void *data, const XML_Char *s)
int hoomd_parse_line (hoomd_data_t *data)
void * open_hoomd_read (const char *filename, const char *filetype, int *natoms)
int read_hoomd_structure (void *mydata, int *optflags, molfile_atom_t *atoms)
int read_hoomd_bonds (void *v, int *nbonds, int **fromptr, int **toptr, float **bondorder)
int read_hoomd_angles (void *v, int *numangles, int **angles, double **angleforces, int *numdihedrals, int **dihedrals, double **dihedralforces, int *numimpropers, int **impropers, double **improperforces, int *numcterms, int **cterms, int *ctermcols, int *ctermrows, double **ctermforces)
int read_hoomd_timestep (void *mydata, int natoms, molfile_timestep_t *ts)
void close_hoomd_read (void *mydata)
void * open_hoomd_write (const char *filename, const char *filetype, int natoms)
int write_hoomd_structure (void *mydata, int optflags, const molfile_atom_t *atoms)
int write_hoomd_bonds (void *v, int nbonds, int *fromptr, int *toptr, float *bondorder)
int write_hoomd_angles (void *v, int numangles, const int *angles, const double *angleforces, int numdihedrals, const int *dihedrals, const double *dihedralforces, int numimpropers, const int *impropers, const double *improperforces, int numcterms, const int *cterms, int ctermcols, int ctermrows, const double *ctermforces)
int write_hoomd_timestep (void *mydata, const molfile_timestep_t *ts)
void close_hoomd_write (void *mydata)
VMDPLUGIN_API int VMDPLUGIN_init ()
VMDPLUGIN_API int VMDPLUGIN_register (void *v, vmdplugin_register_cb cb)
VMDPLUGIN_API int VMDPLUGIN_fini ()

Variables

const char * hoomd_tag_name [HOOMD_NUMTAGS]
molfile_plugin_t plugin
return MOLFILE_SUCCESS


Define Documentation

#define HOOMD_ACCEL   18 /**< accelerations tag */
 

Definition at line 162 of file hoomdplugin.c.

Referenced by xml_end_tag, and xml_new_tag.

#define HOOMD_ANGLE   13 /**< angle section tag */
 

Definition at line 157 of file hoomdplugin.c.

Referenced by write_hoomd_structure, xml_data_block, xml_end_tag, and xml_new_tag.

#define HOOMD_BODY   8 /**< body number tag */
 

Definition at line 152 of file hoomdplugin.c.

Referenced by write_hoomd_structure, xml_data_block, xml_end_tag, and xml_new_tag.

#define HOOMD_BOND   12 /**< bond section tag */
 

Definition at line 156 of file hoomdplugin.c.

Referenced by write_hoomd_structure, xml_data_block, xml_end_tag, and xml_new_tag.

#define HOOMD_BOX   3 /**< box dimensions tag */
 

Definition at line 147 of file hoomdplugin.c.

Referenced by write_hoomd_timestep, xml_end_tag, and xml_new_tag.

#define HOOMD_CHARGE   10 /**< atom diameter tag */
 

Definition at line 154 of file hoomdplugin.c.

Referenced by write_hoomd_structure, xml_data_block, xml_end_tag, and xml_new_tag.

#define HOOMD_CONFIG   2 /**< timestep tag */
 

Definition at line 146 of file hoomdplugin.c.

Referenced by close_hoomd_write, open_hoomd_write, write_hoomd_timestep, xml_end_tag, and xml_new_tag.

#define HOOMD_CONV_POS crd,
box,
p,
 
 

Value:

if (fabsf(box) > SMALL) {            \
    float tmp;                          \
    tmp = floorf(crd / box + 0.5f);     \
    p =  crd - tmp*box;                 \
    i = (int) tmp;                      \
  } else {                              \
    p = crd;                            \
    i = 0.0f;                           \
  }

#define HOOMD_COORD   17 /**< wall coordinate tag */
 

Definition at line 161 of file hoomdplugin.c.

Referenced by xml_end_tag, and xml_new_tag.

#define HOOMD_DEBUG   0
 

Definition at line 233 of file hoomdplugin.c.

#define HOOMD_DIAMETER   11 /**< atom diameter tag */
 

Definition at line 155 of file hoomdplugin.c.

Referenced by write_hoomd_structure, xml_data_block, xml_end_tag, and xml_new_tag.

#define HOOMD_DIHEDRAL   14 /**< dihedral section tag */
 

Definition at line 158 of file hoomdplugin.c.

Referenced by write_hoomd_structure, xml_data_block, xml_end_tag, and xml_new_tag.

#define HOOMD_FORMAT_MAJV   1
 

hoomd file format version that this plugin supports. it will refuse to load file formats with higher major version and print a warning on higher minor version. written files will be in exactly this version.

Definition at line 138 of file hoomdplugin.c.

Referenced by open_hoomd_read, and open_hoomd_write.

#define HOOMD_FORMAT_MINV   4
 

Definition at line 139 of file hoomdplugin.c.

Referenced by open_hoomd_read, and open_hoomd_write.

#define HOOMD_IMAGE   5 /**< image counter tag */
 

Definition at line 149 of file hoomdplugin.c.

Referenced by write_hoomd_timestep, xml_data_block, xml_end_tag, and xml_new_tag.

#define HOOMD_IMPROPER   15 /**< improper section tag */
 

Definition at line 159 of file hoomdplugin.c.

Referenced by write_hoomd_structure, xml_data_block, xml_end_tag, and xml_new_tag.

#define HOOMD_MASS   9 /**< atom mass tag */
 

Definition at line 153 of file hoomdplugin.c.

Referenced by write_hoomd_structure, xml_data_block, xml_end_tag, and xml_new_tag.

#define HOOMD_MAXDEPTH   5
 

maximum XML element nesting level supported

Definition at line 178 of file hoomdplugin.c.

Referenced by xml_data_block.

#define HOOMD_NONE   0 /**< undefined */
 

Definition at line 144 of file hoomdplugin.c.

Referenced by xml_end_tag.

#define HOOMD_NUMTAGS   21 /**< number of known tags */
 

Definition at line 165 of file hoomdplugin.c.

Referenced by xml_end_tag, and xml_new_tag.

#define HOOMD_ORIENT   19 /**< orientation tag */
 

Definition at line 163 of file hoomdplugin.c.

Referenced by xml_end_tag, and xml_new_tag.

#define HOOMD_POS   4 /**< coordinates tag */
 

Definition at line 148 of file hoomdplugin.c.

Referenced by write_hoomd_timestep, xml_data_block, xml_end_tag, and xml_new_tag.

#define HOOMD_TYPE   7 /**< atom type tag */
 

Definition at line 151 of file hoomdplugin.c.

Referenced by write_hoomd_structure, xml_data_block, xml_end_tag, and xml_new_tag.

#define HOOMD_UNKNOWN   20 /**< unknown tag */
 

Definition at line 164 of file hoomdplugin.c.

Referenced by xml_new_tag.

#define HOOMD_VEL   6 /**< velocities tag */
 

Definition at line 150 of file hoomdplugin.c.

Referenced by write_hoomd_timestep, xml_data_block, xml_end_tag, and xml_new_tag.

#define HOOMD_WALL   16 /**< wall description */
 

Definition at line 160 of file hoomdplugin.c.

Referenced by xml_end_tag, and xml_new_tag.

#define HOOMD_XML   1 /**< toplevel tag */
 

Definition at line 145 of file hoomdplugin.c.

Referenced by close_hoomd_write, open_hoomd_write, xml_end_tag, and xml_new_tag.

#define PRINTERR   (void)(0)
 

Definition at line 240 of file hoomdplugin.c.

#define SAFE_CALLOC ptr,
type,
count   
 

Value:

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

Definition at line 246 of file hoomdplugin.c.

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

Definition at line 244 of file hoomdplugin.c.

#define SECTION_CLOSE tag       fprintf(data->fp, "</%s>\n", hoomd_tag_name[tag])
 

Definition at line 1781 of file hoomdplugin.c.

Referenced by close_hoomd_write, write_hoomd_structure, and write_hoomd_timestep.

#define SECTION_OPEN tag,
num       fprintf(data->fp, "<%s num=\"%d\">\n", hoomd_tag_name[tag], num)
 

Definition at line 1778 of file hoomdplugin.c.

Referenced by write_hoomd_structure, and write_hoomd_timestep.

#define SECTION_WRITE_ATOMIC tag,
fmt,
val   
 

Value:

SECTION_OPEN(tag,numatoms);             \
  for (i=0; i < numatoms; ++i)            \
    fprintf(data->fp,fmt, val);           \
  SECTION_CLOSE(tag)

Definition at line 1784 of file hoomdplugin.c.

Referenced by write_hoomd_structure.

#define SMALL   1.0e-7f /*! arbitrary small number. "almost zero" */
 

Definition at line 141 of file hoomdplugin.c.

Referenced by write_hoomd_timestep.

#define THISPLUGIN   plugin
 

Definition at line 123 of file hoomdplugin.c.

#define XML_ATTR_COPY a,
n,
k,
 
 

Value:

strncpy(k, a[n],   sizeof(k)-1); make_lower(k);       \
  strncpy(v, a[n+1], sizeof(v)-1); make_lower(value)
copy attribute/value pairs and convert to lowercase

Definition at line 285 of file hoomdplugin.c.

Referenced by xml_new_tag.

#define XML_UNK_ATTR e,
k,
 
 

Value:

vmdcon_printf(VMDCON_WARN, "hoomdplugin) ignoring unknown "       \
                " attribute %s='%s' for element %s\n", k, v, e);
warning about unknown attribute

Definition at line 290 of file hoomdplugin.c.

Referenced by xml_new_tag.


Function Documentation

int addstring char ***    list,
const char *    key
[static]
 

find string in a NULL terminated list of strings. grow storage and append if needed. return the index.

Definition at line 265 of file hoomdplugin.c.

Referenced by xml_data_block.

void close_hoomd_read void *    mydata [static]
 

Definition at line 1675 of file hoomdplugin.c.

References hoomd_data_t::angle, hoomd_data_t::angletype, hoomd_data_t::angletypename, hoomd_data_t::bondtype, hoomd_data_t::bondtypename, molfile_timestep_t::coords, hoomd_data_t::dihedral, hoomd_data_t::dihedraltype, hoomd_data_t::dihedraltypename, hoomd_data_t::filename, hoomd_data_t::fp, hoomd_data_t::from, hoomd_data_t::imagecounts, hoomd_data_t::improper, hoomd_data_t::impropertype, hoomd_data_t::impropertypename, hoomd_data_t::numangletypes, hoomd_data_t::numbondtypes, hoomd_data_t::numdihedraltypes, hoomd_data_t::numimpropertypes, hoomd_data_t::p, SAFE_FREE, hoomd_data_t::to, hoomd_data_t::ts, and molfile_timestep_t::velocities.

Referenced by VMDPLUGIN_init.

void close_hoomd_write void *    mydata [static]
 

Definition at line 2222 of file hoomdplugin.c.

References hoomd_data_t::angle, hoomd_data_t::angletype, hoomd_data_t::angletypename, hoomd_data_t::atomlist, hoomd_data_t::bondtype, hoomd_data_t::bondtypename, hoomd_data_t::dihedral, hoomd_data_t::dihedraltype, hoomd_data_t::dihedraltypename, hoomd_data_t::filename, hoomd_data_t::fp, hoomd_data_t::from, HOOMD_CONFIG, HOOMD_XML, hoomd_data_t::imagecounts, hoomd_data_t::improper, hoomd_data_t::impropertype, hoomd_data_t::impropertypename, hoomd_data_t::numangles, hoomd_data_t::numangletypes, hoomd_data_t::numbonds, hoomd_data_t::numbondtypes, hoomd_data_t::numdihedrals, hoomd_data_t::numdihedraltypes, hoomd_data_t::numframe, hoomd_data_t::numimpropers, hoomd_data_t::numimpropertypes, SECTION_CLOSE, and hoomd_data_t::to.

Referenced by VMDPLUGIN_init.

int hoomd_parse_line hoomd_data_t   data [static]
 

run the XML parser to read the next line

Definition at line 1174 of file hoomdplugin.c.

References hoomd_data_t::buffer, hoomd_data_t::filename, hoomd_data_t::fp, MOLFILE_BIGBUFSIZ, MOLFILE_ERROR, MOLFILE_SUCCESS, hoomd_data_t::p, and hoomd_data_t::parse_error.

Referenced by open_hoomd_read, read_hoomd_structure, and read_hoomd_timestep.

void make_lower char *    s [static]
 

convert string to upper case

Definition at line 255 of file hoomdplugin.c.

Referenced by xml_new_tag.

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

open the file and validate that it is indeed a HOOMD file. we also need to count the number of atoms, so we instead parse the whole first configuration including bonding info and so on and store it for later use.

Definition at line 1215 of file hoomdplugin.c.

References hoomd_data_t::angle, hoomd_data_t::angletype, hoomd_data_t::angletypename, hoomd_data_t::bondtype, hoomd_data_t::bondtypename, hoomd_data_t::counter, hoomd_data_t::dihedral, hoomd_data_t::dihedraltype, hoomd_data_t::dihedraltypename, hoomd_data_t::doneframe, hoomd_data_t::filename, hoomd_data_t::fp, HOOMD_FORMAT_MAJV, HOOMD_FORMAT_MINV, hoomd_parse_line, hoomd_data_t::majv, hoomd_data_t::minv, MOLFILE_ERROR, MOLFILE_NOOPTIONS, hoomd_data_t::mysigma, hoomd_data_t::numangles, hoomd_data_t::numangletypes, hoomd_data_t::numatoms, hoomd_data_t::numbonds, hoomd_data_t::numbondtypes, hoomd_data_t::numdihedrals, hoomd_data_t::numdihedraltypes, hoomd_data_t::numframe, hoomd_data_t::numimpropers, hoomd_data_t::numimpropertypes, hoomd_data_t::numtypes, hoomd_data_t::optflags, hoomd_data_t::p, hoomd_data_t::parse_error, SAFE_FREE, xml_comment, xml_data_block, xml_end_tag, and xml_new_tag.

Referenced by VMDPLUGIN_init.

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

open hoomd data file for writing. this will also write the XML identfier tag and the opening <hoomd> and <configuration> elements

Definition at line 1718 of file hoomdplugin.c.

References hoomd_data_t::angle, hoomd_data_t::angletype, hoomd_data_t::angletypename, hoomd_data_t::atomlist, hoomd_data_t::bondtype, hoomd_data_t::bondtypename, hoomd_data_t::dihedral, hoomd_data_t::dihedraltype, hoomd_data_t::dihedraltypename, hoomd_data_t::filename, hoomd_data_t::fp, hoomd_data_t::from, HOOMD_CONFIG, HOOMD_FORMAT_MAJV, HOOMD_FORMAT_MINV, hoomd_tag_name, HOOMD_XML, hoomd_data_t::imagecounts, hoomd_data_t::improper, hoomd_data_t::impropertype, hoomd_data_t::impropertypename, hoomd_data_t::numangles, hoomd_data_t::numangletypes, hoomd_data_t::numatoms, hoomd_data_t::numbonds, hoomd_data_t::numbondtypes, hoomd_data_t::numdihedrals, hoomd_data_t::numdihedraltypes, hoomd_data_t::numframe, hoomd_data_t::numimpropers, hoomd_data_t::numimpropertypes, and hoomd_data_t::to.

Referenced by VMDPLUGIN_init.

int read_hoomd_angles void *    v,
int *    numangles,
int **    angles,
double **    angleforces,
int *    numdihedrals,
int **    dihedrals,
double **    dihedralforces,
int *    numimpropers,
int **    impropers,
double **    improperforces,
int *    numcterms,
int **    cterms,
int *    ctermcols,
int *    ctermrows,
double **    ctermforces
[static]
 

Definition at line 1570 of file hoomdplugin.c.

References hoomd_data_t::angle, hoomd_data_t::dihedral, hoomd_data_t::improper, MOLFILE_SUCCESS, hoomd_data_t::numangles, hoomd_data_t::numdihedrals, hoomd_data_t::numimpropers, and VMDCON_INFO.

Referenced by VMDPLUGIN_init.

int read_hoomd_bonds void *    v,
int *    nbonds,
int **    fromptr,
int **    toptr,
float **    bondorder
[static]
 

Definition at line 1484 of file hoomdplugin.c.

References hoomd_data_t::from, MOLFILE_SUCCESS, hoomd_data_t::numbonds, and hoomd_data_t::to.

Referenced by VMDPLUGIN_init.

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

Definition at line 1339 of file hoomdplugin.c.

References molfile_timestep_t::A, molfile_timestep_t::alpha, hoomd_data_t::angle, hoomd_data_t::angletype, hoomd_data_t::angletypename, molfile_atom_t::atomicnumber, hoomd_data_t::atomlist, molfile_timestep_t::B, molfile_timestep_t::beta, hoomd_data_t::bondtype, hoomd_data_t::bondtypename, molfile_timestep_t::C, molfile_atom_t::chain, molfile_timestep_t::coords, hoomd_data_t::counter, hoomd_data_t::dihedral, hoomd_data_t::dihedraltype, hoomd_data_t::dihedraltypename, hoomd_data_t::doneframe, hoomd_data_t::filename, hoomd_data_t::fp, hoomd_data_t::from, molfile_timestep_t::gamma, get_pte_mass, get_pte_vdw_radius, hoomd_parse_line, hoomd_data_t::imagecounts, hoomd_data_t::improper, hoomd_data_t::impropertype, hoomd_data_t::impropertypename, molfile_atom_t::mass, MOLFILE_ERROR, MOLFILE_MASS, MOLFILE_RADIUS, MOLFILE_SUCCESS, hoomd_data_t::mysigma, hoomd_data_t::numangles, hoomd_data_t::numatoms, hoomd_data_t::numbonds, hoomd_data_t::numdihedrals, hoomd_data_t::numframe, hoomd_data_t::numimpropers, hoomd_data_t::optflags, hoomd_data_t::p, hoomd_data_t::parsedepth, molfile_atom_t::radius, molfile_atom_t::resid, molfile_atom_t::resname, SAFE_CALLOC, molfile_atom_t::segid, hoomd_data_t::to, hoomd_data_t::ts, molfile_timestep_t::velocities, xml_comment, xml_data_block, xml_end_tag, and xml_new_tag.

Referenced by VMDPLUGIN_init.

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

Definition at line 1619 of file hoomdplugin.c.

References molfile_timestep_t::A, molfile_timestep_t::alpha, molfile_timestep_t::B, molfile_timestep_t::beta, molfile_timestep_t::C, molfile_timestep_t::coords, hoomd_data_t::doneframe, hoomd_data_t::fp, molfile_timestep_t::gamma, hoomd_parse_line, hoomd_data_t::imagecounts, MOLFILE_ERROR, MOLFILE_SUCCESS, hoomd_data_t::numframe, hoomd_data_t::p, hoomd_data_t::parse_error, hoomd_data_t::ts, and molfile_timestep_t::velocities.

Referenced by VMDPLUGIN_init.

VMDPLUGIN_API int VMDPLUGIN_fini void   
 

Definition at line 2348 of file hoomdplugin.c.

References VMDPLUGIN_API, and VMDPLUGIN_SUCCESS.

VMDPLUGIN_API int VMDPLUGIN_init void   
 

Definition at line 2310 of file hoomdplugin.c.

References molfile_plugin_t::close_file_read, molfile_plugin_t::close_file_write, close_hoomd_read, close_hoomd_write, molfile_plugin_t::filename_extension, MOLFILE_PLUGIN_TYPE, molfile_plugin_t::open_file_read, molfile_plugin_t::open_file_write, open_hoomd_read, open_hoomd_write, molfile_plugin_t::read_angles, molfile_plugin_t::read_bonds, read_hoomd_angles, read_hoomd_bonds, read_hoomd_structure, read_hoomd_timestep, molfile_plugin_t::read_next_timestep, molfile_plugin_t::read_structure, molfile_plugin_t::read_timestep_metadata, vmdplugin_ABIVERSION, VMDPLUGIN_API, VMDPLUGIN_SUCCESS, VMDPLUGIN_THREADUNSAFE, molfile_plugin_t::write_angles, molfile_plugin_t::write_bonds, write_hoomd_angles, write_hoomd_bonds, write_hoomd_structure, write_hoomd_timestep, molfile_plugin_t::write_structure, and molfile_plugin_t::write_timestep.

VMDPLUGIN_API int VMDPLUGIN_register void *    v,
vmdplugin_register_cb    cb
 

Definition at line 2343 of file hoomdplugin.c.

References VMDPLUGIN_API, vmdplugin_register_cb, and VMDPLUGIN_SUCCESS.

int write_hoomd_angles void *    v,
int    numangles,
const int *    angles,
const double *    angleforces,
int    numdihedrals,
const int *    dihedrals,
const double *    dihedralforces,
int    numimpropers,
const int *    impropers,
const double *    improperforces,
int    numcterms,
const int *    cterms,
int    ctermcols,
int    ctermrows,
const double *    ctermforces
[static]
 

Definition at line 2104 of file hoomdplugin.c.

References hoomd_data_t::angle, hoomd_data_t::numangles, hoomd_data_t::numdihedrals, and hoomd_data_t::numimpropers.

Referenced by VMDPLUGIN_init.

int write_hoomd_bonds void *    v,
int    nbonds,
int *    fromptr,
int *    toptr,
float *    bondorder
[static]
 

Definition at line 1999 of file hoomdplugin.c.

References hoomd_data_t::bondtype, hoomd_data_t::from, MOLFILE_SUCCESS, hoomd_data_t::numbonds, hoomd_data_t::numbondtypes, SAFE_CALLOC, and hoomd_data_t::to.

Referenced by VMDPLUGIN_init.

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

write topology data to hoomd data file.

Definition at line 1792 of file hoomdplugin.c.

References hoomd_data_t::angle, hoomd_data_t::angletype, hoomd_data_t::angletypename, hoomd_data_t::bondtype, hoomd_data_t::bondtypename, hoomd_data_t::dihedral, hoomd_data_t::dihedraltype, hoomd_data_t::dihedraltypename, hoomd_data_t::fp, hoomd_data_t::from, HOOMD_ANGLE, HOOMD_BODY, HOOMD_BOND, HOOMD_CHARGE, HOOMD_DIAMETER, HOOMD_DIHEDRAL, HOOMD_IMPROPER, HOOMD_MASS, HOOMD_TYPE, hoomd_data_t::improper, hoomd_data_t::impropertype, hoomd_data_t::impropertypename, MOLFILE_CHARGE, MOLFILE_MASS, MOLFILE_RADIUS, MOLFILE_SUCCESS, hoomd_data_t::numangles, hoomd_data_t::numatoms, hoomd_data_t::numbonds, hoomd_data_t::numdihedrals, hoomd_data_t::numimpropers, SECTION_CLOSE, SECTION_OPEN, SECTION_WRITE_ATOMIC, and hoomd_data_t::to.

Referenced by VMDPLUGIN_init.

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

Definition at line 2143 of file hoomdplugin.c.

References molfile_timestep_t::A, molfile_timestep_t::B, molfile_timestep_t::C, molfile_timestep_t::coords, hoomd_data_t::fp, HOOMD_BOX, HOOMD_CONFIG, HOOMD_IMAGE, HOOMD_POS, hoomd_tag_name, HOOMD_VEL, hoomd_data_t::imagecounts, MOLFILE_SUCCESS, hoomd_data_t::numatoms, hoomd_data_t::numframe, molfile_timestep_t::physical_time, SECTION_CLOSE, SECTION_OPEN, SMALL, molfile_timestep_t::velocities, and vmdplugin_ABIVERSION.

Referenced by VMDPLUGIN_init.

void xml_comment void *    data,
const XML_Char *    s
[static]
 

comment handler

Definition at line 1164 of file hoomdplugin.c.

References hoomd_data_t::parsedepth.

Referenced by open_hoomd_read, and read_hoomd_structure.

void xml_data_block void *    data,
const XML_Char *    s,
int    len
[static]
 

content data handler for xml document

Definition at line 757 of file hoomdplugin.c.

References addstring, hoomd_data_t::angle, hoomd_data_t::angletype, hoomd_data_t::angletypename, molfile_atom_t::atomicnumber, hoomd_data_t::atomlist, hoomd_data_t::bondtype, hoomd_data_t::bondtypename, molfile_atom_t::charge, molfile_timestep_t::coords, hoomd_data_t::counter, hoomd_data_t::currtag, hoomd_data_t::dihedral, hoomd_data_t::dihedraltype, hoomd_data_t::dihedraltypename, hoomd_data_t::from, get_pte_idx, HOOMD_ANGLE, HOOMD_BODY, HOOMD_BOND, HOOMD_CHARGE, HOOMD_DIAMETER, HOOMD_DIHEDRAL, HOOMD_IMAGE, HOOMD_IMPROPER, HOOMD_MASS, HOOMD_MAXDEPTH, HOOMD_POS, HOOMD_TYPE, HOOMD_VEL, hoomd_data_t::imagecounts, hoomd_data_t::improper, hoomd_data_t::impropertype, hoomd_data_t::impropertypename, hoomd_data_t::majv, molfile_atom_t::mass, hoomd_data_t::minv, molfile_atom_t::name, hoomd_data_t::numangles, hoomd_data_t::numangletypes, hoomd_data_t::numatoms, hoomd_data_t::numbonds, hoomd_data_t::numbondtypes, hoomd_data_t::numdihedrals, hoomd_data_t::numdihedraltypes, hoomd_data_t::numframe, hoomd_data_t::numimpropers, hoomd_data_t::numimpropertypes, hoomd_data_t::parse_error, hoomd_data_t::parsedepth, molfile_atom_t::radius, molfile_atom_t::resid, hoomd_data_t::to, hoomd_data_t::ts, molfile_atom_t::type, and molfile_timestep_t::velocities.

Referenced by open_hoomd_read, and read_hoomd_structure.

void xml_end_tag void *    data,
const XML_Char *    elmt
[static]
 

end of element handler for xml document.

Definition at line 629 of file hoomdplugin.c.

References hoomd_data_t::counter, hoomd_data_t::currtag, hoomd_data_t::doneframe, HOOMD_ACCEL, HOOMD_ANGLE, HOOMD_BODY, HOOMD_BOND, HOOMD_BOX, HOOMD_CHARGE, HOOMD_CONFIG, HOOMD_COORD, HOOMD_DIAMETER, HOOMD_DIHEDRAL, HOOMD_IMAGE, HOOMD_IMPROPER, HOOMD_MASS, HOOMD_NONE, HOOMD_NUMTAGS, HOOMD_ORIENT, HOOMD_POS, hoomd_tag_name, HOOMD_TYPE, HOOMD_VEL, HOOMD_WALL, HOOMD_XML, hoomd_data_t::majv, hoomd_data_t::minv, hoomd_data_t::numangles, hoomd_data_t::numatoms, hoomd_data_t::numbonds, hoomd_data_t::numdihedrals, hoomd_data_t::numimpropers, hoomd_data_t::parse_error, and hoomd_data_t::parsedepth.

Referenced by open_hoomd_read, and read_hoomd_structure.

void xml_new_tag void *    data,
const XML_Char *    elmt,
const XML_Char **    attr
[static]
 

element handler for XML file format. this function is called whenever a new XML element is encountered. this is a companion function to xml_end_tag(). We have to record the nesting level of XML elements, so that we can we can return to the previous element's state. hoomd doesn't use this property yet, but may do so in the future.

Parameters:
data  data structure with information on this file.
elmt  name of the XML element
attr  list of attributes and their values as strings. the order is attr1, val1, attr2, val2, ...

Definition at line 307 of file hoomdplugin.c.

References molfile_timestep_t::A, molfile_timestep_t::alpha, molfile_timestep_t::B, molfile_timestep_t::beta, molfile_timestep_t::C, hoomd_data_t::counter, hoomd_data_t::currtag, molfile_timestep_t::gamma, HOOMD_ACCEL, HOOMD_ANGLE, HOOMD_BODY, HOOMD_BOND, HOOMD_BOX, HOOMD_CHARGE, HOOMD_CONFIG, HOOMD_COORD, HOOMD_DIAMETER, HOOMD_DIHEDRAL, HOOMD_IMAGE, HOOMD_IMPROPER, HOOMD_MASS, HOOMD_NUMTAGS, HOOMD_ORIENT, HOOMD_POS, hoomd_tag_name, HOOMD_TYPE, HOOMD_UNKNOWN, HOOMD_VEL, HOOMD_WALL, HOOMD_XML, hoomd_data_t::majv, make_lower, hoomd_data_t::minv, MOLFILE_BUFSIZ, MOLFILE_CHARGE, MOLFILE_MASS, MOLFILE_RADIUS, hoomd_data_t::mysigma, hoomd_data_t::numangles, hoomd_data_t::numatoms, hoomd_data_t::numdihedrals, hoomd_data_t::numdims, hoomd_data_t::numimpropers, hoomd_data_t::numtypes, hoomd_data_t::optflags, hoomd_data_t::parsedepth, molfile_timestep_t::physical_time, hoomd_data_t::ts, VMDCON_INFO, XML_ATTR_COPY, and XML_UNK_ATTR.

Referenced by open_hoomd_read, and read_hoomd_structure.


Variable Documentation

const char* hoomd_tag_name[HOOMD_NUMTAGS] [static]
 

Initial value:

 {
  "(none)", "hoomd_xml", "configuration", "box", 
  "position", "image", "velocity",               
  "type", "body", "mass", "charge", "diameter",  
  "bond", "angle", "dihedral", "improper",       
  "wall", "coord", "acceleration", "orientation",
  "(error)"                                      
}

Definition at line 168 of file hoomdplugin.c.

Referenced by open_hoomd_write, write_hoomd_timestep, xml_end_tag, and xml_new_tag.

return MOLFILE_SUCCESS
 

Definition at line 2138 of file hoomdplugin.c.

Referenced by hoomd_parse_line, read_hoomd_angles, read_hoomd_bonds, read_hoomd_structure, read_hoomd_timestep, write_hoomd_bonds, write_hoomd_structure, and write_hoomd_timestep.

molfile_plugin_t plugin [static]
 

Definition at line 227 of file hoomdplugin.c.


Generated on Tue Apr 23 04:48:52 2024 for VMD Plugins (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002