48 #include <basic/Tracer.hh>
54 #include <numeric/trig.functions.hh>
61 #include <utility/vector1.hh>
64 namespace ObjexxFCL {
namespace fmt { } }
using namespace ObjexxFCL::fmt;
68 static basic::Tracer
tr(
"core.scoring.geometric_solvation.OccludedHbondSolEnergy_onebody" );
72 namespace geometric_solvation {
74 using namespace ObjexxFCL::fmt;
79 OccludedHbondSolEnergy_onebodyCreator::create_energy_method(
86 OccludedHbondSolEnergy_onebodyCreator::score_types_for_method()
const {
99 OccludedHbondSolEnergy_onebody::OccludedHbondSolEnergy_onebody(
107 if (
verbose_ )
tr <<
"OccludedHbondSolEnergy_onebody constructor" << std::endl;
112 occ_hbond_sol_database_( src.occ_hbond_sol_database_ ),
113 verbose_( src.verbose_ )
115 if (
verbose_ )
tr <<
"OccludedHbondSolEnergy_onebody constructor" << std::endl;
143 tr <<
"Error - no derivatives yet for OccludedHbondSolEnergy_onebody (occ_sol_fitted_onebody)" << std::endl;
151 tr <<
"Error - no derivatives yet for OccludedHbondSolEnergy_onebody (occ_sol_fitted_onebody)" << std::endl;
178 neighborlist.push_back( polar_resnum);
182 neighbor_iter != neighbor_iter_end; ++neighbor_iter ) {
183 neighborlist.push_back( (*neighbor_iter)->get_other_ind( polar_resnum ) );
187 for ( chemical::AtomIndices::const_iterator hnum = polar_rsd.
Hpos_polar().begin(), hnume = polar_rsd.
Hpos_polar().end(); hnum != hnume; ++hnum ) {
188 Size const don_h_atom( *hnum );
191 for (
Size occ_inx = 1; occ_inx <= neighborlist.size(); ++occ_inx ) {
192 core::Size const occ_resnum( neighborlist[occ_inx] );
194 for (
Size occ_atom = 1; occ_atom <= occ_rsd.
natoms(); occ_atom++ ) {
196 polar_group_energy += energy;
199 residue_geosol += polar_group_energy;
205 for ( chemical::AtomIndices::const_iterator anum = polar_rsd.
accpt_pos().begin(), anume = polar_rsd.
accpt_pos().end(); anum != anume; ++anum ) {
206 Size const acc_atom( *anum );
209 for (
Size occ_inx = 1; occ_inx <= neighborlist.size(); ++occ_inx ) {
210 core::Size const occ_resnum( neighborlist[occ_inx] );
212 for (
Size occ_atom = 1; occ_atom <= occ_rsd.
natoms(); occ_atom++ ) {
214 polar_group_energy += energy;
217 residue_geosol += polar_group_energy;
243 Real geo_solE(0.), energy(0.);
246 for ( chemical::AtomIndices::const_iterator hnum = polar_rsd.
Hpos_polar().begin(), hnume = polar_rsd.
Hpos_polar().end(); hnum != hnume; ++hnum ) {
247 Size const don_h_atom( *hnum );
248 Size const don_base_atom( polar_rsd.
atom_base( don_h_atom ) );
249 for (
Size occ_atom = 1; occ_atom <= occ_rsd.
natoms(); occ_atom++ ) {
256 for ( chemical::AtomIndices::const_iterator anum = polar_rsd.
accpt_pos().begin(), anume = polar_rsd.
accpt_pos().end(); anum != anume; ++anum ) {
257 Size const acc_atom( *anum );
259 for (
Size occ_atom = 1; occ_atom <= occ_rsd.
natoms(); occ_atom++ ) {
271 Size const polar_atom,
272 Size const base_atom,
294 if ( polar_atom == occ_atom )
return;
295 if ( base_atom == occ_atom )
return;
298 bool polar_atom_donates =
false;
301 if ( polar_atom_donates ) {
303 for ( chemical::AtomIndices::const_iterator anum = occ_rsd.
accpt_pos().begin(), anume = occ_rsd.
accpt_pos().end(); anum != anume; ++anum ) {
304 if ( occ_atom == *anum ) {
310 for ( chemical::AtomIndices::const_iterator hnum = occ_rsd.
Hpos_polar().begin(), hnume = occ_rsd.
Hpos_polar().end(); hnum != hnume; ++hnum ) {
311 Size const don_h_atom( *hnum );
312 if ( occ_atom == occ_rsd.
atom_base( don_h_atom ) ) {
318 assert( ( polar_atom_donates &&
atom_is_donor_h( polar_rsd, polar_atom ) ) ||
319 ( ( ! polar_atom_donates ) &&
atom_is_acceptor( polar_rsd, polar_atom ) ) );
323 if ( polar_atom_donates ) polar_atom_type_lookup_index = polar_rsd.
atom_type_index( base_atom );
325 Vector const & polar_atom_xyz( polar_rsd.
atom( polar_atom ).
xyz() );
326 Vector const & base_atom_xyz( polar_rsd.
atom( base_atom ).
xyz() );
329 Vector const & occ_atom_xyz( occ_rsd.
atom( occ_atom ).
xyz() );
332 Real const dist_sq = ( occ_atom_xyz - polar_atom_xyz).length_squared();
334 Real const curr_cos_angle =
get_cos_angle( base_atom_xyz, polar_atom_xyz, occ_atom_xyz );
348 Real const dist_diff = sqrt(dist_sq) - dist_mu;
349 Real const cos_angle_diff = cos_angle_mu - curr_cos_angle;
351 exp( - ( ( dist_diff * dist_diff / twice_dist_sigma_sq ) + ( cos_angle_diff * cos_angle_diff / twice_cos_angle_sigma_sq ) ) );
360 Vector const & polar_atom_xyz,
361 Vector const & occluding_atom_xyz )
const
363 return dot( (polar_atom_xyz - base_atom_xyz).normalize(), (occluding_atom_xyz - polar_atom_xyz).normalize() );
370 for ( chemical::AtomIndices::const_iterator hnum = rsd.
Hpos_polar().begin(), hnume = rsd.
Hpos_polar().end(); hnum != hnume; ++hnum ) {
371 Size const don_h_atom( *hnum );
372 if ( don_h_atom == atom )
return true;
379 for ( chemical::AtomIndices::const_iterator anum = rsd.
accpt_pos().begin(), anume = rsd.
accpt_pos().end(); anum != anume; ++anum ) {
380 Size const acc_atom( *anum );
381 if ( acc_atom == atom )
return true;
388 for ( chemical::AtomIndices::const_iterator hnum = rsd.
Hpos_polar().begin(), hnume = rsd.
Hpos_polar().end(); hnum != hnume; ++hnum ) {
389 Size const don_h_atom( *hnum );
391 if ( base_atom == atom )
return true;
393 for ( chemical::AtomIndices::const_iterator anum = rsd.
accpt_pos().begin(), anume = rsd.
accpt_pos().end(); anum != anume; ++anum ) {
394 Size const acc_atom( *anum );
396 if ( base_atom == atom )
return true;