wolfhece 2.2.18__py3-none-any.whl → 2.2.23__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- wolfhece/PyDraw.py +128 -1
- wolfhece/PyVertexvectors.py +42 -4
- wolfhece/Results2DGPU.py +11 -2
- wolfhece/__init__.py +15 -1
- wolfhece/_add_path.py +9 -0
- wolfhece/apps/check_install.py +6 -6
- wolfhece/apps/splashscreen.py +1 -1
- wolfhece/apps/version.py +1 -1
- wolfhece/assets/tree.py +0 -0
- wolfhece/cli.py +96 -1
- wolfhece/hydrology/Optimisation.py +30 -25
- wolfhece/mesh2d/cst_2D_boundary_conditions.py +1 -1
- wolfhece/mesh2d/simple_2d.py +94 -69
- wolfhece/report/pdf.py +55 -0
- wolfhece/report/simplesimgpu.py +1409 -0
- wolfhece/scenario/config_manager.py +13 -0
- wolfhece/tools2d_dll.py +7 -2
- wolfhece/wolf_array.py +47 -6
- wolfhece/wolf_hist.py +21 -16
- wolfhece/wolfresults_2D.py +8 -24
- {wolfhece-2.2.18.dist-info → wolfhece-2.2.23.dist-info}/METADATA +3 -1
- {wolfhece-2.2.18.dist-info → wolfhece-2.2.23.dist-info}/RECORD +25 -61
- {wolfhece-2.2.18.dist-info → wolfhece-2.2.23.dist-info}/WHEEL +1 -1
- {wolfhece-2.2.18.dist-info → wolfhece-2.2.23.dist-info}/entry_points.txt +3 -0
- wolfhece/libs/GL/gl.h +0 -1044
- wolfhece/libs/GL/glaux.h +0 -272
- wolfhece/libs/GL/glcorearb.h +0 -3597
- wolfhece/libs/GL/glext.h +0 -11771
- wolfhece/libs/GL/glu.h +0 -255
- wolfhece/libs/GL/glxext.h +0 -926
- wolfhece/libs/GL/wglext.h +0 -840
- wolfhece/libs/MSVCP140.dll +0 -0
- wolfhece/libs/WolfDll.dll +0 -0
- wolfhece/libs/Wolf_tools.dll +0 -0
- wolfhece/libs/api-ms-win-crt-heap-l1-1-0.dll +0 -0
- wolfhece/libs/api-ms-win-crt-math-l1-1-0.dll +0 -0
- wolfhece/libs/api-ms-win-crt-runtime-l1-1-0.dll +0 -0
- wolfhece/libs/fribidi-0.dll +0 -0
- wolfhece/libs/get_infos.cp310-win_amd64.pyd +0 -0
- wolfhece/libs/get_infos.cp311-win_amd64.pyd +0 -0
- wolfhece/libs/get_infos.cp312-win_amd64.pyd +0 -0
- wolfhece/libs/get_infos.cp313-win_amd64.pyd +0 -0
- wolfhece/libs/glu32.dll +0 -0
- wolfhece/libs/hdf5.dll +0 -0
- wolfhece/libs/hdf5_hl.dll +0 -0
- wolfhece/libs/libcurl.dll +0 -0
- wolfhece/libs/libpardiso600-WIN-X86-64.dll +0 -0
- wolfhece/libs/libraqm.dll +0 -0
- wolfhece/libs/msvcr100.dll +0 -0
- wolfhece/libs/netcdf.dll +0 -0
- wolfhece/libs/paho-mqtt3cs.dll +0 -0
- wolfhece/libs/vcomp100.dll +0 -0
- wolfhece/libs/vcruntime140.dll +0 -0
- wolfhece/libs/vcruntime140_1.dll +0 -0
- wolfhece/libs/verify_wolf.cp310-win_amd64.pyd +0 -0
- wolfhece/libs/verify_wolf.cp311-win_amd64.pyd +0 -0
- wolfhece/libs/verify_wolf.cp312-win_amd64.pyd +0 -0
- wolfhece/libs/verify_wolf.cp313-win_amd64.pyd +0 -0
- wolfhece/libs/wolfogl.cp310-win_amd64.pyd +0 -0
- wolfhece/libs/wolfogl.cp311-win_amd64.pyd +0 -0
- wolfhece/libs/wolfogl.cp312-win_amd64.pyd +0 -0
- wolfhece/libs/wolfogl.cp313-win_amd64.pyd +0 -0
- wolfhece/libs/zlib1.dll +0 -0
- {wolfhece-2.2.18.dist-info → wolfhece-2.2.23.dist-info}/top_level.txt +0 -0
wolfhece/mesh2d/simple_2d.py
CHANGED
@@ -322,6 +322,8 @@ def Euler_RK_hedge(h_t1:np.ndarray, h_t2:np.ndarray,
|
|
322
322
|
do = 1
|
323
323
|
|
324
324
|
# valeur à gauche du bord
|
325
|
+
# -----------------------
|
326
|
+
|
325
327
|
q_border[slice_right_border, up] = q[1:-1]
|
326
328
|
q_border[1,up] = CL_q
|
327
329
|
|
@@ -335,6 +337,8 @@ def Euler_RK_hedge(h_t1:np.ndarray, h_t2:np.ndarray,
|
|
335
337
|
theta_border[1,up] = theta[1]
|
336
338
|
|
337
339
|
# valeur à droite du bord
|
340
|
+
# ------------------------
|
341
|
+
|
338
342
|
q_border[slice_left_border, do] = q[1:-1]
|
339
343
|
q_border[-1,do] = q[-2]
|
340
344
|
|
@@ -380,6 +384,16 @@ def splitting(q_left:np.float64, q_right:np.float64,
|
|
380
384
|
z_bridge_left:np.float64, z_bridge_right:np.float64) -> np.ndarray:
|
381
385
|
""" Splitting of the unknowns at border between two nodes
|
382
386
|
-- Based on the WOLF HECE original scheme
|
387
|
+
|
388
|
+
:param q_left: Discharge at the left-side of the border
|
389
|
+
:param q_right: Discharge at the right-side of the border
|
390
|
+
:param h_left: Water depth at the left-side of the border
|
391
|
+
:param h_right: Water depth at the right-side of the border
|
392
|
+
:param z_left: Bed elevation at the left-side of the border
|
393
|
+
:param z_right: Bed elevation at the right-side of the border
|
394
|
+
:param z_bridge_left: Bridge elevation at the left-side of the border
|
395
|
+
:param z_bridge_right: Bridge elevation at the right-side of the border
|
396
|
+
:return: Array of the unknowns according to the WOLF HECE scheme
|
383
397
|
"""
|
384
398
|
|
385
399
|
prod_q = q_left * q_right
|
@@ -421,55 +435,86 @@ def Euler_RK_bridge(h_t1:np.ndarray, h_t2:np.ndarray,
|
|
421
435
|
n:float, u_border:np.ndarray,
|
422
436
|
h_center:np.ndarray, u_center:np.ndarray,
|
423
437
|
z_bridge:np.ndarray, z_bridge_border:np.ndarray,
|
424
|
-
press_mode:int=0,
|
425
438
|
infil_exfil=None) -> None:
|
426
439
|
"""
|
427
440
|
Solve the mass and momentum equations using a explicit Euler/Runge-Kutta scheme (only 1 step)
|
428
441
|
applying source terms for infiltration/exfiltration and pressure at the roof.
|
442
|
+
|
443
|
+
:param h_t1: Water depth at time t
|
444
|
+
:param h_t2: Water depth at time t+dt (or t_star or t_doublestar if RK)
|
445
|
+
:param q_t1: Discharge at time t
|
446
|
+
:param q_t2: Discharge at time t+dt (or t_star or t_doublestar if RK)
|
447
|
+
:param h: Water depth at the mesh center
|
448
|
+
:param q: Discharge at the mesh center
|
449
|
+
:param h_border: Water depth at the mesh border
|
450
|
+
:param q_border: Discharge at the mesh border
|
451
|
+
:param z: Bed elevation
|
452
|
+
:param z_border: Bed elevation at the mesh border
|
453
|
+
:param dt: Time step
|
454
|
+
:param dx: Space step
|
455
|
+
:param CL_h: Downstream boudary condition for water depth
|
456
|
+
:param CL_q: Upstream boundary condition for discharge
|
457
|
+
:param n: Manning coefficient
|
458
|
+
:param u_border: Velocity at the mesh border
|
459
|
+
:param h_center: Water depth at the mesh center
|
460
|
+
:param u_center: Velocity at the mesh center
|
461
|
+
:param z_bridge: Bridge elevation at the mesh center
|
462
|
+
:param z_bridge_border: Bridge elevation at the mesh border
|
463
|
+
:param infil_exfil: Infiltration/exfiltration parameters
|
429
464
|
"""
|
430
465
|
g = 9.81
|
431
466
|
|
432
467
|
slice_mesh = slice(1,-1)
|
433
|
-
|
434
|
-
|
468
|
+
|
469
|
+
# L R L = Left border, R = Right border
|
470
|
+
# l|r l|r l = left value, r = right value
|
471
|
+
# | i | i = node indice
|
472
|
+
# | |
|
473
|
+
# i i+1 i, i+1 = associated borders
|
474
|
+
slice_right_border = slice(2,None) # right border - left value - slice associated to the center values
|
475
|
+
slice_left_border = slice(1,-1) # left border - right value - slice associated to the center values
|
435
476
|
|
436
477
|
up = 0
|
437
478
|
do = 1
|
438
479
|
|
439
|
-
#
|
440
|
-
z_border[slice_right_border, up] = z[1:-1]
|
441
|
-
z_border[1,up] = z[1]
|
442
|
-
|
480
|
+
# altitude du pont
|
443
481
|
z_bridge_copy = z_bridge.copy()
|
444
482
|
|
445
|
-
fs_cells
|
446
|
-
press_cells = np.where(h > z_bridge - z)[0]
|
483
|
+
fs_cells = np.where(h <= z_bridge - z)[0] # mailles à surface libre
|
484
|
+
press_cells = np.where(h > z_bridge - z)[0] # mailles sous-pression
|
447
485
|
|
448
|
-
z_bridge_copy[fs_cells] = z[fs_cells] + h[fs_cells]
|
486
|
+
z_bridge_copy[fs_cells] = z[fs_cells] + h[fs_cells] # on recopie l'altitude de SL
|
487
|
+
|
488
|
+
# valeur à gauche du bord
|
489
|
+
# -----------------------
|
490
|
+
|
491
|
+
# altitude du fond
|
492
|
+
z_border[slice_right_border, up] = z[1:-1]
|
493
|
+
z_border[1,up] = z[1] # tout en amont, recopie de la valeur intérieure
|
449
494
|
|
450
495
|
h_border[slice_right_border, up] = h[1:-1]
|
451
|
-
h_border[1,up] = h[1]
|
496
|
+
h_border[1,up] = h[1] # tout en amont, recopie de la valeur intérieure
|
452
497
|
|
453
498
|
q_border[slice_right_border, up] = q[1:-1]
|
454
|
-
q_border[1,up] = CL_q
|
455
|
-
|
456
|
-
# valeur à droite du bord
|
457
|
-
z_border[slice_left_border, do] = z[1:-1]
|
458
|
-
z_border[-1,do] = z[-2]
|
499
|
+
q_border[1,up] = CL_q # condition limite de debit
|
459
500
|
|
460
501
|
z_bridge_border[slice_right_border, up] = z_bridge_copy[1:-1]
|
461
502
|
z_bridge_border[1,up] = z_bridge_copy[1]
|
462
503
|
|
463
|
-
|
464
|
-
|
504
|
+
# valeur à droite du bord
|
505
|
+
# ------------------------
|
506
|
+
|
507
|
+
z_border[slice_left_border, do] = z[1:-1]
|
508
|
+
z_border[-1,do] = z[-2] # tout en aval, recopie de la valeur intérieure
|
465
509
|
|
466
510
|
h_border[slice_left_border, do] = h[1:-1]
|
467
|
-
h_border[-1,do] = CL_h
|
511
|
+
h_border[-1,do] = CL_h # condition limite de hauteur
|
468
512
|
|
469
513
|
q_border[slice_left_border, do] = q[1:-1]
|
470
|
-
q_border[-1,do] = q[-2]
|
471
|
-
|
514
|
+
q_border[-1,do] = q[-2] # tout en aval, recopie de la valeur intérieure
|
472
515
|
|
516
|
+
z_bridge_border[slice_left_border, do] = z_bridge_copy[1:-1]
|
517
|
+
z_bridge_border[-1,do] = CL_h + z_border[-1,do] # z_bridge_copy[-2]
|
473
518
|
|
474
519
|
for i in range(1, len(h)-1):
|
475
520
|
|
@@ -714,7 +759,7 @@ def problem(dom:np.ndarray, z:np.ndarray, h0:float, q0:float, dx:float, CN:float
|
|
714
759
|
def problem_hedge(dom:np.ndarray, z:np.ndarray, h0:float, q0:float, dx:float, CN:float, n:float):
|
715
760
|
""" Solve the mass and momentum equations using a explicit Runge-Kutta scheme (2 steps - 2nd order)
|
716
761
|
|
717
|
-
**NO BRIDGE
|
762
|
+
**NO BRIDGE but HEDGE in the middle**
|
718
763
|
"""
|
719
764
|
|
720
765
|
h, q, h_pred, q_pred, h_corr, q_corr, q_border, h_border, z_border, u_border, h_center, u_center = all_unk_border(dom, h0, q0)
|
@@ -755,7 +800,6 @@ def problem_hedge(dom:np.ndarray, z:np.ndarray, h0:float, q0:float, dx:float, CN
|
|
755
800
|
def problem_bridge(dom:np.ndarray, z:np.ndarray, z_bridge:np.ndarray,
|
756
801
|
h0:float, q0:float,
|
757
802
|
dx:float, CN:float, n:float,
|
758
|
-
press_mode:int = 4,
|
759
803
|
h_ini:np.ndarray = None, q_ini:np.ndarray = None) -> tuple[np.ndarray]:
|
760
804
|
""" Solve the mass and momentum equations using a explicit Rung-Kutta scheme (2 steps - 2nd order)
|
761
805
|
|
@@ -778,9 +822,9 @@ def problem_bridge(dom:np.ndarray, z:np.ndarray, z_bridge:np.ndarray,
|
|
778
822
|
while eps > 1e-7:
|
779
823
|
dt = compute_dt(dx, h, q, CN)
|
780
824
|
# Predictor step
|
781
|
-
Euler_RK_bridge(h, h_pred, q, q_pred, h, q, h_border, q_border, z, z_border, dt, dx, h0, q0, n, u_border, h_center, u_center, z_bridge, z_bridge_border
|
825
|
+
Euler_RK_bridge(h, h_pred, q, q_pred, h, q, h_border, q_border, z, z_border, dt, dx, h0, q0, n, u_border, h_center, u_center, z_bridge, z_bridge_border)
|
782
826
|
# Corrector step
|
783
|
-
Euler_RK_bridge(h, h_corr, q, q_corr, h_pred, q_pred, h_border, q_border, z, z_border, dt, dx, h0, q0, n, u_border, h_center, u_center, z_bridge, z_bridge_border
|
827
|
+
Euler_RK_bridge(h, h_corr, q, q_corr, h_pred, q_pred, h_border, q_border, z, z_border, dt, dx, h0, q0, n, u_border, h_center, u_center, z_bridge, z_bridge_border)
|
784
828
|
|
785
829
|
# Update -- Mean for second order in time
|
786
830
|
h = (h_pred + h_corr)/2.
|
@@ -799,7 +843,7 @@ def problem_bridge(dom:np.ndarray, z:np.ndarray, z_bridge:np.ndarray,
|
|
799
843
|
def problem_bridge_multiple_steadystates(dom:np.ndarray, z:np.ndarray, z_bridge:np.ndarray,
|
800
844
|
h0:float, qmin:float, qmax:float,
|
801
845
|
dx:float, CN:float, n:float,
|
802
|
-
|
846
|
+
) -> list[tuple[float, np.ndarray, np.ndarray]]:
|
803
847
|
""" Solve multiple steady states for a given discharge range """
|
804
848
|
|
805
849
|
all_q = np.arange(qmin, qmax+.1, (qmax-qmin)/10)
|
@@ -807,7 +851,7 @@ def problem_bridge_multiple_steadystates(dom:np.ndarray, z:np.ndarray, z_bridge:
|
|
807
851
|
ret = []
|
808
852
|
h = None
|
809
853
|
for curq in all_q:
|
810
|
-
h, q = problem_bridge(dom, z, z_bridge, h0, curq, dx, CN, n,
|
854
|
+
h, q = problem_bridge(dom, z, z_bridge, h0, curq, dx, CN, n, h_ini=h, q_ini=None)
|
811
855
|
ret.append((0., h.copy(), q.copy()))
|
812
856
|
|
813
857
|
return ret
|
@@ -815,7 +859,7 @@ def problem_bridge_multiple_steadystates(dom:np.ndarray, z:np.ndarray, z_bridge:
|
|
815
859
|
def problem_bridge_unsteady(dom:np.ndarray, z:np.ndarray, z_bridge:np.ndarray,
|
816
860
|
h0:float, q0:float,
|
817
861
|
dx:float, CN:float, n:float,
|
818
|
-
|
862
|
+
):
|
819
863
|
""" Solve the mass and momentum equations using a explicit Runge-Kutta scheme (2 steps - 2nd order).
|
820
864
|
|
821
865
|
**WITH BRIDGE and NO OVERFLOW**
|
@@ -839,9 +883,9 @@ def problem_bridge_unsteady(dom:np.ndarray, z:np.ndarray, z_bridge:np.ndarray,
|
|
839
883
|
while eps > 1e-7:
|
840
884
|
dt = compute_dt(dx, h, q, CN)
|
841
885
|
# Predictor step
|
842
|
-
Euler_RK_bridge(h, h_pred, q, q_pred, h, q, h_border, q_border, z, z_border, dt, dx, h0, q0, n, u_border, h_center, u_center, z_bridge, z_bridge_border
|
886
|
+
Euler_RK_bridge(h, h_pred, q, q_pred, h, q, h_border, q_border, z, z_border, dt, dx, h0, q0, n, u_border, h_center, u_center, z_bridge, z_bridge_border)
|
843
887
|
# Corrector step
|
844
|
-
Euler_RK_bridge(h, h_corr, q, q_corr, h_pred, q_pred, h_border, q_border, z, z_border, dt, dx, h0, q0, n, u_border, h_center, u_center, z_bridge, z_bridge_border
|
888
|
+
Euler_RK_bridge(h, h_corr, q, q_corr, h_pred, q_pred, h_border, q_border, z, z_border, dt, dx, h0, q0, n, u_border, h_center, u_center, z_bridge, z_bridge_border)
|
845
889
|
|
846
890
|
# Update -- Mean for second order in time
|
847
891
|
h = (h_pred + h_corr)/2.
|
@@ -871,9 +915,9 @@ def problem_bridge_unsteady(dom:np.ndarray, z:np.ndarray, z_bridge:np.ndarray,
|
|
871
915
|
h_cl = h0 + 7. - 7. * (t - totaltime/2)/totaltime*2
|
872
916
|
|
873
917
|
# Predictor step
|
874
|
-
Euler_RK_bridge(h, h_pred, q, q_pred, h, q, h_border, q_border, z, z_border, dt, dx, h_cl, q0, n, u_border, h_center, u_center, z_bridge, z_bridge_border
|
918
|
+
Euler_RK_bridge(h, h_pred, q, q_pred, h, q, h_border, q_border, z, z_border, dt, dx, h_cl, q0, n, u_border, h_center, u_center, z_bridge, z_bridge_border)
|
875
919
|
# Corrector step
|
876
|
-
Euler_RK_bridge(h, h_corr, q, q_corr, h_pred, q_pred, h_border, q_border, z, z_border, dt, dx, h_cl, q0, n, u_border, h_center, u_center, z_bridge, z_bridge_border
|
920
|
+
Euler_RK_bridge(h, h_corr, q, q_corr, h_pred, q_pred, h_border, q_border, z, z_border, dt, dx, h_cl, q0, n, u_border, h_center, u_center, z_bridge, z_bridge_border)
|
877
921
|
|
878
922
|
# Update -- Mean for second order in time
|
879
923
|
h = (h_pred + h_corr)/2.
|
@@ -893,7 +937,6 @@ def problem_bridge_unsteady_topo(dom:np.ndarray, z:np.ndarray,
|
|
893
937
|
z_roof:np.ndarray, z_deck:np.ndarray, z_roof_null:float,
|
894
938
|
h0:float, q0:float,
|
895
939
|
dx:float, CN:float, n:float,
|
896
|
-
press_mode:int = 0,
|
897
940
|
motion_duration:float = 300.,
|
898
941
|
scenario_bc:Literal['unsteady_downstream_bc',
|
899
942
|
'hydrograph',
|
@@ -919,9 +962,9 @@ def problem_bridge_unsteady_topo(dom:np.ndarray, z:np.ndarray,
|
|
919
962
|
while eps > 1e-7:
|
920
963
|
dt = compute_dt(dx, h, q, CN)
|
921
964
|
# Predictor step
|
922
|
-
Euler_RK_bridge(h, h_pred, q, q_pred, h, q, h_border, q_border, z, z_border, dt, dx, h0, q0, n, u_border, h_center, u_center, z_roof, z_roof_border
|
965
|
+
Euler_RK_bridge(h, h_pred, q, q_pred, h, q, h_border, q_border, z, z_border, dt, dx, h0, q0, n, u_border, h_center, u_center, z_roof, z_roof_border)
|
923
966
|
# Corrector step
|
924
|
-
Euler_RK_bridge(h, h_corr, q, q_corr, h_pred, q_pred, h_border, q_border, z, z_border, dt, dx, h0, q0, n, u_border, h_center, u_center, z_roof, z_roof_border
|
967
|
+
Euler_RK_bridge(h, h_corr, q, q_corr, h_pred, q_pred, h_border, q_border, z, z_border, dt, dx, h0, q0, n, u_border, h_center, u_center, z_roof, z_roof_border)
|
925
968
|
|
926
969
|
# Update -- Mean for second order in time
|
927
970
|
h = (h_pred + h_corr)/2.
|
@@ -1216,13 +1259,13 @@ def problem_bridge_unsteady_topo(dom:np.ndarray, z:np.ndarray,
|
|
1216
1259
|
Euler_RK_bridge(h, h_pred, q, q_pred, h, q, h_border, q_border, z, z_border,
|
1217
1260
|
dt, dx, h_cl, q_cl,
|
1218
1261
|
n, u_border, h_center, u_center, z_roof, z_roof_border,
|
1219
|
-
|
1262
|
+
infil_exfil)
|
1220
1263
|
|
1221
1264
|
# Corrector step
|
1222
1265
|
Euler_RK_bridge(h, h_corr, q, q_corr, h_pred, q_pred, h_border, q_border, z, z_border,
|
1223
1266
|
dt, dx, h_cl, q_cl,
|
1224
1267
|
n, u_border, h_center, u_center, z_roof, z_roof_border,
|
1225
|
-
|
1268
|
+
infil_exfil)
|
1226
1269
|
|
1227
1270
|
# Update -- Mean for second order in time
|
1228
1271
|
h = (h_pred + h_corr)/2.
|
@@ -1603,7 +1646,6 @@ def lake_at_rest():
|
|
1603
1646
|
q0 = 0. # Initial discharge
|
1604
1647
|
n = 0.025
|
1605
1648
|
slope = 0 #1e-4
|
1606
|
-
press_mode = 4
|
1607
1649
|
|
1608
1650
|
hu = 0
|
1609
1651
|
|
@@ -1619,7 +1661,7 @@ def lake_at_rest():
|
|
1619
1661
|
# free surface flow
|
1620
1662
|
h1, q1 = problem(dom, z, h0, q0, dx, CN, n)
|
1621
1663
|
# partially pressurized flow
|
1622
|
-
h2, q2 = problem_bridge(dom, z, z_bridge, h0, q0, dx, CN, n
|
1664
|
+
h2, q2 = problem_bridge(dom, z, z_bridge, h0, q0, dx, CN, n)
|
1623
1665
|
|
1624
1666
|
assert np.allclose(h1[1:-1], h0), 'Free surface flow is not steady state'
|
1625
1667
|
assert np.allclose(q1[1:-1], q0), 'Free surface flow is not steady state'
|
@@ -1634,7 +1676,7 @@ def lake_at_rest():
|
|
1634
1676
|
# free surface flow
|
1635
1677
|
h1, q1 = problem(dom, z, h0+1., q0, dx, CN, n)
|
1636
1678
|
# partially pressurized flow
|
1637
|
-
h2, q2 = problem_bridge(dom, z, z_bridge, h0, q0, dx, CN, n
|
1679
|
+
h2, q2 = problem_bridge(dom, z, z_bridge, h0, q0, dx, CN, n)
|
1638
1680
|
|
1639
1681
|
assert np.allclose(h1[1:-1], h0+1.), 'Free surface flow is not steady state'
|
1640
1682
|
assert np.allclose(q1[1:-1], q0), 'Free surface flow is not steady state'
|
@@ -1649,7 +1691,7 @@ def lake_at_rest():
|
|
1649
1691
|
# free surface flow
|
1650
1692
|
h1, q1 = problem(dom, z, h0+2., q0, dx, CN, n)
|
1651
1693
|
# partially pressurized flow
|
1652
|
-
h2, q2 = problem_bridge(dom, z, z_bridge, h0, q0, dx, CN, n
|
1694
|
+
h2, q2 = problem_bridge(dom, z, z_bridge, h0, q0, dx, CN, n)
|
1653
1695
|
|
1654
1696
|
assert np.allclose(h1[1:-1], h0+2.), 'Free surface flow is not steady state'
|
1655
1697
|
assert np.allclose(q1[1:-1], q0), 'Free surface flow is not steady state'
|
@@ -1683,7 +1725,6 @@ def water_line():
|
|
1683
1725
|
q0 = 7.
|
1684
1726
|
n = 0.025
|
1685
1727
|
slope = 1e-4
|
1686
|
-
press_mode = 4
|
1687
1728
|
|
1688
1729
|
dom, x, z = domain(length, dx, slope)
|
1689
1730
|
x = np.array(x)
|
@@ -1699,17 +1740,17 @@ def water_line():
|
|
1699
1740
|
fig, axes = plt.subplots(3,1)
|
1700
1741
|
|
1701
1742
|
h1, q1 = problem(dom, z, h0, q0, dx, CN, n)
|
1702
|
-
h2, q2 = problem_bridge(dom, z, z_bridge, h0, q0, dx, CN, n
|
1743
|
+
h2, q2 = problem_bridge(dom, z, z_bridge, h0, q0, dx, CN, n)
|
1703
1744
|
|
1704
1745
|
plot_bridge(axes[0], x, h1, h2, q1, q2, z, z_bridge, hu)
|
1705
1746
|
|
1706
1747
|
h1, q1 = problem(dom, z, h0+1., q0, dx, CN, n)
|
1707
|
-
h2, q2 = problem_bridge(dom, z, z_bridge, h0+1., q0, dx, CN, n
|
1748
|
+
h2, q2 = problem_bridge(dom, z, z_bridge, h0+1., q0, dx, CN, n)
|
1708
1749
|
|
1709
1750
|
plot_bridge(axes[1], x, h1, h2, q1, q2, z, z_bridge, hu)
|
1710
1751
|
|
1711
1752
|
h1, q1 = problem(dom, z, h0+2., q0, dx, CN, n)
|
1712
|
-
h2, q2 = problem_bridge(dom, z, z_bridge, h0+2., q0, dx, CN, n
|
1753
|
+
h2, q2 = problem_bridge(dom, z, z_bridge, h0+2., q0, dx, CN, n)
|
1713
1754
|
|
1714
1755
|
plot_bridge(axes[2], x, h1, h2, q1, q2, z, z_bridge, hu)
|
1715
1756
|
|
@@ -1737,7 +1778,6 @@ def water_line_noloss_noslope():
|
|
1737
1778
|
q0 = 7.
|
1738
1779
|
n = 0.
|
1739
1780
|
slope = 0.
|
1740
|
-
press_mode = 4
|
1741
1781
|
|
1742
1782
|
dom, x, z = domain(length, dx, slope)
|
1743
1783
|
x = np.array(x)
|
@@ -1753,17 +1793,17 @@ def water_line_noloss_noslope():
|
|
1753
1793
|
fig, axes = plt.subplots(3,1)
|
1754
1794
|
|
1755
1795
|
h1, q1 = problem(dom, z, h0, q0, dx, CN, n)
|
1756
|
-
h2, q2 = problem_bridge(dom, z, z_bridge, h0, q0, dx, CN, n
|
1796
|
+
h2, q2 = problem_bridge(dom, z, z_bridge, h0, q0, dx, CN, n)
|
1757
1797
|
|
1758
1798
|
plot_bridge(axes[0], x, h1, h2, q1, q2, z, z_bridge, hu)
|
1759
1799
|
|
1760
1800
|
h1, q1 = problem(dom, z, h0+1., q0, dx, CN, n)
|
1761
|
-
h2, q2 = problem_bridge(dom, z, z_bridge, h0+1., q0, dx, CN, n
|
1801
|
+
h2, q2 = problem_bridge(dom, z, z_bridge, h0+1., q0, dx, CN, n)
|
1762
1802
|
|
1763
1803
|
plot_bridge(axes[1], x, h1, h2, q1, q2, z, z_bridge, hu)
|
1764
1804
|
|
1765
1805
|
h1, q1 = problem(dom, z, h0+2., q0, dx, CN, n)
|
1766
|
-
h2, q2 = problem_bridge(dom, z, z_bridge, h0+2., q0, dx, CN, n
|
1806
|
+
h2, q2 = problem_bridge(dom, z, z_bridge, h0+2., q0, dx, CN, n)
|
1767
1807
|
|
1768
1808
|
plot_bridge(axes[2], x, h1, h2, q1, q2, z, z_bridge, hu)
|
1769
1809
|
|
@@ -1786,7 +1826,6 @@ def water_lines():
|
|
1786
1826
|
q0 = 7.
|
1787
1827
|
n = 0. #0.025
|
1788
1828
|
slope = 0 #1e-4
|
1789
|
-
press_mode = 4
|
1790
1829
|
|
1791
1830
|
dom, x, z = domain(length, dx, slope)
|
1792
1831
|
x = np.array(x)
|
@@ -1803,7 +1842,7 @@ def water_lines():
|
|
1803
1842
|
idx_bridge = len(dom)//2
|
1804
1843
|
|
1805
1844
|
h0 = 4.5
|
1806
|
-
res = problem_bridge_multiple_steadystates(dom, z, z_bridge, h0, 3.5, 20., dx, CN, n
|
1845
|
+
res = problem_bridge_multiple_steadystates(dom, z, z_bridge, h0, 3.5, 20., dx, CN, n)
|
1807
1846
|
|
1808
1847
|
fig, axes = plt.subplots(2,1)
|
1809
1848
|
|
@@ -1880,7 +1919,6 @@ def unsteady_without_bedmotion():
|
|
1880
1919
|
q0 = 7.
|
1881
1920
|
n = 0. #0.025
|
1882
1921
|
slope = 0 #1e-4
|
1883
|
-
press_mode = 4
|
1884
1922
|
|
1885
1923
|
dom, x, z = domain(length, dx, slope)
|
1886
1924
|
x = np.array(x)
|
@@ -1897,7 +1935,7 @@ def unsteady_without_bedmotion():
|
|
1897
1935
|
idx_bridge = len(dom)//2
|
1898
1936
|
|
1899
1937
|
h0 = 1.5
|
1900
|
-
res = problem_bridge_unsteady(dom, z, z_bridge, h0, q0, dx, CN, n
|
1938
|
+
res = problem_bridge_unsteady(dom, z, z_bridge, h0, q0, dx, CN, n)
|
1901
1939
|
|
1902
1940
|
fig, axes = plt.subplots(2,1)
|
1903
1941
|
|
@@ -1993,7 +2031,6 @@ def unsteady_with_bedmotion(problems:list[int], save_video:bool = False) -> list
|
|
1993
2031
|
q0 = 7.
|
1994
2032
|
n = 0.025
|
1995
2033
|
slope = 0 #1e-4
|
1996
|
-
press_mode = 4
|
1997
2034
|
|
1998
2035
|
dom, x, z = domain(length, dx, slope)
|
1999
2036
|
x = np.array(x)
|
@@ -2053,7 +2090,6 @@ def unsteady_with_bedmotion(problems:list[int], save_video:bool = False) -> list
|
|
2053
2090
|
res = problem_bridge_unsteady_topo(dom, z,
|
2054
2091
|
z_bridge, z_deck, z_roof_null,
|
2055
2092
|
h0, q0, dx, CN, n,
|
2056
|
-
press_mode= press_mode,
|
2057
2093
|
motion_duration= motion_duration,
|
2058
2094
|
scenario_bc= scenario,
|
2059
2095
|
min_overflow= min_overflow)
|
@@ -2121,7 +2157,6 @@ def unsteady_with_bedmotion(problems:list[int], save_video:bool = False) -> list
|
|
2121
2157
|
res = problem_bridge_unsteady_topo(dom, z, z_bridge,
|
2122
2158
|
z_deck, z_roof_null,
|
2123
2159
|
h0, q0, dx, CN, n,
|
2124
|
-
press_mode=press_mode,
|
2125
2160
|
motion_duration=motion_duration,
|
2126
2161
|
scenario_bc=scenario,
|
2127
2162
|
min_overflow=min_overflow)
|
@@ -2187,7 +2222,6 @@ def unsteady_with_bedmotion(problems:list[int], save_video:bool = False) -> list
|
|
2187
2222
|
res = problem_bridge_unsteady_topo(dom, z, z_bridge,
|
2188
2223
|
z_deck, z_roof_null,
|
2189
2224
|
h0, q0, dx, CN, n,
|
2190
|
-
press_mode=press_mode,
|
2191
2225
|
motion_duration=motion_duration,
|
2192
2226
|
scenario_bc=scenario,
|
2193
2227
|
min_overflow=min_overflow)
|
@@ -2255,7 +2289,6 @@ def unsteady_with_bedmotion(problems:list[int], save_video:bool = False) -> list
|
|
2255
2289
|
res = problem_bridge_unsteady_topo(dom, z,
|
2256
2290
|
z_bridge, z_deck, z_roof_null,
|
2257
2291
|
h0, q0, dx, CN, n,
|
2258
|
-
press_mode=press_mode,
|
2259
2292
|
motion_duration=motion_duration,
|
2260
2293
|
scenario_bc=scenario,
|
2261
2294
|
min_overflow= min_overflow)
|
@@ -2330,7 +2363,6 @@ def unsteady_with_bedmotion(problems:list[int], save_video:bool = False) -> list
|
|
2330
2363
|
res = problem_bridge_unsteady_topo(dom, z,
|
2331
2364
|
z_bridge, z_deck, z_roof_null,
|
2332
2365
|
h0, q0, dx, CN, n,
|
2333
|
-
press_mode=press_mode,
|
2334
2366
|
motion_duration=motion_duration,
|
2335
2367
|
scenario_bc=scenario,
|
2336
2368
|
min_overflow= min_overflow)
|
@@ -2389,7 +2421,6 @@ def unsteady_with_bedmotion_interval(problems:list[int], save_video:bool = False
|
|
2389
2421
|
q0 = 7.
|
2390
2422
|
n = 0.025
|
2391
2423
|
slope = 0 #1e-4
|
2392
|
-
press_mode = 4
|
2393
2424
|
|
2394
2425
|
dom, x, z = domain(length, dx, slope)
|
2395
2426
|
x = np.array(x)
|
@@ -2448,7 +2479,6 @@ def unsteady_with_bedmotion_interval(problems:list[int], save_video:bool = False
|
|
2448
2479
|
res = problem_bridge_unsteady_topo(dom, z,
|
2449
2480
|
z_bridge, z_deck, z_roof_null,
|
2450
2481
|
h0, q0, dx, CN, n,
|
2451
|
-
press_mode= press_mode,
|
2452
2482
|
motion_duration= motion_duration,
|
2453
2483
|
scenario_bc= scenario,
|
2454
2484
|
min_overflow= min_overflow,
|
@@ -2516,7 +2546,6 @@ def unsteady_with_bedmotion_interval(problems:list[int], save_video:bool = False
|
|
2516
2546
|
res = problem_bridge_unsteady_topo(dom, z, z_bridge,
|
2517
2547
|
z_deck, z_roof_null,
|
2518
2548
|
h0, q0, dx, CN, n,
|
2519
|
-
press_mode=press_mode,
|
2520
2549
|
motion_duration=motion_duration,
|
2521
2550
|
scenario_bc=scenario,
|
2522
2551
|
min_overflow=min_overflow,
|
@@ -2582,7 +2611,6 @@ def unsteady_with_bedmotion_interval(problems:list[int], save_video:bool = False
|
|
2582
2611
|
res = problem_bridge_unsteady_topo(dom, z, z_bridge,
|
2583
2612
|
z_deck, z_roof_null,
|
2584
2613
|
h0, q0, dx, CN, n,
|
2585
|
-
press_mode=press_mode,
|
2586
2614
|
motion_duration=motion_duration,
|
2587
2615
|
scenario_bc=scenario,
|
2588
2616
|
min_overflow=min_overflow,
|
@@ -2650,7 +2678,6 @@ def unsteady_with_bedmotion_interval(problems:list[int], save_video:bool = False
|
|
2650
2678
|
res = problem_bridge_unsteady_topo(dom, z,
|
2651
2679
|
z_bridge, z_deck, z_roof_null,
|
2652
2680
|
h0, q0, dx, CN, n,
|
2653
|
-
press_mode=press_mode,
|
2654
2681
|
motion_duration=motion_duration,
|
2655
2682
|
scenario_bc=scenario,
|
2656
2683
|
min_overflow= min_overflow,
|
@@ -2725,7 +2752,6 @@ def unsteady_with_bedmotion_interval(problems:list[int], save_video:bool = False
|
|
2725
2752
|
res = problem_bridge_unsteady_topo(dom, z,
|
2726
2753
|
z_bridge, z_deck, z_roof_null,
|
2727
2754
|
h0, q0, dx, CN, n,
|
2728
|
-
press_mode=press_mode,
|
2729
2755
|
motion_duration=motion_duration,
|
2730
2756
|
scenario_bc=scenario,
|
2731
2757
|
min_overflow= min_overflow,
|
@@ -2745,7 +2771,6 @@ def unsteady_with_bedmotion_interval(problems:list[int], save_video:bool = False
|
|
2745
2771
|
return anims
|
2746
2772
|
|
2747
2773
|
|
2748
|
-
|
2749
2774
|
def hedge():
|
2750
2775
|
""" Compute Water line problems with hedge
|
2751
2776
|
|
@@ -2801,12 +2826,12 @@ def hedge():
|
|
2801
2826
|
|
2802
2827
|
if __name__ == '__main__':
|
2803
2828
|
|
2804
|
-
# anim =
|
2805
|
-
|
2829
|
+
# anim = lake_at_rest()
|
2830
|
+
anim = water_line()
|
2806
2831
|
# anim = water_lines()
|
2807
2832
|
# anim = unsteady_without_bedmotion()
|
2808
2833
|
# anim = unteaady_with_bedmotion([2, 6, 7, 8, 9])
|
2809
|
-
anim = hedge()
|
2834
|
+
# anim = hedge()
|
2810
2835
|
# anim = water_line_noloss_noslope()
|
2811
2836
|
|
2812
2837
|
# anim1 = unsteady_with_bedmotion([2])
|
wolfhece/report/pdf.py
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
""" WX Frame displaying a PDF file """
|
2
|
+
import wx
|
3
|
+
import wx.lib.sized_controls as sc
|
4
|
+
from wx.lib.pdfviewer import pdfViewer, pdfButtonPanel
|
5
|
+
|
6
|
+
from pathlib import Path
|
7
|
+
|
8
|
+
class PDFViewer(sc.SizedFrame):
|
9
|
+
|
10
|
+
def __init__(self, parent, **kwargs):
|
11
|
+
""" Initialize the PDF Viewer Frame """
|
12
|
+
super(PDFViewer, self).__init__(parent, **kwargs)
|
13
|
+
|
14
|
+
paneCont = self.GetContentsPane()
|
15
|
+
self.buttonpanel = pdfButtonPanel(paneCont, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, 0)
|
16
|
+
self.buttonpanel.SetSizerProps(expand=True)
|
17
|
+
|
18
|
+
self.viewer:pdfViewer
|
19
|
+
self.viewer = pdfViewer(paneCont, wx.ID_ANY, wx.DefaultPosition,
|
20
|
+
wx.DefaultSize,
|
21
|
+
wx.HSCROLL|wx.VSCROLL|wx.SUNKEN_BORDER)
|
22
|
+
|
23
|
+
self.viewer.SetSizerProps(expand=True, proportion=1)
|
24
|
+
|
25
|
+
# introduce buttonpanel and viewer to each other
|
26
|
+
self.buttonpanel.viewer = self.viewer
|
27
|
+
self.viewer.buttonpanel = self.buttonpanel
|
28
|
+
|
29
|
+
icon = wx.Icon()
|
30
|
+
icon_path = Path(__file__).parent.parent / "apps/wolf_logo2.bmp"
|
31
|
+
icon.CopyFromBitmap(wx.Bitmap(str(icon_path), wx.BITMAP_TYPE_ANY))
|
32
|
+
self.SetIcon(icon)
|
33
|
+
|
34
|
+
|
35
|
+
def load_pdf(self, pdf_path:str):
|
36
|
+
""" Load a PDF file into the viewer """
|
37
|
+
|
38
|
+
if not Path(pdf_path).exists():
|
39
|
+
wx.MessageBox("PDF file does not exist.", "Error", wx.OK | wx.ICON_ERROR)
|
40
|
+
return
|
41
|
+
|
42
|
+
try:
|
43
|
+
self.viewer.LoadFile(str(pdf_path))
|
44
|
+
except Exception as e:
|
45
|
+
wx.MessageBox("Failed to load PDF file.", "Error", wx.OK | wx.ICON_ERROR)
|
46
|
+
|
47
|
+
if __name__ == '__main__':
|
48
|
+
import wx.lib.mixins.inspection as WIT
|
49
|
+
app = WIT.InspectableApp(redirect=False)
|
50
|
+
|
51
|
+
pdfV = PDFViewer(None)
|
52
|
+
pdfV.load_pdf(Path(__file__).parent.parent.parent /'tests' / 'data' / 'pdf' / "dummy.pdf") # Change to your PDF file path
|
53
|
+
pdfV.Show()
|
54
|
+
|
55
|
+
app.MainLoop()
|