Skip to content

Commit

Permalink
benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
ksagiyam committed Jun 24, 2024
1 parent 6119afa commit e89aac3
Show file tree
Hide file tree
Showing 3 changed files with 23,912 additions and 15 deletions.
30 changes: 15 additions & 15 deletions benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,14 +626,14 @@ def v_f_left(t_):
print(f"Time: {end - start}")
elif case in ["FSI1_2", "FSI2_2", "FSI3_2"]:
T = 20 # 10.0 # 12.0
dt = Constant(0.001) #0.001
dt = Constant(0.002) #0.001
chkstride = int(0.01 / float(dt)) # save every 0.01 sec
t = Constant(0.0)
CNshift = 1
elast = True
linear_elast = True
serendipity = True
slip_bc = True
slip_bc = False
if use_netgen:
fname_checkpoint = f"dumbdata/fsi3_P4_P2_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_netgen_new"
fname_FD = f"time_series_FD_P4_P2_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_netgen_new.dat"
Expand All @@ -643,11 +643,11 @@ def v_f_left(t_):
#fname_checkpoint = f"dumbdata/fsi3_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_ALEparamvar1_S"
#fname_FD = f"time_series_FD_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_ALEparamvar1_S.dat"
#fname_FL = f"time_series_FL_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_ALEparamvar1_S.dat"
fname_checkpoint = f"dumbdata/fsi3_Q4_Q3_nref{nref}_0.001_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S"
fname_FD = f"time_series_FD_Q4_Q3_nref{nref}_0.001_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S.dat"
fname_FL = f"time_series_FL_Q4_Q3_nref{nref}_0.001_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S.dat"
fname_ux = f"time_series_ux_Q4_Q3_nref{nref}_0.001_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S.dat"
fname_uy = f"time_series_uy_Q4_Q3_nref{nref}_0.001_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S.dat"
fname_checkpoint = f"dumbdata/fsi3_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S"
fname_FD = f"time_series_FD_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S.dat"
fname_FL = f"time_series_FL_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S.dat"
fname_ux = f"time_series_ux_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S.dat"
fname_uy = f"time_series_uy_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S.dat"
else:
fname_checkpoint = f"dumbdata/fsi3_P4_P2_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_ALEparamtest1"
fname_FD = f"time_series_FD_P4_P2_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_ALEparamtest1.dat"
Expand Down Expand Up @@ -933,16 +933,16 @@ def v_f_left(t_):
outfile.write("t val" + "\n")
with open(fname_uy, 'w') as outfile:
outfile.write("t val" + "\n")
if False:
vf = solution.subfunctions[0]
if True:
Vplot = FunctionSpace(mesh_f, "P", degree)
vfplot = Function(Vplot, name="velocity")
solve(J_f_ * inner(TrialFunction(Vplot), TestFunction(Vplot)) * dx_f == J_f_ * inner(sqrt(dot(vf, vf)), TestFunction(Vplot)) * dx_f, vfplot)
vfplot = Function(Vplot, name="mesh_f")
#vf = solution.subfunctions[0]
#solve(J_f_ * inner(TrialFunction(Vplot), TestFunction(Vplot)) * dx_f == J_f_ * inner(sqrt(dot(vf, vf)), TestFunction(Vplot)) * dx_f, vfplot)
coords = mesh_f.coordinates.dat.data_with_halos
uplot = solution.subfunctions[2]
uplot = Function(V_0).project(solution.subfunctions[2])
coords[:] = coords[:] + uplot.dat.data_ro_with_halos[:]
pgfplot(vfplot, "velocity.dat", degree=2)
#uplot = solution.subfunctions[2]
#uplot = Function(V_0).project(solution.subfunctions[2])
#coords[:] = coords[:] + uplot.dat.data_ro_with_halos[:]
pgfplot(vfplot, "mesh_f.dat", degree=2)
#pgfplot(solution.subfunctions[4], "pressure.dat", degree=2)
#pgfplot(solution.subfunctions[0], "quiver.dat", degree=0)
raise RuntimeError("only plotted solution")
Expand Down
Loading

0 comments on commit e89aac3

Please sign in to comment.