00001
00007 #ifndef COMPUTETCLBC_H
00008 #define COMPUTETCLBC_H
00009
00010 #ifdef NAMD_TCL
00011 #define USE_COMPAT_CONST
00012 #include <tcl.h>
00013 #endif
00014
00015 #include "ComputeHomePatches.h"
00016 #include "ReductionMgr.h"
00017 #include "Tensor.h"
00018 #ifndef WIN32
00019 #include <strings.h>
00020 #endif
00021
00022 class ComputeMgr;
00023
00024 class ComputeTclBC : public ComputeHomePatches {
00025
00026 public:
00027 ComputeTclBC(ComputeID c);
00028 virtual ~ComputeTclBC();
00029 void doWork();
00030
00031 private:
00032 int wrapmode;
00033 Lattice *lattice;
00034
00035 ResizeArray<char> drops;
00036 void cleardrops() {
00037 memset((void*)drops.begin(), 0, drops.size()*sizeof(char));
00038 }
00039
00040 ResizeArrayIter<PatchElem> ap;
00041 int i_atom, n_atom;
00042 CompAtom *atoms;
00043 FullAtom *fullatoms;
00044 Force *forces;
00045 BigReal energy;
00046 SubmitReduction *reduction;
00047
00048 #ifdef NAMD_TCL
00049 Tcl_Interp *interp;
00050 static int Tcl_print(ClientData, Tcl_Interp *, int, char **);
00051 static int Tcl_wrapmode(ClientData, Tcl_Interp *, int, char **);
00052 static int Tcl_cleardrops(ClientData, Tcl_Interp *, int, Tcl_Obj * const []);
00053 static int Tcl_dropatom(ClientData, Tcl_Interp *, int, Tcl_Obj * const []);
00054 static int Tcl_nextatom(ClientData, Tcl_Interp *, int, Tcl_Obj * const []);
00055 static int Tcl_getcoord(ClientData, Tcl_Interp *, int, Tcl_Obj * const []);
00056 static int Tcl_getcell(ClientData, Tcl_Interp *, int, Tcl_Obj * const []);
00057 static int Tcl_getmass(ClientData, Tcl_Interp *, int, Tcl_Obj * const []);
00058 static int Tcl_getcharge(ClientData, Tcl_Interp *, int, Tcl_Obj * const []);
00059 static int Tcl_getid(ClientData, Tcl_Interp *, int, Tcl_Obj * const []);
00060 static int Tcl_addforce(ClientData, Tcl_Interp *, int, Tcl_Obj * const []);
00061 static int Tcl_addenergy(ClientData, Tcl_Interp *, int, Tcl_Obj * const []);
00062 #endif
00063
00064 };
00065
00066 #endif
00067
00068
00069
00070
00071
00072
00073