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

IMDSim Class Reference

handle the low-level setup and teardown of interactive MD simulations. More...

#include <IMDSim.h>

Inheritance diagram for IMDSim:

IMDSimBlocking IMDSimThread List of all members.

Public Types

enum  IMDStates { IMDOFFLINE, IMDSTARTING, IMDRUNNING, IMDPAUSED }
 Currently, VMD stores the simulation's state internally, but ideally these states should be communicated by NAMD. More...


Public Methods

 IMDSim (const char *, int)
 initialize with host and port. More...

virtual ~IMDSim ()
int isConnected () const
int getSimState () const
int next_ts_available () const
virtual void update ()
 Check for available data from the socket. More...

virtual void get_next_ts (float *, IMDEnergies *)=0
 Fetch last received coordinates and energies. Ask for both at the same time so that they at least have a chance of being in sync with each other. More...

virtual void send_forces (int, int *, float *)=0
virtual void pause ()
virtual void unpause ()
virtual void detach ()
virtual void kill ()
virtual void set_transrate (int)

Protected Methods

void disconnect ()

Static Protected Methods

void swap4_aligned (void *data, long ndata)
 reverse endianism of 4 bytes. More...


Protected Attributes

void * sock
int new_coords_ready
int numcoords
int simstate
 One of enum IMDStates. More...

int need2flip
 need to convert endianism. More...


Detailed Description

handle the low-level setup and teardown of interactive MD simulations.

Definition at line 27 of file IMDSim.h.


Member Enumeration Documentation

enum IMDSim::IMDStates
 

Currently, VMD stores the simulation's state internally, but ideally these states should be communicated by NAMD.

Enumeration values:
IMDOFFLINE 
IMDSTARTING 
IMDRUNNING 
IMDPAUSED 

Definition at line 31 of file IMDSim.h.


Constructor & Destructor Documentation

IMDSim::IMDSim const char *   ,
int   
 

initialize with host and port.

Definition at line 28 of file IMDSim.C.

References IMDOFFLINE, IMDRUNNING, new_coords_ready, NULL, numcoords, simstate, sock, vmdsock_connect, vmdsock_create, vmdsock_destroy, and vmdsock_init.

IMDSim::~IMDSim   [virtual]
 

Definition at line 61 of file IMDSim.C.

References disconnect.


Member Function Documentation

virtual void IMDSim::detach   [inline, virtual]
 

Reimplemented in IMDSimBlocking.

Definition at line 52 of file IMDSim.h.

Referenced by IMDMgr::detach.

void IMDSim::disconnect   [protected]
 

Definition at line 51 of file IMDSim.C.

References imd_disconnect, IMDOFFLINE, simstate, sock, vmdsock_destroy, and vmdsock_shutdown.

Referenced by IMDSimBlocking::detach, IMDSimBlocking::kill, IMDSimThread::reader, IMDSimBlocking::send_forces, IMDSimBlocking::update, ~IMDSim, and IMDSimThread::~IMDSimThread.

virtual void IMDSim::get_next_ts float *   ,
IMDEnergies  
[pure virtual]
 

Fetch last received coordinates and energies. Ask for both at the same time so that they at least have a chance of being in sync with each other.

Implemented in IMDSimBlocking.

Referenced by IMDMgr::check_event.

int IMDSim::getSimState   const [inline]
 

Definition at line 38 of file IMDSim.h.

References simstate.

Referenced by IMDSimThread::pause, IMDSimBlocking::pause, IMDMgr::togglepause, IMDSimThread::unpause, and IMDSimBlocking::unpause.

int IMDSim::isConnected   const [inline]
 

Definition at line 37 of file IMDSim.h.

References sock.

