20 #include <basic/Tracer.hh>
25 #include <utility/keys/Key4Tuple.hh>
26 #include <utility/keys/Key3Tuple.hh>
27 #include <utility/pointer/access_ptr.hh>
28 #include <utility/pointer/owning_ptr.hh>
29 #include <utility/pointer/ReferenceCount.hh>
32 #include <numeric/conversions.hh>
54 static basic::Tracer
TR(
"core.mm.MMTorsionLibrary");
69 std::ifstream data( filename.c_str() );
71 while( getline( data, line ) ) {
72 std::istringstream l( line );
73 if( line.size() < 1 || line[0] ==
'#' )
continue;
74 lines.push_back( line );
78 for(
Size i = 1; i <= lines.size(); ++i ) {
80 std::istringstream l( lines[i] );
84 atom_type_string_3, atom_type_string_4;
85 l >> atom_type_string_1 >> atom_type_string_2
86 >> atom_type_string_3 >> atom_type_string_4;
89 int atom_type_int1 =
mm_atom_set_->atom_type_index( atom_type_string_1 );
90 int atom_type_int2 =
mm_atom_set_->atom_type_index( atom_type_string_2 );
91 int atom_type_int3 =
mm_atom_set_->atom_type_index( atom_type_string_3 );
92 int atom_type_int4 =
mm_atom_set_->atom_type_index( atom_type_string_4 );
95 Real k_theta, minimum;
int multiplicity;
96 l >> k_theta >> multiplicity >> minimum;
97 minimum = numeric::conversions::radians( minimum );
100 if( atom_type_string_1 ==
"X" && atom_type_string_4 ==
"X" )
115 int const virt_type =
mm_atom_set_->atom_type_index(
"VIRT");
116 Real const no_op_k_theta( 0.0 );
117 Real const no_op_minimum( 0.0 );
118 int const no_op_multiplicity( 0 );
144 if( fully_assigned_mm_torsion_library_.count(
146 return fully_assigned_mm_torsion_library_.equal_range(
148 }
else if( fully_assigned_mm_torsion_library_.count(
151 return fully_assigned_mm_torsion_library_.equal_range(
155 int const virt_atom_type = mm_atom_set_->atom_type_index( virt_string );
158 if ( atom1 == virt_atom_type ||
159 atom2 == virt_atom_type ||
160 atom3 == virt_atom_type ||
161 atom4 == virt_atom_type ) {
162 return fully_assigned_mm_torsion_library_.equal_range(
167 int const wild_atom_type = mm_atom_set_->atom_type_index( x_string );
169 if( wildcard_mm_torsion_library_.count(
172 return wildcard_mm_torsion_library_.equal_range(
174 }
else if (wildcard_mm_torsion_library_.count(
177 return wildcard_mm_torsion_library_.equal_range(
181 TR <<
"No parameters for "
182 << (*mm_atom_set_)[atom1].name() <<
"-"
183 << (*mm_atom_set_)[atom2].name() <<
"-"
184 << (*mm_atom_set_)[atom3].name() <<
"-"
185 << (*mm_atom_set_)[atom4].name() << std::endl;
188 utility_exit_with_message(
"COULD NOT FIND TORSION PARAMS FOR " + atom1 +
' ' + atom2 +
' ' + atom3 +
' ' + atom4 );
202 return (*this).lookup( mm_atom_set_->atom_type_index( atom1 ),
203 mm_atom_set_->atom_type_index( atom2 ),
204 mm_atom_set_->atom_type_index( atom3 ),
205 mm_atom_set_->atom_type_index( atom4 ) );