diff --git a/benchmark.py b/benchmark.py index 7883d642ae..d9e3042b8d 100644 --- a/benchmark.py +++ b/benchmark.py @@ -177,7 +177,7 @@ def _elevate_degree(mesh, degree, label): ntimesteps = int(T / dt_float) t = Constant(0.0) dim = 2 -nref = 0 # # 2 - 5 tested for CSM 1 and 2 +nref = 4 # # 2 - 5 tested for CSM 1 and 2 h = 0.1 / 2 ** nref degree = 3 #3 # 2 - 4 if True: @@ -187,9 +187,9 @@ def _elevate_degree(mesh, degree, label): # quad mesh mesh, label_left, label_right, label_bottom, label_top, label_interface_orig, label_interface, label_struct_base, label_circle = make_mesh_quad() mesh = _elevate_degree(mesh, degree, label_circle + label_struct_base) +x, y = SpatialCoordinate(mesh) """ #mesh.topology_dm.viewFromOptions("-dm_view") -x, y = SpatialCoordinate(mesh) v = assemble(Constant(1.0, domain=mesh) * ds(label_circle + label_struct_base)) print(v - 2 * pi * r) print(assemble(x * dx(label_struct))) @@ -217,6 +217,11 @@ def _elevate_degree(mesh, degree, label): dS_f = Measure("dS", domain=mesh_f) dS_s = Measure("dS", domain=mesh_s) +#print(repr(mesh)) +#print(repr(mesh_f)) +#print(repr(mesh_s), flush=True) + + if mesh.comm.size == 1: fig, axes = plt.subplots() axes.axis('equal') @@ -496,7 +501,8 @@ def _elevate_degree(mesh, degree, label): J * inner((u - u_0) / dt - v, du) ) * dx_s # dx(label_struct) residual = residual_f + residual_s - v_f_left = 1.5 * Ubar * y_f * (H - y_f) / ((H / 2) ** 2) * conditional(t < 2.0, (1 - cos(pi / 2 * t)) / 2., 1.) + #v_f_left = 1.5 * Ubar * y_f * (H - y_f) / ((H / 2) ** 2) * conditional(t < 2.0, (1 - cos(pi / 2 * t)) / 2., 1.) + v_f_left = 1.5 * Ubar * y * (H - y) / ((H / 2) ** 2) * conditional(t < 2.0, (1 - cos(pi / 2 * t)) / 2., 1.) bc_inflow = DirichletBC(V.sub(0), as_vector([v_f_left, 0.]), label_left) bc_noslip_v = DirichletBC(V.sub(0), Constant((0, 0)), label_bottom + label_top + label_circle + label_struct_base) bc_noslip_u = DirichletBC(V.sub(1), Constant((0, 0)), label_left + label_right + label_bottom + label_top + label_circle + label_struct_base) diff --git a/mesh_f.pdf b/mesh_f.pdf index 30f9f6e799..39aee0a76e 100644 Binary files a/mesh_f.pdf and b/mesh_f.pdf differ diff --git a/mesh_orig.pdf b/mesh_orig.pdf index 0cf82ef517..aff32a05a8 100644 Binary files a/mesh_orig.pdf and b/mesh_orig.pdf differ diff --git a/mesh_s.pdf b/mesh_s.pdf index 9c2ac8828d..c171d11cd1 100644 Binary files a/mesh_s.pdf and b/mesh_s.pdf differ diff --git a/time_series.pdf b/time_series.pdf index 3802dbcb6b..cc9eef4fcb 100644 Binary files a/time_series.pdf and b/time_series.pdf differ