All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PathMSDBase.h
Go to the documentation of this file.
1 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2  Copyright (c) 2013 The plumed team
3  (see the PEOPLE file at the root of the distribution for a list of names)
4 
5  See http://www.plumed-code.org for more information.
6 
7  This file is part of plumed, version 2.0.
8 
9  plumed is free software: you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  plumed is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  along with plumed. If not, see <http://www.gnu.org/licenses/>.
21 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
22 #ifndef __PLUMED_colvar_PathMSDBase_h
23 #define __PLUMED_colvar_PathMSDBase_h
24 
25 #include <cmath>
26 
27 #include "Colvar.h"
28 #include "ActionRegister.h"
29 
30 #include "tools/PDB.h"
31 #include "tools/RMSD.h"
32 #include "tools/Tools.h"
33 
34 namespace PLMD{
35 namespace colvar{
36 
37 class PathMSDBase : public Colvar {
38 /// this class is a general container for path stuff
39  class ImagePath {
40  public:
41  // cardinal indexing: needed to map over msd
42  unsigned index;
43  // spiwok indexing
44  std::vector<double> property;
45  // distance
46  double distance;
47  // similarity (exp - lambda distance) or other
48  double similarity;
49  // derivatives of the distance
50  std::vector<Vector> distder;
51  // here one can add a pointer to a value (hypothetically providing a distance from a point)
52  };
53  struct imgOrderByDist {
54  bool operator ()(ImagePath const& a, ImagePath const& b) {
55  return (a).distance < (b).distance;
56  }
57  };
59  bool operator ()(ImagePath const& a, ImagePath const& b) {
60  return (a).similarity > (b).similarity;
61  }
62  };
63 
64  double lambda;
67  std::vector<RMSD> msdv;
68  std::string reference;
69  std::vector<Vector> derivs_s;
70  std::vector<Vector> derivs_z;
71  std::vector <ImagePath> imgVec; // this can be used for doing neighlist
72 protected:
73  std::vector<PDB> pdbv;
74  std::vector<std::string> labels;
75  std::vector< std::vector<double> > indexvec; // use double to allow isomaps
76  unsigned nframes;
77 public:
78  PathMSDBase(const ActionOptions&);
79 // active methods:
80  virtual void calculate();
81 // virtual void prepare();
82  static void registerKeywords(Keywords& keys);
83 };
84 
85 }
86 }
87 
88 #endif
89 
std::vector< Vector > derivs_s
Definition: PathMSDBase.h:69
std::vector< Vector > derivs_z
Definition: PathMSDBase.h:70
std::vector< ImagePath > imgVec
Definition: PathMSDBase.h:71
PathMSDBase(const ActionOptions &)
Definition: PathMSDBase.cpp:45
std::vector< RMSD > msdv
Definition: PathMSDBase.h:67
This class holds the keywords and their documentation.
Definition: Keywords.h:36
std::vector< Vector > distder
Definition: PathMSDBase.h:50
bool operator()(ImagePath const &a, ImagePath const &b)
Definition: PathMSDBase.h:59
this class is a general container for path stuff
Definition: PathMSDBase.h:39
This class is used to bring the relevant information to the Action constructor.
Definition: Action.h:41
virtual void calculate()
Calculate an Action.
This is the abstract base class to use for implementing new collective variables, within it there is ...
Definition: Colvar.h:39
std::vector< std::string > labels
Definition: PathMSDBase.h:74
bool operator()(ImagePath const &a, ImagePath const &b)
Definition: PathMSDBase.h:54
std::vector< PDB > pdbv
Definition: PathMSDBase.h:73
void const char const char int double * a
Definition: Matrix.h:42
std::vector< double > property
Definition: PathMSDBase.h:44
std::vector< std::vector< double > > indexvec
Definition: PathMSDBase.h:75
static void registerKeywords(Keywords &keys)
Definition: PathMSDBase.cpp:37