29 #include <numeric/constants.hh>
30 #include <numeric/conversions.hh>
31 #include <numeric/xyz.functions.hh>
32 #include <numeric/deriv/distance_deriv.hh>
33 #include <numeric/deriv/dihedral_deriv.hh>
39 #include <basic/options/option.hh>
40 #include <basic/options/keys/score.OptionKeys.gen.hh>
43 #include <utility/vector1.hh>
68 using namespace numeric::constants::d;
74 n_nv_dist_sd_( basic::options::option[ basic::options::OptionKeys::score::pro_close_planar_constraint ] ),
77 trans_chi4_mean_( 176.3 * numeric::constants::d::degrees_to_radians ),
78 trans_chi4_sd_( 6.0158 * numeric::constants::d::degrees_to_radians ),
79 cis_chi4_mean_( -2.9105 * numeric::constants::d::degrees_to_radians ),
80 cis_chi4_sd_( 5.8239 * numeric::constants::d::degrees_to_radians ),
106 bool res_moving_wrt_eachother
113 && resl.seqpos() + 1 == resu.seqpos() && resl.is_bonded( resu );
125 using namespace conformation;
126 using namespace chemical;
169 Size N_up_id = upper_res.atom_index(
bbN_ );
170 Size CD_up_id = upper_res.atom_index(
scCD_ );
175 Vector f1( 0.0 ), f2( 0.0 );
177 numeric::deriv::dihedral_p2_cosine_deriv(
178 upper_res.xyz( CD_up_id ), upper_res.xyz( N_up_id ),
179 lower_res.
xyz( C_lo_id ), lower_res.
xyz( O_lo_id ),
183 f1 *= deriv; f2 *= deriv;
184 upper_res_atom_derivs[ N_up_id ].f1() += f1;
185 upper_res_atom_derivs[ N_up_id ].f2() += f2;
188 numeric::deriv::dihedral_p2_cosine_deriv(
189 lower_res.
xyz( O_lo_id ), lower_res.
xyz( C_lo_id ),
190 upper_res.xyz( N_up_id ), upper_res.xyz( CD_up_id ),
192 f1 *= deriv; f2 *= deriv;
193 lower_res_atom_derivs[ C_lo_id ].f1() += f1;
194 lower_res_atom_derivs[ C_lo_id ].f2() += f2;
199 numeric::deriv::dihedral_p1_cosine_deriv(
200 upper_res.xyz( CD_up_id ), upper_res.xyz( N_up_id ),
201 lower_res.
xyz( C_lo_id ), lower_res.
xyz( O_lo_id ),
203 f1 *= deriv; f2 *= deriv;
204 upper_res_atom_derivs[ CD_up_id ].f1() += f1;
205 upper_res_atom_derivs[ CD_up_id ].f2() += f2;
208 numeric::deriv::dihedral_p1_cosine_deriv(
209 lower_res.
xyz( O_lo_id ), lower_res.
xyz( C_lo_id ),
210 upper_res.xyz( N_up_id ), upper_res.xyz( CD_up_id ),
212 f1 *= deriv; f2 *= deriv;
213 lower_res_atom_derivs[ O_lo_id ].f1() += f1;
214 lower_res_atom_derivs[ O_lo_id ].f2() += f2;
329 Vector const & nv_pos( rsd.
xyz( NV_ind ));
332 Vector f1( 0.0 ), f2( 0.0 );
334 numeric::deriv::distance_f1_f2_deriv( nv_pos, n_pos, dist, f1, f2 );
336 f1 *= deriv; f2 *= deriv;
338 atom_derivs[ NV_ind ].f1() += f1;
339 atom_derivs[ NV_ind ].f2() += f2;
340 atom_derivs[ N_ind ].f1() -= f1;
341 atom_derivs[ N_ind ].f2() -= f2;
362 Vector f1( 0.0 ), f2( 0.0 );
363 Distance dist( 0.0 );
364 numeric::deriv::distance_f1_f2_deriv( nv_pos, n_pos, dist, f1, f2 );
365 Real deriv( weights[ pro_close ] * 2 * dist / ( n_nv_dist_sd_ * n_nv_dist_sd_ ));
369 } else if ( rsd.atom_index( bbN_ ) == atom_index ) {
370 //std::cout << "evaluating N pro-closure energy derivative" << std::endl;
371 Vector const & n_pos( rsd.xyz( atom_index ));
372 Vector const & nv_pos( rsd.xyz( scNV_ ));
374 { /// Scope: Distance derivative.
375 Vector f1( 0.0 ), f2( 0.0 );
376 Distance dist( 0.0 );
377 numeric::deriv::distance_f1_f2_deriv( n_pos, nv_pos, dist, f1, f2 );
378 Real deriv( weights[ pro_close ] * 2 * dist / ( n_nv_dist_sd_ * n_nv_dist_sd_ ));
402 using namespace numeric;
403 using namespace numeric::constants::d;
406 assert( lower_res.
is_bonded( upper_res ) );
409 Real chi4 = dihedral_radians(
414 if ( chi4 < -pi_over_2 ) chi4 += pi_2;
424 using namespace numeric::constants::d;
426 if ( chi4 > pi_over_2 ) {
442 using namespace numeric::constants::d;
443 if ( chi4 < -pi_over_2 ) chi4 += pi_2;
445 if ( chi4 > pi_over_2 ) {