21 #include <basic/Tracer.hh>
25 #include <utility/vector1.hh>
27 #include <utility/keys/Key2Tuple.hh>
28 #include <utility/pointer/access_ptr.hh>
29 #include <utility/pointer/owning_ptr.hh>
30 #include <utility/pointer/ReferenceCount.hh>
59 static basic::Tracer
TR(
"core.mm.MMBondLengthLibrary");
72 std::ifstream data( filename.c_str() );
74 bool in_bonds_section =
false;
75 while( getline( data, line ) ) {
76 std::istringstream l( line );
77 if( line.size() < 1 || line[0] ==
'!' || line[0] ==
' ' )
continue;
78 if (line ==
"ANGLES") in_bonds_section =
false;
79 if (in_bonds_section) lines.push_back( line );
80 if (line ==
"BONDS") in_bonds_section =
true;
84 for(
Size i = 1; i <= lines.size(); ++i ) {
85 std::istringstream l( lines[i] );
88 l >> atom_type_string_1 >> atom_type_string_2;
91 if ( !
mm_atom_set_->contains_atom_type( atom_type_string_1 ) )
continue;
92 if ( !
mm_atom_set_->contains_atom_type( atom_type_string_2 ) )
continue;
95 int atom_type_int1 =
mm_atom_set_->atom_type_index( atom_type_string_1 );
96 int atom_type_int2 =
mm_atom_set_->atom_type_index( atom_type_string_2 );
108 int const virt_type =
mm_atom_set_->atom_type_index(
"VIRT");
109 Real const noop_kb( 0.0 );
110 Real const noop_b0( 0.0 );
118 <<
" (+1 virtual)." << std::endl;
133 int const virt_atom_type =
mm_atom_set_->atom_type_index( virt_string );
136 if ( atom1 == virt_atom_type || atom2 == virt_atom_type ) {
140 TR <<
"No parameters for " << (*mm_atom_set_)[atom1].name() <<
"-" << (*mm_atom_set_)[atom2].name() << std::endl;
141 utility_exit_with_message(
"COULD NOT FIND BOND LENGTH PARAMS" );
148 return (*this).lookup(
158 TR << (i->first).key1() <<
"\t"
159 << (i->first).key2() <<
"\t"
160 << (i->second).key1() <<
"\t"
161 << (i->second).key2() <<
"\t"
170 TR << (i->first).key1() <<
"\t"
171 << (i->first).key2() <<
"\t"
172 << (i->second).key1() <<
"\t"
173 << (i->second).key2() <<
"\t"
182 TR << (i->first).key1() <<
"\t"
183 << (i->first).key2() <<
"\t"
184 << (i->second).key1() <<
"\t"
185 << (i->second).key2() <<
"\t"