Collective Variables Module - Developer Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
ScriptTcl.h
1 
7 /*
8  Modifies SimParameters settings during run.
9 */
10 
11 #ifndef SCRIPTTCL_H
12 #define SCRIPTTCL_H
13 
14 #include "converse.h"
15 #include "NamdTypes.h"
16 #include "Broadcasts.h"
17 
18 #ifdef NAMD_TCL
19 #define USE_COMPAT_CONST
20 #include <tcl.h>
21 #endif
22 
23 class ConfigList;
24 class NamdState;
25 
26 class ScriptTcl {
27 public:
28  ScriptTcl();
29  ~ScriptTcl();
30  void eval(char *script);
31  void load(char *scriptFile);
32 #ifdef NAMD_TCL
33  void run();
34  static int tclsh(int, char **);
35  void tclmain(int, char **);
36 #else
37  void run(char *scriptFile);
38 #endif
39  void measure(Vector *);
40 private:
41  char *scriptFile;
42  ConfigList *config;
43  NamdState *state;
44  void suspend(void);
45  int runWasCalled;
46  int initWasCalled;
47  void barrier();
48  void initcheck();
49  void reinitAtoms(const char *basename=0);
50  SimpleBroadcastObject<int> scriptBarrier;
51  int barrierStep;
52  void runController(int task);
53  void setParameter(const char* param, const char* value);
54  void setParameter(const char* param, int value);
55  friend class DataExchanger;
56  int eval(const char *script, const char **resultPtr);
57 #ifdef NAMD_TCL
58  friend class Controller;
59  friend class GlobalMasterTcl;
60  friend class colvarproxy_namd;
61  Tcl_Interp *interp;
62  static int Tcl_python(ClientData, Tcl_Interp *, int, char **);
63  static int Tcl_startup(ClientData, Tcl_Interp *, int, char **);
64  static int Tcl_exit(ClientData, Tcl_Interp *, int, char **);
65  static int Tcl_abort(ClientData, Tcl_Interp *, int, char **);
66  static int Tcl_numPes(ClientData, Tcl_Interp *, int, char **);
67  static int Tcl_numNodes(ClientData, Tcl_Interp *, int, char **);
68  static int Tcl_numPhysicalNodes(ClientData, Tcl_Interp *, int, char **);
69  static int Tcl_numReplicas(ClientData, Tcl_Interp *, int, char **);
70  static int Tcl_myReplica(ClientData, Tcl_Interp *, int, char **);
71  static int Tcl_replicaEval(ClientData, Tcl_Interp *, int, char **);
72  static int Tcl_replicaYield(ClientData, Tcl_Interp *, int, char **);
73  static int Tcl_replicaSendrecv(ClientData, Tcl_Interp *, int, char **);
74  static int Tcl_replicaSend(ClientData, Tcl_Interp *, int, char **);
75  static int Tcl_replicaRecv(ClientData, Tcl_Interp *, int, char **);
76  static int Tcl_replicaBarrier(ClientData, Tcl_Interp *, int, char **);
77  static int Tcl_replicaAtomSendrecv(ClientData, Tcl_Interp *, int, char **);
78  static int Tcl_replicaAtomSend(ClientData, Tcl_Interp *, int, char **);
79  static int Tcl_replicaAtomRecv(ClientData, Tcl_Interp *, int, char **);
80  static int Tcl_stdout(ClientData, Tcl_Interp *, int, char **);
81  static int Tcl_print(ClientData, Tcl_Interp *, int, char **);
82  static int Tcl_config(ClientData, Tcl_Interp *, int, char **);
83  static int Tcl_isset_config(ClientData, Tcl_Interp *, int, char **);
84  static int Tcl_istrue_config(ClientData, Tcl_Interp *, int, char **);
85  static int Tcl_param(ClientData, Tcl_Interp *, int, char **);
86  static int Tcl_isset_param(ClientData, Tcl_Interp *, int, char **);
87  static int Tcl_istrue_param(ClientData, Tcl_Interp *, int, char **);
88  static int Tcl_reinitvels(ClientData, Tcl_Interp *, int, char **);
89  static int Tcl_rescalevels(ClientData, Tcl_Interp *, int, char **);
90  static int Tcl_run(ClientData, Tcl_Interp *, int, char **);
91  static int Tcl_minimize(ClientData, Tcl_Interp *, int, char **);
92  static int Tcl_move(ClientData, Tcl_Interp *, int, char **);
93  static int Tcl_moveallby(ClientData, Tcl_Interp *, int, char **);
94  static int Tcl_output(ClientData, Tcl_Interp *, int, char **);
95  static int Tcl_measure(ClientData, Tcl_Interp *, int, char **);
96  static int Tcl_colvarbias(ClientData, Tcl_Interp *, int, char **);
97  static int Tcl_colvarvalue(ClientData, Tcl_Interp *, int, char **);
98  static int Tcl_colvars(ClientData, Tcl_Interp *, int, char **);
99  static int Tcl_colvarfreq(ClientData, Tcl_Interp *, int, char **);
100  static int Tcl_checkpoint(ClientData, Tcl_Interp *, int, char **);
101  static int Tcl_revert(ClientData, Tcl_Interp *, int, char **);
102  static int Tcl_checkpointReplica(ClientData, Tcl_Interp *, int, char **);
103  static int Tcl_replicaDcdFile(ClientData, Tcl_Interp *, int, char **);
104  static int Tcl_callback(ClientData, Tcl_Interp *, int, char **);
105  static int Tcl_reinitatoms(ClientData, Tcl_Interp *, int, char **);
106  static int Tcl_coorfile(ClientData, Tcl_Interp *, int, char **);
107  static int Tcl_dumpbench(ClientData, Tcl_Interp *, int, char **);
108  static int Tcl_consForceConfig(ClientData, Tcl_Interp *, int, Tcl_Obj *const objv[]);
109  static int Tcl_reloadCharges(ClientData, Tcl_Interp *, int, char **);
110  static int Tcl_reloadGridforceGrid(ClientData, Tcl_Interp *, int, char **); // BEGIN, END gf
111  static int Tcl_updateGridScale(ClientData, Tcl_Interp *, int, char **); // BEGIN, END gf
112  static int Tcl_reloadStructure(ClientData, Tcl_Interp *, int, char **);
113  char *callbackname;
114  void doCallback(const char *labels, const char *data);
115  int doCallback() { return ! ! callbackname; }
116  char *measure_command;
117  int measure_result;
118 #endif
119 };
120 
121 #endif
122 
Communication between colvars and NAMD (implementation of colvarproxy)
Definition: colvarproxy_namd.h:28
Definition: ScriptTcl.h:26