aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmakeBoundary.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/makeBoundary.py b/makeBoundary.py
index e1ca2de..37a45d7 100755
--- a/makeBoundary.py
+++ b/makeBoundary.py
@@ -13,19 +13,21 @@ def read_definition(filename):
ddict[items[0]] = eval(items[1])
return ddict
+# read boundary definition file.
definition_dict = read_definition('boundaryDefinition.txt')
-for dd in definition_dict:
- print(definition_dict[dd])
+#for dd in definition_dict:
+# print(definition_dict[dd])
-with open('./1D_top.txt', "r") as data:
- xch, ych, zch = np.loadtxt(data, delimiter=' ', unpack=True)
+# with open('./1D_top.txt', "r") as data:
+# xch, ych, zch = np.loadtxt(data, delimiter=' ', unpack=True)
# Fit with polyfit
-m, c = np.polyfit(ych, zch, 1)
-print('gradient =', m, 'intercept =', c)
+# m, c = np.polyfit(ych, zch, 1)
+# print('gradient =', m, 'intercept =', c)
-slope = abs(m) # slope at top boundary
-target_flow = 2.0 # imposed discharge
+slope = abs(definition_dict["slope"]) # slope at top boundary
+target_flow = definition_dict["target_flow"] # imposed discharge
+print(target_flow)
with open('../topography/top_boundary.xyz', "r") as topo:
xin, yin, zin = np.loadtxt(topo, delimiter=' ', unpack=True)