newton = True
    elif sys.argv[7] == "picard":
        newton = False
    else:
        raise ValueError("sysarg 5 - picard or newton")
elif sys.argv[6] == "ipcs":
    coupled = False
else:
    raise ValueError("sysarg 4 - coupled or ipcs")

# show parameters
info(parameters, False)
set_log_active(False)

# describe initial conditions (also analytical solutions) - as strings
u_sS = mms.u_s()
v_sS = mms.v_s()
p_sS = mms.p_s()

# describe source terms - as strings
u_fS = mms.u_fs()
v_fS = mms.v_fs()

# set constants
nu = Constant(1.0)
theta = Constant(0.5)

# generate expressions for initial conditions, boundary conditions and source terms
u_s = Expression((u_sS, v_sS), degree=shape_U + 1)
p_s = Expression((p_sS), degree=shape_P + 1)
w_s = Expression((u_sS, v_sS, p_sS), degree=shape_U + 1)
Пример #2
0
    else:
        raise ValueError('sysarg 5 - picard or newton')
elif sys.argv[4] == 'ipcs':
    coupled = False
else:
    raise ValueError('sysarg 4 - coupled or ipcs')

# show parameters
info(parameters, False)

# initialise save files
u_file = File("results/velocity.pvd")
p_file = File("results/pressure.pvd")

# describe initial conditions (also analytical solutions) - as strings
u0s = mms.u_s()
u1s = mms.v_s()
ps = mms.p_s()

# describe source terms - as strings
u0fs = mms.u_fs()
u1fs = mms.v_fs()

# set constants
nu = Constant(1.0)

# generate expressions for initial conditions, boundary conditions and source terms
u_0 = Expression((u0s, u1s), degree = shape_U + 1)
p_0 = Expression((ps), degree = shape_P + 1)
w_0 = Expression((u0s, u1s, ps), degree = shape_U + 1)
f_0 = Expression((u0fs, u1fs), degree = shape_U + 1)