diff --git a/data/tools/config.ini b/data/tools/config.ini index 4eb551471d405d562c89646dc67b3e47168427e2..79c1ec795d6f270b484674f76b2dd5f089765d81 100644 --- a/data/tools/config.ini +++ b/data/tools/config.ini @@ -4,6 +4,6 @@ #/home/joscha/Downloads/ [directories] -simulation = /home/joscha/software/dune/build-release/dune-tectonic/src/foam/output/tresca-0.6/ +simulation = /home/joscha/software/dune/build-release/dune-tectonic/src/foam/output/pipping-2013-euler/ experiment = ~/group/publications/2016-RosenauCorbiDominguezRudolfRitterPipping output = generated diff --git a/data/tools/main.py b/data/tools/main.py index 0292562d43ff6f3b3fb19559720ce53e2fb29edb..a3f8c770225e33ca9a27a1ad4f66914ea7372e0d 100644 --- a/data/tools/main.py +++ b/data/tools/main.py @@ -35,7 +35,7 @@ def build_patch(coords, percentage): NBODIES = 2 -FINAL_TIME = 150 # s +FINAL_TIME = 15 # s FINAL_VELOCITY = 2e-4 # m/s THRESHOLD_VELOCITY = 0.5*FINAL_VELOCITY # 1000e-6 + FINAL_VELOCITY @@ -53,7 +53,9 @@ params = { h5file = read_h5file() print(list(h5file.keys())) -iterations(h5file, FINAL_TIME) +interval = [0.75*FINAL_TIME, FINAL_TIME] + +iterations(h5file, FINAL_TIME, interval) for body_ID in range(NBODIES): body = 'body' + str(body_ID) @@ -62,9 +64,9 @@ for body_ID in range(NBODIES): continue coords = np.array(h5file[body + '/coordinates']) - patch = build_patch(coords, 0.05) + patch = build_patch(coords, 1.0) - friction_stats(h5file, body_ID, FINAL_TIME, [], [0, FINAL_TIME]) + friction_stats(h5file, body_ID, FINAL_TIME, patch, interval) plt.show() diff --git a/data/tools/support/friction_stats.py b/data/tools/support/friction_stats.py index 1fd7ae2c36e0f29a3711ec8206098defe284d0ae..9651d299460bdf9a92895aa24563100bffa8547d 100644 --- a/data/tools/support/friction_stats.py +++ b/data/tools/support/friction_stats.py @@ -27,12 +27,13 @@ def friction_stats(h5file, body_ID, FINAL_TIME, patch=[], interval=[], TANGENTIA min_v = np.min(v_tx, axis=1) max_v = np.max(v_tx, axis=1) # plot - ax_slip = fig.add_subplot(3, 1, 1) + ax_slip = fig.add_subplot(2, 1, 1) #ax_slip.plot(time, min_v, color='gray', linestyle='--') ax_slip.plot(time, avg_v, color='black', linestyle='-') #ax_slip.plot(time, max_v, color='gray', linestyle='--') - ax_slip.set_ylabel('slip rate') - #ax_slip.set_yscale('log') + ax_slip.set_ylabel('slip rate V') + ax_slip.set_yscale('log') + ax_slip.set_ylim([1e-6,1e-2]) #------------------------- print(np.min(min_v)) @@ -48,27 +49,28 @@ def friction_stats(h5file, body_ID, FINAL_TIME, patch=[], interval=[], TANGENTIA min_states = np.min(states_tx, axis=1) max_states = np.max(states_tx, axis=1) # plot - ax_state = fig.add_subplot(3, 1, 2) - ax_state.plot(time, min_states, color='gray', linestyle='--') + ax_state = fig.add_subplot(2, 1, 2) + #ax_state.plot(time, min_states, color='gray', linestyle='--') ax_state.plot(time, avg_states, color='black', linestyle='-') - ax_state.plot(time, max_states, color='gray', linestyle='--') + #ax_state.plot(time, max_states, color='gray', linestyle='--') ax_state.set_ylabel('state') + ax_state.set_xlabel('time in s') #------------------------- # friction coefficient - friction_coeff = np.array(h5file[body + '/coefficient']) - friction_coeff_t = friction_coeff[t,:] - friction_coeff_tx = friction_coeff_t[:,patch] - # statistics - avg_friction_coeff = np.average(friction_coeff_tx, axis=1) - min_friction_coeff = np.min(friction_coeff_tx, axis=1) - max_friction_coeff = np.max(friction_coeff_tx, axis=1) - # plot - ax_friction = fig.add_subplot(3, 1, 3) - ax_friction.plot(time, min_friction_coeff, color='gray', linestyle='--') - ax_friction.plot(time, avg_friction_coeff, color='black', linestyle='-') - ax_friction.plot(time, max_friction_coeff, color='gray', linestyle='--') - ax_friction.set_ylabel('friction coefficient') + # friction_coeff = np.array(h5file[body + '/coefficient']) + # friction_coeff_t = friction_coeff[t,:] + # friction_coeff_tx = friction_coeff_t[:,patch] + # # statistics + # avg_friction_coeff = np.average(friction_coeff_tx, axis=1) + # min_friction_coeff = np.min(friction_coeff_tx, axis=1) + # max_friction_coeff = np.max(friction_coeff_tx, axis=1) + # # plot + # ax_friction = fig.add_subplot(3, 1, 3) + # ax_friction.plot(time, min_friction_coeff, color='gray', linestyle='--') + # ax_friction.plot(time, avg_friction_coeff, color='black', linestyle='-') + # ax_friction.plot(time, max_friction_coeff, color='gray', linestyle='--') + # ax_friction.set_ylabel('friction coefficient') #------------------------- fig.canvas.draw() \ No newline at end of file diff --git a/data/tools/support/iterations.py b/data/tools/support/iterations.py index b5b0b311cd731e0821ca894a6d73b5368d0d857a..08279780acc59ce587509c66c732b62aec49c239 100644 --- a/data/tools/support/iterations.py +++ b/data/tools/support/iterations.py @@ -27,19 +27,20 @@ def iterations(h5file, FINAL_TIME, interval = []): # plot fig = plt.figure() - ax_fpi = fig.add_subplot(3, 1, 1) + ax_fpi = fig.add_subplot(2, 1, 1) ax_fpi.plot(time, fpi_final[t], color='black', linestyle='-') ax_fpi.set_ylabel('fpi') #------------------------- - ax_mg = fig.add_subplot(3, 1, 2) + ax_mg = fig.add_subplot(2, 1, 2) ax_mg.plot(time, multigrid_final[t], color='black', linestyle='-') - ax_mg.set_ylabel('multigrid') + ax_mg.set_ylabel('multigrid iter.') + ax_mg.set_xlabel('time in s') #------------------------- - ax_tau = fig.add_subplot(3, 1, 3) - ax_tau.plot(time, tau[t], color='black', linestyle='-') - ax_tau.set_ylabel('tau') + #ax_tau = fig.add_subplot(3, 1, 3) + #ax_tau.plot(time, tau[t], color='black', linestyle='-') + #ax_tau.set_ylabel('tau') #------------------------- fig.canvas.draw() \ No newline at end of file