fluidsim.magic

IPython / Jupyter magic commands

class fluidsim.magic.FluidsimMagics(*args, **kwargs)[source]

Bases: IPython.core.magic.Magics

Magics simplifies the instantiation steps for a Simul object.

It 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(self, line)[source]
%fluidsim [-f] [solver]
positional arguments:

solver

optional arguments:

-f, –force-overwrite

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

directory

optional arguments:

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

fluidsim_reset(self, line)[source]
%fluidsim_reset

Functions

load_ipython_extension(ipython)

Load the extension in IPython.

Classes

FluidsimMagics(*args, **kwargs)

Magics simplifies the instantiation steps for a Simul object.