コード例 #1
0
    def test4(self):
        instance = QGmodelInterface(redirection="none")
        instance.initialize_code()

        instance.commit_parameters()

        instance.evolve_model(3600.)
        time, err = instance.get_time()
        self.assertEqual(time, 3600.)
        instance.stop()
コード例 #2
0
def low_level():

    q = QGmodelInterface(redirection="none")

    print 1
    q.initialize_code()
    print 2

    q.set_Lx(4.e6)
    q.set_Ly(4.e6)
    q.set_dx(1.e4)
    q.set_dy(1.e4)
    q.set_dt(1800)

    q.commit_parameters()
    print 3

    q.initialize_grid()
    print 4

    q.evolve_model(86400.)
    print 5
    print q.get_time()

    x, y = numpy.mgrid[0:400, 0:400]

    x = x.flatten() + 1
    y = y.flatten() + 1

    psi, err = q.get_psi1_state(x, y, 1)

    psi = psi.reshape((400, 400))

    print psi.shape
    pyplot.imshow(psi)

    pyplot.show()