Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DistanceChainbreakEnergy.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/ScoreFunction.cc
11 /// @brief Atom pair energy functions
12 /// @author Stuart G. Mentzer (Stuart_Mentzer@objexx.com)
13 /// @author Kevin P. Hinshaw (KevinHinshaw@gmail.com)
14 
15 
16 // Unit headers
19 
20 // Package headers
21 
22 
23 // Project headers
24 #include <core/pose/Pose.hh>
27 //#include <core/scoring/ScoringManager.hh>
30 
31 // Numeric headers
32 
33 // utility headers
34 #include <basic/Tracer.hh>
35 
36 #include <utility/vector1.hh>
37 
38 
39 static basic::Tracer tr("core.scoring.DistanceChainbreak",basic::t_info);
40 
41 namespace core {
42 namespace scoring {
43 namespace methods {
44 
45 
46 /// @details This must return a fresh instance of the DistanceChainbreakEnergy class,
47 /// never an instance already in use
51 ) const {
52  return new DistanceChainbreakEnergy;
53 }
54 
57  ScoreTypes sts;
58  sts.push_back( distance_chainbreak );
59  return sts;
60 }
61 
62 
63 
66 {}
67 
68 /// called at the end of energy evaluation
69 void
71  pose::Pose & pose,
72  ScoreFunction const &,
73  EnergyMap & totals
74 ) const
75 {
77  Real total_dev(0.0);
78  Real const dist_target( 1.32 ); //square root of dist2_target from r++ jumping_loops.cc
79  tr.Trace << "called! cuts: " << pose.fold_tree().num_cutpoint() << std::endl;
80  for ( int n=1; n<= pose.fold_tree().num_cutpoint(); ++n ) {
81  int const cutpoint( pose.fold_tree().cutpoint( n ) );
82  Residue const & lower_rsd( pose.residue( cutpoint ) );
83  if ( !lower_rsd.has_variant_type( chemical::CUTPOINT_LOWER ) ) continue;
84  tr.Trace << "cutpoint " << n << "has CUTPOINT variant" << std::endl;
85  Residue const & upper_rsd( pose.residue( cutpoint+1 ) );
86  assert( upper_rsd.has_variant_type( chemical::CUTPOINT_UPPER ) );
87  // Size const nbb( lower_rsd.mainchain_atoms().size() );
88 
89  total_dev +=
90  std::abs( dist_target - ( upper_rsd.xyz( upper_rsd.lower_connect_atom() ).distance( lower_rsd.xyz( lower_rsd.upper_connect_atom() ) ) ) );
91 
92  //r++ does it a little differently
93  //r++ distancechainbreak is calculated as sqrt( dist_target**2 - dist**2 )
94  // not sure if that is that is the right way to do it.
95  //Distance chain break should only be the distance between 'C' of cutpoint and
96  //'N' of cutpoint + 1
97  }
98 
99  assert( std::abs( totals[ distance_chainbreak ] ) < 1e-3 );
100  totals[ distance_chainbreak ] = total_dev;
101 }
102 
103 
104 /// @brief DistanceChainbreak Energy is context independent and thus indicates that no context graphs need to
105 /// be maintained by class Energies
106 void
108  utility::vector1< bool > & /*context_graphs_required*/
109 ) const
110 {}
113 {
114  return 1; // Initial versioning
115 }
116 
117 
118 } // namespace methods
119 } // namespace scoring
120 } // namespace core