viscid.fluidtrace module

Trace fluid elements in time

class viscid.fluidtrace.SeedCurator(obound0=None, obound1=None, ibound=None, obound_r=None)[source]

Bases: object

Base class for adding/removing seeds from fluid following

This class just removes seeds that go out of bounds, but provides the _update_delmask_oob method which is probably useful to all

update(v_field, seeds, delmask=None, time=None)[source]

add/remove seeds

class viscid.fluidtrace.ContinuousCurator(new_seeds, cadence=0.1, **kwargs)[source]

Bases: viscid.fluidtrace.SeedCurator

Add seeds to the same places at a steady cadence

update(v_field, seeds, delmask=None, time=None)[source]

remove out-of-bounds seeds, then add the seeds at cadence

class viscid.fluidtrace.ReplacementCurator(orig_seeds=None, **kwargs)[source]

Bases: viscid.fluidtrace.SeedCurator

Remove out-of-bounds seeds, then reset them

update(v_field, seeds, delmask=None, time=None)[source]

Remove out-of-bounds seeds, then reset them

viscid.fluidtrace.follow_fluid(dset, initial_seeds, time_slice=slice(None, None, None), curator=None, callback=<function default_fluid_callback>, speed_scale=1.0, dt=None, tstart=None, tstop=None, duration=None, dt_interp=None, v_key='v', anc_keys=(), fld_slc=Ellipsis, stream_opts={}, callback_kwargs={})[source]

Trace fluid elements

Note

you want speed_scale if say V is in km/s and x/y/z is in Re ;)

Parameters:
  • vfile – a vFile object that we can call iter_times on
  • time_slice – string, slice notation, like 1200:2400:1
  • initial_seeds – any SeedGen object
  • plot_function – function that is called each time step, arguments should be exactly: (i [int], grid, v [Vector Field], v_lines [result of streamline trace], root_seeds [SeedGen])
  • stream_opts – must have ds0 and max_length, maxit will be automatically calculated
Returns:

root points after following the fluid