Main Page | Class List | Directories | File List | Class Members | File Members

dcd.h File Reference

DCD trajectory file writer. More...

#include "mdio/file.h"
#include "mdapi/mdtypes.h"

Go to the source code of this file.

Classes

struct  mdio_DcdHeader_t
 DCD header information provided by user. More...
struct  mdio_DcdCell_t
 DCD periodic cell information provided by user. More...
struct  mdio_Dcd_t
 DCD trajectory file writer class. More...

Typedefs

typedef mdio_DcdHeader_t mdio_DcdHeader
 DCD header information provided by user.
typedef mdio_DcdCell_t mdio_DcdCell
 DCD periodic cell information provided by user.
typedef mdio_Dcd_t mdio_Dcd
 DCD trajectory file writer class.

Enumerations

enum  { MDIO_DCD_UNITCELL = 0x001, MDIO_DCD_FIXEDCELL = 0x002 }

Functions

mdio_Dcdmdio_createDcd (void)
 Constructor.
void mdio_destroyDcd (mdio_Dcd *)
 Destructor.
int mdio_writeBeginDcd (mdio_Dcd *, const char *name)
 Begin writing DCD file.
int mdio_writeHeaderDcd (mdio_Dcd *, const mdio_DcdHeader *header)
 Write header information to DCD file.
int mdio_writeFrameDcd (mdio_Dcd *, const MD_Dvec *coord, const mdio_DcdCell *cell, int32 stepnum)
 Write set of coordinates to DCD file.
int mdio_writeEndDcd (mdio_Dcd *)
 End writing DCD file.
int mdio_initializeDcd (mdio_Dcd *)
 Alternative constructor.
void mdio_cleanupDcd (mdio_Dcd *)
 Alternative destructor.


Detailed Description

DCD trajectory file writer.

Author:
David J. Hardy
Date:
2004-2005
The mdio_Dcd class writes DCD trajectory files equivalent to those produced by NAMD. For now, support is only available for file sizes less than 2 gigabytes.

Writing the DCD file is performed by the following sequence of routines:

The mdio_Dcd class is derived from mdio_File so that error handling is performed by typecasting (mdio_Bincoord *) to (mdio_File *).

Typedef Documentation

typedef struct mdio_Dcd_t mdio_Dcd
 

DCD trajectory file writer class.

Members should be treated as private.


Enumeration Type Documentation

anonymous enum
 

Set appropriate cellstatus flag to indicate periodic cell.

Enumerator:
MDIO_DCD_UNITCELL  Flag for a periodic cell.
MDIO_DCD_FIXEDCELL  Flag showing cell dimensions are fixed.


Function Documentation

void mdio_cleanupDcd mdio_Dcd  ) 
 

Alternative destructor.

Use to destroy a preallocated mdio_Dcd object (i.e. one constructed using mdio_initializeDcd() ).

mdio_Dcd* mdio_createDcd void   ) 
 

Constructor.

Creates dynamically allocated DCD trajectory file writer object.

Returns:
Pointer to new object or NULL on failure.

void mdio_destroyDcd mdio_Dcd  ) 
 

Destructor.

Frees dynamically allocated DCD trajectory file writer object.

int mdio_initializeDcd mdio_Dcd  ) 
 

Alternative constructor.

Use to construct a preallocated mdio_Dcd object. See mdio_createDcd() for a description of expected arguments.

int mdio_writeBeginDcd mdio_Dcd ,
const char *  name
 

Begin writing DCD file.

Parameters:
[in] name A nil-terminated string naming the DCD file.
Call this once when writing a DCD file. Opens file for writing.

Returns:
0 on success, MDIO_ERROR on failure.

int mdio_writeEndDcd mdio_Dcd  ) 
 

End writing DCD file.

User calls this once at end of DCD file writing. Closes the file.

Returns:
0 on success, MDIO_ERROR on failure.

int mdio_writeFrameDcd mdio_Dcd ,
const MD_Dvec *  coord,
const mdio_DcdCell cell,
int32  stepnum
 

Write set of coordinates to DCD file.

Parameters:
[in] coord Array of coordinates.
[in] cell Periodic cell information.
[in] stepnum The number of this timestep.
User should call this repeatedly for every frame of coordinates supplied to the DCD file during the simulation. The length of coord array is supplied to the mdio_DcdHeader structure. If system is not periodic, cell should be set to NULL. The value of stepnum is validated against the framestepcnt supplied to mdio_DcdHeader.

Returns:
0 on success, MDIO_ERROR on failure.

int mdio_writeHeaderDcd mdio_Dcd ,
const mdio_DcdHeader header
 

Write header information to DCD file.

Parameters:
[in] header Contains header information from user.
User must supply appropriate values to mdio_DcdHeader fields. Call this once when writing a DCD file.

Returns:
0 on success, MDIO_ERROR on failure.


Generated on Mon Sep 26 10:55:19 2005 for MDX by  doxygen 1.4.4