fluidsim.base.output.phys_fields2d

Physical fields output 2d (fluidsim.base.output.phys_fields2d)

Provides:

class fluidsim.base.output.phys_fields2d.MoviesBasePhysFields2D(output, phys_fields)[source]

Bases: fluidsim.base.output.movies.MoviesBase2D

Methods required to animate physical fields HDF5 files.

init_animation(self, key_field, numfig, dt_equations, tmin, tmax, fig_kw, **kwargs)[source]

Initialize list of files and times, pcolor plot, quiver and colorbar.

_init_fig(self, field, ux=None, uy=None, INSET=True, **kwargs)[source]

Initialize only the figure and related matplotlib objects. This method is shared by both animate and online_plot functionalities.

_get_axis_data(self, shape=None)[source]

Get 1D arrays for setting the axes.

update_animation(self, frame, **fargs)[source]

Loads data and updates figure.

_set_clim(self)[source]

Maintains a constant colorbar throughout the animation.

_get_spatial_means(self, key_spatial='E')[source]

Get field for the inset plot.

class fluidsim.base.output.phys_fields2d.PhysFieldsBase2D(output)[source]

Bases: fluidsim.base.output.phys_fields.PhysFieldsBase

_online_plot(self)[source]

Online plot.

plot(self, field=None, time=None, QUIVER=True, vecx='ux', vecy='uy', nb_contours=20, type_plot='pcolor', vmin=None, vmax=None, cmap='viridis', numfig=None)[source]

Plot a field.

This function is surely buggy! It has to be fixed.

Parameters
field{str, np.ndarray}, optional
timenumber, optional
QUIVERTrue
vecx‘ux’
vecy‘uy’
nb_contours20
type_plot“pcolor” or “contourf”
vminNone
vmaxNone
cmap‘viridis’
numfigNone
_quiver_plot(self, ax, vecx='ux', vecy='uy', XX=None, YY=None)[source]

Superimposes a quiver plot of velocity vectors with a given axis object corresponding to a 2D contour plot.

Classes

MoviesBasePhysFields2D(output, phys_fields)

Methods required to animate physical fields HDF5 files.

PhysFieldsBase2D(output)