Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MMBondLengthScore.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file core/scoring/mm/MMBondLengthScore.cc
11 /// @brief Molecular mechanics bond length score class
12 /// @author Frank DiMaio (based on Colin Smith's MMBondAngle potential)
13 
14 // Unit headers
17 
18 // Project headers
21 
22 // Utility header
23 // AUTO-REMOVED #include <utility/keys/Key3Tuple.hh>
24 #include <utility/pointer/access_ptr.hh>
25 #include <utility/pointer/owning_ptr.hh>
26 #include <utility/pointer/ReferenceCount.hh>
27 
28 // C++ headers
29 #include <iostream>
30 #include <string>
31 #include <map>
32 
33 #include <utility/vector1.hh>
34 #include <utility/keys/Key2Tuple.hh>
35 
36 
37 namespace core {
38 namespace scoring {
39 namespace mm {
40 
41 /// @details Auto-generated virtual destructor
43 
44 
46  mm_bondlength_library_( scoring::ScoringManager::get_instance()->get_MMBondLengthLibrary() )
47 { }
48 
50  mm_bondlength_library_( mmtl )
51 { }
52 
53 /// @details dscore takes Kb, b0, and a distance;
54 /// returns an energy.
55 Real
57 {
58  Real const del( d - b0 );
59  return Kb * del * del;
60 }
61 
62 /// @details Score take a set of 2 mm atom types in the form of an mm_bondlength_pair and a distance in Ang, and returns
63 /// the energy.
65  Real score = 0;
66 
67  // lookup
69  mm_atomtype_set.key1(), mm_atomtype_set.key2());
70 
71  // calc score
72  for ( mm_bondlength_library_citer i = pair.first, e = pair.second; i != e; ++i ) {
73  score += this->score( (i->second).key1(), (i->second).key2(), d );
74  }
75 
76  return score;
77 }
78 
79 /// @details dscore takes Kb, b0, and a distance;
80 /// returns an energy derivative.
81 Real
83  return 2 * Kb * (d-b0);
84 }
85 
87  Real dscore_dang = 0;
88 
89  // lookup
91  mm_atomtype_set.key1(), mm_atomtype_set.key2() );
92 
93  // calc score
94  for ( mm_bondlength_library_citer i = pair.first, e = pair.second; i != e; ++i ) {
95  dscore_dang += dscore( (i->second).key1(), (i->second).key2(), d );
96  }
97 
98  return dscore_dang;
99 }
100 
101 
102 } // namespace mm
103 } // namespace scoring
104 } // namespace core