Skip to content

Commit 5031aba

Browse files
committed
Add status prints to examples without logging
The two aeroelastic deformation examples and the two unsteady variable-geometry examples do not set up logging, so they appear momentarily frozen after the solver runs and while its results are saved and loaded. Print messages when the simulation has finished and when saving and loading start and finish so users can see that the scripts are still making progress.
1 parent 18cd100 commit 5031aba

4 files changed

Lines changed: 20 additions & 0 deletions

examples/aeroelastic_unsteady_first_order_deformation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,15 +348,20 @@
348348
example_solver.run(
349349
prescribed_wake=False,
350350
)
351+
print("The simulation has finished.")
351352

352353
# Save the solved solver to a compressed JSON file. This allows us to load the results
353354
# later without re-running the simulation. Use ".json.gz" for gzip compression, which is
354355
# recommended over plain JSONs for all but the smallest, unmeshed geometry objects.
356+
print("Saving the solver...")
355357
ps.save("example_solver.json.gz", example_solver)
358+
print("Finished saving the solver.")
356359

357360
# Load the saved solver. The loaded object is identical to the original and can be
358361
# passed to any output function.
362+
print("Loading the saved solver...")
359363
loaded_solver = ps.load("example_solver.json.gz")
364+
print("Finished loading the saved solver.")
360365

361366
# Call the animate function on the loaded solver. This produces a GIF of the wake being
362367
# shed. The GIF is saved in the same directory as this script. Press "q", after

examples/aeroelastic_unsteady_first_order_deformation_mixed_wings.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,15 +380,20 @@
380380
example_solver.run(
381381
prescribed_wake=False,
382382
)
383+
print("The simulation has finished.")
383384

384385
# Save the solved solver to a compressed JSON file. This allows us to load the results
385386
# later without re-running the simulation. Use ".json.gz" for gzip compression, which is
386387
# recommended over plain JSONs for all but the smallest, unmeshed geometry objects.
388+
print("Saving the solver...")
387389
ps.save("example_solver.json.gz", example_solver)
390+
print("Finished saving the solver.")
388391

389392
# Load the saved solver. The loaded object is identical to the original and can be
390393
# passed to any output function.
394+
print("Loading the saved solver...")
391395
loaded_solver = ps.load("example_solver.json.gz")
396+
print("Finished loading the saved solver.")
392397

393398
# Call the animate function on the loaded solver. This produces a GIF of the wake being
394399
# shed. The GIF is saved in the same directory as this script. Press "q", after

examples/unsteady_ring_vortex_lattice_method_solver_variable.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,15 +327,20 @@
327327
prescribed_wake=True,
328328
show_progress=True,
329329
)
330+
print("The simulation has finished.")
330331

331332
# Save the solved solver to a compressed JSON file. This allows us to load the results
332333
# later without re-running the simulation. Use ".json.gz" for gzip compression, which is
333334
# recommended over plain JSONs for all but the smallest, unmeshed geometry objects.
335+
print("Saving the solver...")
334336
ps.save("example_solver.json.gz", example_solver)
337+
print("Finished saving the solver.")
335338

336339
# Load the saved solver. The loaded object is identical to the original and can be
337340
# passed to any output function.
341+
print("Loading the saved solver...")
338342
loaded_solver = ps.load("example_solver.json.gz")
343+
print("Finished loading the saved solver.")
339344

340345
# Call the animate function on the loaded solver. This produces a GIF of the wake being
341346
# shed. The GIF is saved in the same directory as this script. Press any key, after

examples/unsteady_ring_vortex_lattice_method_solver_variable_formation.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,15 +321,20 @@
321321
prescribed_wake=True,
322322
show_progress=True,
323323
)
324+
print("The simulation has finished.")
324325

325326
# Save the solved solver to a compressed JSON file. This allows us to load the results
326327
# later without re-running the simulation. Use ".json.gz" for gzip compression, which is
327328
# recommended over plain JSONs for all but the smallest, unmeshed geometry objects.
329+
print("Saving the solver...")
328330
ps.save("example_solver.json.gz", example_solver)
331+
print("Finished saving the solver.")
329332

330333
# Load the saved solver. The loaded object is identical to the original and can be
331334
# passed to any output function.
335+
print("Loading the saved solver...")
332336
loaded_solver = ps.load("example_solver.json.gz")
337+
print("Finished loading the saved solver.")
333338

334339
# Now that we have run the solver, we can create an animation of the results.
335340
ps.output.animate(

0 commit comments

Comments
 (0)