Referenced by IMDMgr::check_event, IMDMgr::connect, IMDSimThread::detach, IMDSimBlocking::detach, IMDSimThread::IMDSimThread, IMDSimThread::kill, IMDSimBlocking::kill, IMDSimThread::pause, IMDSimBlocking::pause, IMDSimThread::send_forces, IMDSimBlocking::send_forces, IMDSimThread::set_transrate, IMDSimBlocking::set_transrate, IMDSimThread::unpause, IMDSimBlocking::unpause, IMDSimBlocking::update, and IMDSimThread::~IMDSimThread.

virtual void IMDSim::kill   [inline, virtual]
 

Reimplemented in IMDSimBlocking.

Definition at line 53 of file IMDSim.h.

Referenced by IMDMgr::kill.

int IMDSim::next_ts_available   const [inline]
 

Definition at line 39 of file IMDSim.h.

References new_coords_ready.

Referenced by IMDMgr::check_event.

virtual void IMDSim::pause   [inline, virtual]
 

Reimplemented in IMDSimBlocking.

Definition at line 49 of file IMDSim.h.

Referenced by IMDMgr::pause, and IMDMgr::togglepause.

virtual void IMDSim::send_forces int   ,
int *   ,
float *   
[pure virtual]
 

Implemented in IMDSimBlocking.

Referenced by IMDMgr::send_forces.

virtual void IMDSim::set_transrate int    [inline, virtual]
 

Reimplemented in IMDSimBlocking.

Definition at line 54 of file IMDSim.h.

Referenced by IMDMgr::set_trans_rate.

void IMDSim::swap4_aligned void *    data,
long    ndata
[static, protected]
 

reverse endianism of 4 bytes.

Definition at line 88 of file IMDSim.C.

References data.

Referenced by IMDSimThread::get_next_ts, IMDSimBlocking::get_next_ts, IMDSimThread::send_forces, and IMDSimBlocking::send_forces.

virtual void IMDSim::unpause   [inline, virtual]
 

Reimplemented in IMDSimBlocking.

Definition at line 50 of file IMDSim.h.

Referenced by IMDMgr::togglepause, and IMDMgr::unpause.

virtual void IMDSim::update void    [inline, virtual]
 

Check for available data from the socket.

Reimplemented in IMDSimBlocking.

Definition at line 42 of file IMDSim.h.

Referenced by IMDMgr::check_event.


Member Data Documentation

int IMDSim::need2flip [protected]
 

need to convert endianism.

Definition at line 61 of file IMDSim.h.

int IMDSim::new_coords_ready [protected]
 

Definition at line 58 of file IMDSim.h.

Referenced by IMDSimThread::get_next_ts, IMDSimBlocking::get_next_ts, IMDSim, and next_ts_available.

int IMDSim::numcoords [protected]
 

Definition at line 59 of file IMDSim.h.

Referenced by IMDSimThread::get_next_ts, IMDSimBlocking::get_next_ts, and IMDSim.

int IMDSim::simstate [protected]
 

One of enum IMDStates.

Definition at line 60 of file IMDSim.h.

Referenced by IMDSimThread::detach, IMDSimBlocking::detach, disconnect, getSimState, IMDSim, IMDSimThread::kill, IMDSimBlocking::kill, IMDSimThread::pause, IMDSimBlocking::pause, IMDSimThread::unpause, and IMDSimBlocking::unpause.

void* IMDSim::sock [protected]
 

Definition at line 57 of file IMDSim.h.

Referenced by IMDSimThread::detach, IMDSimBlocking::detach, disconnect, IMDSim, isConnected, IMDSimThread::kill, IMDSimBlocking::kill, IMDSimThread::pause, IMDSimBlocking::pause, IMDSimThread::reader, IMDSimThread::send_forces, IMDSimBlocking::send_forces, IMDSimThread::set_transrate, IMDSimBlocking::set_transrate, IMDSimThread::unpause, IMDSimBlocking::unpause, and IMDSimBlocking::update.


The documentation for this class was generated from the following files:
Generated on Wed Apr 24 02:44:57 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002