ScriptTcl.h

Go to the documentation of this file.
00001 
00007 /*
00008    Modifies SimParameters settings during run.
00009 */
00010 
00011 #ifndef SCRIPTTCL_H
00012 #define SCRIPTTCL_H
00013 
00014 #include "converse.h"
00015 #include "NamdTypes.h"
00016 #include "Broadcasts.h"
00017 
00018 #ifdef NAMD_TCL
00019 #define USE_COMPAT_CONST
00020 #include <tcl.h>
00021 #endif
00022 
00023 class ConfigList;
00024 class NamdState;
00025 
00026 class ScriptTcl {
00027 public:
00028   ScriptTcl();
00029   ~ScriptTcl();
00030   void eval(char *script);
00031   void load(char *scriptFile);
00032 #ifdef NAMD_TCL
00033   void run();
00034   static int tclsh(int, char **);
00035   void tclmain(int, char **);
00036 #else
00037   void run(char *scriptFile);
00038 #endif
00039   void measure(Vector *);
00040 private:
00041   char *scriptFile;
00042   ConfigList *config;
00043   NamdState *state;
00044   void suspend(void);
00045   int runWasCalled;
00046   int initWasCalled;
00047   void barrier();
00048   void initcheck();
00049   void reinitAtoms(const char *basename=0);
00050   SimpleBroadcastObject<int> scriptBarrier;
00051   int barrierStep;
00052   void runController(int task);
00053   void setParameter(const char* param, const char* value);
00054   void setParameter(const char* param, int value);
00055   friend class DataExchanger;
00056   int eval(const char *script, const char **resultPtr);
00057 #ifdef NAMD_TCL
00058   friend class Controller;
00059   friend class GlobalMasterTcl;
00060   friend class colvarproxy_namd;
00061   Tcl_Interp *interp;
00062   static int Tcl_python(ClientData, Tcl_Interp *, int, char **);
00063   static int Tcl_startup(ClientData, Tcl_Interp *, int, char **);
00064   static int Tcl_exit(ClientData, Tcl_Interp *, int, char **);
00065   static int Tcl_abort(ClientData, Tcl_Interp *, int, char **);
00066   static int Tcl_numPes(ClientData, Tcl_Interp *, int, char **);
00067   static int Tcl_numNodes(ClientData, Tcl_Interp *, int, char **);
00068   static int Tcl_numPhysicalNodes(ClientData, Tcl_Interp *, int, char **);
00069   static int Tcl_numReplicas(ClientData, Tcl_Interp *, int, char **);
00070   static int Tcl_myReplica(ClientData, Tcl_Interp *, int, char **);
00071   static int Tcl_replicaEval(ClientData, Tcl_Interp *, int, char **);
00072   static int Tcl_replicaYield(ClientData, Tcl_Interp *, int, char **);
00073   static int Tcl_replicaSendrecv(ClientData, Tcl_Interp *, int, char **);
00074   static int Tcl_replicaSend(ClientData, Tcl_Interp *, int, char **);
00075   static int Tcl_replicaRecv(ClientData, Tcl_Interp *, int, char **);
00076   static int Tcl_replicaBarrier(ClientData, Tcl_Interp *, int, char **);
00077   static int Tcl_replicaAtomSendrecv(ClientData, Tcl_Interp *, int, char **);
00078   static int Tcl_replicaAtomSend(ClientData, Tcl_Interp *, int, char **);
00079   static int Tcl_replicaAtomRecv(ClientData, Tcl_Interp *, int, char **);
00080   static int Tcl_stdout(ClientData, Tcl_Interp *, int, char **);
00081   static int Tcl_print(ClientData, Tcl_Interp *, int, char **);
00082   static int Tcl_config(ClientData, Tcl_Interp *, int, char **);
00083   static int Tcl_isset_config(ClientData, Tcl_Interp *, int, char **);
00084   static int Tcl_istrue_config(ClientData, Tcl_Interp *, int, char **);
00085   static int Tcl_param(ClientData, Tcl_Interp *, int, char **);
00086   static int Tcl_isset_param(ClientData, Tcl_Interp *, int, char **);
00087   static int Tcl_istrue_param(ClientData, Tcl_Interp *, int, char **);
00088   static int Tcl_reinitvels(ClientData, Tcl_Interp *, int, char **);
00089   static int Tcl_rescalevels(ClientData, Tcl_Interp *, int, char **);
00090   static int Tcl_run(ClientData, Tcl_Interp *, int, char **);
00091   static int Tcl_minimize(ClientData, Tcl_Interp *, int, char **);
00092   static int Tcl_move(ClientData, Tcl_Interp *, int, char **);
00093   static int Tcl_moveallby(ClientData, Tcl_Interp *, int, char **);
00094   static int Tcl_output(ClientData, Tcl_Interp *, int, char **);
00095   static int Tcl_measure(ClientData, Tcl_Interp *, int, char **);
00096   static int Tcl_colvarbias(ClientData, Tcl_Interp *, int, char **);
00097   static int Tcl_colvarvalue(ClientData, Tcl_Interp *, int, char **);
00098   static int Tcl_colvars(ClientData, Tcl_Interp *, int, Tcl_Obj *const objv[]);
00099   static int Tcl_colvarfreq(ClientData, Tcl_Interp *, int, char **);
00100   static int Tcl_checkpoint(ClientData, Tcl_Interp *, int, char **);
00101   static int Tcl_revert(ClientData, Tcl_Interp *, int, char **);
00102   static int Tcl_checkpointReplica(ClientData, Tcl_Interp *, int, char **);
00103   static int Tcl_replicaDcdFile(ClientData, Tcl_Interp *, int, char **);
00104   static int Tcl_callback(ClientData, Tcl_Interp *, int, char **);
00105   static int Tcl_reinitatoms(ClientData, Tcl_Interp *, int, char **);
00106   static int Tcl_coorfile(ClientData, Tcl_Interp *, int, char **);
00107   static int Tcl_dumpbench(ClientData, Tcl_Interp *, int, char **);
00108   static int Tcl_consForceConfig(ClientData, Tcl_Interp *, int, Tcl_Obj *const objv[]);
00109   static int Tcl_reloadCharges(ClientData, Tcl_Interp *, int, char **);
00110   static int Tcl_reloadGridforceGrid(ClientData, Tcl_Interp *, int, char **);   // BEGIN, END gf
00111   static int Tcl_updateGridScale(ClientData, Tcl_Interp *, int, char **);       // BEGIN, END gf
00112   static int Tcl_reloadStructure(ClientData, Tcl_Interp *, int, char **);
00113   char *callbackname;
00114   void doCallback(const char *labels, const char *data);
00115   int doCallback() { return ! ! callbackname; }
00116   char *measure_command;
00117   int measure_result;
00118 #endif
00119 };
00120 
00121 #endif
00122 

Generated on Mon Nov 20 01:17:14 2017 for NAMD by  doxygen 1.4.7