diff --git a/modules/mol/mm/examples/ethanol_example.py b/modules/mol/mm/examples/ethanol_example.py index f76253adcc377cbfd9102c2e0a44a057da2069ae..3cb71c3426f31b5860b51ef094ec4294bbb2941a 100644 --- a/modules/mol/mm/examples/ethanol_example.py +++ b/modules/mol/mm/examples/ethanol_example.py @@ -54,7 +54,7 @@ building_block.AddAtom("OH","OH",0.418) bonds = list() for i in range(8): - bonds.append(MMInteraction(FuncType.HarmonicBond)) + bonds.append(Interaction(FuncType.HarmonicBond)) bonds[0].SetNames(["H11","C1"]) bonds[1].SetNames(["H12","C1"]) @@ -77,10 +77,10 @@ ff.AddMass("H",1.008) ff.AddMass("OH",1.008) #generate bonds and add them to the forcefield -h_c_bond = MMInteraction(FuncType.HarmonicBond) -c_c_bond = MMInteraction(FuncType.HarmonicBond) -c_o_bond = MMInteraction(FuncType.HarmonicBond) -o_h_bond = MMInteraction(FuncType.HarmonicBond) +h_c_bond = Interaction(FuncType.HarmonicBond) +c_c_bond = Interaction(FuncType.HarmonicBond) +c_o_bond = Interaction(FuncType.HarmonicBond) +o_h_bond = Interaction(FuncType.HarmonicBond) h_c_bond.SetTypes(["H","C"]) c_c_bond.SetTypes(["C","C"]) @@ -98,11 +98,11 @@ ff.AddBond(c_o_bond) ff.AddBond(o_h_bond) #generate angles and add them to the forcefield -h_c_h_angle = MMInteraction(FuncType.UreyBradleyAngle) -h_c_c_angle = MMInteraction(FuncType.UreyBradleyAngle) -h_c_o_angle = MMInteraction(FuncType.UreyBradleyAngle) -c_c_o_angle = MMInteraction(FuncType.UreyBradleyAngle) -c_o_h_angle = MMInteraction(FuncType.UreyBradleyAngle) +h_c_h_angle = Interaction(FuncType.UreyBradleyAngle) +h_c_c_angle = Interaction(FuncType.UreyBradleyAngle) +h_c_o_angle = Interaction(FuncType.UreyBradleyAngle) +c_c_o_angle = Interaction(FuncType.UreyBradleyAngle) +c_o_h_angle = Interaction(FuncType.UreyBradleyAngle) h_c_h_angle.SetTypes(["H","C","H"]) h_c_c_angle.SetTypes(["H","C","C"]) @@ -123,11 +123,11 @@ ff.AddAngle(c_c_o_angle) ff.AddAngle(c_o_h_angle) #generate dihedrals and add them to the forcefield -x_c_c_x_dihedral = MMInteraction(FuncType.PeriodicDihedral) -c_c_o_h_dihedral_one = MMInteraction(FuncType.PeriodicDihedral) -c_c_o_h_dihedral_two = MMInteraction(FuncType.PeriodicDihedral) -c_c_o_h_dihedral_three = MMInteraction(FuncType.PeriodicDihedral) -x_c_o_x_dihedral = MMInteraction(FuncType.PeriodicDihedral) +x_c_c_x_dihedral = Interaction(FuncType.PeriodicDihedral) +c_c_o_h_dihedral_one = Interaction(FuncType.PeriodicDihedral) +c_c_o_h_dihedral_two = Interaction(FuncType.PeriodicDihedral) +c_c_o_h_dihedral_three = Interaction(FuncType.PeriodicDihedral) +x_c_o_x_dihedral = Interaction(FuncType.PeriodicDihedral) x_c_c_x_dihedral.SetTypes(["X","C","C","X"]) c_c_o_h_dihedral_one.SetTypes(["C","C","O","OH"]) @@ -148,10 +148,10 @@ ff.AddDihedral(c_c_o_h_dihedral_three) ff.AddDihedral(x_c_o_x_dihedral) #add lj parameters -c_lj = MMInteraction(FuncType.LJ) -o_lj = MMInteraction(FuncType.LJ) -h_lj = MMInteraction(FuncType.LJ) -oh_lj = MMInteraction(FuncType.LJ) +c_lj = Interaction(FuncType.LJ) +o_lj = Interaction(FuncType.LJ) +h_lj = Interaction(FuncType.LJ) +oh_lj = Interaction(FuncType.LJ) c_lj.SetTypes(["C"]) o_lj.SetTypes(["O"]) @@ -174,7 +174,7 @@ ff.SetFudgeLJ(0.5) ff.SetFudgeQQ(0.5) #construct settings -settings = MMSettings() +settings = Settings() settings.init_temperature = 310 settings.forcefield = ff diff --git a/modules/mol/mm/examples/ethanol_example_using_topology.py b/modules/mol/mm/examples/ethanol_example_using_topology.py index 41104e2a2ecbc72e177eb4fa6706e626fb3ec287..dc5f8ff62383e573d30109bbb4ffced16fe78089 100644 --- a/modules/mol/mm/examples/ethanol_example_using_topology.py +++ b/modules/mol/mm/examples/ethanol_example_using_topology.py @@ -136,7 +136,7 @@ top.AddLJPair(6,8,0.5*(sigmas[6]+sigmas[8]),sqrt(epsilons[6]*epsilons[8])) top.AddLJPair(7,8,0.5*(sigmas[7]+sigmas[8]),sqrt(epsilons[7]*epsilons[8])) top.AddLJPair(0,8,0.5*(sigmas[0]+sigmas[8]),sqrt(epsilons[0]*epsilons[8])) -settings = MMSettings() +settings = Settings() settings.init_temperature = 310 settings.integrator = VerletIntegrator(0.0001) diff --git a/modules/mol/mm/examples/gb_example.py b/modules/mol/mm/examples/gb_example.py index 24be5a298bc4e189c184ad218a451dc2381e8546..d8a0b766399fbfacfbd92928162d521d9af3465f 100644 --- a/modules/mol/mm/examples/gb_example.py +++ b/modules/mol/mm/examples/gb_example.py @@ -22,7 +22,7 @@ class Anim(QtCore.QTimer): prot=ost.mol.CreateEntityFromView(io.LoadPDB('1CRN.pdb').Select('peptide=true'),True) -settings = mm.MMSettings() +settings = mm.Settings() settings.integrator = mm.LangevinIntegrator(310,1,0.002) settings.constrain_bonds = True diff --git a/modules/mol/mm/examples/gb_example_traj.dcd b/modules/mol/mm/examples/gb_example_traj.dcd index a3b16707652ff63865c1e1068966cc29d9f0dd9f..45087025b3083a8ce747c5c4bbfa0d6716af27de 100644 Binary files a/modules/mol/mm/examples/gb_example_traj.dcd and b/modules/mol/mm/examples/gb_example_traj.dcd differ diff --git a/modules/mol/mm/examples/gb_example_traj.pdb b/modules/mol/mm/examples/gb_example_traj.pdb index afb415a36cb19b045dff9136144b7355face8c46..a1da60b3f73ab5a617747f15dc302a2d2ad2e5fb 100644 --- a/modules/mol/mm/examples/gb_example_traj.pdb +++ b/modules/mol/mm/examples/gb_example_traj.pdb @@ -628,12 +628,12 @@ ATOM 627 HB3 ALA 45 14.788 6.644 17.011 1.00 0.00 A H ATOM 628 N ASN 46 13.966 6.502 13.739 1.00 5.80 A N ATOM 629 CA ASN 46 13.512 5.395 12.878 1.00 6.15 A C ATOM 630 C ASN 46 13.311 5.853 11.455 1.00 6.61 A C -ATOM 631 OT1 ASN 46 13.733 6.929 11.026 1.00 7.18 A O +ATOM 631 OT1 ASN 46 13.539 7.141 11.084 1.00 7.18 A O ATOM 632 CB ASN 46 12.266 4.769 13.501 1.00 7.27 A C ATOM 633 CG ASN 46 12.538 4.304 14.922 1.00 7.98 A C ATOM 634 OD1 ASN 46 11.982 4.849 15.886 1.00 11.00 A O ATOM 635 ND2 ASN 46 13.407 3.298 15.015 1.00 10.32 A N -ATOM 636 OT2 ASN 46 12.703 4.973 10.746 1.00 7.86 A O +ATOM 636 OT2 ASN 46 12.893 4.996 10.485 1.00 7.86 A O ATOM 637 HN ASN 46 13.338 7.259 13.921 1.00 0.00 A H ATOM 638 HA ASN 46 14.216 4.687 12.825 1.00 0.00 A H ATOM 639 HB1 ASN 46 11.532 5.448 13.515 1.00 0.00 A H diff --git a/modules/mol/mm/examples/gb_example_writing_trajectory.py b/modules/mol/mm/examples/gb_example_writing_trajectory.py index 74e77ce41c5f866472c1e5e2622c49051865139c..051f6ebc8015751002729345af0dfd14c96c0ea6 100644 --- a/modules/mol/mm/examples/gb_example_writing_trajectory.py +++ b/modules/mol/mm/examples/gb_example_writing_trajectory.py @@ -3,7 +3,7 @@ from ost.mol.mm import * prot=io.LoadPDB('1CRN.pdb') #set up the simulation -settings = MMSettings() +settings = Settings() settings.integrator = LangevinIntegrator(310,1,0.002) settings.add_gbsa = True settings.forcefield = LoadCHARMMForcefield() diff --git a/modules/mol/mm/pymod/export_forcefield.cc b/modules/mol/mm/pymod/export_forcefield.cc index db80c3b1990bfb188bf8cd940a0b63d8a69473e3..76659583454fb509e7ad40c89f8e98a16fae6b46 100644 --- a/modules/mol/mm/pymod/export_forcefield.cc +++ b/modules/mol/mm/pymod/export_forcefield.cc @@ -25,11 +25,11 @@ using namespace boost::python; namespace{ - ost::mol::mm::MMInteractionPtr GetLJOneType(ost::mol::mm::ForcefieldPtr p, String type){ + ost::mol::mm::InteractionPtr GetLJOneType(ost::mol::mm::ForcefieldPtr p, String type){ return p->GetLJ(type); } - ost::mol::mm::MMInteractionPtr GetLJTwoTypes(ost::mol::mm::ForcefieldPtr p, String type1, String type2, bool pair){ + ost::mol::mm::InteractionPtr GetLJTwoTypes(ost::mol::mm::ForcefieldPtr p, String type1, String type2, bool pair){ return p->GetLJ(type1,type2,pair); } diff --git a/modules/mol/mm/pymod/export_interaction.cc b/modules/mol/mm/pymod/export_interaction.cc index c9a223dea7ba5f0d668a4a2b317221697d2fecf2..5af850baea30bbad5c4a1e3fd4245b9ac456e0e1 100644 --- a/modules/mol/mm/pymod/export_interaction.cc +++ b/modules/mol/mm/pymod/export_interaction.cc @@ -1,7 +1,7 @@ #include <boost/python.hpp> #include <boost/python/suite/indexing/vector_indexing_suite.hpp> -#include <ost/mol/mm/mm_interaction.hh> +#include <ost/mol/mm/interaction.hh> #include <vector> @@ -27,39 +27,39 @@ std::vector<T> ListToVec(boost::python::list& l){ return vec; } -boost::python::list WrapGetNames(ost::mol::mm::MMInteractionPtr p){ +boost::python::list WrapGetNames(ost::mol::mm::InteractionPtr p){ std::vector<String> names = p->GetNames(); return VecToList<String>(names); } -boost::python::list WrapGetTypes(ost::mol::mm::MMInteractionPtr p){ +boost::python::list WrapGetTypes(ost::mol::mm::InteractionPtr p){ std::vector<String> types = p->GetTypes(); return VecToList<String>(types); } -boost::python::list WrapGetParam(ost::mol::mm::MMInteractionPtr p){ +boost::python::list WrapGetParam(ost::mol::mm::InteractionPtr p){ std::vector<Real> param = p->GetParam(); return VecToList<Real>(param); } -void WrapSetNames(ost::mol::mm::MMInteractionPtr p, boost::python::list l){ +void WrapSetNames(ost::mol::mm::InteractionPtr p, boost::python::list l){ std::vector<String> names = ListToVec<String>(l); p->SetNames(names); } -void WrapSetTypes(ost::mol::mm::MMInteractionPtr p, boost::python::list l){ +void WrapSetTypes(ost::mol::mm::InteractionPtr p, boost::python::list l){ std::vector<String> types = ListToVec<String>(l); p->SetTypes(types); } -void WrapSetParam(ost::mol::mm::MMInteractionPtr p, boost::python::list l){ +void WrapSetParam(ost::mol::mm::InteractionPtr p, boost::python::list l){ std::vector<Real> param = ListToVec<Real>(l); p->SetParam(param); } } -void export_MMInteraction() +void export_Interaction() { enum_<ost::mol::mm::FuncType>("FuncType") @@ -80,29 +80,29 @@ void export_MMInteraction() .value("HarmonicDistanceRestraint", ost::mol::mm::HarmonicDistanceRestraint) ; - class_<ost::mol::mm::MMInteraction>("MMInteraction",init<ost::mol::mm::FuncType>()) + class_<ost::mol::mm::Interaction>("Interaction",init<ost::mol::mm::FuncType>()) .def("SetTypes",&WrapSetTypes) .def("SetNames",&WrapSetNames) .def("SetParam",&WrapSetParam) .def("GetTypes",&WrapGetTypes) .def("GetNames",&WrapGetNames) .def("GetParam",&WrapGetParam) - .def("GetAtoms",&ost::mol::mm::MMInteraction::GetAtoms) - .def("GetFuncType",&ost::mol::mm::MMInteraction::GetFuncType) - .def("ReplaceAtom",&ost::mol::mm::MMInteraction::ReplaceAtom) - .def("MatchTypes",&ost::mol::mm::MMInteraction::MatchTypes) - .def("MatchNames",&ost::mol::mm::MMInteraction::MatchNames) - .def("HasName",&ost::mol::mm::MMInteraction::HasName) - .def("HasType",&ost::mol::mm::MMInteraction::HasType) - .def("IsParametrized",&ost::mol::mm::MMInteraction::IsParametrized) - .def("HasTypeWildcard",&ost::mol::mm::MMInteraction::HasTypeWildcard) - .def("HasNameWildcard",&ost::mol::mm::MMInteraction::HasNameWildcard) + .def("GetAtoms",&ost::mol::mm::Interaction::GetAtoms) + .def("GetFuncType",&ost::mol::mm::Interaction::GetFuncType) + .def("ReplaceAtom",&ost::mol::mm::Interaction::ReplaceAtom) + .def("MatchTypes",&ost::mol::mm::Interaction::MatchTypes) + .def("MatchNames",&ost::mol::mm::Interaction::MatchNames) + .def("HasName",&ost::mol::mm::Interaction::HasName) + .def("HasType",&ost::mol::mm::Interaction::HasType) + .def("IsParametrized",&ost::mol::mm::Interaction::IsParametrized) + .def("HasTypeWildcard",&ost::mol::mm::Interaction::HasTypeWildcard) + .def("HasNameWildcard",&ost::mol::mm::Interaction::HasNameWildcard) ; - boost::python::register_ptr_to_python<ost::mol::mm::MMInteractionPtr>(); + boost::python::register_ptr_to_python<ost::mol::mm::InteractionPtr>(); - class_<std::vector<ost::mol::mm::MMInteractionPtr> >("MMInteractionList", init<>()) - .def(vector_indexing_suite<std::vector<ost::mol::mm::MMInteractionPtr>, true>()) + class_<std::vector<ost::mol::mm::InteractionPtr> >("InteractionList", init<>()) + .def(vector_indexing_suite<std::vector<ost::mol::mm::InteractionPtr>, true>()) ; } diff --git a/modules/mol/mm/pymod/export_modeller.cc b/modules/mol/mm/pymod/export_modeller.cc index 59aceeedbf52734e6b0b10fe8ac9dfd972c4c502..c186f8b4aa2da4e72fe0537f64d113e2444bf5da 100644 --- a/modules/mol/mm/pymod/export_modeller.cc +++ b/modules/mol/mm/pymod/export_modeller.cc @@ -1,6 +1,6 @@ #include <boost/python.hpp> #include <ost/mol/mm/block_modifiers.hh> -#include <ost/mol/mm/mm_modeller.hh> +#include <ost/mol/mm/modeller.hh> using namespace boost::python; @@ -8,14 +8,13 @@ using namespace boost::python; void export_Modeller() { - class_<ost::mol::mm::MMModeller>("MMModeller", no_init) - .def("GenerateDisulfidBonds",&ost::mol::mm::MMModeller::GenerateDisulfidBonds,(arg("ent"))).staticmethod("GenerateDisulfidBonds") - .def("GenerateCYSHEMEBonds",&ost::mol::mm::MMModeller::GenerateCYSHEMEBonds,(arg("ent"))).staticmethod("GenerateCYSHEMEBonds") - .def("GenerateHISHEMEBonds",&ost::mol::mm::MMModeller::GenerateHISHEMEBonds,(arg("ent"))).staticmethod("GenerateHISHEMEBonds") - .def("GenerateMETHEMEBonds",&ost::mol::mm::MMModeller::GenerateDisulfidBonds,(arg("ent"))).staticmethod("GenerateMETHEMEBonds") - .def("AssignPDBNaming",&ost::mol::mm::MMModeller::AssignPDBNaming,(arg("ent"))).staticmethod("AssignPDBNaming") - .def("AssignGromacsNaming",&ost::mol::mm::MMModeller::AssignGromacsNaming,(arg("ent"))).staticmethod("AssignGromacsNaming") - + class_<ost::mol::mm::Modeller>("MMModeller", no_init) + .def("GenerateDisulfidBonds",&ost::mol::mm::Modeller::GenerateDisulfidBonds,(arg("ent"))).staticmethod("GenerateDisulfidBonds") + .def("GenerateCYSHEMEBonds",&ost::mol::mm::Modeller::GenerateCYSHEMEBonds,(arg("ent"))).staticmethod("GenerateCYSHEMEBonds") + .def("GenerateHISHEMEBonds",&ost::mol::mm::Modeller::GenerateHISHEMEBonds,(arg("ent"))).staticmethod("GenerateHISHEMEBonds") + .def("GenerateMETHEMEBonds",&ost::mol::mm::Modeller::GenerateDisulfidBonds,(arg("ent"))).staticmethod("GenerateMETHEMEBonds") + .def("AssignPDBNaming",&ost::mol::mm::Modeller::AssignPDBNaming,(arg("ent"))).staticmethod("AssignPDBNaming") + .def("AssignGromacsNaming",&ost::mol::mm::Modeller::AssignGromacsNaming,(arg("ent"))).staticmethod("AssignGromacsNaming") ; } \ No newline at end of file diff --git a/modules/mol/mm/pymod/export_observers.cc b/modules/mol/mm/pymod/export_observers.cc index 1fa316c6986279c9a0e907159ec458484b4376e3..896236847da4f60bedd925d04e1712c3bdd740d8 100644 --- a/modules/mol/mm/pymod/export_observers.cc +++ b/modules/mol/mm/pymod/export_observers.cc @@ -1,6 +1,6 @@ #include <boost/python.hpp> #include <boost/shared_ptr.hpp> -#include <ost/mol/mm/mm_observer.hh> +#include <ost/mol/mm/observer.hh> using namespace boost::python; @@ -8,18 +8,18 @@ using namespace boost::python; void export_Observers() { - class_<ost::mol::mm::MMObserver, boost::noncopyable>("MMObserver", no_init); + class_<ost::mol::mm::Observer, boost::noncopyable>("Observer", no_init); - class_<ost::mol::mm::TrajObserver, bases<ost::mol::mm::MMObserver> >("TrajObserver", init<int>()) + class_<ost::mol::mm::TrajObserver, bases<ost::mol::mm::Observer> >("TrajObserver", init<int>()) .def("GetTraj", &ost::mol::mm::TrajObserver::GetTraj) ; //noncopyable, because TrajWriter contains a unique ofstream - class_<ost::mol::mm::TrajWriter, boost::noncopyable, bases<ost::mol::mm::MMObserver> >("TrajWriter", init<int, String, String>()) + class_<ost::mol::mm::TrajWriter, boost::noncopyable, bases<ost::mol::mm::Observer> >("TrajWriter", init<int, String, String>()) .def("Finalize", &ost::mol::mm::TrajWriter::Finalize) ; - boost::python::register_ptr_to_python<ost::mol::mm::MMObserverPtr>(); + boost::python::register_ptr_to_python<ost::mol::mm::ObserverPtr>(); boost::python::register_ptr_to_python<ost::mol::mm::TrajObserverPtr>(); boost::python::register_ptr_to_python<ost::mol::mm::TrajWriterPtr>(); } \ No newline at end of file diff --git a/modules/mol/mm/pymod/export_settings.cc b/modules/mol/mm/pymod/export_settings.cc index 3aba50adde1723a1387bc46cf25a87ef6afbbe8a..518cb4c8e1b1855fe6069f55237ffe511e34476f 100644 --- a/modules/mol/mm/pymod/export_settings.cc +++ b/modules/mol/mm/pymod/export_settings.cc @@ -17,13 +17,13 @@ // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA //------------------------------------------------------------------------------ #include <boost/python.hpp> -#include <ost/mol/mm/mm_settings.hh> +#include <ost/mol/mm/settings.hh> #include <OpenMM.h> //for definition of Integrator using namespace boost::python; -void export_MMSettings() +void export_Settings() { enum_<ost::mol::mm::Platform>("Platform") @@ -50,50 +50,50 @@ void export_MMSettings() //export the settings - class_<ost::mol::mm::MMSettings>("MMSettings",init<>()) - .def_readwrite("add_bonds",&ost::mol::mm::MMSettings::add_bonds) - .def_readwrite("add_angles",&ost::mol::mm::MMSettings::add_angles) - .def_readwrite("add_dihedrals",&ost::mol::mm::MMSettings::add_dihedrals) - .def_readwrite("add_impropers",&ost::mol::mm::MMSettings::add_impropers) - .def_readwrite("add_cmaps",&ost::mol::mm::MMSettings::add_cmaps) - .def_readwrite("add_exclusions",&ost::mol::mm::MMSettings::add_exclusions) - .def_readwrite("add_nonbonded",&ost::mol::mm::MMSettings::add_nonbonded) - .def_readwrite("add_gbsa",&ost::mol::mm::MMSettings::add_gbsa) - .def_readwrite("constrain_hbonds",&ost::mol::mm::MMSettings::constrain_hbonds) - .def_readwrite("constrain_bonds",&ost::mol::mm::MMSettings::constrain_bonds) - .def_readwrite("rigid_water",&ost::mol::mm::MMSettings::rigid_water) - .def_readwrite("strict_interactions",&ost::mol::mm::MMSettings::strict_interactions) - .def_readwrite("ideal_bond_length_constraints",&ost::mol::mm::MMSettings::ideal_bond_length_constraints) - .def_readwrite("fix_heavy_atoms",&ost::mol::mm::MMSettings::fix_heavy_atoms) - .def_readwrite("kill_electrostatics",&ost::mol::mm::MMSettings::kill_electrostatics) - .def_readwrite("generate_disulfid_bonds",&ost::mol::mm::MMSettings::generate_disulfid_bonds) - .def_readwrite("nonbonded_method",&ost::mol::mm::MMSettings::nonbonded_method) - .def_readwrite("nonbonded_cutoff",&ost::mol::mm::MMSettings::nonbonded_cutoff) - .def_readwrite("remove_cmm_motion",&ost::mol::mm::MMSettings::remove_cmm_motion) - .def_readwrite("periodic_box_extents",&ost::mol::mm::MMSettings::periodic_box_extents) - .def_readwrite("init_temperature",&ost::mol::mm::MMSettings::init_temperature) - .def_readwrite("forcefield",&ost::mol::mm::MMSettings::forcefield) - .def_readwrite("termini_exceptions",&ost::mol::mm::MMSettings::termini_exceptions) - .def_readwrite("platform",&ost::mol::mm::MMSettings::platform) - .def_readwrite("add_thermostat",&ost::mol::mm::MMSettings::add_thermostat) - .def_readwrite("thermostat_temperature",&ost::mol::mm::MMSettings::thermostat_temperature) - .def_readwrite("thermostat_collision_frequency",&ost::mol::mm::MMSettings::thermostat_collision_frequency) - .def_readwrite("add_barostat",&ost::mol::mm::MMSettings::add_barostat) - .def_readwrite("barostat_temperature",&ost::mol::mm::MMSettings::barostat_temperature) - .def_readwrite("barostat_pressure",&ost::mol::mm::MMSettings::barostat_pressure) - .def_readwrite("barostat_frequency",&ost::mol::mm::MMSettings::barostat_frequency) - .def_readwrite("integrator",&ost::mol::mm::MMSettings::integrator) - .def_readwrite("solvent_dielectric",&ost::mol::mm::MMSettings::solvent_dielectric) - .def_readwrite("solute_dielectric",&ost::mol::mm::MMSettings::solute_dielectric) - .def_readwrite("reaction_field_dielectric",&ost::mol::mm::MMSettings::reaction_field_dielectric) - .def_readwrite("use_dispersion_correction",&ost::mol::mm::MMSettings::use_dispersion_correction) - .def_readwrite("keep_ff_specific_naming",&ost::mol::mm::MMSettings::keep_ff_specific_naming) - .def_readwrite("openmm_plugin_directory",&ost::mol::mm::MMSettings::openmm_plugin_directory) - .def_readwrite("custom_plugin_directory",&ost::mol::mm::MMSettings::custom_plugin_directory) + class_<ost::mol::mm::Settings>("Settings",init<>()) + .def_readwrite("add_bonds",&ost::mol::mm::Settings::add_bonds) + .def_readwrite("add_angles",&ost::mol::mm::Settings::add_angles) + .def_readwrite("add_dihedrals",&ost::mol::mm::Settings::add_dihedrals) + .def_readwrite("add_impropers",&ost::mol::mm::Settings::add_impropers) + .def_readwrite("add_cmaps",&ost::mol::mm::Settings::add_cmaps) + .def_readwrite("add_exclusions",&ost::mol::mm::Settings::add_exclusions) + .def_readwrite("add_nonbonded",&ost::mol::mm::Settings::add_nonbonded) + .def_readwrite("add_gbsa",&ost::mol::mm::Settings::add_gbsa) + .def_readwrite("constrain_hbonds",&ost::mol::mm::Settings::constrain_hbonds) + .def_readwrite("constrain_bonds",&ost::mol::mm::Settings::constrain_bonds) + .def_readwrite("rigid_water",&ost::mol::mm::Settings::rigid_water) + .def_readwrite("strict_interactions",&ost::mol::mm::Settings::strict_interactions) + .def_readwrite("ideal_bond_length_constraints",&ost::mol::mm::Settings::ideal_bond_length_constraints) + .def_readwrite("fix_heavy_atoms",&ost::mol::mm::Settings::fix_heavy_atoms) + .def_readwrite("kill_electrostatics",&ost::mol::mm::Settings::kill_electrostatics) + .def_readwrite("generate_disulfid_bonds",&ost::mol::mm::Settings::generate_disulfid_bonds) + .def_readwrite("nonbonded_method",&ost::mol::mm::Settings::nonbonded_method) + .def_readwrite("nonbonded_cutoff",&ost::mol::mm::Settings::nonbonded_cutoff) + .def_readwrite("remove_cmm_motion",&ost::mol::mm::Settings::remove_cmm_motion) + .def_readwrite("periodic_box_extents",&ost::mol::mm::Settings::periodic_box_extents) + .def_readwrite("init_temperature",&ost::mol::mm::Settings::init_temperature) + .def_readwrite("forcefield",&ost::mol::mm::Settings::forcefield) + .def_readwrite("termini_exceptions",&ost::mol::mm::Settings::termini_exceptions) + .def_readwrite("platform",&ost::mol::mm::Settings::platform) + .def_readwrite("add_thermostat",&ost::mol::mm::Settings::add_thermostat) + .def_readwrite("thermostat_temperature",&ost::mol::mm::Settings::thermostat_temperature) + .def_readwrite("thermostat_collision_frequency",&ost::mol::mm::Settings::thermostat_collision_frequency) + .def_readwrite("add_barostat",&ost::mol::mm::Settings::add_barostat) + .def_readwrite("barostat_temperature",&ost::mol::mm::Settings::barostat_temperature) + .def_readwrite("barostat_pressure",&ost::mol::mm::Settings::barostat_pressure) + .def_readwrite("barostat_frequency",&ost::mol::mm::Settings::barostat_frequency) + .def_readwrite("integrator",&ost::mol::mm::Settings::integrator) + .def_readwrite("solvent_dielectric",&ost::mol::mm::Settings::solvent_dielectric) + .def_readwrite("solute_dielectric",&ost::mol::mm::Settings::solute_dielectric) + .def_readwrite("reaction_field_dielectric",&ost::mol::mm::Settings::reaction_field_dielectric) + .def_readwrite("use_dispersion_correction",&ost::mol::mm::Settings::use_dispersion_correction) + .def_readwrite("keep_ff_specific_naming",&ost::mol::mm::Settings::keep_ff_specific_naming) + .def_readwrite("openmm_plugin_directory",&ost::mol::mm::Settings::openmm_plugin_directory) + .def_readwrite("custom_plugin_directory",&ost::mol::mm::Settings::custom_plugin_directory) ; - boost::python::register_ptr_to_python<ost::mol::mm::MMSettingsPtr>(); + boost::python::register_ptr_to_python<ost::mol::mm::SettingsPtr>(); boost::python::register_ptr_to_python<ost::mol::mm::TerminiExceptionsPtr>(); } diff --git a/modules/mol/mm/pymod/export_simulation.cc b/modules/mol/mm/pymod/export_simulation.cc index edeee9faaeda79943ca29036233285bb087f5019..9b7a6f93e9be1a09c7442a822e4fcb310019eb70 100644 --- a/modules/mol/mm/pymod/export_simulation.cc +++ b/modules/mol/mm/pymod/export_simulation.cc @@ -48,8 +48,8 @@ void export_Simulation() { class_<ost::mol::mm::Simulation>("Simulation",no_init) - .def(init<const ost::mol::EntityHandle, const ost::mol::mm::MMSettingsPtr>()) - .def(init<const ost::mol::mm::TopologyPtr,const ost::mol::EntityHandle&,const ost::mol::mm::MMSettingsPtr>()) + .def(init<const ost::mol::EntityHandle, const ost::mol::mm::SettingsPtr>()) + .def(init<const ost::mol::mm::TopologyPtr,const ost::mol::EntityHandle&,const ost::mol::mm::SettingsPtr>()) .def("Save",&ost::mol::mm::Simulation::Save) .def("Load",&ost::mol::mm::Simulation::Load).staticmethod("Load") .def("Steps",&ost::mol::mm::Simulation::Steps) diff --git a/modules/mol/mm/pymod/wrap_mol_mm.cc b/modules/mol/mm/pymod/wrap_mol_mm.cc index 739b8ad50124db27ac6c58554856ead84a9fe538..9ddcec57e166bd34b2a88af8c10ede960de50d3e 100644 --- a/modules/mol/mm/pymod/wrap_mol_mm.cc +++ b/modules/mol/mm/pymod/wrap_mol_mm.cc @@ -4,12 +4,12 @@ using namespace boost::python; -void export_MMSettings(); +void export_Settings(); void export_Simulation(); void export_OpenMM(); void export_Observers(); void export_GromacsReader(); -void export_MMInteraction(); +void export_Interaction(); void export_Buildingblock(); void export_Forcefield(); void export_BlockModifiers(); @@ -20,12 +20,12 @@ void export_Modeller(); BOOST_PYTHON_MODULE(_ost_mol_mm) { export_Forcefield(); - export_MMSettings(); + export_Settings(); export_Simulation(); export_OpenMM(); export_Observers(); export_GromacsReader(); - export_MMInteraction(); + export_Interaction(); export_Buildingblock(); export_BlockModifiers(); export_Topology(); diff --git a/modules/mol/mm/src/CMakeLists.txt b/modules/mol/mm/src/CMakeLists.txt index 3c95ac8eb1b8ab1f9482bcce0f9cdbcd83d8b00e..6fc560ef2a2f31e148a22e978c0845972b795391 100644 --- a/modules/mol/mm/src/CMakeLists.txt +++ b/modules/mol/mm/src/CMakeLists.txt @@ -5,11 +5,11 @@ set(OST_MOL_MM_HEADERS block_modifiers.hh gromacs_block_modifiers.hh heuristic_block_modifiers.hh - mm_interaction.hh - mm_settings.hh + interaction.hh + settings.hh simulation.hh - mm_modeller.hh - mm_observer.hh + modeller.hh + observer.hh state_extractor.hh system_creator.hh topology_creator.hh @@ -25,11 +25,11 @@ set(OST_MOL_MM_SOURCES buildingblock.cc gromacs_block_modifiers.cc heuristic_block_modifiers.cc - mm_interaction.cc + interaction.cc simulation.cc - mm_modeller.cc + modeller.cc state_extractor.cc - mm_observer.cc + observer.cc system_creator.cc topology_creator.cc topology.cc diff --git a/modules/mol/mm/src/buildingblock.cc b/modules/mol/mm/src/buildingblock.cc index 3d6a8b2b1b2cecc5d08784fd48dfd989928a1685..ffb5e662e858d2bb609cde7d5958994302715d84 100644 --- a/modules/mol/mm/src/buildingblock.cc +++ b/modules/mol/mm/src/buildingblock.cc @@ -13,41 +13,41 @@ BuildingBlock::BuildingBlock(const BuildingBlock& block){ //There would be to danger to mess around with an interaction, //that is associated with another building block. - std::vector<MMInteractionPtr> bonds = block.GetBonds(); - std::vector<MMInteractionPtr> angles = block.GetAngles(); - std::vector<MMInteractionPtr> dihedrals = block.GetDihedrals(); - std::vector<MMInteractionPtr> impropers = block.GetImpropers(); - std::vector<MMInteractionPtr> exclusions = block.GetExclusions(); - std::vector<MMInteractionPtr> cmaps = block.GetCMaps(); - std::vector<MMInteractionPtr> constraints = block.GetConstraints(); - - for(std::vector<MMInteractionPtr>::iterator i = bonds.begin(); + std::vector<InteractionPtr> bonds = block.GetBonds(); + std::vector<InteractionPtr> angles = block.GetAngles(); + std::vector<InteractionPtr> dihedrals = block.GetDihedrals(); + std::vector<InteractionPtr> impropers = block.GetImpropers(); + std::vector<InteractionPtr> exclusions = block.GetExclusions(); + std::vector<InteractionPtr> cmaps = block.GetCMaps(); + std::vector<InteractionPtr> constraints = block.GetConstraints(); + + for(std::vector<InteractionPtr>::iterator i = bonds.begin(); i != bonds.end(); ++i){ - bonds_.push_back(MMInteractionPtr(new MMInteraction(**i))); + bonds_.push_back(InteractionPtr(new Interaction(**i))); } - for(std::vector<MMInteractionPtr>::iterator i = angles.begin(); + for(std::vector<InteractionPtr>::iterator i = angles.begin(); i != angles.end(); ++i){ - angles_.push_back(MMInteractionPtr(new MMInteraction(**i))); + angles_.push_back(InteractionPtr(new Interaction(**i))); } - for(std::vector<MMInteractionPtr>::iterator i = dihedrals.begin(); + for(std::vector<InteractionPtr>::iterator i = dihedrals.begin(); i != dihedrals.end(); ++i){ - dihedrals_.push_back(MMInteractionPtr(new MMInteraction(**i))); + dihedrals_.push_back(InteractionPtr(new Interaction(**i))); } - for(std::vector<MMInteractionPtr>::iterator i = impropers.begin(); + for(std::vector<InteractionPtr>::iterator i = impropers.begin(); i != impropers.end(); ++i){ - impropers_.push_back(MMInteractionPtr(new MMInteraction(**i))); + impropers_.push_back(InteractionPtr(new Interaction(**i))); } - for(std::vector<MMInteractionPtr>::iterator i = exclusions.begin(); + for(std::vector<InteractionPtr>::iterator i = exclusions.begin(); i != exclusions.end(); ++i){ - exclusions_.push_back(MMInteractionPtr(new MMInteraction(**i))); + exclusions_.push_back(InteractionPtr(new Interaction(**i))); } - for(std::vector<MMInteractionPtr>::iterator i = cmaps.begin(); + for(std::vector<InteractionPtr>::iterator i = cmaps.begin(); i != cmaps.end(); ++i){ - cmaps_.push_back(MMInteractionPtr(new MMInteraction(**i))); + cmaps_.push_back(InteractionPtr(new Interaction(**i))); } - for(std::vector<MMInteractionPtr>::iterator i = constraints.begin(); + for(std::vector<InteractionPtr>::iterator i = constraints.begin(); i != constraints.end(); ++i){ - constraints_.push_back(MMInteractionPtr(new MMInteraction(**i))); + constraints_.push_back(InteractionPtr(new Interaction(**i))); } } @@ -87,7 +87,7 @@ bool BuildingBlock::Match(const ost::mol::ResidueHandle& handle, bool match_conn //check connectivity by extracting all unique bonds from handle, //also bonds to other residues. std::set<std::pair<String,String> > raw_bonds_handle; - std::vector<MMInteractionPtr> bonds_handle; + std::vector<InteractionPtr> bonds_handle; ost::mol::AtomHandleList atom_list = handle.GetAtomList(); ost::mol::ResidueHandle prev = handle.GetPrev(); ost::mol::ResidueHandle next = handle.GetNext(); @@ -130,7 +130,7 @@ bool BuildingBlock::Match(const ost::mol::ResidueHandle& handle, bool match_conn for(std::set<std::pair<String,String> >::iterator i = raw_bonds_handle.begin(); i != raw_bonds_handle.end(); ++i){ - MMInteractionPtr p(new MMInteraction(HarmonicBond)); + InteractionPtr p(new Interaction(HarmonicBond)); names[0] = i->first; names[1] = i->second; p->SetNames(names); @@ -139,10 +139,10 @@ bool BuildingBlock::Match(const ost::mol::ResidueHandle& handle, bool match_conn bool found; //let's first check for bonds - for(std::vector<MMInteractionPtr>::const_iterator i = bonds_.begin(); + for(std::vector<InteractionPtr>::const_iterator i = bonds_.begin(); i!=bonds_.end(); ++i){ found = false; - for(std::vector<MMInteractionPtr>::iterator j = bonds_handle.begin(); + for(std::vector<InteractionPtr>::iterator j = bonds_handle.begin(); j != bonds_handle.end(); ++j){ if((*j)->MatchNames((*i)->GetNames())){ found = true; @@ -162,9 +162,9 @@ bool BuildingBlock::Match(const ost::mol::ResidueHandle& handle, bool match_conn } //If there is a distance constraint matching a remaining raw bond, we also //remove it from raw bonds - for(std::vector<MMInteractionPtr>::const_iterator i = constraints_.begin(); + for(std::vector<InteractionPtr>::const_iterator i = constraints_.begin(); i != constraints_.end(); ++i){ - for(std::vector<MMInteractionPtr>::iterator j = bonds_handle.begin(); + for(std::vector<InteractionPtr>::iterator j = bonds_handle.begin(); j != bonds_handle.end(); ++j){ if((*j)->MatchNames((*i)->GetNames())){ std::vector<String> names = (*j)->GetNames(); @@ -202,7 +202,7 @@ void BuildingBlock::Connect(ost::mol::ResidueHandle& handle, ost::mol::XCSEditor String name1, name2; - for(std::vector<MMInteractionPtr>::iterator i = bonds_.begin(); + for(std::vector<InteractionPtr>::iterator i = bonds_.begin(); i != bonds_.end(); ++i){ names = (*i)->GetNames(); @@ -267,7 +267,7 @@ Real BuildingBlock::GetMass(const String& name) const{ } -void BuildingBlock::AddBond(MMInteractionPtr p, bool replace_existing){ +void BuildingBlock::AddBond(InteractionPtr p, bool replace_existing){ this->CheckInteractionToAdd(p); if(replace_existing){ std::vector<String> names = p->GetNames(); @@ -281,7 +281,7 @@ void BuildingBlock::AddBond(MMInteractionPtr p, bool replace_existing){ bonds_.push_back(p); } -void BuildingBlock::AddAngle(MMInteractionPtr p, bool replace_existing){ +void BuildingBlock::AddAngle(InteractionPtr p, bool replace_existing){ this->CheckInteractionToAdd(p); if(replace_existing){ std::vector<String> names = p->GetNames(); @@ -295,7 +295,7 @@ void BuildingBlock::AddAngle(MMInteractionPtr p, bool replace_existing){ angles_.push_back(p); } -void BuildingBlock::AddDihedral(MMInteractionPtr p, bool replace_existing){ +void BuildingBlock::AddDihedral(InteractionPtr p, bool replace_existing){ this->CheckInteractionToAdd(p); if(replace_existing){ std::vector<String> names = p->GetNames(); @@ -309,7 +309,7 @@ void BuildingBlock::AddDihedral(MMInteractionPtr p, bool replace_existing){ dihedrals_.push_back(p); } -void BuildingBlock::AddImproper(MMInteractionPtr p, bool replace_existing){ +void BuildingBlock::AddImproper(InteractionPtr p, bool replace_existing){ this->CheckInteractionToAdd(p); if(replace_existing){ std::vector<String> names = p->GetNames(); @@ -323,7 +323,7 @@ void BuildingBlock::AddImproper(MMInteractionPtr p, bool replace_existing){ impropers_.push_back(p); } -void BuildingBlock::AddExclusion(MMInteractionPtr p, bool replace_existing){ +void BuildingBlock::AddExclusion(InteractionPtr p, bool replace_existing){ this->CheckInteractionToAdd(p); if(replace_existing){ std::vector<String> names = p->GetNames(); @@ -337,7 +337,7 @@ void BuildingBlock::AddExclusion(MMInteractionPtr p, bool replace_existing){ exclusions_.push_back(p); } -void BuildingBlock::AddCMap(MMInteractionPtr p, bool replace_existing){ +void BuildingBlock::AddCMap(InteractionPtr p, bool replace_existing){ this->CheckInteractionToAdd(p); if(replace_existing){ std::vector<String> names = p->GetNames(); @@ -351,7 +351,7 @@ void BuildingBlock::AddCMap(MMInteractionPtr p, bool replace_existing){ cmaps_.push_back(p); } -void BuildingBlock::AddConstraint(MMInteractionPtr p, bool replace_existing){ +void BuildingBlock::AddConstraint(InteractionPtr p, bool replace_existing){ this->CheckInteractionToAdd(p); if(replace_existing){ std::vector<String> names = p->GetNames(); @@ -436,32 +436,32 @@ void BuildingBlock::ReplaceAtom(const String& name,const String& new_name, //nothing will happen, if the atom of interest is not part of //that interaction. - for(std::vector<MMInteractionPtr>::iterator i = bonds_.begin(); + for(std::vector<InteractionPtr>::iterator i = bonds_.begin(); i!=bonds_.end(); ++i){ (*i)->ReplaceAtom(name, new_name, new_type); } - for(std::vector<MMInteractionPtr>::iterator i = angles_.begin(); + for(std::vector<InteractionPtr>::iterator i = angles_.begin(); i!=angles_.end(); ++i){ (*i)->ReplaceAtom(name, new_name, new_type); } - for(std::vector<MMInteractionPtr>::iterator i = dihedrals_.begin(); + for(std::vector<InteractionPtr>::iterator i = dihedrals_.begin(); i!=dihedrals_.end(); ++i){ (*i)->ReplaceAtom(name, new_name, new_type); } - for(std::vector<MMInteractionPtr>::iterator i = impropers_.begin(); + for(std::vector<InteractionPtr>::iterator i = impropers_.begin(); i!=impropers_.end(); ++i){ (*i)->ReplaceAtom(name, new_name, new_type); } - for(std::vector<MMInteractionPtr>::iterator i = exclusions_.begin(); + for(std::vector<InteractionPtr>::iterator i = exclusions_.begin(); i!=exclusions_.end(); ++i){ (*i)->ReplaceAtom(name, new_name, new_type); } - for(std::vector<MMInteractionPtr>::iterator i = cmaps_.begin(); + for(std::vector<InteractionPtr>::iterator i = cmaps_.begin(); i!=cmaps_.end(); ++i){ (*i)->ReplaceAtom(name, new_name, new_type); } @@ -678,7 +678,7 @@ void BuildingBlock::RemoveInteractionsToNext(){ } } -void BuildingBlock::CheckInteractionToAdd(MMInteractionPtr p) const{ +void BuildingBlock::CheckInteractionToAdd(InteractionPtr p) const{ if(p->GetNames().empty()){ throw ost::Error("Expect interaction to have names properly set!"); } diff --git a/modules/mol/mm/src/buildingblock.hh b/modules/mol/mm/src/buildingblock.hh index b313255c6476c668a376a3f93cae9cd6bbca8785..9f41ee0158c4fc7e024ae4e5b18b55de0cda93e2 100644 --- a/modules/mol/mm/src/buildingblock.hh +++ b/modules/mol/mm/src/buildingblock.hh @@ -7,7 +7,7 @@ #include <boost/shared_ptr.hpp> -#include <ost/mol/mm/mm_interaction.hh> +#include <ost/mol/mm/interaction.hh> #include <ost/message.hh> #include <ost/mol/bond_handle.hh> #include <ost/mol/residue_handle.hh> @@ -49,37 +49,37 @@ public: Real GetMass(const String& name) const; - std::vector<MMInteractionPtr> GetBonds() const { return bonds_; } + std::vector<InteractionPtr> GetBonds() const { return bonds_; } - std::vector<MMInteractionPtr> GetAngles() const { return angles_; } + std::vector<InteractionPtr> GetAngles() const { return angles_; } - std::vector<MMInteractionPtr> GetDihedrals() const { return dihedrals_; } + std::vector<InteractionPtr> GetDihedrals() const { return dihedrals_; } - std::vector<MMInteractionPtr> GetImpropers() const { return impropers_; } + std::vector<InteractionPtr> GetImpropers() const { return impropers_; } - std::vector<MMInteractionPtr> GetCMaps() const { return cmaps_; } + std::vector<InteractionPtr> GetCMaps() const { return cmaps_; } - std::vector<MMInteractionPtr> GetExclusions() const { return exclusions_; } + std::vector<InteractionPtr> GetExclusions() const { return exclusions_; } - std::vector<MMInteractionPtr> GetConstraints() const { return constraints_;} + std::vector<InteractionPtr> GetConstraints() const { return constraints_;} //Add data to building block void AddAtom(const String& name, const String& type, Real charge, Real mass = std::numeric_limits<Real>::quiet_NaN()); - void AddBond(MMInteractionPtr p, bool replace_existing = false); + void AddBond(InteractionPtr p, bool replace_existing = false); - void AddAngle(MMInteractionPtr p, bool replace_existing = false); + void AddAngle(InteractionPtr p, bool replace_existing = false); - void AddDihedral(MMInteractionPtr p, bool replace_existing = false); + void AddDihedral(InteractionPtr p, bool replace_existing = false); - void AddImproper(MMInteractionPtr p, bool replace_existing = false); + void AddImproper(InteractionPtr p, bool replace_existing = false); - void AddExclusion(MMInteractionPtr p, bool replace_existing = false); + void AddExclusion(InteractionPtr p, bool replace_existing = false); - void AddCMap(MMInteractionPtr p, bool replace_existing = false); + void AddCMap(InteractionPtr p, bool replace_existing = false); - void AddConstraint(MMInteractionPtr p, bool replace_existing = false); + void AddConstraint(InteractionPtr p, bool replace_existing = false); //modifiers @@ -136,7 +136,7 @@ public: int func_type; if(ds.IsSource()){ ds & func_type; - bonds_.push_back(MMInteractionPtr(new MMInteraction(FuncType(func_type)))); + bonds_.push_back(InteractionPtr(new Interaction(FuncType(func_type)))); } else{ func_type = bonds_[i]->GetFuncType(); @@ -149,7 +149,7 @@ public: int func_type; if(ds.IsSource()){ ds & func_type; - angles_.push_back(MMInteractionPtr(new MMInteraction(FuncType(func_type)))); + angles_.push_back(InteractionPtr(new Interaction(FuncType(func_type)))); } else{ func_type = angles_[i]->GetFuncType(); @@ -162,7 +162,7 @@ public: int func_type; if(ds.IsSource()){ ds & func_type; - dihedrals_.push_back(MMInteractionPtr(new MMInteraction(FuncType(func_type)))); + dihedrals_.push_back(InteractionPtr(new Interaction(FuncType(func_type)))); } else{ func_type = dihedrals_[i]->GetFuncType(); @@ -175,7 +175,7 @@ public: int func_type; if(ds.IsSource()){ ds & func_type; - impropers_.push_back(MMInteractionPtr(new MMInteraction(FuncType(func_type)))); + impropers_.push_back(InteractionPtr(new Interaction(FuncType(func_type)))); } else{ func_type = impropers_[i]->GetFuncType(); @@ -188,7 +188,7 @@ public: int func_type; if(ds.IsSource()){ ds & func_type; - exclusions_.push_back(MMInteractionPtr(new MMInteraction(FuncType(func_type)))); + exclusions_.push_back(InteractionPtr(new Interaction(FuncType(func_type)))); } else{ func_type = exclusions_[i]->GetFuncType(); @@ -201,7 +201,7 @@ public: int func_type; if(ds.IsSource()){ ds & func_type; - cmaps_.push_back(MMInteractionPtr(new MMInteraction(FuncType(func_type)))); + cmaps_.push_back(InteractionPtr(new Interaction(FuncType(func_type)))); } else{ func_type = cmaps_[i]->GetFuncType(); @@ -214,7 +214,7 @@ public: int func_type; if(ds.IsSource()){ ds & func_type; - constraints_.push_back(MMInteractionPtr(new MMInteraction(FuncType(func_type)))); + constraints_.push_back(InteractionPtr(new Interaction(FuncType(func_type)))); } else{ func_type = constraints_[i]->GetFuncType(); @@ -228,19 +228,19 @@ public: private: int GetAtomIndex(const String& atom_name) const; - void CheckInteractionToAdd(MMInteractionPtr p) const; + void CheckInteractionToAdd(InteractionPtr p) const; std::vector<String> atoms_; std::vector<String> types_; std::vector<Real> charges_; std::vector<Real> masses_; - std::vector<MMInteractionPtr> bonds_; - std::vector<MMInteractionPtr> angles_; - std::vector<MMInteractionPtr> dihedrals_; - std::vector<MMInteractionPtr> impropers_; - std::vector<MMInteractionPtr> exclusions_; - std::vector<MMInteractionPtr> cmaps_; - std::vector<MMInteractionPtr> constraints_; + std::vector<InteractionPtr> bonds_; + std::vector<InteractionPtr> angles_; + std::vector<InteractionPtr> dihedrals_; + std::vector<InteractionPtr> impropers_; + std::vector<InteractionPtr> exclusions_; + std::vector<InteractionPtr> cmaps_; + std::vector<InteractionPtr> constraints_; }; }}} diff --git a/modules/mol/mm/src/forcefield.cc b/modules/mol/mm/src/forcefield.cc index 666de94176062ee9737befc05d2e0db0eee9d0af..3a4b15aa4fb07ddcba4a12b5d5eb389559fb585e 100644 --- a/modules/mol/mm/src/forcefield.cc +++ b/modules/mol/mm/src/forcefield.cc @@ -53,7 +53,7 @@ ForcefieldPtr Forcefield::Load(const String& filename){ ds & num_bonds; for(int i = 0; i < num_bonds; ++i){ ds & func_type; - MMInteractionPtr p(new MMInteraction(FuncType(func_type))); + InteractionPtr p(new Interaction(FuncType(func_type))); ds & *p; ff_p->AddBond(p); } @@ -62,7 +62,7 @@ ForcefieldPtr Forcefield::Load(const String& filename){ ds & num_angles; for(int i = 0; i < num_angles; ++i){ ds & func_type; - MMInteractionPtr p(new MMInteraction(FuncType(func_type))); + InteractionPtr p(new Interaction(FuncType(func_type))); ds & *p; ff_p->AddAngle(p); } @@ -71,7 +71,7 @@ ForcefieldPtr Forcefield::Load(const String& filename){ ds & num_lj_pairs; for(int i = 0; i < num_lj_pairs; ++i){ ds & func_type; - MMInteractionPtr p(new MMInteraction(FuncType(func_type))); + InteractionPtr p(new Interaction(FuncType(func_type))); ds & *p; ff_p->AddLJPair(p); } @@ -80,7 +80,7 @@ ForcefieldPtr Forcefield::Load(const String& filename){ ds & num_constraints; for(int i = 0; i < num_constraints; ++i){ ds & func_type; - MMInteractionPtr p(new MMInteraction(FuncType(func_type))); + InteractionPtr p(new Interaction(FuncType(func_type))); ds & *p; ff_p->AddConstraint(p); } @@ -89,7 +89,7 @@ ForcefieldPtr Forcefield::Load(const String& filename){ ds & num_cmaps; for(int i = 0; i < num_cmaps; ++i){ ds & func_type; - MMInteractionPtr p(new MMInteraction(FuncType(func_type))); + InteractionPtr p(new Interaction(FuncType(func_type))); ds & *p; ff_p->AddCMap(p); } @@ -98,7 +98,7 @@ ForcefieldPtr Forcefield::Load(const String& filename){ ds & num_genborn; for(int i = 0; i < num_genborn; ++i){ ds & func_type; - MMInteractionPtr p(new MMInteraction(FuncType(func_type))); + InteractionPtr p(new Interaction(FuncType(func_type))); ds & *p; ff_p->AddImplicitGenborn(p); } @@ -107,7 +107,7 @@ ForcefieldPtr Forcefield::Load(const String& filename){ ds & num_ljs; for(int i = 0; i < num_ljs; ++i){ ds & func_type; - MMInteractionPtr p(new MMInteraction(FuncType(func_type))); + InteractionPtr p(new Interaction(FuncType(func_type))); ds & *p; ff_p->AddLJ(p); } @@ -120,7 +120,7 @@ ForcefieldPtr Forcefield::Load(const String& filename){ ds & temp_num; for(int j = 0; j < temp_num; ++j){ ds & func_type; - MMInteractionPtr p(new MMInteraction(FuncType(func_type))); + InteractionPtr p(new Interaction(FuncType(func_type))); ds & *p; ff_p->AddDihedral(p); } @@ -132,7 +132,7 @@ ForcefieldPtr Forcefield::Load(const String& filename){ ds & temp_num; for(int j = 0; j < temp_num; ++j){ ds & func_type; - MMInteractionPtr p(new MMInteraction(FuncType(func_type))); + InteractionPtr p(new Interaction(FuncType(func_type))); ds & *p; ff_p->AddImproper(p); } @@ -252,7 +252,7 @@ void Forcefield::Save(const String& filename){ int func_type; int num_bonds = bonds_.size(); ds & num_bonds; - for(boost::unordered_map<String,MMInteractionPtr>::iterator i = bonds_.begin(); + for(boost::unordered_map<String,InteractionPtr>::iterator i = bonds_.begin(); i != bonds_.end(); ++i){ func_type = int(i->second->GetFuncType()); ds & func_type; @@ -261,7 +261,7 @@ void Forcefield::Save(const String& filename){ int num_angles = angles_.size(); ds & num_angles; - for(boost::unordered_map<String,MMInteractionPtr>::iterator i = angles_.begin(); + for(boost::unordered_map<String,InteractionPtr>::iterator i = angles_.begin(); i != angles_.end(); ++i){ func_type = int(i->second->GetFuncType()); ds & func_type; @@ -270,7 +270,7 @@ void Forcefield::Save(const String& filename){ int num_lj_pairs = lj_14_pairs_.size(); ds & num_lj_pairs; - for(boost::unordered_map<String,MMInteractionPtr>::iterator i = lj_14_pairs_.begin(); + for(boost::unordered_map<String,InteractionPtr>::iterator i = lj_14_pairs_.begin(); i != lj_14_pairs_.end(); ++i){ func_type = int(i->second->GetFuncType()); ds & func_type; @@ -279,7 +279,7 @@ void Forcefield::Save(const String& filename){ int num_constraints = constraints_.size(); ds & num_constraints; - for(boost::unordered_map<String,MMInteractionPtr>::iterator i = constraints_.begin(); + for(boost::unordered_map<String,InteractionPtr>::iterator i = constraints_.begin(); i != constraints_.end(); ++i){ func_type = int(i->second->GetFuncType()); ds & func_type; @@ -288,7 +288,7 @@ void Forcefield::Save(const String& filename){ int num_cmaps = cmaps_.size(); ds & num_cmaps; - for(boost::unordered_map<String,MMInteractionPtr>::iterator i = cmaps_.begin(); + for(boost::unordered_map<String,InteractionPtr>::iterator i = cmaps_.begin(); i != cmaps_.end(); ++i){ func_type = int(i->second->GetFuncType()); ds & func_type; @@ -297,7 +297,7 @@ void Forcefield::Save(const String& filename){ int num_genborn = implicit_genborn_.size(); ds & num_genborn; - for(boost::unordered_map<String,MMInteractionPtr>::iterator i = implicit_genborn_.begin(); + for(boost::unordered_map<String,InteractionPtr>::iterator i = implicit_genborn_.begin(); i != implicit_genborn_.end(); ++i){ func_type = int(i->second->GetFuncType()); ds & func_type; @@ -306,7 +306,7 @@ void Forcefield::Save(const String& filename){ int num_ljs = ljs_.size(); ds & num_ljs; - for(boost::unordered_map<String,MMInteractionPtr>::iterator i = ljs_.begin(); + for(boost::unordered_map<String,InteractionPtr>::iterator i = ljs_.begin(); i != ljs_.end(); ++i){ func_type = int(i->second->GetFuncType()); ds & func_type; @@ -316,11 +316,11 @@ void Forcefield::Save(const String& filename){ int num_dihedrals = dihedrals_.size(); int vector_size; ds & num_dihedrals; - for(boost::unordered_map<String,std::vector<MMInteractionPtr> >::iterator i = dihedrals_.begin(); + for(boost::unordered_map<String,std::vector<InteractionPtr> >::iterator i = dihedrals_.begin(); i != dihedrals_.end(); ++i){ vector_size = i->second.size(); ds & vector_size; - for(std::vector<MMInteractionPtr>::iterator j = i->second.begin(); + for(std::vector<InteractionPtr>::iterator j = i->second.begin(); j != i->second.end(); ++j){ func_type = int((*j)->GetFuncType()); ds & func_type; @@ -330,11 +330,11 @@ void Forcefield::Save(const String& filename){ int num_impropers = improper_dihedrals_.size(); ds & num_impropers; - for(boost::unordered_map<String,std::vector<MMInteractionPtr> >::iterator i = improper_dihedrals_.begin(); + for(boost::unordered_map<String,std::vector<InteractionPtr> >::iterator i = improper_dihedrals_.begin(); i != improper_dihedrals_.end(); ++i){ vector_size = i->second.size(); ds & vector_size; - for(std::vector<MMInteractionPtr>::iterator j = i->second.begin(); + for(std::vector<InteractionPtr>::iterator j = i->second.begin(); j != i->second.end(); ++j){ func_type = int((*j)->GetFuncType()); ds & func_type; @@ -456,29 +456,29 @@ BlockModifierPtr Forcefield::GetCTerModifier(const String& res_name, const Strin return this->GetBlockModifier(temp); } -MMInteractionPtr Forcefield::GetBond(const String& type1, const String& type2) const{ +InteractionPtr Forcefield::GetBond(const String& type1, const String& type2) const{ std::vector<String> types; types.push_back(type1); types.push_back(type2); - boost::unordered_map<String,MMInteractionPtr>::const_iterator i = + boost::unordered_map<String,InteractionPtr>::const_iterator i = bonds_.find(this->AtomTypesToKeyword(types)); if(i != bonds_.end()) return i->second; throw ost::Error("Forcefield does not contain bond for requested atom types!"); } -MMInteractionPtr Forcefield::GetAngle(const String& type1, const String& type2, +InteractionPtr Forcefield::GetAngle(const String& type1, const String& type2, const String& type3) const{ std::vector<String> types; types.push_back(type1); types.push_back(type2); types.push_back(type3); - boost::unordered_map<String,MMInteractionPtr>::const_iterator i = + boost::unordered_map<String,InteractionPtr>::const_iterator i = angles_.find(this->AtomTypesToKeyword(types)); if(i != angles_.end()) return i->second; throw ost::Error("Forcefield does not contain angle for requested atom types!"); } -std::vector<MMInteractionPtr> Forcefield::GetDihedrals(const String& type1, +std::vector<InteractionPtr> Forcefield::GetDihedrals(const String& type1, const String& type2, const String& type3, const String& type4) const{ @@ -488,20 +488,20 @@ std::vector<MMInteractionPtr> Forcefield::GetDihedrals(const String& type1, types.push_back(type3); types.push_back(type4); - boost::unordered_map<String,std::vector<MMInteractionPtr> >::const_iterator i = + boost::unordered_map<String,std::vector<InteractionPtr> >::const_iterator i = dihedrals_.find(this->AtomTypesToKeyword(types)); if(i != dihedrals_.end()) return i->second; //if we reach this point, we have to look for all dihedrals with wildcards... - std::vector<MMInteractionPtr> dihedrals; + std::vector<InteractionPtr> dihedrals; std::vector<String> types_with_wildcards; //lets first check single wildcards for(int i = 0; i < 4; ++i){ types_with_wildcards = types; types_with_wildcards[i] = "X"; - boost::unordered_map<String,std::vector<MMInteractionPtr> >::const_iterator j = + boost::unordered_map<String,std::vector<InteractionPtr> >::const_iterator j = dihedrals_.find(this->AtomTypesToKeyword(types_with_wildcards)); if(j != dihedrals_.end()) dihedrals.insert(dihedrals.end(),j->second.begin(),j->second.end()); } @@ -512,7 +512,7 @@ std::vector<MMInteractionPtr> Forcefield::GetDihedrals(const String& type1, types_with_wildcards = types; types_with_wildcards[i] = "X"; types_with_wildcards[j] = "X"; - boost::unordered_map<String,std::vector<MMInteractionPtr> >::const_iterator k = + boost::unordered_map<String,std::vector<InteractionPtr> >::const_iterator k = dihedrals_.find(this->AtomTypesToKeyword(types_with_wildcards)); if(k != dihedrals_.end()) dihedrals.insert(dihedrals.end(),k->second.begin(),k->second.end()); } @@ -526,7 +526,7 @@ std::vector<MMInteractionPtr> Forcefield::GetDihedrals(const String& type1, for(int i = 0; i < 4; ++i){ types_with_wildcards = all_wildcards; types_with_wildcards[i] = types[i]; - boost::unordered_map<String,std::vector<MMInteractionPtr> >::const_iterator j = + boost::unordered_map<String,std::vector<InteractionPtr> >::const_iterator j = dihedrals_.find(this->AtomTypesToKeyword(types_with_wildcards)); if(j != dihedrals_.end()) dihedrals.insert(dihedrals.end(),j->second.begin(),j->second.end()); } @@ -535,7 +535,7 @@ std::vector<MMInteractionPtr> Forcefield::GetDihedrals(const String& type1, throw ost::Error("Forcefield does not contain any dihedrals for requested atom types!"); } -std::vector<MMInteractionPtr> Forcefield::GetImpropers(const String& type1, +std::vector<InteractionPtr> Forcefield::GetImpropers(const String& type1, const String& type2, const String& type3, const String& type4) const{ @@ -545,20 +545,20 @@ std::vector<MMInteractionPtr> Forcefield::GetImpropers(const String& type1, types.push_back(type3); types.push_back(type4); - boost::unordered_map<String,std::vector<MMInteractionPtr> >::const_iterator i = + boost::unordered_map<String,std::vector<InteractionPtr> >::const_iterator i = improper_dihedrals_.find(this->AtomTypesToKeyword(types)); if(i != improper_dihedrals_.end()) return i->second; //if we reach this point, we have to look for all dihedrals with wildcards... - std::vector<MMInteractionPtr> impropers; + std::vector<InteractionPtr> impropers; std::vector<String> types_with_wildcards; //lets first check single wildcards for(int i = 0; i < 4; ++i){ types_with_wildcards = types; types_with_wildcards[i] = "X"; - boost::unordered_map<String,std::vector<MMInteractionPtr> >::const_iterator j = + boost::unordered_map<String,std::vector<InteractionPtr> >::const_iterator j = improper_dihedrals_.find(this->AtomTypesToKeyword(types_with_wildcards)); if(j != improper_dihedrals_.end()) impropers.insert(impropers.end(),j->second.begin(),j->second.end()); } @@ -569,7 +569,7 @@ std::vector<MMInteractionPtr> Forcefield::GetImpropers(const String& type1, types_with_wildcards = types; types_with_wildcards[i] = "X"; types_with_wildcards[j] = "X"; - boost::unordered_map<String,std::vector<MMInteractionPtr> >::const_iterator k = + boost::unordered_map<String,std::vector<InteractionPtr> >::const_iterator k = improper_dihedrals_.find(this->AtomTypesToKeyword(types_with_wildcards)); if(k != improper_dihedrals_.end()) impropers.insert(impropers.end(),k->second.begin(),k->second.end()); } @@ -583,7 +583,7 @@ std::vector<MMInteractionPtr> Forcefield::GetImpropers(const String& type1, for(int i = 0; i < 4; ++i){ types_with_wildcards = all_wildcards; types_with_wildcards[i] = types[i]; - boost::unordered_map<String,std::vector<MMInteractionPtr> >::const_iterator j = + boost::unordered_map<String,std::vector<InteractionPtr> >::const_iterator j = improper_dihedrals_.find(this->AtomTypesToKeyword(types_with_wildcards)); if(j != improper_dihedrals_.end()) impropers.insert(impropers.end(),j->second.begin(),j->second.end()); } @@ -593,7 +593,7 @@ std::vector<MMInteractionPtr> Forcefield::GetImpropers(const String& type1, throw ost::Error("Forcefield does not contain any impropers for requested atom types!"); } -MMInteractionPtr Forcefield::GetCMap(const String& type1, const String& type2, +InteractionPtr Forcefield::GetCMap(const String& type1, const String& type2, const String& type3, const String& type4, const String& type5) const{ @@ -603,24 +603,24 @@ MMInteractionPtr Forcefield::GetCMap(const String& type1, const String& type2, types.push_back(type3); types.push_back(type4); types.push_back(type5); - boost::unordered_map<String,MMInteractionPtr>::const_iterator i = + boost::unordered_map<String,InteractionPtr>::const_iterator i = cmaps_.find(this->AtomTypesToKeyword(types,false)); if(i != cmaps_.end()) return i->second; throw ost::Error("Forcefield does not contain cmap for requested atom types!"); } -MMInteractionPtr Forcefield::GetImplicitGenborn(const String& type) const{ +InteractionPtr Forcefield::GetImplicitGenborn(const String& type) const{ - boost::unordered_map<String,MMInteractionPtr>::const_iterator i = + boost::unordered_map<String,InteractionPtr>::const_iterator i = implicit_genborn_.find(type); if(i != implicit_genborn_.end()) return i->second; throw ost::Error("Forcefield does not contain implicit genborn parameters for requested atom type!"); } -MMInteractionPtr Forcefield::GetLJ(const String& type) const{ +InteractionPtr Forcefield::GetLJ(const String& type) const{ - boost::unordered_map<String,MMInteractionPtr>::const_iterator i = + boost::unordered_map<String,InteractionPtr>::const_iterator i = ljs_.find(type); if(i != ljs_.end()){ @@ -629,7 +629,7 @@ MMInteractionPtr Forcefield::GetLJ(const String& type) const{ throw ost::Error("Forcefield does not contain lennard jones parameters for requested atom types!"); } -MMInteractionPtr Forcefield::GetLJ(const String& type1, +InteractionPtr Forcefield::GetLJ(const String& type1, const String& type2, bool pair) const{ std::vector<String> types; @@ -637,7 +637,7 @@ MMInteractionPtr Forcefield::GetLJ(const String& type1, types.push_back(type2); if(pair){ - boost::unordered_map<String,MMInteractionPtr>::const_iterator i = + boost::unordered_map<String,InteractionPtr>::const_iterator i = lj_14_pairs_.find(this->AtomTypesToKeyword(types)); if(i == lj_14_pairs_.end()){ if(!gen_pairs_){ @@ -653,11 +653,11 @@ MMInteractionPtr Forcefield::GetLJ(const String& type1, } } - MMInteractionPtr temp1, temp2; + InteractionPtr temp1, temp2; temp1 = this->GetLJ(type1); temp2 = this->GetLJ(type2); if(temp1 && temp2){ - MMInteractionPtr return_ptr(new MMInteraction(LJPair)); + InteractionPtr return_ptr(new Interaction(LJPair)); std::vector<Real> param1, param2, param; param1 = temp1->GetParam(); param2 = temp2->GetParam(); @@ -672,12 +672,12 @@ MMInteractionPtr Forcefield::GetLJ(const String& type1, } -MMInteractionPtr Forcefield::GetConstraint(const String& type1, +InteractionPtr Forcefield::GetConstraint(const String& type1, const String& type2){ std::vector<String> types; types.push_back(type1); types.push_back(type2); - boost::unordered_map<String,MMInteractionPtr>::const_iterator i = + boost::unordered_map<String,InteractionPtr>::const_iterator i = constraints_.find(this->AtomTypesToKeyword(types)); if(i != constraints_.end()) return i->second; throw ost::Error("Forcefield does not contain constraint for requested atom types!"); @@ -693,63 +693,63 @@ Real Forcefield::GetMass(const String& atom_type) const{ return it->second; } -void Forcefield::AddBond(MMInteractionPtr p){ +void Forcefield::AddBond(InteractionPtr p){ this->CheckInteractionToAdd(p,"BOND"); std::vector<String> types = p->GetTypes(); bonds_[this->AtomTypesToKeyword(types)] = p; } -void Forcefield::AddAngle(MMInteractionPtr p){ +void Forcefield::AddAngle(InteractionPtr p){ this->CheckInteractionToAdd(p,"ANGLE"); std::vector<String> types = p->GetTypes(); angles_[this->AtomTypesToKeyword(types)] = p; } -void Forcefield::AddDihedral(MMInteractionPtr p){ +void Forcefield::AddDihedral(InteractionPtr p){ this->CheckInteractionToAdd(p,"DIHEDRAL"); std::vector<String> types = p->GetTypes(); String keyword = this->AtomTypesToKeyword(types); if(dihedrals_.find(keyword) == dihedrals_.end()){ - dihedrals_[keyword] = std::vector<MMInteractionPtr>(); + dihedrals_[keyword] = std::vector<InteractionPtr>(); } dihedrals_[keyword].push_back(p); } -void Forcefield::AddImproper(MMInteractionPtr p){ +void Forcefield::AddImproper(InteractionPtr p){ this->CheckInteractionToAdd(p,"IMPROPER"); std::vector<String> types = p->GetTypes(); String keyword = this->AtomTypesToKeyword(types); if(improper_dihedrals_.find(keyword) == improper_dihedrals_.end()){ - improper_dihedrals_[keyword] = std::vector<MMInteractionPtr>(); + improper_dihedrals_[keyword] = std::vector<InteractionPtr>(); } improper_dihedrals_[keyword].push_back(p); } -void Forcefield::AddCMap(MMInteractionPtr p){ +void Forcefield::AddCMap(InteractionPtr p){ this->CheckInteractionToAdd(p,"CMAP"); std::vector<String> types = p->GetTypes(); cmaps_[this->AtomTypesToKeyword(types,false)] = p; } -void Forcefield::AddImplicitGenborn(MMInteractionPtr p){ +void Forcefield::AddImplicitGenborn(InteractionPtr p){ this->CheckInteractionToAdd(p,"IMPLICIT_GENBORN"); std::vector<String> types = p->GetTypes(); implicit_genborn_[this->AtomTypesToKeyword(types)] = p; } -void Forcefield::AddLJ(MMInteractionPtr p){ +void Forcefield::AddLJ(InteractionPtr p){ this->CheckInteractionToAdd(p,"LJ"); std::vector<String> types = p->GetTypes(); ljs_[types[0]] = p; } -void Forcefield::AddLJPair(MMInteractionPtr p){ +void Forcefield::AddLJPair(InteractionPtr p){ this->CheckInteractionToAdd(p,"LJ_PAIR"); std::vector<String> types = p->GetTypes(); lj_14_pairs_[this->AtomTypesToKeyword(types)] = p; } -void Forcefield::AddConstraint(MMInteractionPtr p){ +void Forcefield::AddConstraint(InteractionPtr p){ this->CheckInteractionToAdd(p,"CONSTRAINT"); std::vector<String> types = p->GetTypes(); constraints_[this->AtomTypesToKeyword(types)] = p; @@ -955,7 +955,7 @@ String Forcefield::AtomTypesToKeyword(std::vector<String>& types, bool allow_reo return ss.str(); } -void Forcefield::CheckInteractionToAdd(MMInteractionPtr p, const String& interaction_type) const{ +void Forcefield::CheckInteractionToAdd(InteractionPtr p, const String& interaction_type) const{ bool valid = true; if(p->GetTypes().empty()) valid = false; if(!p->IsParametrized()) valid = false; diff --git a/modules/mol/mm/src/forcefield.hh b/modules/mol/mm/src/forcefield.hh index aba6447676e34319030bda1402d40751c2d3d881..0e9a0da64b95774ec42bedcc0b2e5fd35e21e7cc 100644 --- a/modules/mol/mm/src/forcefield.hh +++ b/modules/mol/mm/src/forcefield.hh @@ -10,7 +10,7 @@ #include <ost/message.hh> #include <ost/mol/mm/buildingblock.hh> -#include <ost/mol/mm/mm_interaction.hh> +#include <ost/mol/mm/interaction.hh> #include <ost/mol/mm/block_modifiers.hh> #include <ost/mol/mm/gromacs_block_modifiers.hh> @@ -71,38 +71,38 @@ public: BlockModifierPtr GetCTerModifier(const String& res_name, const String& ter_name = "") const; - MMInteractionPtr GetBond(const String& type1, + InteractionPtr GetBond(const String& type1, const String& type2) const; - MMInteractionPtr GetAngle(const String& type1, + InteractionPtr GetAngle(const String& type1, const String& type2, const String& type3) const; - std::vector<MMInteractionPtr> GetDihedrals(const String& type1, + std::vector<InteractionPtr> GetDihedrals(const String& type1, const String& type2, const String& type3, const String& type4) const; - std::vector<MMInteractionPtr> GetImpropers(const String& type1, + std::vector<InteractionPtr> GetImpropers(const String& type1, const String& type2, const String& type3, const String& type4) const; - MMInteractionPtr GetCMap(const String& type1, + InteractionPtr GetCMap(const String& type1, const String& type2, const String& type3, const String& type4, const String& type5) const; - MMInteractionPtr GetImplicitGenborn(const String& type1) const; + InteractionPtr GetImplicitGenborn(const String& type1) const; - MMInteractionPtr GetLJ(const String& type1, + InteractionPtr GetLJ(const String& type1, const String& type2, bool pair=false) const; - MMInteractionPtr GetLJ(const String& type) const; + InteractionPtr GetLJ(const String& type) const; - MMInteractionPtr GetConstraint(const String& type1, + InteractionPtr GetConstraint(const String& type1, const String& type2); Real GetMass(const String& type) const; @@ -115,23 +115,23 @@ public: void AddBuildingBlock(const String& name, BuildingBlockPtr p) { building_blocks_[name] = p; } - void AddBond(MMInteractionPtr p); + void AddBond(InteractionPtr p); - void AddAngle(MMInteractionPtr p); + void AddAngle(InteractionPtr p); - void AddDihedral(MMInteractionPtr p); + void AddDihedral(InteractionPtr p); - void AddImproper(MMInteractionPtr p); + void AddImproper(InteractionPtr p); - void AddCMap(MMInteractionPtr p); + void AddCMap(InteractionPtr p); - void AddImplicitGenborn(MMInteractionPtr p); + void AddImplicitGenborn(InteractionPtr p); - void AddLJ(MMInteractionPtr p); + void AddLJ(InteractionPtr p); - void AddLJPair(MMInteractionPtr p); + void AddLJPair(InteractionPtr p); - void AddConstraint(MMInteractionPtr p); + void AddConstraint(InteractionPtr p); void AddMass(const String& type, Real mass) { atom_masses_[type] = mass; } @@ -179,7 +179,7 @@ public: private: String AtomTypesToKeyword(std::vector<String>& types, bool allow_reordering = true) const; - void CheckInteractionToAdd(MMInteractionPtr p, const String& interaction_type) const; + void CheckInteractionToAdd(InteractionPtr p, const String& interaction_type) const; //this is all nonbonded stuff bool gen_pairs_; @@ -191,15 +191,15 @@ private: boost::unordered_map<String, BlockModifierPtr> block_modifiers_; //the standard interactions - boost::unordered_map<String,MMInteractionPtr> bonds_; - boost::unordered_map<String,MMInteractionPtr> angles_; - boost::unordered_map<String,MMInteractionPtr> lj_14_pairs_; - boost::unordered_map<String,MMInteractionPtr> constraints_; - boost::unordered_map<String,MMInteractionPtr> cmaps_; - boost::unordered_map<String,MMInteractionPtr> implicit_genborn_; - boost::unordered_map<String,MMInteractionPtr> ljs_; - boost::unordered_map<String,std::vector<MMInteractionPtr> > dihedrals_; - boost::unordered_map<String,std::vector<MMInteractionPtr> > improper_dihedrals_; + boost::unordered_map<String,InteractionPtr> bonds_; + boost::unordered_map<String,InteractionPtr> angles_; + boost::unordered_map<String,InteractionPtr> lj_14_pairs_; + boost::unordered_map<String,InteractionPtr> constraints_; + boost::unordered_map<String,InteractionPtr> cmaps_; + boost::unordered_map<String,InteractionPtr> implicit_genborn_; + boost::unordered_map<String,InteractionPtr> ljs_; + boost::unordered_map<String,std::vector<InteractionPtr> > dihedrals_; + boost::unordered_map<String,std::vector<InteractionPtr> > improper_dihedrals_; boost::unordered_map<String, std::vector<std::pair<String,String> > > atom_renaming_ff_specific_; boost::unordered_map<String, ResidueNamesPtr> res_renaming_ff_specific_; diff --git a/modules/mol/mm/src/gromacs_block_modifiers.cc b/modules/mol/mm/src/gromacs_block_modifiers.cc index 083b0b84249355cea7a1233a76e8fab5e3128b32..5cad3445186d2e1197000e26d72efb590b699ad0 100644 --- a/modules/mol/mm/src/gromacs_block_modifiers.cc +++ b/modules/mol/mm/src/gromacs_block_modifiers.cc @@ -325,7 +325,7 @@ void GromacsBlockModifier::ApplyOnBuildingBlock(BuildingBlockPtr p){ //the bond, that connects the newly added atom to its anchor is not necessarily //defined. Let's add it here. Note, that nothing happens, if this specific bond //is already part of the building block. - MMInteractionPtr b_p(new MMInteraction(p->GetBonds()[0]->GetFuncType())); + InteractionPtr b_p(new Interaction(p->GetBonds()[0]->GetFuncType())); std::vector<String> bond_names; std::vector<String> bond_types; bond_names.push_back(anchor_atoms[0]); @@ -345,27 +345,27 @@ void GromacsBlockModifier::ApplyOnBuildingBlock(BuildingBlockPtr p){ } //we simply add the new interactions to the building block - for(std::vector<MMInteractionPtr>::iterator i = bonds_.begin(); + for(std::vector<InteractionPtr>::iterator i = bonds_.begin(); i != bonds_.end(); ++i){ p->AddBond(*i, true); } - for(std::vector<MMInteractionPtr>::iterator i = angles_.begin(); + for(std::vector<InteractionPtr>::iterator i = angles_.begin(); i != angles_.end(); ++i){ p->AddAngle(*i, true); } - for(std::vector<MMInteractionPtr>::iterator i = dihedrals_.begin(); + for(std::vector<InteractionPtr>::iterator i = dihedrals_.begin(); i != dihedrals_.end(); ++i){ p->AddDihedral(*i, true); } - for(std::vector<MMInteractionPtr>::iterator i = impropers_.begin(); + for(std::vector<InteractionPtr>::iterator i = impropers_.begin(); i != impropers_.end(); ++i){ p->AddImproper(*i, true); } - for(std::vector<MMInteractionPtr>::iterator i = cmaps_.begin(); + for(std::vector<InteractionPtr>::iterator i = cmaps_.begin(); i != cmaps_.end(); ++i){ p->AddCMap(*i, true); } @@ -430,7 +430,7 @@ void GromacsBlockModifier::ApplyOnResidue(ost::mol::ResidueHandle& res, ost::mol } -void GromacsBlockModifier::CheckInteractionToAdd(MMInteractionPtr p, const String& interaction_type) const{ +void GromacsBlockModifier::CheckInteractionToAdd(InteractionPtr p, const String& interaction_type) const{ if(p->GetNames().empty()) throw ost::Error("Expect interaction to have names properly set!"); if(interaction_type == "BOND"){ diff --git a/modules/mol/mm/src/gromacs_block_modifiers.hh b/modules/mol/mm/src/gromacs_block_modifiers.hh index e5621f9e772b4ea3cf9d9bdb8783302695d9d7e5..9f6afd897a5e9b77729e6ebae51674a1a7fc0770 100644 --- a/modules/mol/mm/src/gromacs_block_modifiers.hh +++ b/modules/mol/mm/src/gromacs_block_modifiers.hh @@ -109,19 +109,19 @@ public: const std::vector<String>& anchors, const String& type, Real charge); - void AddBond(MMInteractionPtr p) { this->CheckInteractionToAdd(p,"BOND"); + void AddBond(InteractionPtr p) { this->CheckInteractionToAdd(p,"BOND"); bonds_.push_back(p); } - void AddAngle(MMInteractionPtr p) { this->CheckInteractionToAdd(p,"ANGLE"); + void AddAngle(InteractionPtr p) { this->CheckInteractionToAdd(p,"ANGLE"); angles_.push_back(p); } - void AddDihedral(MMInteractionPtr p) { this->CheckInteractionToAdd(p,"DIHEDRAL"); + void AddDihedral(InteractionPtr p) { this->CheckInteractionToAdd(p,"DIHEDRAL"); dihedrals_.push_back(p); } - void AddImproper(MMInteractionPtr p) { this->CheckInteractionToAdd(p,"IMPROPER"); + void AddImproper(InteractionPtr p) { this->CheckInteractionToAdd(p,"IMPROPER"); impropers_.push_back(p); } - void AddCMap(MMInteractionPtr p) { this->CheckInteractionToAdd(p,"CMAP"); + void AddCMap(InteractionPtr p) { this->CheckInteractionToAdd(p,"CMAP"); cmaps_.push_back(p); } void AddDeleteAtom(const String& atom_name) { delete_atom_names_.push_back(atom_name); } @@ -149,7 +149,7 @@ public: int func_type; if(ds.IsSource()){ ds & func_type; - bonds_.push_back(MMInteractionPtr(new MMInteraction(FuncType(func_type)))); + bonds_.push_back(InteractionPtr(new Interaction(FuncType(func_type)))); } else{ func_type = bonds_[i]->GetFuncType(); @@ -162,7 +162,7 @@ public: int func_type; if(ds.IsSource()){ ds & func_type; - angles_.push_back(MMInteractionPtr(new MMInteraction(FuncType(func_type)))); + angles_.push_back(InteractionPtr(new Interaction(FuncType(func_type)))); } else{ func_type = angles_[i]->GetFuncType(); @@ -175,7 +175,7 @@ public: int func_type; if(ds.IsSource()){ ds & func_type; - dihedrals_.push_back(MMInteractionPtr(new MMInteraction(FuncType(func_type)))); + dihedrals_.push_back(InteractionPtr(new Interaction(FuncType(func_type)))); } else{ func_type = dihedrals_[i]->GetFuncType(); @@ -188,7 +188,7 @@ public: int func_type; if(ds.IsSource()){ ds & func_type; - impropers_.push_back(MMInteractionPtr(new MMInteraction(FuncType(func_type)))); + impropers_.push_back(InteractionPtr(new Interaction(FuncType(func_type)))); } else{ func_type = impropers_[i]->GetFuncType(); @@ -201,7 +201,7 @@ public: int func_type; if(ds.IsSource()){ ds & func_type; - cmaps_.push_back(MMInteractionPtr(new MMInteraction(FuncType(func_type)))); + cmaps_.push_back(InteractionPtr(new Interaction(FuncType(func_type)))); } else{ func_type = cmaps_[i]->GetFuncType(); @@ -272,16 +272,16 @@ public: private: - void CheckInteractionToAdd(MMInteractionPtr p, const String& interaction_type) const; + void CheckInteractionToAdd(InteractionPtr p, const String& interaction_type) const; //Atoms, that will be added to the building block //Interactions, that will be added to the building block - std::vector<MMInteractionPtr> bonds_; - std::vector<MMInteractionPtr> angles_; - std::vector<MMInteractionPtr> dihedrals_; - std::vector<MMInteractionPtr> impropers_; - std::vector<MMInteractionPtr> cmaps_; + std::vector<InteractionPtr> bonds_; + std::vector<InteractionPtr> angles_; + std::vector<InteractionPtr> dihedrals_; + std::vector<InteractionPtr> impropers_; + std::vector<InteractionPtr> cmaps_; //paramters we need for the replace statement std::vector<String> replace_old_atom_name_; diff --git a/modules/mol/mm/src/gromacs_reader.cc b/modules/mol/mm/src/gromacs_reader.cc index e6fed54ac29ceef9bc77c325183b44d8fb54020f..7306556dbfcbb82b41d535fd5a703f5f20fb208e 100644 --- a/modules/mol/mm/src/gromacs_reader.cc +++ b/modules/mol/mm/src/gromacs_reader.cc @@ -437,25 +437,25 @@ void GromacsReader::ParseForcefield(std::vector<std::vector<String> >& content){ switch(keyword_id){ case 11:{ - MMInteractionPtr bond = this->ParseBond(current_line,true); + InteractionPtr bond = this->ParseBond(current_line,true); ff_->AddBond(bond); ff_bonded_types_[0] = bond->GetFuncType(); break; } case 12:{ - MMInteractionPtr constraint = this->ParseConstraint(current_line,true); + InteractionPtr constraint = this->ParseConstraint(current_line,true); ff_->AddConstraint(constraint); break; } case 13:{ - MMInteractionPtr angle = this->ParseAngle(current_line,true); + InteractionPtr angle = this->ParseAngle(current_line,true); ff_->AddAngle(angle); ff_bonded_types_[1] = angle->GetFuncType(); break; } case 14:{ - MMInteractionPtr p = this->ParseDihedral(current_line,true); + InteractionPtr p = this->ParseDihedral(current_line,true); FuncType functype = p->GetFuncType(); if(functype == PeriodicDihedral){ @@ -469,17 +469,17 @@ void GromacsReader::ParseForcefield(std::vector<std::vector<String> >& content){ break; } case 15:{ - MMInteractionPtr lj = this->ParseLJ(current_line,true); + InteractionPtr lj = this->ParseLJ(current_line,true); ff_->AddLJ(lj); break; } case 16:{ - MMInteractionPtr genborn = this->ParseGenborn(current_line,true); + InteractionPtr genborn = this->ParseGenborn(current_line,true); ff_->AddImplicitGenborn(genborn); break; } case 17:{ - MMInteractionPtr lj_pair = this->ParseLJPair(current_line,true); + InteractionPtr lj_pair = this->ParseLJPair(current_line,true); ff_->AddLJPair(lj_pair); break; } @@ -506,7 +506,7 @@ void GromacsReader::ParseForcefield(std::vector<std::vector<String> >& content){ break; } case 20:{ - MMInteractionPtr cmap = this->ParseCMap(current_line,true); + InteractionPtr cmap = this->ParseCMap(current_line,true); ff_->AddCMap(cmap); break; } @@ -1103,7 +1103,7 @@ BuildingBlockPtr GromacsReader::BlockFromITP(const std::vector<std::vector<Strin current_line[2] = index_name_mapper[boost::lexical_cast<int>(current_line[2])]; current_line[3] = index_name_mapper[boost::lexical_cast<int>(current_line[3])]; - MMInteractionPtr int_ptr = this->ParseDihedral(current_line,false); + InteractionPtr int_ptr = this->ParseDihedral(current_line,false); FuncType functype = int_ptr->GetFuncType(); if(functype == PeriodicDihedral){ @@ -1117,7 +1117,7 @@ BuildingBlockPtr GromacsReader::BlockFromITP(const std::vector<std::vector<Strin case 5:{ //current_line[0] = index_name_mapper[boost::lexical_cast<int>(current_line[0])]; //current_line[1] = index_name_mapper[boost::lexical_cast<int>(current_line[1])]; - //p->exclusions_.push_back(MMInteraction::ParseExclusion(current_line,false)); + //p->exclusions_.push_back(Interaction::ParseExclusion(current_line,false)); break; } case 6:{ @@ -1142,9 +1142,9 @@ BuildingBlockPtr GromacsReader::BlockFromITP(const std::vector<std::vector<Strin std::vector<String> names; - MMInteractionPtr p1(new MMInteraction(DistanceConstraint)); - MMInteractionPtr p2(new MMInteraction(DistanceConstraint)); - MMInteractionPtr p3(new MMInteraction(DistanceConstraint)); + InteractionPtr p1(new Interaction(DistanceConstraint)); + InteractionPtr p2(new Interaction(DistanceConstraint)); + InteractionPtr p3(new Interaction(DistanceConstraint)); //first constraint dist => O - H parameters.push_back(boost::lexical_cast<Real>(current_line[2])); @@ -1249,7 +1249,7 @@ BlockModifierPtr GromacsReader::ParseBlockModifier(const std::vector<std::vector } -MMInteractionPtr GromacsReader::ParseBond(const std::vector<String>& data, +InteractionPtr GromacsReader::ParseBond(const std::vector<String>& data, bool type_definition, FuncType functype){ @@ -1280,7 +1280,7 @@ MMInteractionPtr GromacsReader::ParseBond(const std::vector<String>& data, atom_definition.push_back(data[0]); atom_definition.push_back(data[1]); - MMInteractionPtr p(new MMInteraction(functype)); + InteractionPtr p(new Interaction(functype)); if(type_definition) p->SetTypes(atom_definition); else p->SetNames(atom_definition); @@ -1299,7 +1299,7 @@ MMInteractionPtr GromacsReader::ParseBond(const std::vector<String>& data, return p; } -MMInteractionPtr GromacsReader::ParseAngle(const std::vector<String>& data, +InteractionPtr GromacsReader::ParseAngle(const std::vector<String>& data, bool type_definition, FuncType functype){ @@ -1330,7 +1330,7 @@ MMInteractionPtr GromacsReader::ParseAngle(const std::vector<String>& data, atom_definition.push_back(data[1]); atom_definition.push_back(data[2]); - MMInteractionPtr p(new MMInteraction(functype)); + InteractionPtr p(new Interaction(functype)); if(type_definition) p->SetTypes(atom_definition); else p->SetNames(atom_definition); @@ -1357,7 +1357,7 @@ MMInteractionPtr GromacsReader::ParseAngle(const std::vector<String>& data, return p; } -MMInteractionPtr GromacsReader::ParseDihedral(const std::vector<String>& data, +InteractionPtr GromacsReader::ParseDihedral(const std::vector<String>& data, bool type_definition, FuncType functype){ if(data.size() < 4){ @@ -1389,7 +1389,7 @@ MMInteractionPtr GromacsReader::ParseDihedral(const std::vector<String>& data, atom_definition.push_back(data[2]); atom_definition.push_back(data[3]); - MMInteractionPtr p(new MMInteraction(functype)); + InteractionPtr p(new Interaction(functype)); if(type_definition) p->SetTypes(atom_definition); else p->SetNames(atom_definition); @@ -1414,7 +1414,7 @@ MMInteractionPtr GromacsReader::ParseDihedral(const std::vector<String>& data, return p; } -MMInteractionPtr GromacsReader::ParseCMap(const std::vector<String>& data, +InteractionPtr GromacsReader::ParseCMap(const std::vector<String>& data, bool type_definition, FuncType functype){ if(data.size() < 5){ @@ -1432,7 +1432,7 @@ MMInteractionPtr GromacsReader::ParseCMap(const std::vector<String>& data, atom_definition.push_back(data[3]); atom_definition.push_back(data[4]); - MMInteractionPtr p(new MMInteraction(functype)); + InteractionPtr p(new Interaction(functype)); if(type_definition) p->SetTypes(atom_definition); else p->SetNames(atom_definition); @@ -1467,7 +1467,7 @@ MMInteractionPtr GromacsReader::ParseCMap(const std::vector<String>& data, } -MMInteractionPtr GromacsReader::ParseLJ(const std::vector<String>& data, +InteractionPtr GromacsReader::ParseLJ(const std::vector<String>& data, bool type_definition, FuncType functype){ @@ -1482,7 +1482,7 @@ MMInteractionPtr GromacsReader::ParseLJ(const std::vector<String>& data, std::vector<String> atom_definition; atom_definition.push_back(data[0]); - MMInteractionPtr p(new MMInteraction(functype)); + InteractionPtr p(new Interaction(functype)); if(type_definition) p->SetTypes(atom_definition); else p->SetNames(atom_definition); @@ -1501,7 +1501,7 @@ MMInteractionPtr GromacsReader::ParseLJ(const std::vector<String>& data, } -MMInteractionPtr GromacsReader::ParseLJPair(const std::vector<String>& data, +InteractionPtr GromacsReader::ParseLJPair(const std::vector<String>& data, bool type_definition, FuncType functype){ @@ -1532,7 +1532,7 @@ MMInteractionPtr GromacsReader::ParseLJPair(const std::vector<String>& data, atom_definition.push_back(data[0]); atom_definition.push_back(data[1]); - MMInteractionPtr p(new MMInteraction(functype)); + InteractionPtr p(new Interaction(functype)); if(type_definition) p->SetTypes(atom_definition); else p->SetNames(atom_definition); @@ -1550,7 +1550,7 @@ MMInteractionPtr GromacsReader::ParseLJPair(const std::vector<String>& data, return p; } -MMInteractionPtr GromacsReader::ParseConstraint(const std::vector<String>& data, +InteractionPtr GromacsReader::ParseConstraint(const std::vector<String>& data, bool type_definition, FuncType functype){ @@ -1581,7 +1581,7 @@ MMInteractionPtr GromacsReader::ParseConstraint(const std::vector<String>& data, atom_definition.push_back(data[0]); atom_definition.push_back(data[1]); - MMInteractionPtr p(new MMInteraction(functype)); + InteractionPtr p(new Interaction(functype)); if(type_definition) p->SetTypes(atom_definition); else p->SetNames(atom_definition); @@ -1598,7 +1598,7 @@ MMInteractionPtr GromacsReader::ParseConstraint(const std::vector<String>& data, return p; } -MMInteractionPtr GromacsReader::ParseGenborn(const std::vector<String>& data, +InteractionPtr GromacsReader::ParseGenborn(const std::vector<String>& data, bool type_definition, FuncType functype){ @@ -1612,7 +1612,7 @@ MMInteractionPtr GromacsReader::ParseGenborn(const std::vector<String>& data, functype = GBSA; //bit hacky, I know, but there is only one type for gbsa anyway.... - MMInteractionPtr p(new MMInteraction(functype)); + InteractionPtr p(new Interaction(functype)); if(type_definition) p->SetTypes(atom_definition); else p->SetNames(atom_definition); @@ -1631,7 +1631,7 @@ MMInteractionPtr GromacsReader::ParseGenborn(const std::vector<String>& data, } -MMInteractionPtr GromacsReader::ParseExclusion(const std::vector<String>& data, +InteractionPtr GromacsReader::ParseExclusion(const std::vector<String>& data, bool type_definition, FuncType functype){ @@ -1645,7 +1645,7 @@ MMInteractionPtr GromacsReader::ParseExclusion(const std::vector<String>& data, atom_definition.push_back(data[0]); atom_definition.push_back(data[1]); - MMInteractionPtr p(new MMInteraction(functype)); + InteractionPtr p(new Interaction(functype)); if(type_definition) p->SetTypes(atom_definition); else p->SetNames(atom_definition); @@ -1682,7 +1682,7 @@ void GromacsReader::ParseCHARMMPRM(std::vector<std::vector<String> >& content){ break; } case 1:{ //bonds - MMInteractionPtr p(new MMInteraction(HarmonicBond)); + InteractionPtr p(new Interaction(HarmonicBond)); std::vector<String> types; std::vector<Real> parameters; types.push_back(current_line[0]); @@ -1699,7 +1699,7 @@ void GromacsReader::ParseCHARMMPRM(std::vector<std::vector<String> >& content){ break; } case 2:{ //angles - MMInteractionPtr p(new MMInteraction(UreyBradleyAngle)); + InteractionPtr p(new Interaction(UreyBradleyAngle)); std::vector<String> types; std::vector<Real> parameters; types.push_back(current_line[0]); @@ -1725,7 +1725,7 @@ void GromacsReader::ParseCHARMMPRM(std::vector<std::vector<String> >& content){ break; } case 3:{ //diherals - MMInteractionPtr p(new MMInteraction(PeriodicDihedral)); + InteractionPtr p(new Interaction(PeriodicDihedral)); std::vector<String> types; std::vector<Real> parameters; types.push_back(current_line[0]); @@ -1745,7 +1745,7 @@ void GromacsReader::ParseCHARMMPRM(std::vector<std::vector<String> >& content){ break; } case 4:{ //improper - MMInteractionPtr p(new MMInteraction(HarmonicImproper)); + InteractionPtr p(new Interaction(HarmonicImproper)); std::vector<String> types; std::vector<Real> parameters; types.push_back(current_line[0]); @@ -1787,7 +1787,7 @@ void GromacsReader::ParseCHARMMPRM(std::vector<std::vector<String> >& content){ throw ost::io::IOException(ss.str()); } if(parameters.size() == dim*dim+1){ - MMInteractionPtr p(new MMInteraction(CMap)); + InteractionPtr p(new Interaction(CMap)); p->SetTypes(types); p->SetParam(parameters); ff_->AddCMap(p); @@ -1815,7 +1815,7 @@ void GromacsReader::ParseCHARMMPRM(std::vector<std::vector<String> >& content){ }catch(std::exception& e){ throw ost::io::IOException("Could not cast LJ parameters into real type!"); } - MMInteractionPtr p(new MMInteraction(LJ)); + InteractionPtr p(new Interaction(LJ)); p->SetTypes(types); p->SetParam(parameters); ff_->AddLJ(p); @@ -1846,7 +1846,7 @@ void GromacsReader::ParseCHARMMPRM(std::vector<std::vector<String> >& content){ //have explicitely defined 1,4 interactions for(uint i = 0; i < lj_14_types.size(); ++i){ for(uint j = i; j < lj_14_types.size(); ++j){ - MMInteractionPtr p(new MMInteraction(LJPair)); + InteractionPtr p(new Interaction(LJPair)); std::vector<String> types; std::vector<Real> parameters; types.push_back(lj_14_types[i]); @@ -1861,7 +1861,7 @@ void GromacsReader::ParseCHARMMPRM(std::vector<std::vector<String> >& content){ //let's add all pairwise 1,4 interactions, where only one partner has explicitely defined 1,4 interactions for(uint i = 0; i < lj_14_types.size(); ++i){ for(uint j = 0; j < lj_types.size(); ++j){ - MMInteractionPtr p(new MMInteraction(LJPair)); + InteractionPtr p(new Interaction(LJPair)); std::vector<String> types; std::vector<Real> parameters; types.push_back(lj_14_types[i]); @@ -1914,7 +1914,7 @@ void GromacsReader::ParseCHARMMRTF(std::vector<std::vector<String> >& content){ case 17:{//bond int num_bonds = (current_line.size()-1) / 2; for(int i = 0; i < num_bonds; ++i){ - MMInteractionPtr p(new MMInteraction(HarmonicBond)); + InteractionPtr p(new Interaction(HarmonicBond)); std::vector<String> names; names.push_back(current_line[i*2+1]); names.push_back(current_line[i*2+2]); @@ -1927,7 +1927,7 @@ void GromacsReader::ParseCHARMMRTF(std::vector<std::vector<String> >& content){ case 18:{//angle int num_angles = (current_line.size()-1) / 3; for(int i = 0; i < num_angles; ++i){ - MMInteractionPtr p(new MMInteraction(UreyBradleyAngle)); + InteractionPtr p(new Interaction(UreyBradleyAngle)); std::vector<String> names; names.push_back(current_line[i*3+1]); names.push_back(current_line[i*3+2]); @@ -1941,7 +1941,7 @@ void GromacsReader::ParseCHARMMRTF(std::vector<std::vector<String> >& content){ case 19:{//dihedral int num_dihedrals = (current_line.size()-1) / 4; for(int i = 0; i < num_dihedrals; ++i){ - MMInteractionPtr p(new MMInteraction(PeriodicDihedral)); + InteractionPtr p(new Interaction(PeriodicDihedral)); std::vector<String> names; names.push_back(current_line[i*4+1]); names.push_back(current_line[i*4+2]); @@ -1956,7 +1956,7 @@ void GromacsReader::ParseCHARMMRTF(std::vector<std::vector<String> >& content){ case 20:{//improper int num_impropers = (current_line.size()-1) / 4; for(int i = 0; i < num_impropers; ++i){ - MMInteractionPtr p(new MMInteraction(HarmonicImproper)); + InteractionPtr p(new Interaction(HarmonicImproper)); std::vector<String> names; names.push_back(current_line[i*4+1]); names.push_back(current_line[i*4+2]); @@ -1971,7 +1971,7 @@ void GromacsReader::ParseCHARMMRTF(std::vector<std::vector<String> >& content){ case 5:{//cmap int num_cmaps = (current_line.size()-1) / 8; for(int i = 0; i < num_cmaps; ++i){ - MMInteractionPtr p(new MMInteraction(CMap)); + InteractionPtr p(new Interaction(CMap)); std::vector<String> names; names.push_back(current_line[i*4+1]); names.push_back(current_line[i*4+2]); @@ -2007,7 +2007,7 @@ void GromacsReader::ParseCHARMMRTF(std::vector<std::vector<String> >& content){ case 26:{ //double =>basically a bond int num_bonds = (current_line.size()-1) / 2; for(int i = 0; i < num_bonds; ++i){ - MMInteractionPtr p(new MMInteraction(HarmonicBond)); + InteractionPtr p(new Interaction(HarmonicBond)); std::vector<String> names; names.push_back(current_line[i*2+1]); names.push_back(current_line[i*2+2]); diff --git a/modules/mol/mm/src/gromacs_reader.hh b/modules/mol/mm/src/gromacs_reader.hh index 89a2e20a45edbbb2e63c860800a80f704339eefc..31d4ddbfeac26d97d9845d25daa9be61c0be4acf 100644 --- a/modules/mol/mm/src/gromacs_reader.hh +++ b/modules/mol/mm/src/gromacs_reader.hh @@ -11,7 +11,7 @@ #include <ost/base.hh> #include <ost/io/io_exception.hh> #include <ost/mol/mm/forcefield.hh> -#include <ost/mol/mm/mm_interaction.hh> +#include <ost/mol/mm/interaction.hh> #include <ost/mol/mm/gromacs_block_modifiers.hh> @@ -103,39 +103,39 @@ public: private: - MMInteractionPtr ParseBond(const std::vector<String>& data, + InteractionPtr ParseBond(const std::vector<String>& data, bool type_definition, FuncType functype = Invalid); - MMInteractionPtr ParseAngle(const std::vector<String>& data, + InteractionPtr ParseAngle(const std::vector<String>& data, bool type_definition, FuncType functype = Invalid); - MMInteractionPtr ParseDihedral(const std::vector<String>& data, + InteractionPtr ParseDihedral(const std::vector<String>& data, bool type_definition, FuncType functype = Invalid); - MMInteractionPtr ParseCMap(const std::vector<String>& data, + InteractionPtr ParseCMap(const std::vector<String>& data, bool type_definition, FuncType functype = Invalid); - MMInteractionPtr ParseLJ(const std::vector<String>& data, + InteractionPtr ParseLJ(const std::vector<String>& data, bool type_definition, FuncType functype = Invalid); - MMInteractionPtr ParseLJPair(const std::vector<String>& data, + InteractionPtr ParseLJPair(const std::vector<String>& data, bool type_definition, FuncType functype = Invalid); - MMInteractionPtr ParseConstraint(const std::vector<String>& data, + InteractionPtr ParseConstraint(const std::vector<String>& data, bool type_definition, FuncType functype = Invalid); - MMInteractionPtr ParseGenborn(const std::vector<String>& data, + InteractionPtr ParseGenborn(const std::vector<String>& data, bool type_definition, FuncType functype = Invalid); - MMInteractionPtr ParseExclusion(const std::vector<String>& data, + InteractionPtr ParseExclusion(const std::vector<String>& data, bool type_definition, FuncType functype = Invalid); diff --git a/modules/mol/mm/src/heuristic_block_modifiers.cc b/modules/mol/mm/src/heuristic_block_modifiers.cc index 9d415088a4c688996284262994889ac44f4e936d..46b1850acbb73b0399a79ead0173d7505eaf7ba0 100644 --- a/modules/mol/mm/src/heuristic_block_modifiers.cc +++ b/modules/mol/mm/src/heuristic_block_modifiers.cc @@ -12,7 +12,7 @@ void HeuristicHydrogenConstructor::ApplyOnBuildingBlock(BuildingBlockPtr p){ HeuristicHydrogenConstructor::HeuristicHydrogenConstructor(BuildingBlockPtr block){ std::vector<String> atom_names = block->GetAtoms(); - std::vector<MMInteractionPtr> bonds = block->GetBonds(); + std::vector<InteractionPtr> bonds = block->GetBonds(); for(std::vector<String>::iterator aname = atom_names.begin(); aname != atom_names.end(); ++aname){ @@ -21,7 +21,7 @@ HeuristicHydrogenConstructor::HeuristicHydrogenConstructor(BuildingBlockPtr bloc std::vector<String> antecedent_names, hydrogen_names; String aname_other; - for (std::vector<MMInteractionPtr>::iterator i = bonds.begin() ; + for (std::vector<InteractionPtr>::iterator i = bonds.begin() ; i != bonds.end(); ++i){ std::vector<String> bond_names=(*i)->GetNames(); diff --git a/modules/mol/mm/src/mm_interaction.cc b/modules/mol/mm/src/interaction.cc similarity index 82% rename from modules/mol/mm/src/mm_interaction.cc rename to modules/mol/mm/src/interaction.cc index 093e2d122e43773e786c1afa5b3440e109d65c2d..2831edbbce1bd45b05d168e8f0b68d5ef41b64b7 100644 --- a/modules/mol/mm/src/mm_interaction.cc +++ b/modules/mol/mm/src/interaction.cc @@ -1,14 +1,14 @@ -#include <ost/mol/mm/mm_interaction.hh> +#include <ost/mol/mm/interaction.hh> namespace ost { namespace mol{ namespace mm{ -MMInteraction::MMInteraction(FuncType func_type): func_type_(func_type), - set_parameters_(false), - has_type_wildcard_(false), - has_name_wildcard_(false){ } +Interaction::Interaction(FuncType func_type): func_type_(func_type), + set_parameters_(false), + has_type_wildcard_(false), + has_name_wildcard_(false){ } -void MMInteraction::SetTypes(std::vector<String> types){ +void Interaction::SetTypes(std::vector<String> types){ if(!this->CheckSetNamesTypes(types)){ throw ost::Error("Tried to set invalid number of types to interaction!"); } @@ -19,7 +19,7 @@ void MMInteraction::SetTypes(std::vector<String> types){ else has_type_wildcard_ = false; } -void MMInteraction::SetNames(std::vector<String> names){ +void Interaction::SetNames(std::vector<String> names){ if(!this->CheckSetNamesTypes(names)){ throw ost::Error("Tried to set invalid number of names to interaction!"); } @@ -30,7 +30,7 @@ void MMInteraction::SetNames(std::vector<String> names){ else has_name_wildcard_ = false; } -void MMInteraction::SetParam(std::vector<Real>& parameters){ +void Interaction::SetParam(std::vector<Real>& parameters){ if(!this->CheckSetParam(parameters)){ throw ost::Error("Tried to set invalid number of parameters to interaction!"); } @@ -38,7 +38,7 @@ void MMInteraction::SetParam(std::vector<Real>& parameters){ set_parameters_ = true; } -ost::mol::AtomHandleList MMInteraction::GetAtoms(const ost::mol::ResidueHandle& res) const{ +ost::mol::AtomHandleList Interaction::GetAtoms(const ost::mol::ResidueHandle& res) const{ ost::mol::AtomHandleList return_list; ost::mol::ResidueHandle prev = res.GetPrev(); @@ -84,7 +84,7 @@ ost::mol::AtomHandleList MMInteraction::GetAtoms(const ost::mol::ResidueHandle& return return_list; } -bool MMInteraction::MatchTypes(const std::vector<String>& atom_types) const { +bool Interaction::MatchTypes(const std::vector<String>& atom_types) const { if(atom_types_.size() == 0) return false; if(atom_types.size() != atom_types_.size()) return false; @@ -102,7 +102,7 @@ bool MMInteraction::MatchTypes(const std::vector<String>& atom_types) const { return match || reverse_match; } -bool MMInteraction::MatchNames(const std::vector<String>& atom_names) const { +bool Interaction::MatchNames(const std::vector<String>& atom_names) const { if(atom_names_.size() == 0) return false; if(atom_names.size() != atom_names_.size()) return false; @@ -120,7 +120,7 @@ bool MMInteraction::MatchNames(const std::vector<String>& atom_names) const { return match || r_match; } -bool MMInteraction::ReplaceAtom(const String& name, const String& new_name, const String& new_type){ +bool Interaction::ReplaceAtom(const String& name, const String& new_name, const String& new_type){ for(uint i = 0; i < atom_names_.size(); ++i){ if(atom_names_[i] == name){ @@ -135,15 +135,15 @@ bool MMInteraction::ReplaceAtom(const String& name, const String& new_name, cons return false; } -bool MMInteraction::HasName(const String& name) const{ +bool Interaction::HasName(const String& name) const{ return std::find(atom_names_.begin(),atom_names_.end(),name) != atom_names_.end(); } -bool MMInteraction::HasType(const String& type) const{ +bool Interaction::HasType(const String& type) const{ return std::find(atom_types_.begin(),atom_types_.end(),type) != atom_types_.end(); } -bool MMInteraction::CheckSetNamesTypes(std::vector<String>& types){ +bool Interaction::CheckSetNamesTypes(std::vector<String>& types){ switch(func_type_){ case HarmonicBond: return types.size() == 2; @@ -164,7 +164,7 @@ bool MMInteraction::CheckSetNamesTypes(std::vector<String>& types){ } } -bool MMInteraction::CheckSetParam(std::vector<Real>& param){ +bool Interaction::CheckSetParam(std::vector<Real>& param){ switch(func_type_){ case HarmonicBond: return param.size() == 2; diff --git a/modules/mol/mm/src/mm_interaction.hh b/modules/mol/mm/src/interaction.hh similarity index 95% rename from modules/mol/mm/src/mm_interaction.hh rename to modules/mol/mm/src/interaction.hh index ca69e78b15117d729cc9b10e823d4cc6a66d7922..0d495b27537ff9e35d13d78e6fc021e237bf6fd6 100644 --- a/modules/mol/mm/src/mm_interaction.hh +++ b/modules/mol/mm/src/interaction.hh @@ -17,8 +17,8 @@ namespace ost { namespace mol{ namespace mm{ -class MMInteraction; -typedef boost::shared_ptr<MMInteraction> MMInteractionPtr; +class Interaction; +typedef boost::shared_ptr<Interaction> InteractionPtr; enum FuncType{ Invalid, @@ -38,10 +38,10 @@ enum FuncType{ HarmonicDistanceRestraint }; -class MMInteraction{ +class Interaction{ public: - MMInteraction(FuncType func_type); + Interaction(FuncType func_type); void SetTypes(std::vector<String> types); @@ -141,7 +141,6 @@ private: std::vector<String> atom_names_; }; - }}} //ns #endif diff --git a/modules/mol/mm/src/mm_modeller.cc b/modules/mol/mm/src/modeller.cc similarity index 95% rename from modules/mol/mm/src/mm_modeller.cc rename to modules/mol/mm/src/modeller.cc index 2cc9714833324a7bb92a8be3582656190d3e3a9f..9e87752bf96316426b68247da9ac002f5948c0ca 100644 --- a/modules/mol/mm/src/mm_modeller.cc +++ b/modules/mol/mm/src/modeller.cc @@ -1,9 +1,9 @@ -#include <ost/mol/mm/mm_modeller.hh> +#include <ost/mol/mm/modeller.hh> namespace ost{ namespace mol{ namespace mm{ -void MMModeller::GenerateDisulfidBonds(ost::mol::EntityHandle& handle){ +void Modeller::GenerateDisulfidBonds(ost::mol::EntityHandle& handle){ ost::mol::ResidueHandleList res_list = handle.GetResidueList(); ost::mol::XCSEditor ed = handle.EditXCS(); @@ -31,7 +31,7 @@ void MMModeller::GenerateDisulfidBonds(ost::mol::EntityHandle& handle){ } } -void MMModeller::GenerateCYSHEMEBonds(ost::mol::EntityHandle& handle){ +void Modeller::GenerateCYSHEMEBonds(ost::mol::EntityHandle& handle){ ost::mol::ResidueHandleList res_list = handle.GetResidueList(); ost::mol::XCSEditor ed = handle.EditXCS(); @@ -85,7 +85,7 @@ void MMModeller::GenerateCYSHEMEBonds(ost::mol::EntityHandle& handle){ } } -void MMModeller::GenerateHISHEMEBonds(ost::mol::EntityHandle& handle){ +void Modeller::GenerateHISHEMEBonds(ost::mol::EntityHandle& handle){ ost::mol::ResidueHandleList res_list = handle.GetResidueList(); ost::mol::XCSEditor ed = handle.EditXCS(); @@ -111,7 +111,7 @@ void MMModeller::GenerateHISHEMEBonds(ost::mol::EntityHandle& handle){ } } -void MMModeller::GenerateMETHEMEBonds(ost::mol::EntityHandle& handle){ +void Modeller::GenerateMETHEMEBonds(ost::mol::EntityHandle& handle){ ost::mol::ResidueHandleList res_list = handle.GetResidueList(); ost::mol::XCSEditor ed = handle.EditXCS(); @@ -136,7 +136,7 @@ void MMModeller::GenerateMETHEMEBonds(ost::mol::EntityHandle& handle){ } } -void MMModeller::LowerPrecision(ost::mol::EntityHandle& handle){ +void Modeller::LowerPrecision(ost::mol::EntityHandle& handle){ ost::mol::AtomHandleList atom_list = handle.GetAtomList(); ost::mol::XCSEditor ed = handle.EditXCS(ost::mol::BUFFERED_EDIT); @@ -154,7 +154,7 @@ void MMModeller::LowerPrecision(ost::mol::EntityHandle& handle){ ed.UpdateICS(); } -void MMModeller::AssignPDBNaming(ost::mol::EntityHandle& handle){ +void Modeller::AssignPDBNaming(ost::mol::EntityHandle& handle){ std::map<String,String> gromacs_to_pdb; gromacs_to_pdb["ARGN"] = "ARG"; @@ -206,7 +206,7 @@ void MMModeller::AssignPDBNaming(ost::mol::EntityHandle& handle){ } } -void MMModeller::AssignGromacsNaming(ost::mol::EntityHandle& handle){ +void Modeller::AssignGromacsNaming(ost::mol::EntityHandle& handle){ ost::mol::XCSEditor ed = handle.EditXCS(); diff --git a/modules/mol/mm/src/mm_modeller.hh b/modules/mol/mm/src/modeller.hh similarity index 98% rename from modules/mol/mm/src/mm_modeller.hh rename to modules/mol/mm/src/modeller.hh index 682f5a885ba37e829e96a35c410923350c7081d1..814a5edaadf33f23cd02b6fa9c9ae8ea557a6933 100644 --- a/modules/mol/mm/src/mm_modeller.hh +++ b/modules/mol/mm/src/modeller.hh @@ -29,7 +29,7 @@ namespace ost { namespace mol{ namespace mm{ -class MMModeller{ +class Modeller{ public: static void GenerateDisulfidBonds(ost::mol::EntityHandle& handle); diff --git a/modules/mol/mm/src/mm_observer.cc b/modules/mol/mm/src/observer.cc similarity index 99% rename from modules/mol/mm/src/mm_observer.cc rename to modules/mol/mm/src/observer.cc index aa0d5c5ee5e24b08f7993778c795b6c1bebecc9b..5ea1cbe7292a583df2d6fa944d58d1fd10f6986a 100644 --- a/modules/mol/mm/src/mm_observer.cc +++ b/modules/mol/mm/src/observer.cc @@ -1,4 +1,4 @@ -#include <ost/mol/mm/mm_observer.hh> +#include <ost/mol/mm/observer.hh> #include <OpenMM.h> namespace ost { namespace mol{ namespace mm{ diff --git a/modules/mol/mm/src/mm_observer.hh b/modules/mol/mm/src/observer.hh similarity index 94% rename from modules/mol/mm/src/mm_observer.hh rename to modules/mol/mm/src/observer.hh index eec055472e9500ede28edf4eb398ca2c1acd0bc4..815db37e0c3141af724c6204cf0b5f8bf65cf0e8 100644 --- a/modules/mol/mm/src/mm_observer.hh +++ b/modules/mol/mm/src/observer.hh @@ -21,15 +21,15 @@ namespace OpenMM{ namespace ost { namespace mol{ namespace mm{ -class MMObserver; +class Observer; class TrajObserver; class TrajWriter; -typedef boost::shared_ptr<MMObserver> MMObserverPtr; +typedef boost::shared_ptr<Observer> ObserverPtr; typedef boost::shared_ptr<TrajObserver> TrajObserverPtr; typedef boost::shared_ptr<TrajWriter> TrajWriterPtr; -class MMObserver{ +class Observer{ public: virtual void Notify() = 0; @@ -43,7 +43,7 @@ public: }; -class TrajObserver : public MMObserver{ +class TrajObserver : public Observer{ public: @@ -67,7 +67,7 @@ private: bool registered_; }; -class TrajWriter : public MMObserver{ +class TrajWriter : public Observer{ //Note, that this code is highly redundant to the code in io/mol/dcd_io.hh!!! diff --git a/modules/mol/mm/src/mm_settings.hh b/modules/mol/mm/src/settings.hh similarity index 97% rename from modules/mol/mm/src/mm_settings.hh rename to modules/mol/mm/src/settings.hh index c29ea463f0b3aa4d2e041a3b4afb888bbb489bcd..639ddc9b487b7f3d9fcdc8d7a59d4ea9ae1f5472 100644 --- a/modules/mol/mm/src/mm_settings.hh +++ b/modules/mol/mm/src/settings.hh @@ -16,9 +16,9 @@ namespace OpenMM{ namespace ost { namespace mol{ namespace mm{ -struct MMSettings; +struct Settings; class TerminiExceptions; -typedef boost::shared_ptr<MMSettings> MMSettingsPtr; +typedef boost::shared_ptr<Settings> SettingsPtr; typedef boost::shared_ptr<TerminiExceptions> TerminiExceptionsPtr; enum Platform{ @@ -64,9 +64,9 @@ private: }; -struct MMSettings{ +struct Settings{ - MMSettings(): add_bonds(true), + Settings(): add_bonds(true), add_angles(true), add_dihedrals(true), add_impropers(true), diff --git a/modules/mol/mm/src/simulation.cc b/modules/mol/mm/src/simulation.cc index 7f10f6c392964ae1220ae513a8e12cd2f2cb1400..31fd2ec47e0ecc268c2f3ad1b8efe1faec58504c 100644 --- a/modules/mol/mm/src/simulation.cc +++ b/modules/mol/mm/src/simulation.cc @@ -4,7 +4,7 @@ namespace ost{ namespace mol{ namespace mm{ Simulation::Simulation(const ost::mol::EntityHandle& handle, - const MMSettingsPtr settings){ + const SettingsPtr settings){ //note, that ent_ will be "completed" inside this function! //(hydrogens and shit) @@ -16,7 +16,7 @@ Simulation::Simulation(const ost::mol::EntityHandle& handle, Simulation::Simulation(const TopologyPtr top, const ost::mol::EntityHandle& handle, - const MMSettingsPtr settings){ + const SettingsPtr settings){ if(static_cast<uint>(handle.GetAtomCount()) != top->GetNumParticles()){ throw ost::Error("Number of atoms in entity must be consistent with number of particles in topology!"); @@ -119,7 +119,7 @@ void Simulation::Save(const String& filename){ context_->createCheckpoint(stream); } -SimulationPtr Simulation::Load(const String& filename, MMSettingsPtr settings){ +SimulationPtr Simulation::Load(const String& filename, SettingsPtr settings){ if (!boost::filesystem::exists(filename)) { std::stringstream ss; ss << "Could not open simulation File '" @@ -249,7 +249,7 @@ SimulationPtr Simulation::Load(const String& filename, MMSettingsPtr settings){ void Simulation::Init(const TopologyPtr top, - const MMSettingsPtr settings){ + const SettingsPtr settings){ top_ = top; @@ -449,7 +449,7 @@ Real Simulation::GetPotentialEnergy(){ return energy; } -void Simulation::Register(MMObserverPtr o){ +void Simulation::Register(ObserverPtr o){ observers_.push_back(o); time_to_notify_.push_back(o->Rythm()); o->Init(context_,top_,ent_); diff --git a/modules/mol/mm/src/simulation.hh b/modules/mol/mm/src/simulation.hh index 8996995254017beb1b3f5e4d56c9bdbc19c3cad8..9d3a295e999cba7e4eb5a99f5ccef17d762db7d0 100644 --- a/modules/mol/mm/src/simulation.hh +++ b/modules/mol/mm/src/simulation.hh @@ -8,14 +8,12 @@ #include <ost/mol/mm/system_creator.hh> #include <ost/mol/mm/topology.hh> #include <ost/mol/mm/topology_creator.hh> -#include <ost/mol/mm/mm_settings.hh> -#include <ost/mol/mm/mm_modeller.hh> +#include <ost/mol/mm/settings.hh> +#include <ost/mol/mm/modeller.hh> #include <ost/geom/vec3.hh> -#include <ost/mol/mm/mm_observer.hh> +#include <ost/mol/mm/observer.hh> #include <ost/mol/mm/state_extractor.hh> #include <ost/mol/mm/steep.hh> -#include <ost/mol/mm/mm_interaction.hh> - #include <time.h> @@ -40,15 +38,15 @@ class Simulation { public: Simulation(const ost::mol::EntityHandle& handle, - const MMSettingsPtr settings); + const SettingsPtr settings); Simulation(const ost::mol::mm::TopologyPtr top, const ost::mol::EntityHandle& handle, - const MMSettingsPtr settings); + const SettingsPtr settings); void Save(const String& filename); - static SimulationPtr Load(const String& filename, MMSettingsPtr settings); + static SimulationPtr Load(const String& filename, SettingsPtr settings); ost::mol::EntityHandle GetEntity() { return ent_; } @@ -78,7 +76,7 @@ public: void Steps(int steps); - void Register(MMObserverPtr o); + void Register(ObserverPtr o); void ResetHarmonicBond(uint index, Real bond_length, Real force_constant); @@ -124,7 +122,7 @@ private: Simulation() { } //hidden constructor... void Init(const ost::mol::mm::TopologyPtr top, - const MMSettingsPtr settings); + const SettingsPtr settings); int TimeToNextNotification(); @@ -132,7 +130,7 @@ private: IntegratorPtr integrator_; ContextPtr context_; TopologyPtr top_; - std::vector<MMObserverPtr> observers_; + std::vector<ObserverPtr> observers_; std::vector<int> time_to_notify_; std::map<FuncType,uint> system_force_mapper_; ost::mol::EntityHandle ent_; diff --git a/modules/mol/mm/src/system_creator.cc b/modules/mol/mm/src/system_creator.cc index 4c7eabd90a3435f5ffb1423b0e925e7e61b2e338..02ec5bec27914ff093eff78c586c1a686340945a 100644 --- a/modules/mol/mm/src/system_creator.cc +++ b/modules/mol/mm/src/system_creator.cc @@ -4,7 +4,7 @@ namespace ost{ namespace mol{ namespace mm{ SystemPtr SystemCreator::Create(const TopologyPtr top, - const MMSettingsPtr settings, + const SettingsPtr settings, std::map<FuncType,uint>& mapper){ uint mapper_index = 0; diff --git a/modules/mol/mm/src/system_creator.hh b/modules/mol/mm/src/system_creator.hh index 58b06b05631a936c5ec8eb9f5f8f07993d5ec9ab..3dc507c1ad4a9cb8d4aa4123dd5b397dbf4d6626 100644 --- a/modules/mol/mm/src/system_creator.hh +++ b/modules/mol/mm/src/system_creator.hh @@ -12,9 +12,8 @@ #include <ost/mol/mm/forcefield.hh> #include <ost/mol/mm/buildingblock.hh> #include <ost/mol/mm/block_modifiers.hh> -#include <ost/mol/mm/mm_interaction.hh> -#include <ost/mol/mm/mm_settings.hh> -#include <ost/mol/mm/mm_modeller.hh> +#include <ost/mol/mm/settings.hh> +#include <ost/mol/mm/modeller.hh> #include <ost/mol/mm/index.hh> #include <ost/mol/mm/topology.hh> @@ -35,7 +34,7 @@ typedef boost::shared_ptr<OpenMM::System> SystemPtr; class SystemCreator { public: static SystemPtr Create(const TopologyPtr top, - const MMSettingsPtr settings, + const SettingsPtr settings, std::map<FuncType,uint>& mapper); }; diff --git a/modules/mol/mm/src/topology.cc b/modules/mol/mm/src/topology.cc index 99dc19c47e0bf35c0157cd47f1d1f5849ae324a0..e4771197da32383b39b18022d92a724dd31fd11b 100644 --- a/modules/mol/mm/src/topology.cc +++ b/modules/mol/mm/src/topology.cc @@ -1,5 +1,4 @@ #include <ost/mol/mm/topology.hh> -#include <ost/mol/mm/mm_modeller.hh> namespace ost{ namespace mol{ namespace mm{ diff --git a/modules/mol/mm/src/topology.hh b/modules/mol/mm/src/topology.hh index 0c9b800d906f2d3dc6deef1c212b9a7e63349067..bc2f2bdcf6e365f98a97a665aaaf79bb6b2cc18c 100644 --- a/modules/mol/mm/src/topology.hh +++ b/modules/mol/mm/src/topology.hh @@ -15,9 +15,7 @@ #include <ost/mol/mm/buildingblock.hh> #include <ost/mol/mm/block_modifiers.hh> #include <ost/mol/mm/forcefield.hh> -#include <ost/mol/mm/mm_settings.hh> #include <ost/mol/mm/index.hh> -#include <ost/mol/mm/mm_interaction.hh> #include <ost/mol/xcs_editor.hh> #include <ost/mol/bond_handle.hh> #include <ost/mol/residue_prop.hh> diff --git a/modules/mol/mm/src/topology_creator.cc b/modules/mol/mm/src/topology_creator.cc index 6cdf0e15d5f61a0efd244d5a17253ff56bd4472f..fcf9af58200f857e9402815d555e8f9ebd7277ea 100644 --- a/modules/mol/mm/src/topology_creator.cc +++ b/modules/mol/mm/src/topology_creator.cc @@ -53,14 +53,14 @@ int GetAtomIndex(uint residue_index, namespace ost{ namespace mol{ namespace mm{ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, - const MMSettingsPtr settings){ + const SettingsPtr settings){ ost::mol::ResidueHandleList res_list = ent.GetResidueList(); ost::mol::XCSEditor ed = ent.EditXCS(ost::mol::BUFFERED_EDIT); //rename all the stuff to the gromacs naming... - MMModeller::AssignGromacsNaming(ent); + Modeller::AssignGromacsNaming(ent); //even if not reconnected yet, it gets assumed, that //peptide or nucleotide bonds are correctly set in the input entity @@ -130,7 +130,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, ed.UpdateICS(); if(settings->generate_disulfid_bonds){ - MMModeller::GenerateDisulfidBonds(ent); + Modeller::GenerateDisulfidBonds(ent); } ff->AssignFFSpecificNames(ent); @@ -268,8 +268,8 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, std::set<Index<2> > pairs_14; std::set<Index<2> > distance_constraints; //per atom parameters - std::vector<MMInteractionPtr> ljs; - std::vector<MMInteractionPtr> gbsa; + std::vector<InteractionPtr> ljs; + std::vector<InteractionPtr> gbsa; //extract all bonded interactions directly from the structure itself, //except the impropers, cmaps and exclusions. Those two get read from the building //blocks. @@ -336,13 +336,13 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, } } //impropers exclusions and cmaps get read from residuetemplates! - std::vector<MMInteractionPtr> interaction_list; + std::vector<InteractionPtr> interaction_list; std::vector<String> interaction_atom_names; if(settings->add_impropers){ for(uint i = 0; i < building_blocks.size(); ++i){ interaction_list = building_blocks[i]->GetImpropers(); - for(std::vector<MMInteractionPtr>::iterator j = interaction_list.begin(); + for(std::vector<InteractionPtr>::iterator j = interaction_list.begin(); j != interaction_list.end(); ++j){ interaction_atom_names = (*j)->GetNames(); Index<4> improper_index; @@ -357,7 +357,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, if(settings->add_cmaps){ for(uint i = 0; i < building_blocks.size(); ++i){ interaction_list = building_blocks[i]->GetCMaps(); - for(std::vector<MMInteractionPtr>::iterator j = interaction_list.begin(); + for(std::vector<InteractionPtr>::iterator j = interaction_list.begin(); j != interaction_list.end(); ++j){ interaction_atom_names = (*j)->GetNames(); Index<5> cmap_index; @@ -372,7 +372,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, if(settings->add_nonbonded && settings->add_exclusions){ for(uint i = 0; i < building_blocks.size(); ++i){ interaction_list = building_blocks[i]->GetExclusions(); - for(std::vector<MMInteractionPtr>::iterator j = interaction_list.begin(); + for(std::vector<InteractionPtr>::iterator j = interaction_list.begin(); j != interaction_list.end(); ++j){ interaction_atom_names = (*j)->GetNames(); uint one = GetAtomIndex(i,res_list,atom_indices,interaction_atom_names[0]); @@ -419,7 +419,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, //only the first is added to avoid contradicting constraints for(uint i = 0; i < building_blocks.size(); ++i){ interaction_list = building_blocks[i]->GetConstraints(); - for(std::vector<MMInteractionPtr>::iterator j = interaction_list.begin(); + for(std::vector<InteractionPtr>::iterator j = interaction_list.begin(); j != interaction_list.end(); ++j){ interaction_atom_names = (*j)->GetNames(); uint one = GetAtomIndex(i,res_list,atom_indices,interaction_atom_names[0]); @@ -452,7 +452,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, distance_constraints.insert(*i); Real distance; if(settings->ideal_bond_length_constraints){ - MMInteractionPtr bond_ptr = ff->GetBond(atom_types[(*i)[0]],atom_types[(*i)[1]]); + InteractionPtr bond_ptr = ff->GetBond(atom_types[(*i)[0]],atom_types[(*i)[1]]); parameters = bond_ptr->GetParam(); distance = parameters[0]; } @@ -466,7 +466,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, distance_constraints.insert(*i); Real distance; if(settings->ideal_bond_length_constraints){ - MMInteractionPtr bond_ptr = ff->GetBond(atom_types[(*i)[0]],atom_types[(*i)[1]]); + InteractionPtr bond_ptr = ff->GetBond(atom_types[(*i)[0]],atom_types[(*i)[1]]); parameters = bond_ptr->GetParam(); distance = parameters[0]; } @@ -530,7 +530,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, //handle bonds for(uint i = 0; i < res_list.size(); ++i){ interaction_list = building_blocks[i]->GetBonds(); - for(std::vector<MMInteractionPtr>::iterator j = interaction_list.begin(); + for(std::vector<InteractionPtr>::iterator j = interaction_list.begin(); j != interaction_list.end(); ++j){ if((*j)->IsParametrized()){ interaction_atom_names = (*j)->GetNames(); @@ -549,7 +549,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, for(std::set<Index<2> >::iterator i = bonds.begin(); i!=bonds.end(); ++i){ - MMInteractionPtr bond_ptr; + InteractionPtr bond_ptr; try{ bond_ptr = ff->GetBond(atom_types[(*i)[0]],atom_types[(*i)[1]]); } catch(ost::Error& e){ @@ -573,7 +573,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, //handle angles for(uint i = 0; i < res_list.size(); ++i){ interaction_list = building_blocks[i]->GetAngles(); - for(std::vector<MMInteractionPtr>::iterator j = interaction_list.begin(); + for(std::vector<InteractionPtr>::iterator j = interaction_list.begin(); j != interaction_list.end(); ++j){ if((*j)->IsParametrized()){ interaction_atom_names = (*j)->GetNames(); @@ -613,7 +613,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, for(std::set<Index<3> >::iterator i = angles.begin(); i!=angles.end(); ++i){ - MMInteractionPtr angle_ptr; + InteractionPtr angle_ptr; try{ angle_ptr = ff->GetAngle(atom_types[(*i)[0]], atom_types[(*i)[1]], @@ -655,7 +655,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, std::set<Index<4> > dihedrals_to_delete; for(uint i = 0; i < res_list.size(); ++i){ interaction_list = building_blocks[i]->GetDihedrals(); - for(std::vector<MMInteractionPtr>::iterator j = interaction_list.begin(); + for(std::vector<InteractionPtr>::iterator j = interaction_list.begin(); j != interaction_list.end(); ++j){ if((*j)->IsParametrized()){ interaction_atom_names = (*j)->GetNames(); @@ -702,7 +702,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, for(std::set<Index<4> >::iterator i = dihedrals.begin(); i!=dihedrals.end(); ++i){ - std::vector<MMInteractionPtr> dihedral_ptr; + std::vector<InteractionPtr> dihedral_ptr; try{ dihedral_ptr = ff->GetDihedrals(atom_types[(*i)[0]], @@ -722,7 +722,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, continue; // ignore it and continue with next interaction } - for(std::vector<MMInteractionPtr>::iterator j = dihedral_ptr.begin(); + for(std::vector<InteractionPtr>::iterator j = dihedral_ptr.begin(); j != dihedral_ptr.end(); ++j){ parameters = (*j)->GetParam(); top->AddPeriodicDihedral((*i)[0],(*i)[1],(*i)[2],(*i)[3], @@ -736,7 +736,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, std::set<Index<4> > impropers_to_delete; for(uint i = 0; i < building_blocks.size(); ++i){ interaction_list = building_blocks[i]->GetImpropers(); - for(std::vector<MMInteractionPtr>::iterator j = interaction_list.begin(); + for(std::vector<InteractionPtr>::iterator j = interaction_list.begin(); j != interaction_list.end(); ++j){ if((*j)->IsParametrized()){ //we do not have to care about the ordering, since we extracted the @@ -780,7 +780,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, for(std::set<Index<4> >::iterator i = impropers.begin(); i!=impropers.end(); ++i){ - std::vector<MMInteractionPtr> improper_ptr; + std::vector<InteractionPtr> improper_ptr; try{ improper_ptr = ff->GetImpropers(atom_types[(*i)[0]], @@ -800,7 +800,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, continue; // ignore it and continue with next interaction } - for(std::vector<MMInteractionPtr>::iterator j = improper_ptr.begin(); + for(std::vector<InteractionPtr>::iterator j = improper_ptr.begin(); j != improper_ptr.end(); ++j){ parameters = (*j)->GetParam(); switch((*j)->GetFuncType()){ @@ -826,7 +826,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, //handle cmaps for(uint i = 0; i < res_list.size(); ++i){ interaction_list = building_blocks[i]->GetCMaps(); - for(std::vector<MMInteractionPtr>::iterator j = interaction_list.begin(); + for(std::vector<InteractionPtr>::iterator j = interaction_list.begin(); j != interaction_list.end(); ++j){ if((*j)->IsParametrized()){ //we do not have to care about the ordering, since we extracted the @@ -854,7 +854,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, for(std::set<Index<5> >::iterator i = cmaps.begin(); i!=cmaps.end(); ++i){ - MMInteractionPtr cmap_ptr; + InteractionPtr cmap_ptr; try{ cmap_ptr = ff->GetCMap(atom_types[(*i)[0]], @@ -883,7 +883,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, if(settings->add_nonbonded){ - MMInteractionPtr lj_interaction; + InteractionPtr lj_interaction; std::vector<Real> sigmas; std::vector<Real> epsilons; @@ -925,7 +925,7 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, std::vector<Real> radii; std::vector<Real> scaling; for(uint i = 0; i < atom_list.size(); ++i){ - MMInteractionPtr gbsa_ptr = ff->GetImplicitGenborn(atom_types[i]); + InteractionPtr gbsa_ptr = ff->GetImplicitGenborn(atom_types[i]); if(!gbsa_ptr){ std::stringstream ss; ss << "Structure contains atom of type " << types[i] << " which is not"; @@ -948,9 +948,9 @@ TopologyPtr TopologyCreator::Create(ost::mol::EntityHandle& ent, //first, we rename to the gromacs standars... ff->AssignFFSpecificNames(ent,true); //still call the assign gromacs names function... - MMModeller::AssignGromacsNaming(ent); + Modeller::AssignGromacsNaming(ent); //let's finally do the renaming to PDB standard - MMModeller::AssignPDBNaming(ent); + Modeller::AssignPDBNaming(ent); } diff --git a/modules/mol/mm/src/topology_creator.hh b/modules/mol/mm/src/topology_creator.hh index 160590755bdb528c675cd28774e51debeb616130..7d95ac1bd63186bcaf10cc98037c09392c1fc65b 100644 --- a/modules/mol/mm/src/topology_creator.hh +++ b/modules/mol/mm/src/topology_creator.hh @@ -13,9 +13,9 @@ #include <ost/mol/mm/forcefield.hh> #include <ost/mol/mm/buildingblock.hh> #include <ost/mol/mm/block_modifiers.hh> -#include <ost/mol/mm/mm_interaction.hh> -#include <ost/mol/mm/mm_settings.hh> -#include <ost/mol/mm/mm_modeller.hh> +#include <ost/mol/mm/interaction.hh> +#include <ost/mol/mm/settings.hh> +#include <ost/mol/mm/modeller.hh> #include <ost/mol/mm/index.hh> #include <ost/mol/mm/topology.hh> @@ -28,7 +28,7 @@ typedef boost::shared_ptr<TopologyCreator> TopologyCreatorPtr; class TopologyCreator { public: static TopologyPtr Create(ost::mol::EntityHandle& ent, - const MMSettingsPtr settings); + const SettingsPtr settings); }; diff --git a/modules/mol/mm/tests/test_block.cc b/modules/mol/mm/tests/test_block.cc index 45732b4131e3d4732ef2cba57169ee8ed294ccb8..ce2a9d8768aeefdbd32983455c1f94e22450e231 100644 --- a/modules/mol/mm/tests/test_block.cc +++ b/modules/mol/mm/tests/test_block.cc @@ -1,6 +1,6 @@ #include <boost/test/unit_test.hpp> #include <boost/test/auto_unit_test.hpp> -#include <ost/mol/mm/mm_interaction.hh> +#include <ost/mol/mm/interaction.hh> #include <ost/mol/mm/buildingblock.hh> #include <ost/mol/mol.hh> #include <ost/mol/builder.hh> @@ -18,7 +18,7 @@ BOOST_AUTO_TEST_CASE(test_block_basics) BuildingBlock block = BuildingBlock(); block.AddAtom("A","a",0.5); block.AddAtom("B","b",1.0); - MMInteractionPtr bond(new MMInteraction(HarmonicBond)); + InteractionPtr bond(new Interaction(HarmonicBond)); std::vector<String> names; names.push_back("A"); names.push_back("B"); @@ -32,7 +32,7 @@ BOOST_AUTO_TEST_CASE(test_block_basics) BOOST_CHECK(block.GetType("X") == "x"); BOOST_CHECK(block.GetCharge("X")==42.0); BOOST_CHECK(block.GetAtoms().size() == 2); - std::vector<MMInteractionPtr> bonds = block.GetBonds(); + std::vector<InteractionPtr> bonds = block.GetBonds(); BOOST_CHECK(bonds[0]->HasName("X")); block.RemoveAtom("X"); BOOST_CHECK_THROW(block.GetType("X"),ost::Error); @@ -45,8 +45,8 @@ BOOST_AUTO_TEST_CASE(test_block_basics) param_one.push_back(1.0); param_two.push_back(2.0); param_two.push_back(2.0); - MMInteractionPtr bond_one(new MMInteraction(HarmonicBond)); - MMInteractionPtr bond_two(new MMInteraction(HarmonicBond)); + InteractionPtr bond_one(new Interaction(HarmonicBond)); + InteractionPtr bond_two(new Interaction(HarmonicBond)); bond_one->SetNames(names); bond_one->SetParam(param_one); bond_two->SetNames(names); @@ -93,9 +93,9 @@ BOOST_AUTO_TEST_CASE(test_connect) block.AddAtom("A","a",0.0); block.AddAtom("B","b",0.0); - MMInteractionPtr bond_one(new MMInteraction(HarmonicBond)); - MMInteractionPtr bond_two(new MMInteraction(HarmonicBond)); - MMInteractionPtr bond_three(new MMInteraction(HarmonicBond)); + InteractionPtr bond_one(new Interaction(HarmonicBond)); + InteractionPtr bond_two(new Interaction(HarmonicBond)); + InteractionPtr bond_three(new Interaction(HarmonicBond)); std::vector<String> two_string; two_string.push_back("A"); two_string.push_back("B"); @@ -125,7 +125,7 @@ BOOST_AUTO_TEST_CASE(test_connect) BOOST_CHECK_THROW(block.Connect(res_list[0],ed),ost::Error); BOOST_CHECK_THROW(block.Connect(res_list[2],ed),ost::Error); - MMInteractionPtr bond_four(new MMInteraction(HarmonicBond)); + InteractionPtr bond_four(new Interaction(HarmonicBond)); two_string[1] = "X"; bond_four->SetNames(two_string); block.AddBond(bond_four); @@ -170,9 +170,9 @@ BOOST_AUTO_TEST_CASE(test_match) BOOST_CHECK(!block.Match(res_list[1],true,info_string)); - MMInteractionPtr bond_one(new MMInteraction(HarmonicBond)); - MMInteractionPtr bond_two(new MMInteraction(HarmonicBond)); - MMInteractionPtr bond_three(new MMInteraction(HarmonicBond)); + InteractionPtr bond_one(new Interaction(HarmonicBond)); + InteractionPtr bond_two(new Interaction(HarmonicBond)); + InteractionPtr bond_three(new Interaction(HarmonicBond)); std::vector<String> names_one; names_one.push_back("A"); @@ -201,7 +201,7 @@ BOOST_AUTO_TEST_CASE(test_match) block.RemoveAtom("A"); block.AddAtom("A","a",0.0); - MMInteractionPtr constraint(new MMInteraction(DistanceConstraint)); + InteractionPtr constraint(new Interaction(DistanceConstraint)); constraint->SetNames(names_one); BOOST_CHECK(!block.Match(res_list[1],true,info_string)); block.AddConstraint(constraint); diff --git a/modules/mol/mm/tests/test_block_modifiers.cc b/modules/mol/mm/tests/test_block_modifiers.cc index 901ae4c6fa8e30a26f632a97475d7da6a50f820b..0baa79d28c0bd78fbc8d3562323077033647fd07 100644 --- a/modules/mol/mm/tests/test_block_modifiers.cc +++ b/modules/mol/mm/tests/test_block_modifiers.cc @@ -1,6 +1,6 @@ #include <boost/test/unit_test.hpp> #include <boost/test/auto_unit_test.hpp> -#include <ost/mol/mm/mm_interaction.hh> +#include <ost/mol/mm/interaction.hh> #include <ost/mol/mm/buildingblock.hh> #include <ost/mol/mol.hh> #include <ost/mol/builder.hh> @@ -19,13 +19,13 @@ BOOST_AUTO_TEST_CASE(test_gromacs_block_modifier_basics){ GromacsBlockModifier mod; //let's create some interactions - MMInteractionPtr harmonic_bond(new MMInteraction(HarmonicBond)); - MMInteractionPtr urey_bradley_angle(new MMInteraction(UreyBradleyAngle)); - MMInteractionPtr harmonic_angle(new MMInteraction(HarmonicAngle)); - MMInteractionPtr periodic_dihedral(new MMInteraction(PeriodicDihedral)); - MMInteractionPtr periodic_improper(new MMInteraction(PeriodicImproper)); - MMInteractionPtr harmonic_improper(new MMInteraction(HarmonicImproper)); - MMInteractionPtr cmap(new MMInteraction(CMap)); + InteractionPtr harmonic_bond(new Interaction(HarmonicBond)); + InteractionPtr urey_bradley_angle(new Interaction(UreyBradleyAngle)); + InteractionPtr harmonic_angle(new Interaction(HarmonicAngle)); + InteractionPtr periodic_dihedral(new Interaction(PeriodicDihedral)); + InteractionPtr periodic_improper(new Interaction(PeriodicImproper)); + InteractionPtr harmonic_improper(new Interaction(HarmonicImproper)); + InteractionPtr cmap(new Interaction(CMap)); //check whether error gets thrown, when names of interactions are not set BOOST_CHECK_THROW(mod.AddBond(harmonic_bond),ost::Error); @@ -78,20 +78,7 @@ BOOST_AUTO_TEST_CASE(test_gromacs_block_modifier_basics){ BOOST_CHECK_THROW(mod.AddDihedral(harmonic_bond),ost::Error); BOOST_CHECK_THROW(mod.AddImproper(periodic_dihedral),ost::Error); BOOST_CHECK_THROW(mod.AddCMap(periodic_improper),ost::Error); - - - - - - - - - - } - - - BOOST_AUTO_TEST_SUITE_END(); diff --git a/modules/mol/mm/tests/test_forcefield.cc b/modules/mol/mm/tests/test_forcefield.cc index a2fec9865249a2f2ba9a629352516824ad3542e1..e8c649354efcfb0c3baa7b6d0d98f1585b957212 100644 --- a/modules/mol/mm/tests/test_forcefield.cc +++ b/modules/mol/mm/tests/test_forcefield.cc @@ -1,8 +1,8 @@ #include <boost/test/unit_test.hpp> #include <boost/test/auto_unit_test.hpp> -#include <ost/mol/mm/mm_settings.hh> +#include <ost/mol/mm/settings.hh> #include <ost/mol/mm/forcefield.hh> -#include <ost/mol/mm/mm_interaction.hh> +#include <ost/mol/mm/interaction.hh> #include <ost/mol/mm/buildingblock.hh> #include <ost/mol/mm/gromacs_block_modifiers.hh> #include <ost/message.hh> @@ -85,17 +85,17 @@ BOOST_AUTO_TEST_CASE(test_forcefield_basics){ five_real.push_back(5.0); - MMInteractionPtr harmonic_bond(new MMInteraction(HarmonicBond)); - MMInteractionPtr urey_bradley_angle(new MMInteraction(UreyBradleyAngle)); - MMInteractionPtr harmonic_angle(new MMInteraction(HarmonicAngle)); - MMInteractionPtr periodic_dihedral(new MMInteraction(PeriodicDihedral)); - MMInteractionPtr periodic_improper(new MMInteraction(PeriodicImproper)); - MMInteractionPtr harmonic_improper(new MMInteraction(HarmonicImproper)); - MMInteractionPtr cmap(new MMInteraction(CMap)); - MMInteractionPtr lj(new MMInteraction(LJ)); - MMInteractionPtr lj_pair(new MMInteraction(LJPair)); - MMInteractionPtr gbsa(new MMInteraction(GBSA)); - MMInteractionPtr distance_constraint(new MMInteraction(DistanceConstraint)); + InteractionPtr harmonic_bond(new Interaction(HarmonicBond)); + InteractionPtr urey_bradley_angle(new Interaction(UreyBradleyAngle)); + InteractionPtr harmonic_angle(new Interaction(HarmonicAngle)); + InteractionPtr periodic_dihedral(new Interaction(PeriodicDihedral)); + InteractionPtr periodic_improper(new Interaction(PeriodicImproper)); + InteractionPtr harmonic_improper(new Interaction(HarmonicImproper)); + InteractionPtr cmap(new Interaction(CMap)); + InteractionPtr lj(new Interaction(LJ)); + InteractionPtr lj_pair(new Interaction(LJPair)); + InteractionPtr gbsa(new Interaction(GBSA)); + InteractionPtr distance_constraint(new Interaction(DistanceConstraint)); //check whether errors get thrown when incorrectly parametrized interactions are added diff --git a/modules/mol/mm/tests/test_interaction.cc b/modules/mol/mm/tests/test_interaction.cc index b30080e8c0e924efbe102c3ecd0389bc2489dcc7..4e2f645faf517823e7baf4497a5d6264f7e50a6f 100644 --- a/modules/mol/mm/tests/test_interaction.cc +++ b/modules/mol/mm/tests/test_interaction.cc @@ -1,6 +1,6 @@ #include <boost/test/unit_test.hpp> #include <boost/test/auto_unit_test.hpp> -#include <ost/mol/mm/mm_interaction.hh> +#include <ost/mol/mm/interaction.hh> #include <ost/mol/mol.hh> #include <ost/mol/builder.hh> @@ -14,20 +14,20 @@ BOOST_AUTO_TEST_SUITE( mol_mm ); BOOST_AUTO_TEST_CASE(test_set_stuff) { - MMInteraction harmonic_bond = MMInteraction(HarmonicBond); - MMInteraction harmonic_angle = MMInteraction(HarmonicAngle); - MMInteraction urey_bradley = MMInteraction(UreyBradleyAngle); - MMInteraction periodic_dihedral = MMInteraction(PeriodicDihedral); - MMInteraction periodic_improper = MMInteraction(PeriodicImproper); - MMInteraction harmonic_improper = MMInteraction(HarmonicImproper); - MMInteraction cmap = MMInteraction(CMap); - MMInteraction lj = MMInteraction(LJ); - MMInteraction lj_pair = MMInteraction(LJPair); - MMInteraction gbsa = MMInteraction(GBSA); - MMInteraction distance_constraint = MMInteraction(DistanceConstraint); - MMInteraction exclusion = MMInteraction(Exclusion); - MMInteraction harmonic_distance_restraint = MMInteraction(HarmonicDistanceRestraint); - MMInteraction harmonic_position_restraint = MMInteraction(HarmonicPositionRestraint); + Interaction harmonic_bond = Interaction(HarmonicBond); + Interaction harmonic_angle = Interaction(HarmonicAngle); + Interaction urey_bradley = Interaction(UreyBradleyAngle); + Interaction periodic_dihedral = Interaction(PeriodicDihedral); + Interaction periodic_improper = Interaction(PeriodicImproper); + Interaction harmonic_improper = Interaction(HarmonicImproper); + Interaction cmap = Interaction(CMap); + Interaction lj = Interaction(LJ); + Interaction lj_pair = Interaction(LJPair); + Interaction gbsa = Interaction(GBSA); + Interaction distance_constraint = Interaction(DistanceConstraint); + Interaction exclusion = Interaction(Exclusion); + Interaction harmonic_distance_restraint = Interaction(HarmonicDistanceRestraint); + Interaction harmonic_position_restraint = Interaction(HarmonicPositionRestraint); //std::vector<String> one_string, two_string, three_string, four_string, five_string; //std::vector<Real> one_real, two_real, three_real, four_real, five_real, zero_real; @@ -152,7 +152,7 @@ BOOST_AUTO_TEST_CASE(test_set_stuff) BOOST_CHECK_NO_THROW(cmap.SetParam(valid_cmap_parameters)); BOOST_CHECK(harmonic_bond.IsParametrized()); - MMInteraction new_bond = MMInteraction(HarmonicBond); + Interaction new_bond = Interaction(HarmonicBond); std::vector<String> with_wildcard, without_wildcard; with_wildcard.push_back("A"); without_wildcard.push_back("A"); @@ -183,7 +183,7 @@ BOOST_AUTO_TEST_CASE(test_set_stuff) BOOST_AUTO_TEST_CASE(test_match_stuff) { - MMInteraction dihedral = MMInteraction(PeriodicDihedral); + Interaction dihedral = Interaction(PeriodicDihedral); std::vector<String> with_wildcard, without_wildcard; with_wildcard.push_back("X"); @@ -212,7 +212,7 @@ BOOST_AUTO_TEST_CASE(test_match_stuff) } BOOST_AUTO_TEST_CASE(test_replace_atom){ - MMInteraction bond = MMInteraction(HarmonicBond); + Interaction bond = Interaction(HarmonicBond); std::vector<String> strings; strings.push_back("A"); strings.push_back("B"); @@ -245,7 +245,7 @@ BOOST_AUTO_TEST_CASE(test_getatoms){ ost::mol::AtomHandleList atom_list_two = res_list[1].GetAtomList(); ost::mol::AtomHandleList atom_list_three = res_list[2].GetAtomList(); - MMInteraction bond = MMInteraction(HarmonicBond); + Interaction bond = Interaction(HarmonicBond); std::vector<String> strings; strings.push_back("A"); strings.push_back("B"); diff --git a/modules/mol/mm/tests/test_simulation.cc b/modules/mol/mm/tests/test_simulation.cc index f0e362e4b7fb08e682ff815f6c5f5435fc4537da..9c08182a4c63ca96a1ae7dd3d7cffbce068b226b 100644 --- a/modules/mol/mm/tests/test_simulation.cc +++ b/modules/mol/mm/tests/test_simulation.cc @@ -1,8 +1,8 @@ #include <boost/test/unit_test.hpp> #include <boost/test/auto_unit_test.hpp> -#include <ost/mol/mm/mm_settings.hh> +#include <ost/mol/mm/settings.hh> #include <ost/mol/mm/forcefield.hh> -#include <ost/mol/mm/mm_interaction.hh> +#include <ost/mol/mm/interaction.hh> #include <ost/mol/mm/buildingblock.hh> #include <ost/mol/mm/gromacs_block_modifiers.hh> #include <ost/message.hh> @@ -29,7 +29,7 @@ BOOST_AUTO_TEST_CASE(test_simulation_basics){ ost::conop::ProcessorPtr processor(new ost::conop::HeuristicProcessor); processor->Process(test_ent); - MMSettingsPtr settings(new MMSettings); + SettingsPtr settings(new Settings); ForcefieldPtr forcefield = Forcefield::Load("CHARMM27.dat"); settings->forcefield = forcefield; settings->add_gbsa = true; @@ -123,7 +123,7 @@ BOOST_AUTO_TEST_CASE(test_simulation_energy_calculations){ ost::conop::ProcessorPtr processor(new ost::conop::HeuristicProcessor); processor->Process(test_ent); - MMSettingsPtr settings(new MMSettings); + SettingsPtr settings(new Settings); ForcefieldPtr forcefield = Forcefield::Load("CHARMM27.dat"); settings->forcefield = forcefield; diff --git a/modules/mol/mm/tests/test_topology.cc b/modules/mol/mm/tests/test_topology.cc index 59de803c02a02aabe90b635a881c6b4cc7be6461..09636628d94a96141bc0c5410e428db3867697ca 100644 --- a/modules/mol/mm/tests/test_topology.cc +++ b/modules/mol/mm/tests/test_topology.cc @@ -2,7 +2,7 @@ #include <boost/test/auto_unit_test.hpp> #include <ost/mol/mm/topology.hh> #include <ost/mol/mm/topology_creator.hh> -#include <ost/mol/mm/mm_settings.hh> +#include <ost/mol/mm/settings.hh> #include <ost/mol/mm/forcefield.hh> #include <ost/io/mol/pdb_reader.hh> #include <ost/conop/heuristic.hh> @@ -297,7 +297,7 @@ BOOST_AUTO_TEST_CASE(test_topology_merge){ reader.Import(test_ent); ForcefieldPtr ff = Forcefield::Load("CHARMM27.dat"); - MMSettingsPtr settings = MMSettingsPtr(new MMSettings); + SettingsPtr settings = SettingsPtr(new Settings); settings->add_gbsa = true; settings->forcefield = ff;