Example #1
0
    if len(sys.argv) == 3:

        dt = 0.01

        bodies = [[], []]
        interactions = [[], [], [], [], []]

        app = QtGui.QApplication(sys.argv)

        init_system(sys.argv[1], bodies, interactions)

        integrator = Integrator(bodies, interactions)
        viewer = GridViewer(integrator, dt, k_list)

        configure_system(sys.argv[2], integrator)

        integrator.integrate(dt)
        integrator.max_energy = integrator.normalize(integrator.get_max_energy())
        viewer.prepare_color_key()

        timer = QTimer()
        timer.timeout.connect(run)
        timer.start(10)

        sys.exit(app.exec_())

    else:

        print "Insufficient amount of parameters"