30 #include <numeric/xyzMatrix.hh>
33 #include <utility/vector1.hh>
135 centroid += rsd.
xyz(i);
139 centroid /=
static_cast< Real >( numatoms );
142 centroid = rsd.
xyz(
"CA" );
152 using namespace chemical;
159 if ( res_type ==
aa_phe ) WC_atom =
" CZ ";
160 if ( res_type ==
aa_tyr ) WC_atom =
" CZ ";
161 if ( res_type ==
aa_trp ) WC_atom =
" CZ2";
163 Vector const WC_coord (rsd.
xyz( WC_atom ) );
164 x = WC_coord - centroid;
170 if ( res_type ==
aa_phe ) H_atom =
" CD1";
171 if ( res_type ==
aa_tyr ) H_atom =
" CD1";
172 if ( res_type ==
aa_trp ) H_atom =
" CD1";
174 Vector const H_coord (rsd.
xyz( H_atom ) );
175 y = H_coord - centroid;
190 Real const cos_theta,
191 Real & deriv )
const{
197 Real const value = -1 * ( 1 - cos_theta * cos_theta) * ( 1 - cos_theta * cos_theta);
198 deriv = 4 * ( 1 - cos_theta * cos_theta ) * cos_theta;
212 Real & deriv )
const{
214 using namespace core::scoring::constraints;
216 static Real const lower_bound_( -2.0 );
217 static Real const upper_bound_( 7.0 );
218 static Real const bound_zone_ ( 2.0 );
219 static Real const well_depth_ ( 1.0 );
220 static FuncOP dist_func_(
new FadeFunc( lower_bound_, upper_bound_, bound_zone_, well_depth_) );
222 Real const value = dist_func_->func( dist );
223 deriv = dist_func_->dfunc( dist );
250 Real const cos_theta = dot( stub1.
M.col_z(), stub2.
M.col_z() );
251 Real const cen_dist = ( centroid1 - centroid2 ).length();
268 return atom_indices[ 4 ];
284 using namespace chemical;
286 Size const pos1( atom_id.
rsd() );
290 if ( !rsd1.is_aromatic() )
return;
295 int const pos1_map( domain_map( pos1 ) );
296 bool const pos1_fixed( pos1_map != 0 );
302 EnergyGraph const & energy_graph( energies.energy_graph() );
306 iru = energy_graph.get_node( pos1 )->const_edge_list_begin(),
308 iru != irue; ++iru ) {
309 Size const pos2( (*iru)->get_other_ind( pos1 ) );
311 if ( pos1_fixed && pos1_map == domain_map( pos2 ) )
continue;
315 if ( !rsd2.is_aromatic() )
continue;
317 assert( pos2 != pos1 );
346 Real const cos_theta = dot( stub1.
M.col_z(), stub2.
M.col_z() );
347 Vector const d_i_j = centroid1 - centroid2;
348 Real const cen_dist = d_i_j.length();
349 Vector const r_i_j = d_i_j / cen_dist;
351 Real angle_deriv( 0.0 ), dist_deriv( 0.0 );
358 Matrix
const & M_i( stub1.
M );
359 Vector const & z_i = M_i.col_z();
360 Matrix
const & M_j( stub2.
M );
361 Vector const & z_j = M_j.col_z();
364 -1.0 * angle_score * dist_deriv * r_i_j;
366 Vector const f1 = cross( f2, centroid2 ) + dist_score * angle_deriv * cross( z_i, z_j );