diff --git a/modules/mol/mm/src/simulation.cc b/modules/mol/mm/src/simulation.cc index 4e0fcece9b06fba78fc7e8e552d035f8c429eb71..7f10f6c392964ae1220ae513a8e12cd2f2cb1400 100644 --- a/modules/mol/mm/src/simulation.cc +++ b/modules/mol/mm/src/simulation.cc @@ -253,10 +253,13 @@ void Simulation::Init(const TopologyPtr top, top_ = top; - integrator_ = settings->integrator; - if(!integrator_){ - throw ost::Error("Settings must have a valid integrator attached to set up a simulation!"); + + if(!settings->integrator){ + //user did not specify an integrator, so let's just use a standard integrator + settings->integrator = IntegratorPtr(new OpenMM::VerletIntegrator(0.001)); } + integrator_ = settings->integrator; + system_ = SystemCreator::Create(top_,settings,system_force_mapper_); //setting up the context, which combines the system with an integrator diff --git a/modules/mol/mm/tests/test_simulation.cc b/modules/mol/mm/tests/test_simulation.cc index f5da8757e3f5654f73954ab32417390efec609e9..f0e362e4b7fb08e682ff815f6c5f5435fc4537da 100644 --- a/modules/mol/mm/tests/test_simulation.cc +++ b/modules/mol/mm/tests/test_simulation.cc @@ -42,9 +42,6 @@ BOOST_AUTO_TEST_CASE(test_simulation_basics){ top->AddHarmonicPositionRestraint(1,geom::Vec3(0.0,0.0,0.0),10.0); top->AddHarmonicDistanceRestraint(1,2,10.0,10.0); - //try to set up simulation without an integrator - BOOST_CHECK_THROW(Simulation sim(test_ent,settings),ost::Error); - settings->integrator = IntegratorPtr(new OpenMM::VerletIntegrator(0.002)); Simulation sim(top, test_ent, settings);