diff --git a/Tests/Data/Notebooks/SimplePETSc.py b/Tests/Data/Notebooks/SimplePETSc.py index 22a47b305d189d1772f6ef2d8847ae7646fac0df..43f3999f95f57d5a34f1c0e88271e466204f23c3 100644 --- a/Tests/Data/Notebooks/SimplePETSc.py +++ b/Tests/Data/Notebooks/SimplePETSc.py @@ -44,7 +44,7 @@ if not out_dir.exists(): out_dir.mkdir(parents=True) print(f"mpirun --bind-to none -np 2 ogs {prj_file} > out.txt") -run(f"mpirun --bind-to none -np 2 ogs {prj_file} > out.txt", check=True) +run(f"mpirun --bind-to none -np 2 ogs {prj_file} > out.txt", shell=True, check=True) print(datetime.now()) diff --git a/Tests/Data/PhaseField/Kregime_Propagating_jupyter_notebook/Kregime_Propagating_jupyter.py b/Tests/Data/PhaseField/Kregime_Propagating_jupyter_notebook/Kregime_Propagating_jupyter.py index c3bf01ee6905d14413057c60826c7fe24dbcd3ef..d436f331f88fda8d5772baa04f1bf32161aaa0f0 100644 --- a/Tests/Data/PhaseField/Kregime_Propagating_jupyter_notebook/Kregime_Propagating_jupyter.py +++ b/Tests/Data/PhaseField/Kregime_Propagating_jupyter_notebook/Kregime_Propagating_jupyter.py @@ -310,7 +310,11 @@ def Hydraulic_Fracturing_Toughness_Dominated_numerical(h, phasefield_model): # run simulation with ogs t0 = time.time() print(">>> OGS started execution ... <<<") - run(f"ogs {out_dir}/{prj_name} -o {out_dir} > {out_dir}/log.txt", check=True) + run( + f"ogs {out_dir}/{prj_name} -o {out_dir} > {out_dir}/log.txt", + shell=True, + check=True, + ) tf = time.time() print(">>> OGS terminated execution <<< Elapsed time: ", round(tf - t0, 2), " s.") diff --git a/Tests/Data/PhaseField/PForthotropy_jupyter_notebook/sen_shear.py b/Tests/Data/PhaseField/PForthotropy_jupyter_notebook/sen_shear.py index 94af9e238d773183e57d0587cee0cab9eaa142b5..0c521b63360eee6900103fc165cbd375bed96b41 100644 --- a/Tests/Data/PhaseField/PForthotropy_jupyter_notebook/sen_shear.py +++ b/Tests/Data/PhaseField/PForthotropy_jupyter_notebook/sen_shear.py @@ -133,10 +133,12 @@ def ogs_ortho( # partition mesh run( f"NodeReordering -i shear.vtu -o {out_dir}/shear.vtu >> {logfile}", + shell=True, check=True, ) run( f"constructMeshesFromGeometry -m {out_dir}/shear.vtu -g shear.gml >> {logfile}", + shell=True, check=True, ) shutil.move("shear_top.vtu", f"{out_dir}/shear_top.vtu") @@ -149,14 +151,20 @@ def ogs_ortho( shutil.move("shear_p_2.vtu", f"{out_dir}/shear_p_2.vtu") shutil.move("shear_p_3.vtu", f"{out_dir}/shear_p_3.vtu") - run(f"partmesh -s -o {out_dir} -i {out_dir}/shear.vtu >> {logfile}", check=True) + run( + f"partmesh -s -o {out_dir} -i {out_dir}/shear.vtu >> {logfile}", + shell=True, + check=True, + ) run( f"partmesh -m -n {ncores} -o {out_dir} -i {out_dir}/shear.vtu -- {out_dir}/shear_top.vtu {out_dir}/shear_bottom.vtu {out_dir}/shear_left.vtu {out_dir}/shear_right.vtu >> {logfile}", + shell=True, check=True, ) else: run( f"NodeReordering -i shear.vtu -o {out_dir}/shear.vtu >> {logfile}", + shell=True, check=True, ) @@ -199,11 +207,16 @@ def ogs_ortho( print(f" > OGS started execution with MPI - {ncores} cores...") run( f"mpirun --bind-to none -np {ncores} ogs {out_dir}/{prj_name} -o {output_dir} >> {logfile}", + shell=True, check=True, ) else: print(" > OGS started execution - ") - run(f"ogs {out_dir}/{prj_name} -o {output_dir} >> {logfile}", check=True) + run( + f"ogs {out_dir}/{prj_name} -o {output_dir} >> {logfile}", + shell=True, + check=True, + ) tf = time.time() print(" > OGS terminated execution. Elapsed time: ", round(tf - t0, 2), " s.") diff --git a/Tests/Data/PhaseField/kregime_jupyter_notebook/Kregime_Static_jupyter.py b/Tests/Data/PhaseField/kregime_jupyter_notebook/Kregime_Static_jupyter.py index e0df462d951f93f6669c4124579753932024fccc..4b3d48982dbbe5f8184dd7fc2d3d8d54631db1b2 100644 --- a/Tests/Data/PhaseField/kregime_jupyter_notebook/Kregime_Static_jupyter.py +++ b/Tests/Data/PhaseField/kregime_jupyter_notebook/Kregime_Static_jupyter.py @@ -267,6 +267,7 @@ def sneddon_numerical(h): print(">>> OGS started execution ... <<<") run( f"ogs {out_dir}/{prj_name} -o {out_dir} -m {out_dir} > {out_dir}/ogs-out.txt", + shell=True, check=True, ) tf = time.time() diff --git a/Tests/Data/PhaseField/surfing_jupyter_notebook/surfing_pyvista.py b/Tests/Data/PhaseField/surfing_jupyter_notebook/surfing_pyvista.py index ff66ae38243b03711768a9de8ba4f4329191be76..d8ec72da54fc2c2ca5287e6465461bf7ea317eb0 100644 --- a/Tests/Data/PhaseField/surfing_jupyter_notebook/surfing_pyvista.py +++ b/Tests/Data/PhaseField/surfing_jupyter_notebook/surfing_pyvista.py @@ -186,10 +186,12 @@ if not out_dir.exists(): # https://www.opengeosys.org/docs/tools/meshing/structured-mesh-generation/ run( f"generateStructuredMesh -o {out_dir}/surfing_quad_1x2.vtu -e quad --lx 2 --nx {round(2/h)+1} --ly 1 --ny {round(1/h)+1}", + shell=True, check=True, ) run( f"NodeReordering -i {out_dir}/surfing_quad_1x2.vtu -o {out_dir}/surfing_quad_1x2_NR.vtu", + shell=True, check=True, ) @@ -269,6 +271,7 @@ t0 = time.time() print(">>> OGS started execution ... <<<") run( f"ogs {out_dir}/{prj_name} -o {out_dir} -m {out_dir} > {out_dir}/ogs-out.txt", + shell=True, check=True, ) diff --git a/Tests/Data/PhaseField/tpb_jupyter_notebook/TPB.py b/Tests/Data/PhaseField/tpb_jupyter_notebook/TPB.py index 8a3a5b409da27a334518b040f07c7f5d96e62d57..110560133dab2c624209417c13fcc3ee5f0071cf 100644 --- a/Tests/Data/PhaseField/tpb_jupyter_notebook/TPB.py +++ b/Tests/Data/PhaseField/tpb_jupyter_notebook/TPB.py @@ -139,22 +139,36 @@ def ogs_TPB( if MPI: # partition mesh - run(f"NodeReordering -i TPB.vtu -o {out_dir}/TPB.vtu >> {logfile}", check=True) + run( + f"NodeReordering -i TPB.vtu -o {out_dir}/TPB.vtu >> {logfile}", + shell=True, + check=True, + ) run( f"constructMeshesFromGeometry -m {out_dir}/TPB.vtu -g TPB.gml >> {logfile}", + shell=True, check=True, ) shutil.move("TPB_left.vtu", f"{out_dir}/TPB_left.vtu") shutil.move("TPB_right.vtu", f"{out_dir}/TPB_right.vtu") shutil.move("TPB_top.vtu", f"{out_dir}/TPB_top.vtu") shutil.copy("TPB.gml", f"{out_dir}/TPB.gml") - run(f"partmesh -s -o {out_dir} -i {out_dir}/TPB.vtu >> {logfile}", check=True) + run( + f"partmesh -s -o {out_dir} -i {out_dir}/TPB.vtu >> {logfile}", + shell=True, + check=True, + ) run( f"partmesh -m -n {ncores} -o {out_dir} -i {out_dir}/TPB.vtu -- {out_dir}/TPB_right.vtu {out_dir}/TPB_left.vtu {out_dir}/TPB_top.vtu >> {logfile}", + shell=True, check=True, ) else: - run(f"NodeReordering -i TPB.vtu -o {out_dir}/TPB.vtu >> {logfile}", check=True) + run( + f"NodeReordering -i TPB.vtu -o {out_dir}/TPB.vtu >> {logfile}", + shell=True, + check=True, + ) # change properties in prj file model = ot.Project( @@ -194,11 +208,16 @@ def ogs_TPB( print(f" > OGS started execution with MPI - {ncores} cores...") run( f"mpirun --bind-to none -np {ncores} ogs {out_dir}/{prj_name} -o {output_dir} >> {logfile}", + shell=True, check=True, ) else: print(" > OGS started execution ...") - run(f"ogs {out_dir}/{prj_name} -o {output_dir} >> {logfile}", check=True) + run( + f"ogs {out_dir}/{prj_name} -o {output_dir} >> {logfile}", + shell=True, + check=True, + ) tf = time.time() print(" > OGS terminated execution. Elapsed time: ", round(tf - t0, 2), " s.")