Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DFIRE_Energy.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/DFIRE_Energy.cc
11 /// @author James Thompson
12 
13 // Unit Headers
16 
17 // Package Headers
22 // AUTO-REMOVED #include <core/scoring/ScoringManager.hh>
24 #include <core/scoring/Energies.hh>
26 
27 // Project headers
28 // AUTO-REMOVED #include <core/conformation/Residue.hh>
29 #include <core/pose/Pose.hh>
30 
31 // Utility headers
32 // AUTO-REMOVED #include <ObjexxFCL/format.hh>
33 // AUTO-REMOVED #include <numeric/conversions.hh>
34 #include <basic/Tracer.hh>
35 
37 #include <utility/vector1.hh>
38 
39 
40 static basic::Tracer TR("core.scoring.methods.DFIRE_Energy");
41 
42 namespace core {
43 namespace scoring {
44 namespace methods {
45 namespace dfire {
46 
47 /// @details This must return a fresh instance of the DFIRE_Energy class,
48 /// never an instance already in use
52 ) const {
53  return new DFIRE_Energy;
54 }
55 
58  ScoreTypes sts;
59  sts.push_back( core::scoring::DFIRE );
60  return sts;
61 }
62 
63 /// ctor
66 {
68 }
69 
73 }
74 
75 void
77  pose::Pose & pose, ScoreFunction const &
78 ) const {
79  using namespace core::scoring::methods;
80  //std::cout << "called setup_for_scoring" << std::endl;
81  // Do we have a potential yet?
82  if (!potential_is_loaded_) {
83  utility_exit_with_message("No potential loaded.");
84  }
85 
86  LongRangeEnergyType const & lr_type( long_range_type() );
87  // create a container
88  Energies & energies( pose.energies() );
89  bool create_new_lre_container( false );
90 
91  if ( energies.long_range_container( lr_type ) == 0 ) {
92  create_new_lre_container = true;
93 
94  } else {
95  LREnergyContainerOP lrc = energies.nonconst_long_range_container( lr_type );
96  DenseEnergyContainerOP dec( static_cast< DenseEnergyContainer * > ( lrc.get() ) );
97  if ( dec->size() != pose.total_residue() ) {
98  create_new_lre_container = true;
99  }
100  }
101 
102  if ( create_new_lre_container ) {
104  energies.set_long_range_container( lr_type, new_dec );
105  }
106 }
107 
108 
109 /// clone
112 {
113  return new DFIRE_Energy;
114 }
115 
116 /////////////////////////////////////////////////////////////////////////////
117 // methods
118 /////////////////////////////////////////////////////////////////////////////
119 
120 ///
121 void
123  conformation::Residue const &,
124  pose::Pose const &,
125  EnergyMap &
126 ) const {
127  //std::cout << "called residue_energy" << std::endl;
128  return;
129 }
130 
132  pose::Pose const & pose,
133  Size res1,
134  Size res2
135 ) const {
136  //std::cout << "testing " << res1 << "," << res2 << " ";
137  //if (pose.residue_type(res1).is_protein() && pose.residue_type(res2).is_protein() ) {
138  // std::cout << "true!" << std::endl;
139  //} else {
140  // std::cout << "false!" << std::endl;
141  //}
142 
143  return ( pose.residue_type(res1).is_protein() && pose.residue_type(res2).is_protein() );
144 }
145 
146 void
148  conformation::Residue const &,
149  pose::Pose const &,
150  ScoreFunction const &,
151  EnergyMap &
152 ) const {
153  //std::cout << "called eval_intrares_energy" << std::endl;
154  return;
155 }
156 
157 void
159  conformation::Residue const & rsd1,
160  conformation::Residue const & rsd2,
161  pose::Pose const &,
162  ScoreFunction const &,
163  EnergyMap & emap
164 ) const {
165  //std::cout << "residue_pair_energy" << std::endl;
167 }
168 
169 /// @brief Energy is context independent and thus indicates that no context
170 /// graphs need to be maintained.
171 void
173  utility::vector1< bool > & /*context_graphs_required*/
174 ) const {}
175 
178  return 1; // Initial versioning
179 }
180 
181 
182 } // dfire
183 } // methods
184 } // scoring
185 } // core