Skip to content
Snippets Groups Projects
Commit 2a9d2d3a authored by podlesny's avatar podlesny
Browse files

read params from output file

parent 1d0d2aee
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@ from support.max_distance import max_distance
from support.iterations import iterations
from support.friction_stats import friction_stats
from support.slip_rates import slip_rates
def build_patch(coords, percentage):
x_coords = coords[:, 0]
......@@ -58,16 +59,19 @@ out_path = config.get('directories', 'output')
h5path = os.path.join(sim_path)
h5file = h5py.File(os.path.join(h5path, 'output.h5'), 'r')
interval = [994, 996]
print(list(h5file.keys()))
print(list(h5file['frictionalBoundary'].keys()))
iterations(h5file, FINAL_TIME)
iterations(h5file, FINAL_TIME, interval)
coords = np.array(h5file['frictionalBoundary/coordinates'])
patch = build_patch(coords, 0.05)
patch = build_patch(coords, 1.0)
friction_stats(h5file, 0, FINAL_TIME, patch, interval, TANGENTIAL_COORDS)
slip_rates(h5file, 0, FINAL_TIME, patch, interval, TANGENTIAL_COORDS)
friction_stats(h5file, 0, FINAL_TIME, [], [0, 50], TANGENTIAL_COORDS)
plt.show()
h5file.close()
\ No newline at end of file
......@@ -18,6 +18,7 @@ from support.slip_endings import slip_endings
from support.max_distance import max_distance
from support.io import read_h5file
from support.io import read_params
from support.iterations import iterations
from support.friction_stats import friction_stats
......@@ -34,27 +35,17 @@ def build_patch(coords, percentage):
return [i for i in range(len(x_coords)) if x_coords[i]>=xmin and x_coords[i]<=xmax]
NBODIES = 2
FINAL_TIME = 15 # s
FINAL_VELOCITY = 2e-4 # m/s
THRESHOLD_VELOCITY = 0.5*FINAL_VELOCITY # 1000e-6 + FINAL_VELOCITY
# read problem parameters
params = read_params('foam.cfg')
TANGENTIAL_COORDS = 1
# friction params
params = {
'L' : 1e-5,
'V0' : 1e-6,
'mu0': 0.6,
'a' : 0.010,
'b' : 0.015
}
FINAL_TIME = params['finalTime']
NBODIES = params['bodyCount']
h5file = read_h5file()
print(list(h5file.keys()))
interval = [10, 13] #[0.75*FINAL_TIME, FINAL_TIME]
interval = [23, 24] #[0.75*FINAL_TIME, FINAL_TIME]
iterations(h5file, FINAL_TIME, interval)
......@@ -68,7 +59,7 @@ for body_ID in range(NBODIES):
patch = build_patch(coords, 1.0)
friction_stats(h5file, body_ID, FINAL_TIME, patch, interval)
slip_rates(h5file, body_ID, FINAL_TIME, patch, interval, 0)
slip_rates(h5file, body_ID, FINAL_TIME, patch, interval, TANGENTIAL_COORDS)
plt.show()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment