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

Generated on Tue May 22 01:17:16 2018 for NAMD by  doxygen 1.4.7