00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef OST_MM_TOPOLOGY_HH
00021 #define OST_MM_TOPOLOGY_HH
00022
00023 #include <vector>
00024 #include <map>
00025 #include <set>
00026
00027 #include <boost/shared_ptr.hpp>
00028
00029 #include <ost/message.hh>
00030 #include <ost/mol/atom_handle.hh>
00031 #include <ost/mol/residue_handle.hh>
00032 #include <ost/mol/entity_handle.hh>
00033 #include <ost/mol/mm/index.hh>
00034 #include <ost/mol/mm/buildingblock.hh>
00035 #include <ost/mol/mm/block_modifiers.hh>
00036 #include <ost/mol/mm/forcefield.hh>
00037 #include <ost/mol/mm/index.hh>
00038 #include <ost/mol/xcs_editor.hh>
00039 #include <ost/mol/bond_handle.hh>
00040 #include <ost/mol/residue_prop.hh>
00041
00042 #include <time.h>
00043
00044
00045
00046 namespace ost { namespace mol{ namespace mm{
00047
00048 class Topology;
00049 typedef boost::shared_ptr<Topology> TopologyPtr;
00050
00051
00052 class Topology{
00053
00054 public:
00055
00056 Topology(const std::vector<Real>& masses);
00057
00058 Topology() { }
00059
00060
00061 static TopologyPtr Load(const String& filename);
00062
00063 void Save(const String& filename);
00064
00065 uint AddHarmonicBond(uint index_one,
00066 uint index_two,
00067 Real bond_length,
00068 Real force_constant);
00069
00070 uint AddHarmonicAngle(uint index_one,
00071 uint index_two,
00072 uint index_three,
00073 Real angle,
00074 Real force_constant);
00075
00076 uint AddUreyBradleyAngle(uint index_one,
00077 uint index_two,
00078 uint index_three,
00079 Real angle,
00080 Real angle_force_constant,
00081 Real bond_length,
00082 Real bond_force_constant);
00083
00084 uint AddPeriodicDihedral(uint index_one,
00085 uint index_two,
00086 uint index_three,
00087 uint index_four,
00088 int multiplicity,
00089 Real phase,
00090 Real force_constant);
00091
00092 uint AddPeriodicImproper(uint index_one,
00093 uint index_two,
00094 uint index_three,
00095 uint index_four,
00096 int multiplicity,
00097 Real phase,
00098 Real force_constant);
00099
00100 uint AddHarmonicImproper(uint index_one,
00101 uint index_two,
00102 uint index_three,
00103 uint index_four,
00104 Real angle,
00105 Real force_constant);
00106
00107 uint AddCMap(uint index_one,
00108 uint index_two,
00109 uint index_three,
00110 uint index_four,
00111 uint index_five,
00112 int dimension,
00113 std::vector<Real> values);
00114
00115 uint AddLJPair(uint index_one,
00116 uint index_two,
00117 Real sigma,
00118 Real epsilon);
00119
00120
00121 uint AddDistanceConstraint(uint index_one,
00122 uint index_two,
00123 Real distance);
00124
00125 uint AddExclusion(uint index_one,
00126 uint index_two);
00127
00128 void AddPositionConstraint(uint index);
00129
00130 void ResetPositionConstraints() { position_constraints_.clear(); }
00131
00132 void ResetExclusions() { exclusions_.clear(); }
00133
00134 uint AddHarmonicPositionRestraint(uint index, const geom::Vec3& ref_position, Real k,
00135 Real x_scale = 1.0, Real y_scale = 1.0, Real z_scale = 1.0);
00136
00137 uint AddHarmonicDistanceRestraint(uint index_one, uint index_two,
00138 Real length, Real force_constant);
00139
00140 uint AddFGMDHBondDonor(uint index_one, uint index_two,
00141 Real length, Real k_length, Real alpha,
00142 Real k_alpha, Real beta, Real k_beta);
00143
00144 uint AddFGMDHBondAcceptor(uint index_one, uint index_two);
00145
00146
00147 void SetSigmas(const std::vector<Real>& sigmas);
00148
00149 void SetSigma(uint index, Real sigma);
00150
00151 void SetEpsilons(const std::vector<Real>& epsilons);
00152
00153 void SetEpsilon(uint index, Real epsilon);
00154
00155 void SetGBSARadii(const std::vector<Real>& gbsa_radii);
00156
00157 void SetGBSARadius(uint index, Real radius);
00158
00159 void SetOBCScalings(const std::vector<Real>& obc_scaling);
00160
00161 void SetOBCScaling(uint index, Real scaling);
00162
00163 void SetCharges(const std::vector<Real>& charges);
00164
00165 void SetCharge(uint index, Real charge);
00166
00167 void SetMasses(const std::vector<Real>& masses);
00168
00169 void SetMass(uint index, Real mass);
00170
00171 void SetFudgeQQ(Real fudge) { fudge_qq_ = fudge; }
00172
00173 void SetFudgeLJ(Real fudge) { fudge_lj_ = fudge;}
00174
00175
00176 void GetHarmonicBondParameters(uint index, uint& index_one, uint& index_two,
00177 Real& bond_length, Real& force_constant) const;
00178
00179 void GetHarmonicAngleParameters(uint index, uint& index_one, uint& index_two, uint& index_three,
00180 Real& angle, Real& force_constant) const;
00181
00182 void GetUreyBradleyAngleParameters(uint index, uint& index_one, uint& index_two, uint& index_three,
00183 Real& angle, Real& angle_force_constant, Real& bond_length, Real& bond_force_constant) const;
00184
00185 void GetPeriodicDihedralParameters(uint index, uint& index_one, uint& index_two, uint& index_three, uint& index_four,
00186 int& multiplicity, Real& phase, Real& force_constant) const;
00187
00188 void GetPeriodicImproperParameters(uint index, uint& index_one, uint& index_two, uint& index_three, uint& index_four,
00189 int& multiplicity, Real& phase, Real& force_constant) const;
00190
00191 void GetHarmonicImproperParameters(uint index, uint& index_one, uint& index_two, uint& index_three, uint& index_four,
00192 Real& angle, Real& force_constant) const;
00193
00194 void GetCMapParameters(uint index, uint& index_one, uint& index_two, uint& index_three, uint& index_four, uint& index_five,
00195 int& dimension, std::vector<Real>& map) const;
00196
00197 void GetLJPairParameters(uint index, uint& index_one, uint& index_two,
00198 Real& sigma, Real& epsilon) const;
00199
00200 void GetDistanceConstraintParameters(uint index, uint& index_one, uint& index_two,
00201 Real& distance) const;
00202
00203 void GetHarmonicPositionRestraintParameters(uint index, uint& atom_index, geom::Vec3& ref_position,
00204 Real& k, Real& x_scale, Real& y_scale, Real& z_scale) const;
00205
00206 void GetHarmonicDistanceRestraintParameters(uint index, uint& atom_one, uint& atom_two, Real& length,
00207 Real& force_constant) const;
00208
00209 void GetFGMDHBondDonorParameters(uint index, uint& index_one, uint& index_two,
00210 Real& length, Real& k_length, Real& alpha,
00211 Real& k_alpha, Real& beta, Real& k_beta) const;
00212
00213 void GetFGMDHBondAcceptorParameters(uint index, uint& index_one, uint& index_two) const;
00214
00215 void SetHarmonicBondParameters(uint index, const Real bond_length, const Real force_constant);
00216
00217 void SetHarmonicAngleParameters(uint index, const Real angle, const Real force_constant);
00218
00219 void SetUreyBradleyAngleParameters(uint index, const Real angle, const Real angle_force_constant,
00220 const Real bond_length, const Real bond_force_constant);
00221
00222 void SetPeriodicDihedralParameters(uint index, const int multiplicity,
00223 const Real phase, const Real force_constant);
00224
00225 void SetPeriodicImproperParameters(uint index, const int multiplicity, const Real phase,
00226 const Real force_constant);
00227
00228 void SetHarmonicImproperParameters(uint index, const Real angle, const Real force_constant);
00229
00230 void SetCMapParameters(uint index, const int dimension, const std::vector<Real>& map);
00231
00232 void SetLJPairParameters(uint index, const Real sigma, const Real epsilon);
00233
00234 void SetDistanceConstraintParameters(uint index, const Real distance);
00235
00236 void SetHarmonicPositionRestraintParameters(uint index, const geom::Vec3& ref_position, Real k,
00237 Real x_scale = 1.0, Real y_scale = 1.0, Real z_scale = 1.0);
00238
00239 void SetHarmonicDistanceRestraintParameters(uint index, Real length, Real force_constant);
00240
00241 void SetFGMDHBondDonorParameters(uint index, Real length, Real k_length,
00242 Real alpha, Real k_alpha, Real beta,
00243 Real k_beta);
00244
00245 const std::vector<std::pair<Index<2>, std::vector<Real> > >& GetHarmonicBonds() const { return harmonic_bonds_; }
00246
00247 const std::vector<std::pair<Index<3>, std::vector<Real> > >& GetHarmonicAngles() const { return harmonic_angles_; }
00248
00249 const std::vector<std::pair<Index<3>, std::vector<Real> > >& GetUreyBradleyAngles() const { return urey_bradley_angles_; }
00250
00251 const std::vector<std::pair<Index<4>, std::vector<Real> > >& GetPeriodicDihedrals() const { return periodic_dihedrals_; }
00252
00253 const std::vector<std::pair<Index<4>, std::vector<Real> > >& GetPeriodicImpropers() const { return periodic_impropers_; }
00254
00255 const std::vector<std::pair<Index<4>, std::vector<Real> > >& GetHarmonicImpropers() const { return harmonic_impropers_; }
00256
00257 const std::vector<std::pair<Index<5>, std::vector<Real> > >& GetCMaps() const { return cmaps_; }
00258
00259 const std::vector<std::pair<Index<2>, std::vector<Real> > >& GetLJPairs() const { return lj_pairs_; }
00260
00261 const std::vector<std::pair<Index<2>, std::vector<Real> > >& GetDistanceConstraints() const { return distance_constraints_; }
00262
00263 const std::vector<std::pair<Index<1>, std::vector<Real> > >& GetHarmonicPositionRestraints() const { return harmonic_position_restraints_; }
00264
00265 const std::vector<std::pair<Index<2>, std::vector<Real> > >& GetHarmonicDistanceRestraints() const{ return harmonic_distance_restraints_; }
00266
00267 const std::vector<Index<2> >& GetExclusions() const { return exclusions_; }
00268
00269 const std::vector<uint>& GetPositionConstraints() const { return position_constraints_; }
00270
00271 const std::vector<std::pair<Index<2>, std::vector<Real> > >& GetFGMDHBondDonors() const { return fgmd_hbond_donors_; }
00272
00273 const std::vector<Index<2> >& GetFGMDHBondAcceptors() const { return fgmd_hbond_acceptors_; }
00274
00275 std::vector<Real> GetSigmas() const { return sigmas_; }
00276
00277 std::vector<Real> GetEpsilons() const { return epsilons_; }
00278
00279 std::vector<Real> GetGBSARadii() const { return gbsa_radii_; }
00280
00281 std::vector<Real> GetOBCScalings() const { return obc_scaling_; }
00282
00283 std::vector<Real> GetCharges() const { return charges_; }
00284
00285 Real GetCharge(uint index) const;
00286
00287 Real GetMass(uint index) const;
00288
00289 Real GetSigma(uint index) const;
00290
00291 Real GetEpsilon(uint index) const;
00292
00293 Real GetGBSARadius(uint index) const;
00294
00295 Real GetOBCScaling(uint index) const;
00296
00297 std::vector<Real> GetMasses() const { return atom_masses_; }
00298
00299 Real GetFudgeQQ() const { return fudge_qq_; }
00300
00301 Real GetFudgeLJ() const { return fudge_lj_; }
00302
00303 std::vector<uint> GetHarmonicBondIndices(uint index_one,
00304 uint index_two) const;
00305
00306 std::vector<uint> GetHarmonicAngleIndices(uint index_one,
00307 uint index_two,
00308 uint index_three) const;
00309
00310 std::vector<uint> GetUreyBradleyAngleIndices(uint index_one,
00311 uint index_two,
00312 uint index_three) const;
00313
00314 std::vector<uint> GetPeriodicDihedralIndices(uint index_one,
00315 uint index_two,
00316 uint index_three,
00317 uint index_four) const;
00318
00319 std::vector<uint> GetPeriodicImproperIndices(uint index_one,
00320 uint index_two,
00321 uint index_three,
00322 uint index_four) const;
00323
00324 std::vector<uint> GetHarmonicImproperIndices(uint index_one,
00325 uint index_two,
00326 uint index_three,
00327 uint index_four) const;
00328
00329 std::vector<uint> GetCMapIndices(uint index_one,
00330 uint index_two,
00331 uint index_three,
00332 uint index_four,
00333 uint index_five) const;
00334
00335 int GetLJPairIndex(uint index_one,
00336 uint index_two) const;
00337
00338 int GetDistanceConstraintIndex(uint index_one,
00339 uint index_two) const;
00340
00341
00342
00343 std::vector<uint> GetHarmonicDistanceRestraintIndices(uint index_one,
00344 uint index_two) const;
00345
00346 std::vector<uint> GetFGMDHBondDonorIndices(uint index_one,
00347 uint index_two) const;
00348
00349 std::vector<uint> GetFGMDHBondAcceptorIndices(uint index_one,
00350 uint index_two) const;
00351
00352 std::vector<uint> GetHarmonicBondIndices(uint atom_index) const;
00353
00354 std::vector<uint> GetHarmonicAngleIndices(uint atom_index) const;
00355
00356 std::vector<uint> GetUreyBradleyAngleIndices(uint atom_index) const;
00357
00358 std::vector<uint> GetPeriodicDihedralIndices(uint atom_index) const;
00359
00360 std::vector<uint> GetPeriodicImproperIndices(uint atom_index) const;
00361
00362 std::vector<uint> GetHarmonicImproperIndices(uint atom_index) const;
00363
00364 std::vector<uint> GetCMapIndices(uint atom_index) const;
00365
00366 std::vector<uint> GetLJPairIndices(uint atom_index) const;
00367
00368 std::vector<uint> GetDistanceConstraintIndices(uint atom_index) const;
00369
00370 std::vector<uint> GetHarmonicPositionRestraintIndices(uint atom_index) const;
00371
00372 std::vector<uint> GetHarmonicDistanceRestraintIndices(uint atom_index) const;
00373
00374 std::vector<uint> GetFGMDHBondDonorIndices(uint atom_index) const;
00375
00376 std::vector<uint> GetFGMDHBondAcceptorIndices(uint atom_index) const;
00377
00378 uint GetNumParticles() { return num_particles_; }
00379
00380 uint GetNumHarmonicBonds() { return harmonic_bonds_.size(); }
00381
00382 uint GetNumHarmonicAngles() { return harmonic_angles_.size(); }
00383
00384 uint GetNumUreyBradleyAngles() { return urey_bradley_angles_.size(); }
00385
00386 uint GetNumPeriodicDihedrals() { return periodic_dihedrals_.size(); }
00387
00388 uint GetNumPeriodicImpropers() { return periodic_impropers_.size(); }
00389
00390 uint GetNumHarmonicImpropers() { return harmonic_impropers_.size(); }
00391
00392 uint GetNumCMaps() { return cmaps_.size(); }
00393
00394 uint GetNumLJPairs() { return lj_pairs_.size(); }
00395
00396 uint GetNumDistanceConstraints() { return distance_constraints_.size(); }
00397
00398 uint GetNumPositionConstraints() { return position_constraints_.size(); }
00399
00400 uint GetNumHarmonicPositionRestraints() { return harmonic_position_restraints_.size(); }
00401
00402 uint GetNumHarmonicDistanceRestraints() { return harmonic_distance_restraints_.size();}
00403
00404 uint GetNumExclusions() { return exclusions_.size(); }
00405
00406 uint GetNumFGMDHBondDonors() { return fgmd_hbond_donors_.size(); }
00407
00408 uint GetNumFGMDHBondAcceptors() { return fgmd_hbond_acceptors_.size(); }
00409
00410 void Merge(ost::mol::EntityHandle& ent, TopologyPtr other, const ost::mol::EntityHandle& other_ent);
00411
00412 void Merge(TopologyPtr other);
00413
00414 template <typename DS>
00415 void Serialize(DS& ds){
00416
00417
00418 uint num_items = 0;
00419 Index<2> actual_index;
00420
00421 ds & num_particles_;
00422 ds & fudge_qq_;
00423 ds & fudge_lj_;
00424
00425 if(ds.IsSource()){
00426 ds & num_items;
00427 atom_masses_ = std::vector<Real>(num_items);
00428 ds & num_items;
00429 sigmas_ = std::vector<Real>(num_items);
00430 ds & num_items;
00431 epsilons_ = std::vector<Real>(num_items);
00432 ds & num_items;
00433 gbsa_radii_ = std::vector<Real>(num_items);
00434 ds & num_items;
00435 obc_scaling_ = std::vector<Real>(num_items);
00436 ds & num_items;
00437 charges_ = std::vector<Real>(num_items);
00438 ds & num_items;
00439 position_constraints_ = std::vector<uint>(num_items);
00440 }
00441 else{
00442 num_items = atom_masses_.size();
00443 ds & num_items;
00444 num_items = sigmas_.size();
00445 ds & num_items;
00446 num_items = epsilons_.size();
00447 ds & num_items;
00448 num_items = gbsa_radii_.size();
00449 ds & num_items;
00450 num_items = obc_scaling_.size();
00451 ds & num_items;
00452 num_items = charges_.size();
00453 ds & num_items;
00454 num_items = position_constraints_.size();
00455 ds & num_items;
00456 }
00457
00458 for(std::vector<Real>::iterator i = atom_masses_.begin();
00459 i != atom_masses_.end(); ++i){
00460 ds & *i;
00461 }
00462
00463 for(std::vector<Real>::iterator i = sigmas_.begin();
00464 i != sigmas_.end(); ++i){
00465 ds & *i;
00466 }
00467
00468 for(std::vector<Real>::iterator i = epsilons_.begin();
00469 i != epsilons_.end(); ++i){
00470 ds & *i;
00471 }
00472
00473 for(std::vector<Real>::iterator i = gbsa_radii_.begin();
00474 i != gbsa_radii_.end(); ++i){
00475 ds & *i;
00476 }
00477
00478 for(std::vector<Real>::iterator i = obc_scaling_.begin();
00479 i != obc_scaling_.end(); ++i){
00480 ds & *i;
00481 }
00482
00483 for(std::vector<Real>::iterator i = charges_.begin();
00484 i != charges_.end(); ++i){
00485 ds & *i;
00486 }
00487
00488 for(std::vector<uint>::iterator i = position_constraints_.begin();
00489 i != position_constraints_.end(); ++i){
00490 ds & *i;
00491 }
00492
00493 if(ds.IsSource()){
00494 ds & num_items;
00495 for(uint i = 0; i < num_items; ++i){
00496 harmonic_bonds_.push_back(std::make_pair(Index<2>(),std::vector<Real>(2)));
00497 }
00498
00499 ds & num_items;
00500 for(uint i = 0; i < num_items; ++i){
00501 harmonic_angles_.push_back(std::make_pair(Index<3>(),std::vector<Real>(2)));
00502 }
00503
00504 ds & num_items;
00505 for(uint i = 0; i < num_items; ++i){
00506 urey_bradley_angles_.push_back(std::make_pair(Index<3>(),std::vector<Real>(4)));
00507 }
00508
00509 ds & num_items;
00510 for(uint i = 0; i < num_items; ++i){
00511 periodic_dihedrals_.push_back(std::make_pair(Index<4>(),std::vector<Real>(3)));
00512 }
00513
00514 ds & num_items;
00515 for(uint i = 0; i < num_items; ++i){
00516 periodic_impropers_.push_back(std::make_pair(Index<4>(),std::vector<Real>(3)));
00517 }
00518
00519 ds & num_items;
00520 for(uint i = 0; i < num_items; ++i){
00521 harmonic_impropers_.push_back(std::make_pair(Index<4>(),std::vector<Real>(2)));
00522 }
00523
00524 ds & num_items;
00525 for(uint i = 0; i < num_items; ++i){
00526 uint num_values = 0;
00527 ds & num_values;
00528 cmaps_.push_back(std::make_pair(Index<5>(),std::vector<Real>(num_values)));
00529 }
00530
00531 ds & num_items;
00532 for(uint i = 0; i < num_items; ++i){
00533 lj_pairs_.push_back(std::make_pair(Index<2>(),std::vector<Real>(2)));
00534 }
00535
00536 ds & num_items;
00537 for(uint i = 0; i < num_items; ++i){
00538 distance_constraints_.push_back(std::make_pair(Index<2>(),std::vector<Real>(1)));
00539 }
00540
00541 ds & num_items;
00542 exclusions_ = std::vector<Index<2> >(num_items);
00543
00544 ds & num_items;
00545 for(uint i = 0; i < num_items; ++i){
00546 harmonic_position_restraints_.push_back(std::make_pair(Index<1>(),std::vector<Real>(7)));
00547 }
00548
00549 ds & num_items;
00550 for(uint i = 0; i < num_items; ++i){
00551 harmonic_distance_restraints_.push_back(std::make_pair(Index<2>(),std::vector<Real>(2)));
00552 }
00553
00554 ds & num_items;
00555 for(uint i = 0; i < num_items; ++i){
00556 fgmd_hbond_donors_.push_back(std::make_pair(Index<2>(),std::vector<Real>(6)));
00557 }
00558
00559 ds & num_items;
00560 for(uint i = 0; i < num_items; ++i){
00561 fgmd_hbond_acceptors_.push_back(Index<2>());
00562 }
00563 }
00564 else{
00565 num_items = harmonic_bonds_.size();
00566 ds & num_items;
00567 num_items = harmonic_angles_.size();
00568 ds & num_items;
00569 num_items = urey_bradley_angles_.size();
00570 ds & num_items;
00571 num_items = periodic_dihedrals_.size();
00572 ds & num_items;
00573 num_items = periodic_impropers_.size();
00574 ds & num_items;
00575 num_items = harmonic_impropers_.size();
00576 ds & num_items;
00577 num_items = cmaps_.size();
00578 ds & num_items;
00579 for(uint i = 0; i < cmaps_.size(); ++i){
00580 num_items = cmaps_[i].second.size();
00581 ds & num_items;
00582 }
00583 num_items = lj_pairs_.size();
00584 ds & num_items;
00585 num_items = distance_constraints_.size();
00586 ds & num_items;
00587 num_items = exclusions_.size();
00588 ds & num_items;
00589 num_items = harmonic_position_restraints_.size();
00590 ds & num_items;
00591 num_items = harmonic_distance_restraints_.size();
00592 ds & num_items;
00593 num_items = fgmd_hbond_donors_.size();
00594 ds & num_items;
00595 num_items = fgmd_hbond_acceptors_.size();
00596 ds & num_items;
00597 }
00598
00599 for(std::vector<std::pair<Index<2>,std::vector<Real> > >::iterator i = harmonic_bonds_.begin();
00600 i != harmonic_bonds_.end(); ++i){
00601 ds & i->first;
00602 ds & i->second[0];
00603 ds & i->second[1];
00604 }
00605
00606 for(std::vector<std::pair<Index<3>,std::vector<Real> > >::iterator i = harmonic_angles_.begin();
00607 i != harmonic_angles_.end(); ++i){
00608 ds & i->first;
00609 ds & i->second[0];
00610 ds & i->second[1];
00611 }
00612
00613 for(std::vector<std::pair<Index<3>,std::vector<Real> > >::iterator i = urey_bradley_angles_.begin();
00614 i != urey_bradley_angles_.end(); ++i){
00615 ds & i->first;
00616 ds & i->second[0];
00617 ds & i->second[1];
00618 ds & i->second[2];
00619 ds & i->second[3];
00620 }
00621
00622 for(std::vector<std::pair<Index<4>,std::vector<Real> > >::iterator i = periodic_dihedrals_.begin();
00623 i != periodic_dihedrals_.end(); ++i){
00624 ds & i->first;
00625 ds & i->second[0];
00626 ds & i->second[1];
00627 ds & i->second[2];
00628 }
00629
00630 for(std::vector<std::pair<Index<4>,std::vector<Real> > >::iterator i = periodic_impropers_.begin();
00631 i != periodic_impropers_.end(); ++i){
00632 ds & i->first;
00633 ds & i->second[0];
00634 ds & i->second[1];
00635 ds & i->second[2];
00636 }
00637
00638 for(std::vector<std::pair<Index<4>,std::vector<Real> > >::iterator i = harmonic_impropers_.begin();
00639 i != harmonic_impropers_.end(); ++i){
00640 ds & i->first;
00641 ds & i->second[0];
00642 ds & i->second[1];
00643 }
00644
00645 for(std::vector<std::pair<Index<5>,std::vector<Real> > >::iterator i = cmaps_.begin();
00646 i != cmaps_.end(); ++i){
00647 ds & i->first;
00648 for(std::vector<Real>::iterator j = i->second.begin();
00649 j != i->second.end(); ++j){
00650 ds & (*j);
00651 }
00652 }
00653
00654 for(std::vector<std::pair<Index<2>,std::vector<Real> > >::iterator i = lj_pairs_.begin();
00655 i != lj_pairs_.end(); ++i){
00656 ds & i->first;
00657 ds & i->second[0];
00658 ds & i->second[1];
00659 }
00660
00661 for(std::vector<std::pair<Index<2>,std::vector<Real> > >::iterator i = distance_constraints_.begin();
00662 i != distance_constraints_.end(); ++i){
00663 ds & i->first;
00664 ds & i->second[0];
00665 }
00666
00667 for(std::vector<Index<2> >::iterator i = exclusions_.begin();
00668 i != exclusions_.end(); ++i){
00669 ds & (*i);
00670 }
00671
00672 for(std::vector<std::pair<Index<1>,std::vector<Real> > >::iterator i = harmonic_position_restraints_.begin();
00673 i != harmonic_position_restraints_.end(); ++i){
00674 ds & i->first;
00675 ds & i->second[0];
00676 ds & i->second[1];
00677 ds & i->second[2];
00678 ds & i->second[3];
00679 ds & i->second[4];
00680 ds & i->second[5];
00681 ds & i->second[6];
00682 }
00683
00684 for(std::vector<std::pair<Index<2>,std::vector<Real> > >::iterator i = harmonic_distance_restraints_.begin();
00685 i != harmonic_distance_restraints_.end(); ++i){
00686 ds & i->first;
00687 ds & i->second[0];
00688 ds & i->second[1];
00689 }
00690
00691 for(std::vector<std::pair<Index<2>,std::vector<Real> > >::iterator i = fgmd_hbond_donors_.begin();
00692 i != fgmd_hbond_donors_.end(); ++i){
00693 ds & i->first;
00694 ds & i->second[0];
00695 ds & i->second[1];
00696 ds & i->second[2];
00697 ds & i->second[3];
00698 ds & i->second[4];
00699 ds & i->second[5];
00700 }
00701
00702 for(std::vector<Index<2> >::iterator i = fgmd_hbond_acceptors_.begin();
00703 i != fgmd_hbond_acceptors_.end(); ++i){
00704 ds & (*i);
00705 }
00706
00707 if(ds.IsSource()){
00708 ds & num_items;
00709 for(uint i = 0; i < num_items; ++i){
00710 ds & actual_index;
00711 added_lj_pairs_.insert(actual_index);
00712 }
00713
00714 ds & num_items;
00715 for(uint i = 0; i < num_items; ++i){
00716 ds & actual_index;
00717 added_distance_constraints_.insert(actual_index);
00718 }
00719
00720 ds & num_items;
00721 for(uint i = 0; i < num_items; ++i){
00722 ds & actual_index;
00723 added_exclusions_.insert(actual_index);
00724 }
00725 }
00726 else{
00727 num_items = added_lj_pairs_.size();
00728 ds & num_items;
00729 for(std::set<Index<2> >::iterator i = added_lj_pairs_.begin();
00730 i != added_lj_pairs_.end(); ++i){
00731 actual_index = *i;
00732 ds & actual_index;
00733 }
00734 num_items = added_distance_constraints_.size();
00735 ds & num_items;
00736 for(std::set<Index<2> >::iterator i = added_distance_constraints_.begin();
00737 i != added_distance_constraints_.end(); ++i){
00738 actual_index = *i;
00739 ds & actual_index;
00740 }
00741 num_items = added_exclusions_.size();
00742 ds & num_items;
00743 for(std::set<Index<2> >::iterator i = added_exclusions_.begin();
00744 i != added_exclusions_.end(); ++i){
00745 actual_index = *i;
00746 ds & actual_index;
00747 }
00748 }
00749 }
00750
00751 private:
00752
00753 void MergeTop(TopologyPtr other);
00754
00755 void MergeEnt(ost::mol::EntityHandle& ent, const ost::mol::EntityHandle& other_ent);
00756
00757 void CheckTopToAdd(TopologyPtr other);
00758
00759 void CheckEntToAdd(ost::mol::EntityHandle& ent, TopologyPtr other,
00760 const ost::mol::EntityHandle& other_ent);
00761
00762 uint num_particles_;
00763
00764
00765 Real fudge_qq_;
00766 Real fudge_lj_;
00767
00768
00769 std::vector<Real> atom_masses_;
00770 std::vector<Real> sigmas_;
00771 std::vector<Real> epsilons_;
00772 std::vector<Real> gbsa_radii_;
00773 std::vector<Real> obc_scaling_;
00774 std::vector<Real> charges_;
00775 std::vector<uint> position_constraints_;
00776
00777
00778 std::vector<std::pair<Index<2>,std::vector<Real> > > harmonic_bonds_;
00779 std::vector<std::pair<Index<3>,std::vector<Real> > > harmonic_angles_;
00780 std::vector<std::pair<Index<3>,std::vector<Real> > > urey_bradley_angles_;
00781 std::vector<std::pair<Index<4>,std::vector<Real> > > periodic_dihedrals_;
00782 std::vector<std::pair<Index<4>,std::vector<Real> > > periodic_impropers_;
00783 std::vector<std::pair<Index<4>,std::vector<Real> > > harmonic_impropers_;
00784 std::vector<std::pair<Index<5>,std::vector<Real> > > cmaps_;
00785 std::vector<std::pair<Index<2>,std::vector<Real> > > lj_pairs_;
00786 std::vector<std::pair<Index<2>,std::vector<Real> > > distance_constraints_;
00787 std::vector<Index<2> > exclusions_;
00788 std::vector<std::pair<Index<1>,std::vector<Real> > > harmonic_position_restraints_;
00789 std::vector<std::pair<Index<2>,std::vector<Real> > > harmonic_distance_restraints_;
00790 std::vector<std::pair<Index<2>,std::vector<Real> > > fgmd_hbond_donors_;
00791 std::vector<Index<2> > fgmd_hbond_acceptors_;
00792
00793
00794
00795 std::set<Index<2> > added_lj_pairs_;
00796 std::set<Index<2> > added_distance_constraints_;
00797 std::set<Index<2> > added_exclusions_;
00798
00799 };
00800
00801
00802 }}}
00803
00804 #endif