20 #include <basic/Tracer.hh>
21 #include <utility/string_util.hh>
22 #include <utility/io/izstream.hh>
28 #include <utility/vector1.hh>
29 #include <utility/exit.hh>
34 static basic::Tracer
tr(
"core.chemical");
46 AtomTypeIndex atom_type_index1 = atom_type_set->atom_type_index(atom_type_name1);
47 AtomTypeIndex atom_type_index2 = atom_type_set->atom_type_index(atom_type_name2);
53 if(atom_type_index1 > atom_type_index2)
std::swap(atom_type_index1, atom_type_index2);
54 std::pair<AtomTypeIndex,AtomTypeIndex> index_pair(atom_type_index1,atom_type_index2);
68 Size atom_type_index1 = atom_type_set->atom_type_index(atom_type_name1);
69 Size atom_type_index2 = atom_type_set->atom_type_index(atom_type_name2);
71 if(atom_type_index1 > atom_type_index2)
std::swap(atom_type_index1, atom_type_index2);
74 utility_exit_with_message(
"ideal bond_length not defined between these atom types: "+ atom_type_name1+
" "+atom_type_name2);
83 std::pair<AtomTypeIndex,AtomTypeIndex> index_pair(atom_type_index1,atom_type_index2);
98 Size atom_type_index1 = atom_type_set->atom_type_index(atom_type_name1);
99 Size atom_type_index2 = atom_type_set->atom_type_index(atom_type_name2);
101 if(atom_type_index1 > atom_type_index2)
std::swap(atom_type_index1, atom_type_index2);
104 utility_exit_with_message(
"this pair is already in the table... "+ atom_type_name1+
" "+atom_type_name2);
116 assert(atom_type_index1 <= atom_type_index2);
119 std::pair<AtomTypeIndex,AtomTypeIndex> index_pair(atom_type_index1,atom_type_index2);
127 utility::io::izstream data( filename.c_str() );
129 if ( !data.good() ) utility_exit_with_message(
"Unable to open element file: "+filename );
133 using namespace basic;
137 getline( data, line );
138 while ( getline( data,line ) ) {
139 utility::trim(line,
" \t\n");
140 if ( line.empty() > 0 )
continue;
141 if ( line.find(
"#",0) == 0 )
continue;
143 std::istringstream l( line );
147 l >> name1 >> name2 >> length;
150 utility_exit_with_message(
"bad line: "+line);
170 std::cout << i->first.first <<
" " << i->first.second <<
" " << i->second << std::endl;