Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CoarseEtableEnergy.hh
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/CoarseEtableEnergy.hh
11 /// @brief Energy method for coarse grained residue representation class header
12 /// @author Oliver
13 
14 
15 #ifndef INCLUDED_core_scoring_etable_CoarseEtableEnergy_hh
16 #define INCLUDED_core_scoring_etable_CoarseEtableEnergy_hh
17 
18 // Unit headers
20 
21 // Package headers
24 //#include <core/scoring/etable/BaseEtableEnergy.tmpl.hh>
25 // AUTO-REMOVED #include <core/scoring/etable/Etable.hh>
28 
29 // Project headers
31 #include <core/pose/Pose.fwd.hh>
32 
33 #include <ObjexxFCL/FArray3D.hh>
34 
35 namespace core {
36 namespace scoring {
37 namespace etable {
38 
39 
40 ///
41 
42 class CoarseEtableEnergy;
43 
44 
45 class CoarseEtableEnergy : public BaseEtableEnergy< CoarseEtableEnergy > {
46 public:
48 public:
49  /// @brief Constructor that belongs in a .cc file!
51  Etable const & etable_in,
52  methods::EnergyMethodOptions const & options,
53  coarse::CoarseEtableCAP coarse_etable_in
54  );
55 
56  //clone
58  clone() const {
59  return new CoarseEtableEnergy( *this );
60  }
61 
62  void
64  Size const res1,
65  Size const res2,
66  pose::Pose const & pose
67  ) const;
68 
69  void indicate_required_context_graphs( utility::vector1< bool > & context_graphs_required ) const
70  {
71  context_graphs_required[ ten_A_neighbor_graph ] = true;
72  }
73 
74  //
75  void
76  setup_for_scoring_(pose::Pose const& pose, scoring::ScoreFunction const&) const;
77 
78 public:
79  // implementation for quasi-virtual functions
80  inline
81  void
83  conformation::Atom const & atom1,
84  conformation::Atom const & atom2,
85  Real const weight,
86  Energy &atr,
87  Energy &rep,
88  Energy &solv,
89  Energy &bb,
90  Real & dsq
91  ) const;
92 
93  //
94  inline
95  void
97  conformation::Atom const & atom1,
98  conformation::Atom const & atom2,
99  Real weight,
100  Energy &atr,
101  Energy &rep,
102  Energy &solv,
103  Energy &bb
104  ) const;
105 
106 
107  ///
108  inline
109  Real
111  conformation::Atom const & atom1,
112  conformation::Atom const & atom2,
113  EnergyMap const & weights,
114  Vector & f1,
115  Vector & f2
116  ) const;
117 
118  virtual
119  bool
120  defines_intrares_energy( EnergyMap const & /*weights*/ ) const
121  {
122  return false;
123  }
124 
125  virtual
126  void
128  conformation::Residue const &,
129  pose::Pose const &,
130  ScoreFunction const &,
131  EnergyMap &
132  ) const {}
133 
134 private:
136 
137 };
138 
139  //inline methods
140 
141 inline
142 void
144  conformation::Atom const & atom1,
145  conformation::Atom const & atom2,
146  Real const weight,
147  Energy &atr,
148  Energy &rep,
149  Energy &solv,
150  Energy &bb,
151  Real & d2
152 ) const {
153  // std::cerr << __FILE__<< ' ' << __LINE__ << std::endl;
154  if ( coarse_etable_->handles( atom1, atom2 ) ) {
155  int disbin;
156  Real frac;
157  if (interpolate_bins( atom1, atom2, d2, disbin, frac )) {
158  coarse_etable_->atom_pair_energy( disbin, frac, atom1, atom2, bb);
159  atr = rep = solv = 0.0;
160  }
161  } else {
162  parent::atom_pair_energy_( atom1, atom2, weight, atr, rep, solv, bb, d2);
163  }
164 }
165 ///////////////////////////////////////////////////////////////////////////////
166 
167 /// How does the coarse_etable_ know which residue pair this is?
168 /// when is coarse_etable_->set_residue_pair( rsd1, rsd2 ); called?
169 inline
170 Real
172  conformation::Atom const & atom1,
173  conformation::Atom const & atom2,
174  EnergyMap const & weights,
175  Vector & f1,
176  Vector & f2
177 ) const
178 {
179  if ( coarse_etable_->handles(atom1,atom2) ) {
180  f1 = atom1.xyz().cross( atom2.xyz() );
181  f2 = atom1.xyz() - atom2.xyz();
182  Real d2,frac;
183  int disbin;
184  if (interpolate_bins(atom1,atom2,d2,disbin,frac)) {
185  return coarse_etable_->eval_dE_dR(disbin,frac,atom1,atom2,weights);
186  } else {
187  return 0.0;
188  }
189  } else {
190  return parent::eval_dE_dR_over_r_(atom1,atom2,weights,f1,f2);
191  }
192 }
193 
194 
195 ///////////////////////////////////////////////////////////////////////////////
196 
197 inline
198 void
200  conformation::Atom const & atom1,
201  conformation::Atom const & atom2,
202  Real weight,
203  Energy &atr,
204  Energy &rep,
205  Energy &solv,
206  Energy &bb
207 ) const
208 {
209 
210  if ( coarse_etable_->handles( atom1, atom2) ) {
211  Real d2,frac; int disbin;
212  if ( interpolate_bins( atom1, atom2, d2, disbin, frac) ) {
213  coarse_etable_->atom_pair_energy( disbin, frac, atom1, atom2, bb);
214  atr = rep = solv = 0.0;
215  }
216  } else {
217  parent::pair_energy_H_( atom1, atom2, weight, atr, rep, solv, bb );
218  }
219 }
220 
221 
222 
223 }
224 }
225 }
226 
227 #endif