All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PathMSD.cpp
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 #include "PathMSDBase.h"
23 #include "core/PlumedMain.h"
24 
25 using namespace std;
26 
27 namespace PLMD{
28 namespace colvar{
29 
30 //+PLUMEDOC COLVAR PATHMSD
31 /*
32 This Colvar calculates path collective variables.
33 
34 This is the Path Collective Variables implementation
35 ( see \cite brand07 ).
36 This variable computes the progress along a given set of frames that is provided
37 in input ("sss" component) and the distance from them ("zzz" component).
38 (see below).
39 
40 \par Examples
41 
42 Here below is a case where you have defined three frames and you want to
43 calculate the progress along the path and the distance from it in p1
44 
45 \verbatim
46 p1: PATHMSD REFERENCE=file.pdb LAMBDA=500.0 NEIGH_STRIDE=4 NEIGH_SIZE=8
47 PRINT ARG=p1.sss,p1.zzz STRIDE=1 FILE=colvar FMT=%8.4f
48 \endverbatim
49 
50 note that NEIGH_STRIDE=4 NEIGH_SIZE=8 control the neighborlist parameter (optional but
51 recommended for performance) and states that the neighbor list will be calculated every 4
52 timesteps and consider only the closest 8 member to the actual md snapshots.
53 
54 \note
55 The implementation of this collective variable and of \ref PROPERTYMAP
56 is shared, as well as most input options.
57 
58 
59 */
60 //+ENDPLUMEDOC
61 
62 class PathMSD : public PathMSDBase {
63 public:
64  PathMSD(const ActionOptions&);
65  static void registerKeywords(Keywords& keys);
66 };
67 
68 PLUMED_REGISTER_ACTION(PathMSD,"PATHMSD")
69 
70 void PathMSD::registerKeywords(Keywords& keys){
71  PathMSDBase::registerKeywords(keys);
72  componentsAreNotOptional(keys);
73  keys.addOutputComponent("sss","default","the position on the path");
74  keys.addOutputComponent("zzz","default","the distance from the path");
75 }
76 
77 PathMSD::PathMSD(const ActionOptions&ao):
78 Action(ao),PathMSDBase(ao)
79 {
80  checkRead();
81 
82  log<<" Bibliography "
83  <<plumed.cite("Branduardi, Gervasio, Parrinello J. Chem. Phys. 126, 054103 (2007)")
84  <<"\n";
85  // no need to read anything
88  requestAtoms(pdbv[0].getAtomNumbers());
89 
90  double i=1.;
91  for(unsigned it=0 ;it<nframes ;++it){
92  vector<double> v; v.push_back(i);
93  indexvec.push_back(v);i+=1.;
94  }
95 }
96 
97 }
98 
99 }
Log & log
Reference to the log stream.
Definition: Action.h:93
void componentIsNotPeriodic(const std::string &name)
Set your value component to have no periodicity.
void checkRead()
Check if Action was properly read.
Definition: Action.cpp:161
STL namespace.
void requestAtoms(const std::vector< AtomNumber > &a)
Definition: Colvar.cpp:44
This class holds the keywords and their documentation.
Definition: Keywords.h:36
This class is used to bring the relevant information to the Action constructor.
Definition: Action.h:41
Base class for all the input Actions.
Definition: Action.h:60
Provides the keyword PATHMSD
Definition: PathMSD.cpp:62
void addComponentWithDerivatives(const std::string &name)
Add a value with a name like label.name that has derivatives.
Main plumed object.
Definition: Plumed.h:201
std::vector< PDB > pdbv
Definition: PathMSDBase.h:73
std::vector< std::vector< double > > indexvec
Definition: PathMSDBase.h:75