Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

colvarbias_abf.h

Go to the documentation of this file.
00001 /************************************************************************
00002  * Headers for the ABF and histogram biases                             *
00003  ************************************************************************/
00004 
00005 #ifndef COLVARBIAS_ABF_H
00006 #define COLVARBIAS_ABF_H
00007 
00008 #include <vector>
00009 #include <list>
00010 #include <sstream>
00011 #include <iomanip>
00012 //#include <cmath>
00013 
00014 #include "colvarbias.h"
00015 #include "colvargrid.h"
00016 
00017 typedef cvm::real* gradient_t;
00018 
00019 
00021 class colvarbias_abf : public colvarbias {
00022 
00023 public:
00024 
00025   colvarbias_abf (std::string const &conf, char const *key);
00026   ~colvarbias_abf ();
00027 
00028   cvm::real update ();
00029 
00030 private:
00031 
00033   std::string   output_prefix;
00034 
00036   std::vector<std::string> input_prefix;
00037 
00038   bool          apply_bias;
00039   bool          update_bias;
00040   bool          hide_Jacobian;
00041   size_t        full_samples;
00042   size_t        min_samples;
00044   int           output_freq;
00046   bool      b_history_files;
00047   size_t    history_freq;
00048 
00049   // Internal data and methods
00050 
00051   std::vector<int>  bin, prev_bin;
00052   gradient_t        prev_force;
00053 
00055   colvar_grid_gradient  *gradients;
00057   colvar_grid_count     *samples;
00058 
00060   void            write_gradients_samples (const std::string &prefix, bool append = false);
00061 
00063   void            read_gradients_samples ();
00064 
00065   std::istream& read_restart  (std::istream&);
00066   std::ostream& write_restart (std::ostream&);
00067 };
00068 
00069 
00071 class colvarbias_histogram : public colvarbias {
00072 
00073 public:
00074 
00075   colvarbias_histogram (std::string const &conf, char const *key);
00076   ~colvarbias_histogram ();
00077 
00078   cvm::real update ();
00079 
00080 private:
00081 
00083   colvar_grid_count    *grid;
00084   std::vector<int>  bin;
00085   std::string     out_name;
00086 
00087   int             output_freq;  
00088   void            write_grid ();
00089   std::ofstream   grid_os;  
00090 
00091   std::istream& read_restart  (std::istream&);
00092   std::ostream& write_restart (std::ostream&);
00093 };
00094 
00095 #endif

Generated on Sun Feb 12 04:07:53 2012 for NAMD by  doxygen 1.3.9.1