Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

ScriptTcl.C File Reference

#include "InfoStream.h"
#include "BackEnd.h"
#include "ScriptTcl.h"
#include "Broadcasts.h"
#include "ConfigList.h"
#include "Node.h"
#include "PDB.h"
#include "WorkDistrib.h"
#include "NamdState.h"
#include "Controller.h"
#include "SimParameters.h"
#include "Thread.h"
#include "ProcessorPrivate.h"
#include "PatchMgr.h"
#include "Measure.h"
#include "colvarmodule.h"
#include "DumpBench.h"
#include <stdio.h>
#include <ctype.h>
#include <strings.h>
#include <tcl.h>
#include "TclCommands.h"
#include "Debug.h"
#include <molfile_plugin.h>
#include <libmolfile_plugin.h>
#include "ComputeConsForceMsgs.h"

Go to the source code of this file.

Defines

#define USE_COMPAT_CONST
#define MIN_DEBUG_LEVEL   4
#define DEG2RAD   3.14159625359/180.0
#define UNITCELLSLOP   0.0001

Functions

int register_cb (void *v, vmdplugin_t *p)
int get_lattice_from_ts (Lattice *lattice, const molfile_timestep_t *ts)

Variables

molfile_plugin_t * dcdplugin
int numatoms
void * filehandle
float * coords
Vectorvcoords


Define Documentation

#define DEG2RAD   3.14159625359/180.0
 

Definition at line 771 of file ScriptTcl.C.

Referenced by get_lattice_from_ts().

#define MIN_DEBUG_LEVEL   4
 

Definition at line 41 of file ScriptTcl.C.

#define UNITCELLSLOP   0.0001
 

Definition at line 772 of file ScriptTcl.C.

#define USE_COMPAT_CONST
 

Copyright (c) 1995, 1996, 1997, 1998, 1999, 2000 by The Board of Trustees of the University of Illinois. All rights reserved.

Definition at line 35 of file ScriptTcl.C.


Function Documentation

int get_lattice_from_ts Lattice lattice,
const molfile_timestep_t *  ts
[static]
 

Definition at line 774 of file ScriptTcl.C.

References DEG2RAD, Lattice::set(), Vector::x, Vector::y, and Vector::z.

00775 {
00776   // Check if valid unit cell data is contained in the timestep.  We don't
00777   // have any formalized way of doing this yet; for now, just check that
00778   // the length of the vector is greater than 1.
00779   if (ts->A <= 1 || ts->B <= 1 || ts->C <= 1) return 0;
00780 
00781   // convert from degrees to radians
00782   // Try to get exact results when the angles are exactly 90.
00783   double epsalpha = DEG2RAD*(ts->alpha-90.0);
00784   double epsbeta  = DEG2RAD*(ts->beta-90.0);
00785   double epsgamma = DEG2RAD*(ts->gamma-90.0);
00786   double cosAB = -sin(epsgamma);
00787   double sinAB = cos(epsgamma);
00788   double cosAC = -sin(epsbeta);
00789   double cosBC = -sin(epsalpha);
00790 
00791   // A will lie along the positive x axis.
00792   // B will lie in the x-y plane
00793   // The origin will be (0,0,0).
00794   Vector A(0), B(0), vecC(0);
00795   A.x = ts->A;
00796   B.x = ts->B*cosAB;
00797   B.y = ts->B*sinAB;
00798   //if (fabs(B.x) < UNITCELLSLOP) B.x = 0;
00799   //if (fabs(B.y) < UNITCELLSLOP) B.y = 0;
00800   vecC.x = ts->C * cosAC;
00801   vecC.y = (ts->B*ts->C*cosBC - B.x*vecC.x)/B.y;
00802   vecC.z = sqrt(ts->C*ts->C - vecC.x*vecC.x - vecC.y*vecC.y);
00803   //if (fabs(vecC.x) < UNITCELLSLOP) vecC.x = 0;
00804   //if (fabs(vecC.y) < UNITCELLSLOP) vecC.y = 0;
00805   //if (fabs(vecC.z) < UNITCELLSLOP) vecC.z = 0;
00806   lattice->set(A, B, vecC, Vector(0));
00807   return 1;
00808 }

int register_cb void *  v,
vmdplugin_t *  p
[static]
 

Definition at line 48 of file ScriptTcl.C.

References dcdplugin.

00048                                                 {
00049         dcdplugin = (molfile_plugin_t *)p;
00050         return 0;
00051 }


Variable Documentation

float* coords [static]
 

Definition at line 58 of file ScriptTcl.C.

molfile_plugin_t* dcdplugin [static]
 

Definition at line 47 of file ScriptTcl.C.

Referenced by register_cb().

void* filehandle [static]
 

Definition at line 57 of file ScriptTcl.C.

int numatoms [static]
 

Definition at line 56 of file ScriptTcl.C.

Vector* vcoords [static]
 

Definition at line 59 of file ScriptTcl.C.


Generated on Fri May 25 04:07:19 2012 for NAMD by  doxygen 1.3.9.1