Skip to content

Commit 039277f

Browse files
committed
Merge branch 'fix-beam' into 'master'
[nb] subprocess.run needs shell=True when args are given as string. See merge request ogs/ogs!5166
2 parents abe67b2 + 15d11dc commit 039277f

File tree

3 files changed

+16
-14
lines changed
  • Tests/Data
  • web/content/docs/devguide/environments/redistributable-builds

3 files changed

+16
-14
lines changed

Tests/Data/Parabolic/ComponentTransport/elder_jupyter/elder_jupyter.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
# %%
6161
import matplotlib.pyplot as plt
6262
import ogstools as ogs
63-
from IPython.display import HTML, Image
63+
from IPython.display import HTML
6464

6565
# %%
6666
ogs.plot.setup.dpi = 30 # resolution
@@ -142,15 +142,6 @@ def plot_func(ax: plt.Axes, timevalue: float) -> None:
142142
)
143143
HTML(anim.to_jshtml())
144144

145-
# %% [markdown]
146-
# ### Compare simulation results OGS-5 vs. OGS-6
147-
#
148-
# Here, we compare numerical results of OGS-6 to those of OGS-5.
149-
# Settings of both simulators were chosen to be as identical as possible.
150-
# Simulation times were and for $3300 s$ OGS-6 and $7800 s$ OGS-5, respectively.
151-
152-
# %%
153-
Image(url="../elder/elder.gif")
154145

155146
# %% [markdown]
156147
# ## Literature

Tests/Data/PhaseField/beam_jupyter_notebook/beam.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,23 +154,32 @@ def ogs_beam(
154154
run(
155155
f"generateStructuredMesh -o {out_dir}/bar_.vtu -e hex --lx {beam_length} --nx {round(beam_length/h)} --ly {beam_height} --ny {round(beam_height/h)} --lz {beam_depth} --nz {round(beam_depth/h)} > {logfile}",
156156
check=True,
157+
shell=True,
157158
)
158159
run(
159160
f"NodeReordering -i {out_dir}/bar_.vtu -o {out_dir}/bar.vtu >> {logfile}",
160161
check=True,
162+
shell=True,
161163
)
162164
run(
163165
f"ExtractSurface -i {out_dir}/bar.vtu -o {out_dir}/bar_left.vtu -x 1 -y 0 -z 0 >> {logfile}",
164166
check=True,
167+
shell=True,
165168
)
166169
run(
167170
f"extractSurface -i {out_dir}/bar.vtu -o {out_dir}/bar_right.vtu -x -1 -y 0 -z 0 >> {logfile}",
168171
check=True,
172+
shell=True,
173+
)
174+
run(
175+
f"partmesh -s -o {out_dir} -i {out_dir}/bar.vtu >> {logfile}",
176+
check=True,
177+
shell=True,
169178
)
170-
run(f"partmesh -s -o {out_dir} -i {out_dir}/bar.vtu >> {logfile}", check=True)
171179
run(
172180
f"partmesh -m -n 3 -o {out_dir} -i {out_dir}/bar.vtu -- {out_dir}/bar_right.vtu {out_dir}/bar_left.vtu >> {logfile}",
173181
check=True,
182+
shell=True,
174183
)
175184
# change properties in prj file
176185
model = ot.Project(
@@ -206,7 +215,9 @@ def ogs_beam(
206215
t0 = time.time()
207216
print(" > OGS started execution ...")
208217
run(
209-
f"mpirun -n 3 ogs {out_dir}/{prj_name} -o {output_dir} >> {logfile}", check=True
218+
f"mpirun -n 3 ogs {out_dir}/{prj_name} -o {output_dir} >> {logfile}",
219+
check=True,
220+
shell=True,
210221
)
211222
tf = time.time()
212223
print(" > OGS terminated execution. Elapsed time: ", round(tf - t0, 2), " s.")

web/content/docs/devguide/environments/redistributable-builds/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ If a binary runs on a different machine depends on a lot of factors. The followi
4040

4141
#### For redistribution
4242

43-
- `OGS_CPU_ARCHITECTURE`: set to `generic` for good balance between optimization and portability; set to `core2` for maximum portability, more info on [GCC docs](https://gcc.gnu.org/onlinedocs/gcc/gcc-command-options/machine-dependent-options/x86-options.html#cmdoption-x86-mtune)
43+
- `OGS_CPU_ARCHITECTURE`: set to `generic` for good balance between optimization and portability; set to `core2` for maximum portability, more info on [GCC docs](https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html)
4444

4545
#### For optimization
4646

47-
- `OGS_CPU_ARCHITECTURE`: tot to `native` for best optimization for your current CPU, possible values are [listed here](https://stackoverflow.com/a/25095818/80480), more info on [GCC docs](https://gcc.gnu.org/onlinedocs/gcc/gcc-command-options/machine-dependent-options/x86-options.html#cmdoption-x86-mtune)
47+
- `OGS_CPU_ARCHITECTURE`: tot to `native` for best optimization for your current CPU, possible values are [listed here](https://stackoverflow.com/a/25095818/80480), more info on [GCC docs](https://gcc.gnu.org/onlinedocs/gcc/x86-Options.html)
4848

4949
</div>
5050

0 commit comments

Comments
 (0)