예제 #1
0
def solver_scaled(I, V, f, c, U_0, U_L, L, dt, C, T,
                  version='vectorized',
                  stability_safety_factor=1.0):
    """Solve 1D wave equation in dimensionless form."""
    action = PlotAndStoreSolution(
        '', -1.3, 1.3,  # assume properly scaled u
        every_frame=1,
        filename='tmpdata')
    print 'Computing the numerical solution'
    cpu, hashed_input = solver_unscaled(
        I=I, V=V, f=f, c=c, U_0=U_0, U_L=U_L,
        L=1, dt=dt, C=C, T=T,
        user_action=action, version=version,
        stability_safety_factor=stability_safety_factor)
    if cpu > 0:
        print 'Computing the numerical solution'
        action.close_file(hashed_input)
    return filedata
예제 #2
0
def solver_scaled(I,
                  V,
                  f,
                  c,
                  U_0,
                  U_L,
                  L,
                  dt,
                  C,
                  T,
                  version='vectorized',
                  stability_safety_factor=1.0):
    """Solve 1D wave equation in dimensionless form."""
    action = PlotAndStoreSolution(
        '',
        -1.3,
        1.3,  # assume properly scaled u
        every_frame=1,
        filename='tmpdata')
    print 'Computing the numerical solution'
    cpu, hashed_input = solver_unscaled(
        I=I,
        V=V,
        f=f,
        c=c,
        U_0=U_0,
        U_L=U_L,
        L=1,
        dt=dt,
        C=C,
        T=T,
        user_action=action,
        version=version,
        stability_safety_factor=stability_safety_factor)
    if cpu > 0:
        print 'Computing the numerical solution'
        action.close_file(hashed_input)
    return filedata
예제 #3
0
 def __init__(self, B, S, a, L, B0, A, x0, sigma, **kwargs):
     self.B, self.S = B, S  # functions for bottom and slide
     self.a, self.L, self.B0 = a, L, B0
     self.A, self.x0, self.sigma = A, x0, sigma
     PlotAndStoreSolution.__init__(self, **kwargs)
예제 #4
0
 def __init__(self, B, S, a, L, B0, A, x0, sigma, **kwargs):
     self.B, self.S = B, S  # functions for bottom and slide
     self.a, self.L, self.B0 = a, L, B0
     self.A, self.x0, self.sigma = A, x0, sigma
     PlotAndStoreSolution.__init__(self, **kwargs)