34 #include <basic/prof.hh>
37 #include <utility/vector1.hh>
66 atom_vdw_(
ScoringManager::get_instance()->get_AtomVDW( options.atom_vdw_atom_type_set_name() ) ),
67 atom_type_set_name_( options.atom_vdw_atom_type_set_name() ),
68 vdw_scale_factor_( 0.8 )
83 atom_vdw_( src.atom_vdw_ ),
84 atom_type_set_name_( src.atom_type_set_name_ ),
85 vdw_scale_factor_( src.vdw_scale_factor_ )
119 using namespace etable::count_pair;
126 CountPairFactory::create_count_pair_function( rsd1, rsd2,
CP_CROSSOVER_4 );
128 for (
Size i = 1, i_end = rsd1.
natoms(); i <= i_end; ++i ) {
132 for (
Size j = 1, j_end = rsd2.
natoms(); j <= j_end; ++j ) {
135 if ( cpfxn->count( i, j, weight, path_dist ) ) {
136 if ( weight < 0.99 )
continue;
139 Real const clash( bump_dsq - i_xyz.distance_squared( rsd2.
xyz(j) ) );
141 score += ( clash * clash ) / bump_dsq;
144 std::cerr <<
"Etable: " << rsd2.
atom_type_index(j) <<
" " << i_atom_vdw.size() <<
" " << i <<
" " << j << std::endl;
145 utility_exit_with_message(
"Fatal Error in VDW_Energy" );
152 for (
Size i = 1, i_end = rsd1.
natoms(); i <= i_end; ++i ) {
156 for (
Size j = 1, j_end = rsd2.
natoms(); j <= j_end; ++j ) {
159 Real const clash( bump_dsq - i_xyz.distance_squared( rsd2.
xyz(j) ) );
161 score += ( clash * clash ) / bump_dsq;
168 std::cerr <<
"Etable: " << rsd2.
atom_type_index(j) <<
" " << i_atom_vdw.size() <<
" " << i <<
" " << j << std::endl;
169 utility_exit_with_message(
"Fatal Error in VDW_Energy" );
194 using namespace etable::count_pair;
197 Size const pos1( atom_id.
rsd() );
201 int const pos1_map( domain_map( pos1 ) );
202 bool const pos1_fixed( pos1_map != 0 );
204 Vector const & i_xyz( rsd1.xyz(i) );
205 Size const i_type( rsd1.atom_type_index(i) );
212 EnergyGraph const & energy_graph( energies.energy_graph() );
216 iru = energy_graph.get_node( pos1 )->const_edge_list_begin(),
218 iru != irue; ++iru ) {
219 Size const pos2( (*iru)->get_other_ind( pos1 ) );
221 if ( pos1_fixed && pos1_map == domain_map( pos2 ) )
continue;
225 assert( pos2 != pos1 );
227 if ( rsd1.is_bonded( rsd2 ) || rsd1.is_pseudo_bonded( rsd2 ) ) {
232 for (
Size j=1, j_end = rsd2.natoms(); j<= j_end; ++j ) {
236 if ( cpfxn->count( i, j, cp_weight, path_dist ) ) {
237 if ( cp_weight < 0.99 )
continue;
238 Vector const & j_xyz( rsd2.xyz(j) );
239 Vector const f2( i_xyz - j_xyz );
240 Real const dis2( f2.length_squared() );
241 Real const bump_dsq( i_atom_vdw[ rsd2.atom_type_index(j) ] );
242 if ( dis2 < bump_dsq ) {
245 Vector const f1( i_xyz.cross( j_xyz ) );
246 F1 += dE_dr_over_r * f1;
247 F2 += dE_dr_over_r * f2;
253 for (
Size j=1, j_end = rsd2.natoms(); j<= j_end; ++j ) {
255 Vector const & j_xyz( rsd2.xyz(j) );
256 Vector const f2( i_xyz - j_xyz );
257 Real const dis2( f2.length_squared() );
258 Real const bump_dsq( i_atom_vdw[ rsd2.atom_type_index(j) ] );
259 if ( dis2 < bump_dsq ) {
262 Vector const f1( i_xyz.cross( j_xyz ) );
263 F1 += dE_dr_over_r * f1;
264 F2 += dE_dr_over_r * f2;