1 /***************************************************************************
3 *cr (C) Copyright 1995-2009 The Board of Trustees of the
4 *cr University of Illinois
5 *cr All Rights Reserved
7 ***************************************************************************/
9 /***************************************************************************
13 * $Author: johns $ $Locker: $ $State: Exp $
14 * $Revision: 1.20 $ $Date: 2009/12/07 17:41:17 $
17 * UIUC Open Source License
18 * http://www.ks.uiuc.edu/Research/vmd/plugins/pluginlicense.html
20 ***************************************************************************/
27 #if ( INT_MAX == 2147483647 )
34 typedef enum IMDType_t
{
35 IMD_DISCONNECT
, /**< close IMD connection, leaving sim running */
36 IMD_ENERGIES
, /**< energy data block */
37 IMD_FCOORDS
, /**< atom coordinates */
38 IMD_GO
, /**< start the simulation */
39 IMD_HANDSHAKE
, /**< endianism and version check message */
40 IMD_KILL
, /**< kill the simulation job, shutdown IMD */
41 IMD_MDCOMM
, /**< MDComm style force data */
42 IMD_PAUSE
, /**< pause the running simulation */
43 IMD_TRATE
, /**< set IMD update transmission rate */
44 IMD_IOERROR
/**< indicate an I/O error */
45 } IMDType
; /**< IMD command message type enumerations */
49 int32 tstep
; /**< integer timestep index */
50 float T
; /**< Temperature in degrees Kelvin */
51 float Etot
; /**< Total energy, in Kcal/mol */
52 float Epot
; /**< Potential energy, in Kcal/mol */
53 float Evdw
; /**< Van der Waals energy, in Kcal/mol */
54 float Eelec
; /**< Electrostatic energy, in Kcal/mol */
55 float Ebond
; /**< Bond energy, Kcal/mol */
56 float Eangle
; /**< Angle energy, Kcal/mol */
57 float Edihe
; /**< Dihedral energy, Kcal/mol */
58 float Eimpr
; /**< Improper energy, Kcal/mol */
59 } IMDEnergies
; /**< IMD simulation energy report structure */
62 /* Send control messages - these consist of a header with no subsequent data */
63 extern int imd_disconnect(void *); /**< leave sim running but close IMD */
64 extern int imd_pause(void *); /**< pause simulation */
65 extern int imd_kill(void *); /**< kill simulation, shutdown IMD */
66 extern int imd_handshake(void *); /**< check endianness, version compat */
67 extern int imd_trate(void *, int32
); /**< set IMD update transmission rate */
69 /* Send data update messages */
71 /** Send MDComm compatible forces, units are Kcal/mol/angstrom */
72 extern int imd_send_mdcomm(void *, int32
, const int32
*, const float *);
75 extern int imd_send_energies(void *, const IMDEnergies
*);
77 /** Send atom forces and coordinates, units are Kcal/mol/angstrom */
78 extern int imd_send_fcoords(void *, int32
, const float *);
81 * recv_handshake returns 0 if server and client have the same relative
82 * endianism; returns 1 if they have opposite endianism, and -1 if there
83 * was an error in the handshake process.
85 extern int imd_recv_handshake(void *);
87 /** Receive header and data */
88 extern IMDType
imd_recv_header(void *, int32
*);
90 /** Receive MDComm-style forces, units are Kcal/mol/angstrom */
91 extern int imd_recv_mdcomm(void *, int32
, int32
*, float *);
93 /** Receive energies */
94 extern int imd_recv_energies(void *, IMDEnergies
*);
96 /** Receive atom coordinates and forces, units are Kcal/mol/angstrom */
97 extern int imd_recv_fcoords(void *, int32
, float *);