Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
HPatchEnergy.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/methods/HPatchEnergy.cc
11 /// @author Ron Jacak
12 
13 // Unit headers
16 
17 // Package headers
19 
20 // Project headers
21 #include <core/pose/Pose.hh>
22 #include <core/scoring/Energies.hh>
23 
24 // Utility headers
25 #include <basic/Tracer.hh>
26 
27 #include <core/id/AtomID.hh>
28 #include <utility/vector1.hh>
29 
30 
31 static basic::Tracer TR("core.pack.interaction_graph.HPatchEnergy");
32 
33 // C++ headers
34 
35 
36 namespace core {
37 namespace pack {
38 namespace interaction_graph {
39 
40 /// @details This must return a fresh instance of the HPatchEnergy class, never an instance already in use
43  return new HPatchEnergy;
44 }
45 
49  sts.push_back( scoring::hpatch );
50  return sts;
51 }
52 
53 
56 {}
57 
58 
61  return new HPatchEnergy();
62 }
63 
64 
65 void
67  // since this is a fake EnergyMethod, don't do anything here
68  // is it even necessary to implement this method as empty?
69 }
70 
71 
72 void
73 HPatchEnergy::residue_energy( conformation::Residue const & /*rsd*/, pose::Pose const & /*pose*/, scoring::EnergyMap & /*emap*/ ) const {
74 
75  // if this were a real term, the code here might look like the following
76  //Real hpatch_score( 0.0 );
77  //hpatch_score = evaluate_score( pose, rsd )
78  //emap [ hpatch ] += hpatch_score
79 
80 }
81 
82 // HPatchEnergy is non-pairwise decomposable, so it can only be calculated all at once, not on a residue by residue
83 // basis. For packing, it uses a specialized InteractionGraph that updates the score efficiently for substitutions.
84 void
86 
87  // don't run if minimizing, non-differentiable
88  if ( ! pose.energies().use_nblist() ) {
89  core::Real hpatch_score = 0.0;
90  std::map< Size, std::pair< Real, Real > > patch_scores;
91  std::map< Size, utility::vector1< id::AtomID > > atoms_in_patches;
92  SurfacePotential::get_instance()->compute_pose_hpatch_score( pose, hpatch_score, patch_scores, atoms_in_patches );
93  //TR << "hpatch score: " << hpatch_score << std::endl;
94  totals[ scoring::hpatch ] = hpatch_score;
95  }
96 
97 }
100 {
101  return 1; // Initial versioning
102 }
103 
104 
105 } // namespace interaction_graph
106 } // namespace pack
107 } // namespace core