00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef COLVARPROXY_VMD_H
00011 #define COLVARPROXY_VMD_H
00012
00013 #include "colvarproxy_vmd_version.h"
00014
00015 #include <tcl.h>
00016
00017 #include "DrawMolecule.h"
00018 #include "Timestep.h"
00019 #include "Inform.h"
00020
00021 #include "colvarmodule.h"
00022 #include "colvarproxy.h"
00023 #include "colvartypes.h"
00024 #include "colvaratoms.h"
00025
00026
00027 int tcl_colvars(ClientData clientData, Tcl_Interp *interp,
00028 int objc, Tcl_Obj *const objv[]);
00029
00032 class colvarproxy_vmd : public colvarproxy {
00033
00034 public:
00035
00040 colvarproxy_vmd(Tcl_Interp *interp, VMDApp *vmd, int molid);
00041
00043 int update_atomic_properties();
00044
00045 virtual ~colvarproxy_vmd();
00046
00047 virtual int request_deletion();
00048
00049 virtual int setup();
00050
00051 virtual int update_input();
00052
00053 virtual cvm::real rand_gaussian();
00054
00055 virtual int get_molid(int &molid);
00056
00057 virtual int get_frame(long int &f);
00058
00059 virtual int set_frame(long int f);
00060
00061 virtual void init_tcl_pointers();
00062
00063 virtual void add_energy(cvm::real energy);
00064
00065 virtual void request_total_force(bool yesno);
00066
00067 virtual void log(std::string const &message);
00068
00069 virtual void error(std::string const &message);
00070
00071 virtual int set_unit_system(std::string const &units_in, bool check_only);
00072
00073 virtual int run_force_callback();
00074
00075 virtual int run_colvar_callback(std::string const &name,
00076 std::vector<const colvarvalue *> const &cvcs,
00077 colvarvalue &value);
00078
00079 virtual int run_colvar_gradient_callback(std::string const &name,
00080 std::vector<const colvarvalue *> const &cvc_values,
00081 std::vector<cvm::matrix2d<cvm::real> > &gradient);
00082
00083 virtual int load_atoms(char const *filename,
00084 cvm::atom_group &atoms,
00085 std::string const &pdb_field,
00086 double const pdb_field_value = 0.0);
00087
00088 virtual int load_coords(char const *filename,
00089 std::vector<cvm::atom_pos> &pos,
00090 const std::vector<int> &indices,
00091 std::string const &pdb_field,
00092 double const pdb_field_value = 0.0);
00093
00094 virtual int init_atom(int atom_number);
00095
00096 virtual int check_atom_id(int atom_number);
00097
00098 virtual int init_atom(cvm::residue_id const &residue,
00099 std::string const &atom_name,
00100 std::string const &segment_id);
00101
00102 virtual int check_atom_id(cvm::residue_id const &residue,
00103 std::string const &atom_name,
00104 std::string const &segment_id);
00105
00106 virtual int init_volmap_by_id(int volmap_id);
00107
00108 virtual int check_volmap_by_id(int volmap_id);
00109
00110 virtual void clear_volmap(int index);
00111
00112 virtual int compute_volmap(int flags,
00113 int volmap_id,
00114 cvm::atom_iter atom_begin,
00115 cvm::atom_iter atom_end,
00116 cvm::real *value,
00117 cvm::real *atom_field);
00118
00119 template<int flags>
00120 void compute_voldata(VolumetricData const *voldata,
00121 cvm::atom_iter atom_begin,
00122 cvm::atom_iter atom_end,
00123 cvm::real *value,
00124 cvm::real *atom_field);
00125
00127 int get_alch_lambda(cvm::real* lambda) {
00128 *lambda = 0.0;
00129 return COLVARS_OK;
00130 }
00131
00133 int send_alch_lambda(void) { return COLVARS_OK; }
00134
00136 int get_dE_dlambda(cvm::real* dE_dlambda) {
00137 *dE_dlambda = 0.0;
00138 return COLVARS_OK;
00139 }
00140
00141 protected:
00142
00144 VMDApp *vmd;
00145
00147 int vmdmolid;
00148
00150 DrawMolecule *vmdmol;
00151
00153 long int vmdmol_frame;
00154
00156 Inform msgColvars;
00157 };
00158
00159
00160 #endif