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) f = Expression((u_fS, v_fS), degree=shape_U + 1) label = "a", "b", "c", "d", "e", "f", "g" h = [] # element sizes E = [] # errors
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) h = [] # element sizes E = [] # errors for nx in [4, 8, 16, 32, 64, 128]: h.append(pi/nx)