NAMD
eabf1D.h
Go to the documentation of this file.
1 //
2 // The extended adaptive biasing force method has been contributed to NAMD by the following authors:
3 //
4 // Haohao Fu and Christophe Chipot
5 // Laboratoire International Associ\'e
6 // Centre National de la Recherche Scientifique et University of Illinois at Urbana--Champaign
7 // Unit\'e Mixte de Recherche No. 7565, Universit\'e de Lorraine
8 // B.P. 70239, 54506 Vand\oe uvre-lès-Nancy cedex, France
9 //
10 // Copyright 2016, Centre National de la Recherche Scientifique
11 //
12 
13 #ifndef EABF1D_H
14 #define EABF1D_H
15 
16 #include <iostream>
17 #include <string>
18 #include <sstream>
19 #include <vector>
20 
21 #include "eabf.h"
22 
23 class eABF1D: public eABF
24 {
25 public:
26  eABF1D() {}
27  // called when (re)start a namd run
28  eABF1D(const double _lowerboundary,
29  const double _upperboundary,
30  const double _width,
31  const double _krestr,
32  const std::string& _outputfile,
33  const int _outputfreq,
34  const bool _restart,
35  const std::string& _inputfile,
36  const bool _outputgrad,
37  const int _gradfreq,
38  const double _temperature);
39  virtual ~eABF1D() {}
40 
41  bool update(const std::string&);
42 
43 protected:
44 
45  std::vector<std::vector<int> > countall; // the distribution of samples, needed for eABF
46  std::vector<double> sumx; // the sum of x in each bin, needed for eABF
47  std::vector<double> sumx2; // the sum of x^2, needed for eABF
48  std::vector<int> county; // the distribution in each bin, needed for eABF
49 
50  bool initialize();
51 
52  bool readfile();
53 
54  bool writefile() const;
55 
56  bool writehead(ofstream_namd&) const;
57 
58  bool calpmf() const;
59 
60  int convertscale(double lowerboundary, int window) const
61  {
62  return int((lowerboundary - this->lowerboundary[0]) / width[0] + window);
63  }
64 
65 };
66 
67 #endif // EABF1D_H
bool calpmf() const
Definition: eabf1D.C:197
std::vector< double > lowerboundary
Definition: eabf.h:61
std::vector< double > width
Definition: eabf.h:63
bool readfile()
Definition: eabf1D.C:123
std::vector< double > sumx
Definition: eabf1D.h:46
int convertscale(double lowerboundary, int window) const
Definition: eabf1D.h:60
bool writefile() const
Definition: eabf1D.C:169
bool writehead(ofstream_namd &) const
Definition: eabf1D.C:189
Definition: eabf.h:22
std::vector< double > sumx2
Definition: eabf1D.h:47
bool update(const std::string &)
Definition: eabf1D.C:67
std::vector< int > county
Definition: eabf1D.h:48
virtual ~eABF1D()
Definition: eabf1D.h:39
Definition: eabf1D.h:23
eABF1D()
Definition: eabf1D.h:26
bool initialize()
Definition: eabf1D.C:45
std::vector< std::vector< int > > countall
Definition: eabf1D.h:45