def test18(self): solsys = new_solar_system() mercury = Mercury() mercury.initialize_code() self.assertEqual(mercury.parameters.integrator,10) mercury.parameters.integrator=2 self.assertEqual(mercury.parameters.integrator,2) mercury.stop()
def test3(self): solsys = new_solar_system() mercury = Mercury() mercury.initialize_code() mercury.particles.add_particles(solsys) mercury.commit_particles() start_pos = mercury.orbiters[2].position mercury.evolve_model(365.14|units.day) self.assertAlmostEqual(mercury.orbiters[2].position, start_pos, 1) mercury.stop()
def test21(self): solsys = new_solar_system() mercury = Mercury() mercury.initialize_code() names=["elements_file","close_encounters_file","info_file", "bigbody_file","smallbody_file","integration_parameters_file","restart_file"] for name in names: self.assertEqual(getattr(mercury.parameters,name),"/dev/null") for name in names: setattr(mercury.parameters,name,os.path.join(mercury.output_directory,name)) for name in names: self.assertEqual(getattr(mercury.parameters,name),os.path.join(mercury.output_directory,name)) mercury.stop()