20 #ifndef OST_MM_TOPOLOGY_HH
21 #define OST_MM_TOPOLOGY_HH
27 #include <boost/shared_ptr.hpp>
46 namespace ost {
namespace mol{
namespace mm{
56 Topology(
const std::vector<Real>& masses);
80 Real angle_force_constant,
82 Real bond_force_constant);
105 Real force_constant);
113 std::vector<Real> values);
135 Real x_scale = 1.0,
Real y_scale = 1.0,
Real z_scale = 1.0);
147 void SetSigmas(
const std::vector<Real>& sigmas);
151 void SetEpsilons(
const std::vector<Real>& epsilons);
163 void SetCharges(
const std::vector<Real>& charges);
167 void SetMasses(
const std::vector<Real>& masses);
177 Real& bond_length,
Real& force_constant)
const;
180 Real& angle,
Real& force_constant)
const;
183 Real& angle,
Real& angle_force_constant,
Real& bond_length,
Real& bond_force_constant)
const;
186 int& multiplicity,
Real& phase,
Real& force_constant)
const;
189 int& multiplicity,
Real& phase,
Real& force_constant)
const;
192 Real& angle,
Real& force_constant)
const;
195 int& dimension, std::vector<Real>& map)
const;
201 Real& distance)
const;
207 Real& force_constant)
const;
220 const Real bond_length,
const Real bond_force_constant);
223 const Real phase,
const Real force_constant);
226 const Real force_constant);
237 Real x_scale = 1.0,
Real y_scale = 1.0,
Real z_scale = 1.0);
245 const std::vector<std::pair<Index<2>, std::vector<Real> > >&
GetHarmonicBonds()
const {
return harmonic_bonds_; }
247 const std::vector<std::pair<Index<3>, std::vector<Real> > >&
GetHarmonicAngles()
const {
return harmonic_angles_; }
249 const std::vector<std::pair<Index<3>, std::vector<Real> > >&
GetUreyBradleyAngles()
const {
return urey_bradley_angles_; }
251 const std::vector<std::pair<Index<4>, std::vector<Real> > >&
GetPeriodicDihedrals()
const {
return periodic_dihedrals_; }
253 const std::vector<std::pair<Index<4>, std::vector<Real> > >&
GetPeriodicImpropers()
const {
return periodic_impropers_; }
255 const std::vector<std::pair<Index<4>, std::vector<Real> > >&
GetHarmonicImpropers()
const {
return harmonic_impropers_; }
257 const std::vector<std::pair<Index<5>, std::vector<Real> > >&
GetCMaps()
const {
return cmaps_; }
259 const std::vector<std::pair<Index<2>, std::vector<Real> > >&
GetLJPairs()
const {
return lj_pairs_; }
261 const std::vector<std::pair<Index<2>, std::vector<Real> > >&
GetDistanceConstraints()
const {
return distance_constraints_; }
271 const std::vector<std::pair<Index<2>, std::vector<Real> > >&
GetFGMDHBondDonors()
const {
return fgmd_hbond_donors_; }
298 std::vector<Real>
GetMasses()
const {
return atom_masses_; }
305 uint index_two)
const;
309 uint index_three)
const;
313 uint index_three)
const;
318 uint index_four)
const;
323 uint index_four)
const;
328 uint index_four)
const;
334 uint index_five)
const;
337 uint index_two)
const;
340 uint index_two)
const;
345 uint index_two)
const;
348 uint index_two)
const;
351 uint index_two)
const;
415 template <
typename DS>
428 atom_masses_ = std::vector<Real>(num_items);
430 sigmas_ = std::vector<Real>(num_items);
432 epsilons_ = std::vector<Real>(num_items);
434 gbsa_radii_ = std::vector<Real>(num_items);
436 obc_scaling_ = std::vector<Real>(num_items);
438 charges_ = std::vector<Real>(num_items);
440 position_constraints_ = std::vector<uint>(num_items);
443 num_items = atom_masses_.size();
445 num_items = sigmas_.size();
447 num_items = epsilons_.size();
449 num_items = gbsa_radii_.size();
451 num_items = obc_scaling_.size();
453 num_items = charges_.size();
455 num_items = position_constraints_.size();
459 for(std::vector<Real>::iterator i = atom_masses_.begin();
460 i != atom_masses_.end(); ++i){
464 for(std::vector<Real>::iterator i = sigmas_.begin();
465 i != sigmas_.end(); ++i){
469 for(std::vector<Real>::iterator i = epsilons_.begin();
470 i != epsilons_.end(); ++i){
474 for(std::vector<Real>::iterator i = gbsa_radii_.begin();
475 i != gbsa_radii_.end(); ++i){
479 for(std::vector<Real>::iterator i = obc_scaling_.begin();
480 i != obc_scaling_.end(); ++i){
484 for(std::vector<Real>::iterator i = charges_.begin();
485 i != charges_.end(); ++i){
489 for(std::vector<uint>::iterator i = position_constraints_.begin();
490 i != position_constraints_.end(); ++i){
496 for(
uint i = 0; i < num_items; ++i){
497 harmonic_bonds_.push_back(std::make_pair(
Index<2>(),std::vector<Real>(2)));
501 for(
uint i = 0; i < num_items; ++i){
502 harmonic_angles_.push_back(std::make_pair(
Index<3>(),std::vector<Real>(2)));
506 for(
uint i = 0; i < num_items; ++i){
507 urey_bradley_angles_.push_back(std::make_pair(
Index<3>(),std::vector<Real>(4)));
511 for(
uint i = 0; i < num_items; ++i){
512 periodic_dihedrals_.push_back(std::make_pair(
Index<4>(),std::vector<Real>(3)));
516 for(
uint i = 0; i < num_items; ++i){
517 periodic_impropers_.push_back(std::make_pair(
Index<4>(),std::vector<Real>(3)));
521 for(
uint i = 0; i < num_items; ++i){
522 harmonic_impropers_.push_back(std::make_pair(
Index<4>(),std::vector<Real>(2)));
526 for(
uint i = 0; i < num_items; ++i){
529 cmaps_.push_back(std::make_pair(
Index<5>(),std::vector<Real>(num_values)));
533 for(
uint i = 0; i < num_items; ++i){
534 lj_pairs_.push_back(std::make_pair(
Index<2>(),std::vector<Real>(2)));
538 for(
uint i = 0; i < num_items; ++i){
539 distance_constraints_.push_back(std::make_pair(
Index<2>(),std::vector<Real>(1)));
543 exclusions_ = std::vector<Index<2> >(num_items);
546 for(
uint i = 0; i < num_items; ++i){
547 harmonic_position_restraints_.push_back(std::make_pair(
Index<1>(),std::vector<Real>(7)));
551 for(
uint i = 0; i < num_items; ++i){
552 harmonic_distance_restraints_.push_back(std::make_pair(
Index<2>(),std::vector<Real>(2)));
556 for(
uint i = 0; i < num_items; ++i){
557 fgmd_hbond_donors_.push_back(std::make_pair(
Index<2>(),std::vector<Real>(6)));
561 for(
uint i = 0; i < num_items; ++i){
562 fgmd_hbond_acceptors_.push_back(
Index<2>());
566 num_items = harmonic_bonds_.size();
568 num_items = harmonic_angles_.size();
570 num_items = urey_bradley_angles_.size();
572 num_items = periodic_dihedrals_.size();
574 num_items = periodic_impropers_.size();
576 num_items = harmonic_impropers_.size();
578 num_items = cmaps_.size();
580 for(
uint i = 0; i < cmaps_.size(); ++i){
581 num_items = cmaps_[i].second.size();
584 num_items = lj_pairs_.size();
586 num_items = distance_constraints_.size();
588 num_items = exclusions_.size();
590 num_items = harmonic_position_restraints_.size();
592 num_items = harmonic_distance_restraints_.size();
594 num_items = fgmd_hbond_donors_.size();
596 num_items = fgmd_hbond_acceptors_.size();
600 for(std::vector<std::pair<
Index<2>,std::vector<Real> > >::iterator i = harmonic_bonds_.begin();
601 i != harmonic_bonds_.end(); ++i){
607 for(std::vector<std::pair<
Index<3>,std::vector<Real> > >::iterator i = harmonic_angles_.begin();
608 i != harmonic_angles_.end(); ++i){
614 for(std::vector<std::pair<
Index<3>,std::vector<Real> > >::iterator i = urey_bradley_angles_.begin();
615 i != urey_bradley_angles_.end(); ++i){
623 for(std::vector<std::pair<
Index<4>,std::vector<Real> > >::iterator i = periodic_dihedrals_.begin();
624 i != periodic_dihedrals_.end(); ++i){
631 for(std::vector<std::pair<
Index<4>,std::vector<Real> > >::iterator i = periodic_impropers_.begin();
632 i != periodic_impropers_.end(); ++i){
639 for(std::vector<std::pair<
Index<4>,std::vector<Real> > >::iterator i = harmonic_impropers_.begin();
640 i != harmonic_impropers_.end(); ++i){
646 for(std::vector<std::pair<
Index<5>,std::vector<Real> > >::iterator i = cmaps_.begin();
647 i != cmaps_.end(); ++i){
649 for(std::vector<Real>::iterator j = i->second.begin();
650 j != i->second.end(); ++j){
655 for(std::vector<std::pair<
Index<2>,std::vector<Real> > >::iterator i = lj_pairs_.begin();
656 i != lj_pairs_.end(); ++i){
662 for(std::vector<std::pair<
Index<2>,std::vector<Real> > >::iterator i = distance_constraints_.begin();
663 i != distance_constraints_.end(); ++i){
668 for(std::vector<
Index<2> >::iterator i = exclusions_.begin();
669 i != exclusions_.end(); ++i){
673 for(std::vector<std::pair<
Index<1>,std::vector<Real> > >::iterator i = harmonic_position_restraints_.begin();
674 i != harmonic_position_restraints_.end(); ++i){
685 for(std::vector<std::pair<
Index<2>,std::vector<Real> > >::iterator i = harmonic_distance_restraints_.begin();
686 i != harmonic_distance_restraints_.end(); ++i){
692 for(std::vector<std::pair<
Index<2>,std::vector<Real> > >::iterator i = fgmd_hbond_donors_.begin();
693 i != fgmd_hbond_donors_.end(); ++i){
703 for(std::vector<
Index<2> >::iterator i = fgmd_hbond_acceptors_.begin();
704 i != fgmd_hbond_acceptors_.end(); ++i){
710 for(
uint i = 0; i < num_items; ++i){
712 added_lj_pairs_.insert(actual_index);
716 for(
uint i = 0; i < num_items; ++i){
718 added_distance_constraints_.insert(actual_index);
722 for(
uint i = 0; i < num_items; ++i){
724 added_exclusions_.insert(actual_index);
728 num_items = added_lj_pairs_.size();
730 for(std::set<
Index<2> >::iterator i = added_lj_pairs_.begin();
731 i != added_lj_pairs_.end(); ++i){
735 num_items = added_distance_constraints_.size();
737 for(std::set<
Index<2> >::iterator i = added_distance_constraints_.begin();
738 i != added_distance_constraints_.end(); ++i){
742 num_items = added_exclusions_.size();
744 for(std::set<
Index<2> >::iterator i = added_exclusions_.begin();
745 i != added_exclusions_.end(); ++i){
770 std::vector<Real> atom_masses_;
771 std::vector<Real> sigmas_;
772 std::vector<Real> epsilons_;
773 std::vector<Real> gbsa_radii_;
774 std::vector<Real> obc_scaling_;
775 std::vector<Real> charges_;
776 std::vector<uint> position_constraints_;
779 std::vector<std::pair<Index<2>,std::vector<Real> > > harmonic_bonds_;
780 std::vector<std::pair<Index<3>,std::vector<Real> > > harmonic_angles_;
781 std::vector<std::pair<Index<3>,std::vector<Real> > > urey_bradley_angles_;
782 std::vector<std::pair<Index<4>,std::vector<Real> > > periodic_dihedrals_;
783 std::vector<std::pair<Index<4>,std::vector<Real> > > periodic_impropers_;
784 std::vector<std::pair<Index<4>,std::vector<Real> > > harmonic_impropers_;
785 std::vector<std::pair<Index<5>,std::vector<Real> > > cmaps_;
786 std::vector<std::pair<Index<2>,std::vector<Real> > > lj_pairs_;
787 std::vector<std::pair<Index<2>,std::vector<Real> > > distance_constraints_;
788 std::vector<Index<2> > exclusions_;
789 std::vector<std::pair<Index<1>,std::vector<Real> > > harmonic_position_restraints_;
790 std::vector<std::pair<Index<2>,std::vector<Real> > > harmonic_distance_restraints_;
791 std::vector<std::pair<Index<2>,std::vector<Real> > > fgmd_hbond_donors_;
792 std::vector<Index<2> > fgmd_hbond_acceptors_;
796 std::set<Index<2> > added_lj_pairs_;
797 std::set<Index<2> > added_distance_constraints_;
798 std::set<Index<2> > added_exclusions_;
void GetLJPairParameters(uint index, uint &index_one, uint &index_two, Real &sigma, Real &epsilon) const
void SetEpsilon(uint index, Real epsilon)
const std::vector< std::pair< Index< 2 >, std::vector< Real > > > & GetLJPairs() const
uint GetNumPeriodicDihedrals()
void SetUreyBradleyAngleParameters(uint index, const Real angle, const Real angle_force_constant, const Real bond_length, const Real bond_force_constant)
void SetMass(uint index, Real mass)
uint AddPeriodicImproper(uint index_one, uint index_two, uint index_three, uint index_four, int multiplicity, Real phase, Real force_constant)
void SetFudgeQQ(Real fudge)
std::vector< uint > GetPeriodicImproperIndices(uint index_one, uint index_two, uint index_three, uint index_four) const
uint AddHarmonicBond(uint index_one, uint index_two, Real bond_length, Real force_constant)
uint GetNumPositionConstraints()
Real GetEpsilon(uint index) const
int GetLJPairIndex(uint index_one, uint index_two) const
const std::vector< std::pair< Index< 2 >, std::vector< Real > > > & GetFGMDHBondDonors() const
std::vector< Real > GetMasses() const
void SetEpsilons(const std::vector< Real > &epsilons)
uint AddLJPair(uint index_one, uint index_two, Real sigma, Real epsilon)
const std::vector< std::pair< Index< 3 >, std::vector< Real > > > & GetUreyBradleyAngles() const
uint GetNumFGMDHBondAcceptors()
const std::vector< std::pair< Index< 4 >, std::vector< Real > > > & GetPeriodicImpropers() const
boost::shared_ptr< Topology > TopologyPtr
uint AddFGMDHBondAcceptor(uint index_one, uint index_two)
std::vector< uint > GetHarmonicDistanceRestraintIndices(uint index_one, uint index_two) const
Real GetCharge(uint index) const
uint GetNumHarmonicDistanceRestraints()
std::vector< uint > GetFGMDHBondDonorIndices(uint index_one, uint index_two) const
uint GetNumDistanceConstraints()
const std::vector< std::pair< Index< 1 >, std::vector< Real > > > & GetHarmonicPositionRestraints() const
void SetGBSARadius(uint index, Real radius)
const std::vector< std::pair< Index< 5 >, std::vector< Real > > > & GetCMaps() const
void SetFGMDHBondDonorParameters(uint index, Real length, Real k_length, Real alpha, Real k_alpha, Real beta, Real k_beta)
void SetSigmas(const std::vector< Real > &sigmas)
void GetFGMDHBondAcceptorParameters(uint index, uint &index_one, uint &index_two) const
void SetOBCScalings(const std::vector< Real > &obc_scaling)
uint AddPeriodicDihedral(uint index_one, uint index_two, uint index_three, uint index_four, int multiplicity, Real phase, Real force_constant)
void SetCharges(const std::vector< Real > &charges)
std::vector< uint > GetCMapIndices(uint index_one, uint index_two, uint index_three, uint index_four, uint index_five) const
std::vector< uint > GetUreyBradleyAngleIndices(uint index_one, uint index_two, uint index_three) const
const std::vector< std::pair< Index< 2 >, std::vector< Real > > > & GetHarmonicDistanceRestraints() const
const std::vector< uint > & GetPositionConstraints() const
void SetCharge(uint index, Real charge)
std::vector< Real > GetCharges() const
uint AddHarmonicImproper(uint index_one, uint index_two, uint index_three, uint index_four, Real angle, Real force_constant)
void GetPeriodicImproperParameters(uint index, uint &index_one, uint &index_two, uint &index_three, uint &index_four, int &multiplicity, Real &phase, Real &force_constant) const
void AddPositionConstraint(uint index)
void GetHarmonicImproperParameters(uint index, uint &index_one, uint &index_two, uint &index_three, uint &index_four, Real &angle, Real &force_constant) const
std::vector< uint > GetLJPairIndices(uint atom_index) const
const std::vector< std::pair< Index< 2 >, std::vector< Real > > > & GetHarmonicBonds() const
void SetPeriodicImproperParameters(uint index, const int multiplicity, const Real phase, const Real force_constant)
void SetHarmonicPositionRestraintParameters(uint index, const geom::Vec3 &ref_position, Real k, Real x_scale=1.0, Real y_scale=1.0, Real z_scale=1.0)
void SetGBSARadii(const std::vector< Real > &gbsa_radii)
void SetFudgeLJ(Real fudge)
void GetDistanceConstraintParameters(uint index, uint &index_one, uint &index_two, Real &distance) const
uint AddHarmonicAngle(uint index_one, uint index_two, uint index_three, Real angle, Real force_constant)
const std::vector< std::pair< Index< 2 >, std::vector< Real > > > & GetDistanceConstraints() const
const std::vector< std::pair< Index< 4 >, std::vector< Real > > > & GetHarmonicImpropers() const
Real GetGBSARadius(uint index) const
Real GetMass(uint index) const
void Merge(ost::mol::EntityHandle &ent, TopologyPtr other, const ost::mol::EntityHandle &other_ent)
void GetUreyBradleyAngleParameters(uint index, uint &index_one, uint &index_two, uint &index_three, Real &angle, Real &angle_force_constant, Real &bond_length, Real &bond_force_constant) const
uint AddExclusion(uint index_one, uint index_two)
void ResetPositionConstraints()
void SetHarmonicDistanceRestraintParameters(uint index, Real length, Real force_constant)
uint GetNumFGMDHBondDonors()
uint GetNumHarmonicAngles()
void GetCMapParameters(uint index, uint &index_one, uint &index_two, uint &index_three, uint &index_four, uint &index_five, int &dimension, std::vector< Real > &map) const
uint AddFGMDHBondDonor(uint index_one, uint index_two, Real length, Real k_length, Real alpha, Real k_alpha, Real beta, Real k_beta)
uint AddHarmonicPositionRestraint(uint index, const geom::Vec3 &ref_position, Real k, Real x_scale=1.0, Real y_scale=1.0, Real z_scale=1.0)
void SetHarmonicImproperParameters(uint index, const Real angle, const Real force_constant)
const std::vector< Index< 2 > > & GetFGMDHBondAcceptors() const
uint AddHarmonicDistanceRestraint(uint index_one, uint index_two, Real length, Real force_constant)
std::vector< uint > GetHarmonicBondIndices(uint index_one, uint index_two) const
uint AddCMap(uint index_one, uint index_two, uint index_three, uint index_four, uint index_five, int dimension, std::vector< Real > values)
std::vector< uint > GetHarmonicAngleIndices(uint index_one, uint index_two, uint index_three) const
void SetMasses(const std::vector< Real > &masses)
std::vector< uint > GetPeriodicDihedralIndices(uint index_one, uint index_two, uint index_three, uint index_four) const
std::vector< uint > GetFGMDHBondAcceptorIndices(uint index_one, uint index_two) const
const std::vector< Index< 2 > > & GetExclusions() const
void SetDistanceConstraintParameters(uint index, const Real distance)
Three dimensional vector class, using Real precision.
void GetPeriodicDihedralParameters(uint index, uint &index_one, uint &index_two, uint &index_three, uint &index_four, int &multiplicity, Real &phase, Real &force_constant) const
Real GetSigma(uint index) const
std::vector< Real > GetEpsilons() const
int GetDistanceConstraintIndex(uint index_one, uint index_two) const
uint GetNumHarmonicPositionRestraints()
void GetHarmonicAngleParameters(uint index, uint &index_one, uint &index_two, uint &index_three, Real &angle, Real &force_constant) const
void GetFGMDHBondDonorParameters(uint index, uint &index_one, uint &index_two, Real &length, Real &k_length, Real &alpha, Real &k_alpha, Real &beta, Real &k_beta) const
void GetHarmonicDistanceRestraintParameters(uint index, uint &atom_one, uint &atom_two, Real &length, Real &force_constant) const
uint GetNumPeriodicImpropers()
std::vector< uint > GetDistanceConstraintIndices(uint atom_index) const
std::vector< uint > GetHarmonicPositionRestraintIndices(uint atom_index) const
void SetOBCScaling(uint index, Real scaling)
uint AddDistanceConstraint(uint index_one, uint index_two, Real distance)
void SetHarmonicAngleParameters(uint index, const Real angle, const Real force_constant)
std::vector< Real > GetOBCScalings() const
const std::vector< std::pair< Index< 4 >, std::vector< Real > > > & GetPeriodicDihedrals() const
void SetHarmonicBondParameters(uint index, const Real bond_length, const Real force_constant)
uint AddUreyBradleyAngle(uint index_one, uint index_two, uint index_three, Real angle, Real angle_force_constant, Real bond_length, Real bond_force_constant)
static TopologyPtr Load(const String &filename)
const std::vector< std::pair< Index< 3 >, std::vector< Real > > > & GetHarmonicAngles() const
uint GetNumHarmonicImpropers()
Real GetOBCScaling(uint index) const
void SetCMapParameters(uint index, const int dimension, const std::vector< Real > &map)
void SetSigma(uint index, Real sigma)
void SetPeriodicDihedralParameters(uint index, const int multiplicity, const Real phase, const Real force_constant)
std::vector< uint > GetHarmonicImproperIndices(uint index_one, uint index_two, uint index_three, uint index_four) const
void GetHarmonicPositionRestraintParameters(uint index, uint &atom_index, geom::Vec3 &ref_position, Real &k, Real &x_scale, Real &y_scale, Real &z_scale) const
uint GetNumUreyBradleyAngles()
std::vector< Real > GetGBSARadii() const
void GetHarmonicBondParameters(uint index, uint &index_one, uint &index_two, Real &bond_length, Real &force_constant) const
void SetLJPairParameters(uint index, const Real sigma, const Real epsilon)
uint GetNumHarmonicBonds()
void Save(const String &filename)
std::vector< Real > GetSigmas() const