Skip to content

Commit b8cc6f6

Browse files
committed
benchmark
1 parent 2f6272c commit b8cc6f6

File tree

3 files changed

+697
-1025
lines changed

3 files changed

+697
-1025
lines changed

benchmark.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def _elevate_degree(mesh, degree):
151151
mesh_s = Submesh(mesh, dmcommon.CELL_SETS_LABEL, label_struct, mesh.topological_dimension())
152152
mesh_s = _elevate_degree(mesh_s, degree)
153153
else:
154-
nref = 0
154+
nref = 1
155155
mesh = make_mesh(quadrilateral)
156156
if nref > 0:
157157
mesh = MeshHierarchy(mesh, nref)[-1]
@@ -626,14 +626,14 @@ def v_f_left(t_):
626626
print(f"Time: {end - start}")
627627
elif case in ["FSI1_2", "FSI2_2", "FSI3_2"]:
628628
T = 20 # 10.0 # 12.0
629-
dt = Constant(0.002) #0.001
629+
dt = Constant(0.001) #0.001
630630
chkstride = int(0.01 / float(dt)) # save every 0.01 sec
631631
t = Constant(0.0)
632632
CNshift = 1
633633
elast = True
634634
linear_elast = True
635635
serendipity = True
636-
slip_bc = False
636+
slip_bc = True
637637
if use_netgen:
638638
fname_checkpoint = f"dumbdata/fsi3_P4_P2_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_netgen_new"
639639
fname_FD = f"time_series_FD_P4_P2_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_netgen_new.dat"
@@ -643,11 +643,11 @@ def v_f_left(t_):
643643
#fname_checkpoint = f"dumbdata/fsi3_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_ALEparamvar1_S"
644644
#fname_FD = f"time_series_FD_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_ALEparamvar1_S.dat"
645645
#fname_FL = f"time_series_FL_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_ALEparamvar1_S.dat"
646-
fname_checkpoint = f"dumbdata/fsi3_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S"
647-
fname_FD = f"time_series_FD_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S.dat"
648-
fname_FL = f"time_series_FL_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S.dat"
649-
fname_ux = f"time_series_ux_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S.dat"
650-
fname_uy = f"time_series_uy_Q4_Q3_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparamvar1_S.dat"
646+
fname_checkpoint = f"dumbdata/fsi3_Q4_Q3_nref{nref}_0.001_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparam1_S"
647+
fname_FD = f"time_series_FD_Q4_Q3_nref{nref}_0.001_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparam1_S.dat"
648+
fname_FL = f"time_series_FL_Q4_Q3_nref{nref}_0.001_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparam1_S.dat"
649+
fname_ux = f"time_series_ux_Q4_Q3_nref{nref}_0.001_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparam1_S.dat"
650+
fname_uy = f"time_series_uy_Q4_Q3_nref{nref}_0.001_shift{CNshift}_{elast}_{linear_elast}_{slip_bc}_ALEparam1_S.dat"
651651
else:
652652
fname_checkpoint = f"dumbdata/fsi3_P4_P2_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_ALEparamtest1"
653653
fname_FD = f"time_series_FD_P4_P2_nref{nref}_0.002_shift{CNshift}_{elast}_{linear_elast}_ALEparamtest1.dat"
@@ -682,11 +682,11 @@ def v_f_left(t_):
682682
E_s = mu_s * 2 * (1 + nu_s)
683683
lambda_s = nu_s * E_s / (1 + nu_s) / (1 - 2 * nu_s)
684684
# ALE constants
685-
#nu_ale = Constant(0.49)
685+
nu_ale = Constant(0.49)
686686
mu_ale = Constant(float(mu_s))
687-
decay_r = Constant(0.5) # decay ratio
688-
profile = (1. - decay_r * abs(x_f - pointA[0]) / (L - pointA[0])) * (1. - decay_r * abs(y_f - pointA[1]) / (L - pointA[0]))
689-
nu_ale = Constant(0.49) * profile
687+
#decay_r = Constant(0.5) # decay ratio
688+
#profile = (1. - decay_r * abs(x_f - pointA[0]) / (L - pointA[0])) * (1. - decay_r * abs(y_f - pointA[1]) / (L - pointA[0]))
689+
#nu_ale = Constant(0.49) * profile
690690
#mu_ale = Constant(2 * float(mu_s)) * profile
691691
E_ale = mu_ale * 2 * (1 + nu_ale)
692692
lambda_ale = nu_ale * E_ale / (1 + nu_ale) / (1 - 2 * nu_ale)
@@ -933,7 +933,7 @@ def v_f_left(t_):
933933
outfile.write("t val" + "\n")
934934
with open(fname_uy, 'w') as outfile:
935935
outfile.write("t val" + "\n")
936-
if True:
936+
if False:
937937
Vplot = FunctionSpace(mesh_f, "P", degree)
938938
vfplot = Function(Vplot, name="mesh_f").assign(Constant(1))
939939
#vf = solution.subfunctions[0]

0 commit comments

Comments
 (0)