fluidsim.magic

IPython / Jupyter magic commands

class fluidsim.magic.FluidsimMagics(**kwargs: Any)[source]

Bases: MagicsCore

Magic commands can be loaded in IPython or Jupyter as

>>> %load_ext fluidsim.magic

Examples

  • Magic command %fluidsim

%fluidsim creates the variables params and Simul for a particular solver.

Create default parameters for a solver:

>>> %fluidsim ns2d

If a variable params already exists, you will be ask if you really want to overwrite it. To skip this question:

>>> %fluidsim ns2d -f

List all available solvers and initialized simulation:

>>> %fluidsim
  • Magic command %fluidsim_load

%fluidsim_load creates the variables sim, params and Simul from an existing simulation.

Load existing simulation excluding state_phys files:

>>> %fluidsim_load

Load existing simulation all options: force overwrite, with state_phys files, merging parameters:

>>> %fluidsim_load -f -s -t -m
  • Other fluidsim magic commands

Quick reference (print this help message):

>>> %fluidsim_help

Delete the objects sim and params:

>>> %fluidsim_reset
fluidsim_load(line)[source]
%fluidsim_load [-f] [-s] [-t T_APPROX] [-m] [directory]
positional arguments:
directory Optional: absolute path/relative path/name of

directory

options:

-f, –force-overwrite -s, –state-phys -t T_APPROX, –t-approx T_APPROX -m, –merge-missing-params

Functions

load_ipython_extension(ipython)

Load the extension in IPython.

Classes

FluidsimMagics(**kwargs)

Magic commands can be loaded in IPython or Jupyter as