All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DRMSD.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_tools_DRMSD_h
23 #define __PLUMED_tools_DRMSD_h
24 
25 #include "Tensor.h"
26 #include "Vector.h"
27 #include <vector>
28 #include <limits>
29 #include <map>
30 
31 namespace PLMD{
32 
33 class PDB;
34 class Pbc;
35 
36 /// A class that implements DRMSD calculations
37 class DRMSD {
38  std::map< std::pair <unsigned,unsigned> , double> targets;
39  unsigned natoms;
40  public:
41 /// Constructor
42  DRMSD(): natoms(0) {}
43 /// clear the structure
44  void clear();
45 /// set reference, align and displace from input pdb structure
46  void setFromPDB(const PDB&, double lbound=0.0, double ubound=std::numeric_limits<double>::max( ));
47 /// set reference coordinates
48  void setReference(const std::vector<Vector> & reference, double lbound=0.0, double ubound=std::numeric_limits<double>::max( ));
49 /// Compute drmsd ( no pbc )
50  double calculate(const std::vector<Vector> & positions,
51  std::vector<Vector> &derivatives, Tensor& virial) const ;
52 /// Compute drmsd ( with pbc )
53  double calculate(const std::vector<Vector>& positions, const Pbc& pbc,
54  std::vector<Vector> &derivatives, Tensor& virial, bool do_pbc=true) const ;
55 };
56 
57 }
58 
59 #endif
60 
Class implementing fixed size matrices of doubles.
Definition: Tensor.h:70
unsigned natoms
Definition: DRMSD.h:39
Definition: Pbc.h:38
double calculate(const std::vector< Vector > &positions, std::vector< Vector > &derivatives, Tensor &virial) const
Compute drmsd ( no pbc )
Definition: DRMSD.cpp:51
std::map< std::pair< unsigned, unsigned >, double > targets
Definition: DRMSD.h:38
DRMSD()
Constructor.
Definition: DRMSD.h:42
A class that implements DRMSD calculations.
Definition: DRMSD.h:37
Minimalistic pdb parser.
Definition: PDB.h:38
void setReference(const std::vector< Vector > &reference, double lbound=0.0, double ubound=std::numeric_limits< double >::max())
set reference coordinates
Definition: DRMSD.cpp:38
void setFromPDB(const PDB &, double lbound=0.0, double ubound=std::numeric_limits< double >::max())
set reference, align and displace from input pdb structure
Definition: DRMSD.cpp:30
void clear()
clear the structure
Definition: DRMSD.cpp:34