Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

colvarproxy_system.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 
00003 // This file is part of the Collective Variables module (Colvars).
00004 // The original version of Colvars and its updates are located at:
00005 // https://github.com/Colvars/colvars
00006 // Please update all Colvars source files before making any changes.
00007 // If you wish to distribute your changes, please submit them to the
00008 // Colvars repository at GitHub.
00009 
00010 #ifndef COLVARPROXY_SYSTEM_H
00011 #define COLVARPROXY_SYSTEM_H
00012 
00013 
00015 class colvarproxy_system {
00016 
00017 public:
00018 
00020   colvarproxy_system();
00021 
00023   virtual ~colvarproxy_system();
00024 
00032   std::string units;
00033 
00035   virtual int set_unit_system(std::string const &units, bool check_only);
00036 
00038   inline cvm::real angstrom_to_internal(cvm::real l) const
00039   {
00040     return l * angstrom_value_;
00041   }
00042 
00044   inline cvm::real internal_to_angstrom(cvm::real l) const
00045   {
00046     return l / angstrom_value_;
00047   }
00048 
00050   inline cvm::real boltzmann() const
00051   {
00052     return boltzmann_;
00053   }
00054 
00056   inline cvm::real target_temperature() const
00057   {
00058     return target_temperature_;
00059   }
00060 
00062   virtual int set_target_temperature(cvm::real T);
00063 
00065   virtual cvm::real dt();
00066 
00068   virtual cvm::real rand_gaussian(void);
00069 
00071   virtual void add_energy(cvm::real energy);
00072 
00074   virtual cvm::rvector position_distance(cvm::atom_pos const &pos1,
00075                                          cvm::atom_pos const &pos2) const;
00076 
00078   void update_pbc_lattice();
00079 
00081   void reset_pbc_lattice();
00082 
00085   virtual void request_total_force(bool yesno);
00086 
00088   virtual bool total_forces_enabled() const;
00089 
00091   virtual bool total_forces_same_step() const;
00092 
00095   virtual int get_molid(int &molid);
00096 
00098   virtual int get_alch_lambda(cvm::real* lambda);
00099 
00101   void set_alch_lambda(cvm::real lambda);
00102 
00104   virtual int send_alch_lambda();
00105 
00107   virtual int get_dE_dlambda(cvm::real* dE_dlambda);
00108 
00110   virtual int apply_force_dE_dlambda(cvm::real* force);
00111 
00113   virtual int get_d2E_dlambda2(cvm::real* d2E_dlambda2);
00114 
00116   cvm::real indirect_lambda_biasing_force;
00117 
00119   virtual cvm::real get_accelMD_factor() const {
00120     cvm::error("Error: accessing the reweighting factor of accelerated MD  "
00121                "is not yet implemented in the MD engine.\n",
00122                COLVARS_NOT_IMPLEMENTED);
00123     return 1.0;
00124   }
00125   virtual bool accelMD_enabled() const {
00126     return false;
00127   }
00128 
00129 protected:
00130 
00132   cvm::real cached_alch_lambda;
00133 
00135   bool cached_alch_lambda_changed;
00136 
00138   cvm::real boltzmann_;
00139 
00141   cvm::real target_temperature_;
00142 
00147   cvm::real angstrom_value_;
00148 
00150   cvm::real kcal_mol_value_;
00151 
00153   bool total_force_requested;
00154 
00160   enum Boundaries_type {
00161     boundaries_non_periodic,
00162     boundaries_pbc_ortho,
00163     boundaries_pbc_triclinic,
00164     boundaries_unsupported
00165   };
00166 
00168   Boundaries_type boundaries_type;
00169 
00171   cvm::rvector unit_cell_x, unit_cell_y, unit_cell_z;
00172 
00174   cvm::rvector reciprocal_cell_x, reciprocal_cell_y, reciprocal_cell_z;
00175 };
00176 
00177 #endif

Generated on Tue Oct 15 02:43:57 2024 for VMD (current) by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002