visualization module

This file is part of PyFrac.

Created by Haseeb Zia on Friday, July 06, 2018. Copyright (c) ECOLE POLYTECHNIQUE FEDERALE DE LAUSANNE, Switzerland, Geo-Energy Laboratory, 2016-2020. All rights reserved. See the LICENSE.TXT file for more details.

visualization.animate_simulation_results(fracture_list, variable='footprint', projection=None, elements=None, plot_prop=None, edge=4, contours_at=None, labels=None, mat_properties=None, backGround_param=None, block_figure=False, plot_non_zero=True, pause_time=0.2)[source]

This function plots the fracture evolution with time. The state of the fracture at different times is provided in the form of a list of Fracture objects.

Parameters
  • fracture_list (list) – – the list of Fracture objects giving the evolution of fracture with time.

  • variable (string) – – the variable to be plotted. See supported_variables of the labels module for a list of supported variables. It can also be a list of variables which will be plotted in separate widows.

  • projection (string) – – a string specifying the projection. See supported_projections for the supported projections for each of the supprted variable. If not provided, the default will be used.

  • elements (ndarray) – – the elements to be plotted.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • edge (int) – – the edge of the cell that will be plotted. This is for variables that are evaluated on the cell edges instead of cell center. It can have a value from 0 to 4 (0->left, 1->right, 2->bottome, 3->top, 4->average).

  • labels (LabelProperties) – – the labels to be used for the plot.

  • mat_properties (MaterialProperties) – – the material properties. It is mainly used to colormap the mesh.

  • backGround_param (string) – – the parameter according to which the the mesh will be colormapped.

  • block_figure (bool) – – if True, a key would be needed to be pressed to proceed to the next frame.

  • contours_at (list) – – the values at which the contours are to be plotted.

  • plot_non_zero (bool) – – if true, only non-zero values will be plotted.

  • pause_time (float) – – time (in seconds) between two successive updates of frames.

visualization.fill_mkmtTriangle(fig)[source]

This function colors the Maxwell triangle used to highlight the regime dominant in the ribbon cell.

Parameters

fig (figure) – – The figure with the Maxwell triangle to color.

visualization.get_HF_analytical_solution_footprint(regime, mat_prop, inj_prop, plot_prop, fluid_prop=None, time_srs=None, h=None, samp_cell=None, gamma=None, inj_point=None)[source]

This function returns footprint of the analytical solution in the form of patches

visualization.get_elements(specifier, fr)[source]
visualization.mkmtTriangle(fig)[source]

This function draws the Maxwell triangle used to higlight the regime dominant in the ribbon cell.

Parameters

fig (figure) – – The figure to place the Maxwell triangle in.

visualization.plot_analytical_solution(regime, variable, mat_prop, inj_prop, mesh=None, fluid_prop=None, fig=None, projection='2D', time_srs=None, length_srs=None, h=None, samp_cell=None, plot_prop=None, labels=None, contours_at=None, gamma=None)[source]

This function plots the analytical solution according to the given regime. It can be used to compare simulation results by superimposing on the figure obtained from the plot function.

Parameters
  • regime (string) –

    – the string specifying the limiting case solution to be plotted. The

    available options are.

    option

    limiting solution

    ’M’

    viscosity storage

    ’Mt’

    viscosity leak-off

    ’K’

    toughness storage

    ’Kt’

    toughness leak-off

    ’PKN’

    PKN

    ’KGD_K’

    KGD toughness

    ’MDR’

    MDR turbulent viscosity

    ’E_K’

    anisotropic toughness

    ’E_E’

    anisotropic elasticity

  • variable (string) – – the variable to be plotted. Possible options are ‘w’, ‘width’ or ‘p’, ‘pressure’.

  • mat_prop (MaterialProperties) – – the MaterialProperties object giving the material properties.

  • inj_prop (InjectionProperties) – – the InjectionProperties object giving the injection properties.

  • mesh (CartesianMesh) – – a CartesianMesh class object describing the grid.

  • fluid_prop (FluidProperties) – – the FluidProperties object giving the fluid properties.

  • fig (figure) – – figure object to superimpose the image.

  • projection (string) – – a string specifying the projection.

  • time_srs (list or ndarray) – – the times at which the analytical solution is to be plotted.

  • length_srs (list or ndarray) – – the length at which the analytical solution is to be plotted. It will be the radius of the fracture in the case of a radial fractures, length of the fracture in case of height contained fractures and the length of the minor axis in case of elliptical fractures.

  • h (float) – – the height of fracture in case of height contained hydraulic fractures

  • samp_cell (int) – – the cell from where the values of the parameter to be taken. If not given, values from the cell containing the injection point is taken

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • labels (LabelProperties) – – the labels to be used for the plot.

  • contours_at (list) – – the values at which the contours are to be plotted.

  • gamma (float) – – the aspect ratio, used in the case of elliptical fracture.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_analytical_solution_at_point(regime, variable, mat_prop, inj_prop, fluid_prop=None, fig=None, point=None, time_srs=None, length_srs=None, h=None, samp_cell=None, plot_prop=None, labels=None, gamma=None)[source]

This function plots the given analytical solution at a given point. It can be used to compare simulation results by superimposing on the figure obtained from the plot at point function.

Parameters
  • regime (string) –

    – the string specifying the limiting case solution to be plotted. The

    available options are.

    option

    limiting solution

    ’M’

    viscosity storage

    ’Mt’

    viscosity leak-off

    ’K’

    toughness storage

    ’Kt’

    toughness leak-off

    ’PKN’

    PKN

    ’KGD_K’

    KGD toughness

    ’MDR’

    MDR turbulent viscosity

    ’E_K’

    anisotropic toughness

    ’E_E’

    anisotropic elasticity

  • variable (string) – – the variable to be plotted. Possible options are ‘w’, ‘width’ or ‘p’, ‘pressure’.

  • mat_prop (MaterialProperties) – – the MaterialProperties object giving the material properties.

  • inj_prop (InjectionProperties) – – the InjectionProperties object giving the injection properties.

  • fluid_prop (FluidProperties) – – the FluidProperties object giving the fluid properties.

  • fig (figure) – – figure object to superimpose the image.

  • point (list or ndarray) – – the point at which the solution to be plotted [x, y].

  • time_srs (list or ndarray) – – the times at which the analytical solution is to be plotted.

  • length_srs (list or ndarray) – – the length at which the analytical solution is to be plotted. It will be the radius of the fracture in the case of a radial fractures, length of the fracture in case of height contained fractures and the length of the minor axis in case of elliptical fractures.

  • h (float) – – the height of fracture in case of height contained hydraulic fractures

  • samp_cell (int) – – the cell from where the values of the parameter to be taken. If not given, values from the cell containing the injection point is taken

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • labels (LabelProperties) – – the labels to be used for the plot.

  • gamma (float) – – the aspect ratio, used in the case of elliptical fracture.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_analytical_solution_slice(regime, variable, mat_prop, inj_prop, mesh=None, fluid_prop=None, fig=None, point1=None, point2=None, time_srs=None, length_srs=None, h=None, samp_cell=None, plot_prop=None, labels=None, gamma=None, plt_top_view=False)[source]

This function plots slice of the given analytical solution. It can be used to compare simulation results by superimposing on the figure obtained from the slice plot function.

Parameters
  • regime (string) –

    – the string specifying the limiting case solution to be plotted. The

    available options are.

    option

    limiting solution

    ’M’

    viscosity storage

    ’Mp’

    finite pulse viscosity storage

    ’Mt’

    viscosity leak-off

    ’K’

    toughness storage

    ’Kt’

    toughness leak-off

    ’PKN’

    PKN

    ’KGD_K’

    KGD toughness

    ’MDR’

    MDR turbulent viscosity

    ’E_K’

    anisotropic toughness

    ’E_E’

    anisotropic elasticity

  • variable (string) – – the variable to be plotted. Possible options are ‘w’, ‘width’ or ‘p’, ‘pressure’.

  • mat_prop (MaterialProperties) – – the MaterialProperties object giving the material properties.

  • inj_prop (InjectionProperties) – – the InjectionProperties object giving the injection properties.

  • mesh (CartesianMesh) – – a CartesianMesh class object describing the grid.

  • fluid_prop (FluidProperties) – – the FluidProperties object giving the fluid properties.

  • fig (figure) – – figure object to superimpose the image.

  • point1 (list or ndarray) – – the left point from which the slice should pass [x, y].

  • point2 (list or ndarray) – – the right point from which the slice should pass [x, y].

  • time_srs (list or ndarray) – – the times at which the analytical solution is to be plotted.

  • length_srs (list or ndarray) – – the length at which the analytical solution is to be plotted. It will be the radius of the fracture in the case of a radial fractures, length of the fracture in case of height contained fractures and the length of the minor axis in case of elliptical fractures.

  • h (float) – – the height of fracture in case of height contained hydraulic fractures

  • samp_cell (int) – – the cell from where the values of the parameter to be taken. If not given, values from the cell containing the injection point is taken

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • labels (LabelProperties) – – the labels to be used for the plot.

  • gamma (float) – – the aspect ratio, used in the case of elliptical fracture.

  • plt_top_view (bool) – – if True, top view will be plotted also

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_footprint_analytical(regime, mat_prop, inj_prop, fluid_prop=None, time_srs=None, h=None, samp_cell=None, fig=None, plot_prop=None, gamma=None, inj_point=None)[source]

This function plots footprint of the analytical solution fracture. It can be used to compare simulation results by superimposing on the figure obtained from the footprint plot.

Parameters
  • regime (string) –

    – the string specifying the limiting case solution to be plotted. The

    available options are.

    option

    limiting solution

    ’M’

    viscosity storage

    ’Mt’

    viscosity leak-off

    ’K’

    toughness storage

    ’Kt’

    toughness leak-off

    ’PKN’

    PKN

    ’KGD_K’

    KGD toughness

    ’MDR’

    MDR turbulent viscosity

    ’E_K’

    anisotropic toughness

    ’E_E’

    anisotropic elasticity

  • mat_prop (MaterialProperties) – – the MaterialProperties object giving the material properties.

  • inj_prop (InjectionProperties) – – the InjectionProperties object giving the injection properties.

  • fluid_prop (FluidProperties) – – the FluidProperties object giving the fluid properties.

  • time_srs (list or ndarray) – – the times at which the analytical solution is to be plotted.

  • h (float) – – the height of fracture in case of height contained hydraulic fractures

  • samp_cell (int) – – the cell from where the values of the parameter to be taken. If not given, values from the cell containing the injection point is taken.

  • fig (figure) – – figure object to superimpose the image.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • gamma (float) – – the aspect ratio, used in the case of elliptical fracture.

  • inj_point (list) – – a list of size 2, giving the x and y coordinate of the injection point.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_fracture_list(fracture_list, variable='footprint', projection=None, elements=None, plot_prop=None, fig=None, edge=4, contours_at=None, labels=None, mat_properties=None, backGround_param=None, plot_non_zero=True, source_loc=array([0, 0]))[source]

This function plots the fracture evolution with time. The state of the fracture at different times is provided in the form of a list of Fracture objects.

Parameters
  • fracture_list (list) – – the list of Fracture objects giving the evolution of fracture with time.

  • variable (string) – – the variable to be plotted. See supported_variables of the labels module for a list of supported variables.

  • mat_properties (MaterialProperties) – – the material properties. It is mainly used to colormap the mesh.

  • projection (string) – – a string specifying the projection. See supported_projections for the supported projections for each of the supported variable. If not provided, the default will be used.

  • elements (ndarray) – – the elements to be plotted.

  • backGround_param (string) – – the parameter according to which the the mesh will be colormapped.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • edge (int) – – the edge of the cell that will be plotted. This is for variables that are evaluated on the cell edges instead of cell center. It can have a value from 0 to 4 (0->left, 1->right, 2->bottom, 3->top, 4->average).

  • contours_at (list) – – the values at which the contours are to be plotted.

  • labels (LabelProperties) – – the labels to be used for the plot.

  • plot_non_zero (bool) – – if true, only non-zero values will be plotted.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_fracture_list_at_point(fracture_list, variable='width', point=None, plot_prop=None, fig=None, edge=4, labels=None)[source]

This function plots the fracture evolution on a given point.

Parameters
  • fracture_list (list) – – the list of Fracture objects giving the evolution of fracture with time.

  • variable (string) – – the variable to be plotted. See supported_variables of the labels module for a list of supported variables.

  • point (list or ndarray) – – the point at which the given variable is plotted against time [x, y].

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • edge (int) – – the edge of the cell that will be plotted. This is for variables that are evaluated on the cell edges instead of cell center. It can have a value from 0 to 4 (0->left, 1->right, 2->bottome, 3->top, 4->average).

  • labels (LabelProperties) – – the labels to be used for the plot.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_fracture_list_slice(fracture_list, variable='width', point1=None, point2=None, projection='2D', plot_prop=None, fig=None, edge=4, labels=None, plot_cell_center=False, orientation='horizontal', extreme_points=None, export2Json=False, export2Json_assuming_no_remeshing=True)[source]

This function plots the fracture evolution on a given slice of the domain. Two points are to be given that will be joined to form the slice. The values on the slice are either interpolated from the values available on the cell centers. Exact values on the cell centers can also be plotted.

Parameters
  • fracture_list (list) – – the list of Fracture objects giving the evolution of fracture with time.

  • variable (string) – – the variable to be plotted. See supported_variables of the labels module for a list of supported variables.

  • point1 (list or ndarray) – – the left point from which the slice should pass [x, y].

  • point2 (list or ndarray) – – the right point from which the slice should pass [x, y].

  • projection (string) – – a string specifying the projection. It can either ‘3D’ or ‘2D’.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • edge (int) – – the edge of the cell that will be plotted. This is for variables that are evaluated on the cell edges instead of cell center. It can have a value from 0 to 4 (0->left, 1->right, 2->bottom, 3->top, 4->average).

  • labels (LabelProperties) – – the labels to be used for the plot.

  • plot_cell_center (bool) – – if True, the discrete values at the cell centers will be plotted. In this case, the slice passing through the center of the cell containing point1 will be taken. The slice will be made according to the given orientation (see orientation). If False, the values will be interpolated on the line joining the given two points.

  • orientation (string) – – the orientation according to which the slice is made in the case the plotted values are not interpolated and are taken at the cell centers. Any of the four (‘vertical’, ‘horizontal’, ‘ascending’ and ‘descending’) orientation can be used.

  • extreme_points (ndarray) -- An empty array of shape (2, 2) – points of the plotted slice. These points can be used to plot analytical solution.

  • export2Json (bool) – data of the corresponding plot

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_fracture_slice_cell_center(var_value, mesh, point=None, orientation='horizontal', fig=None, plot_prop=None, vmin=None, vmax=None, plot_colorbar=True, labels=None, plt_2D_image=True, extreme_points=None, export2Json=False)[source]

This function plots the fracture on a given slice of the domain. A points along with the direction of the slice is given to form the slice. The slice is made from the center of the cell containing the given point along the given orientation.

Parameters
  • var_value (ndarray) – – a ndarray with the length of the number of cells in the mesh.

  • mesh (CartesianMesh) – – a CartesianMesh object giving the descritization of the domain.

  • point (list or ndarray) – – the point from which the slice should pass [x, y].

  • orientation (string) – – the orientation according to which the slice is made. Any of the four (‘vertical’, ‘horizontal’, ‘ascending’ and ‘descending’) orientations can be used.

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • vmin (float) – – the minimum value to be used to colormap and make the colorbar.

  • vmax (float) – – the maximum value to be used to colormap and make the colorbar.

  • plot_colorbar (bool) – – if True, colorbar will be plotted.

  • labels (LabelProperties) – – the labels to be used for the plot.

  • plt_2D_image (bool) – – if True, a subplot showing the colormap and the slice will also be plotted.

  • extreme_points (ndarray) -- An empty array of shape (2, 2) – points of the plotted slice. These points can be used to plot analytical solution.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_fracture_slice_interpolated(var_value, mesh, point1=None, point2=None, fig=None, plot_prop=None, vmin=None, vmax=None, plot_colorbar=True, labels=None, plt_2D_image=True, export2Json=False)[source]

This function plots the fracture on a given slice of the domain. Two points are to be given that will be joined to form the slice. The values on the slice are interpolated from the values available on the cell centers.

Parameters
  • var_value (ndarray) – – a ndarray with the length of the number of cells in the mesh.

  • mesh (CartesianMesh) – – a CartesianMesh object giving the descritization of the domain.

  • point1 (list or ndarray) – – the left point from which the slice should pass [x, y].

  • point2 (list or ndarray) – – the right point from which the slice should pass [x, y].

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • vmin (float) – – the minimum value to be used to colormap and make the colorbar.

  • vmax (float) – – the maximum value to be used to colormap and make the colorbar.

  • plot_colorbar (bool) – – if True, colorbar will be plotted.

  • labels (LabelProperties) – – the labels to be used for the plot.

  • plt_2D_image (bool) – – if True, a subplot showing the colormap and the slice will also be plotted.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_fracture_surface(width, mesh, fig=None, plot_prop=None, plot_colorbar=True, elements=None, vmin=None, vmax=None)[source]

This function plots the 2D fracture variable in the form of a surface.

Parameters
  • width (ndarray) – – the fracture width.

  • mesh (CartesianMesh) – – a CartesianMesh object giving the descritization of the domain.

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • elements (ndarray) – – the elements to be plotted.

  • vmin (float) – – the minimum value to be used to colormap and make the colorbar.

  • vmax (float) – – the maximum value to be used to colormap and make the colorbar.

  • plt_colorbar (bool) – – if True, colorbar will be plotted.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_fracture_variable_as_contours(var_value, mesh, fig=None, plot_prop=None, plt_backGround=True, plt_colorbar=True, contours_at=None, vmin=None, vmax=None)[source]

This function plots the contours of the 2D fracture variable.

Parameters
  • var_value (ndarray) – – a ndarray of the length of the number of cells in the mesh.

  • mesh (CartesianMesh) – – a CartesianMesh object giving the descritization of the domain.

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • plt_backGround (bool) – – if True, the colormap of the variable will also be plotted.

  • plt_colorbar (bool) – – if True, colorbar will be plotted.

  • contours_at (list or ndarray) – – the values at which the countours are to be plotted.

  • vmin (float) – – the minimum value to be used to colormap and make the colorbar.

  • vmax (float) – – the maximum value to be used to colormap and make the colorbar.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_fracture_variable_as_image(var_value, mesh, fig=None, plot_prop=None, elements=None, vmin=None, vmax=None, plt_colorbar=True)[source]

This function plots the 2D fracture variable in the form of a colormap.

Parameters
  • var_value (ndarray) – – a ndarray of the length of the number of cells in the mesh.

  • mesh (CartesianMesh) – – a CartesianMesh object giving the descritization of the domain.

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • elements (ndarray) – – the elements to be plotted.

  • vmin (float) – – the minimum value to be used to colormap and make the colorbar.

  • vmax (float) – – the maximum value to be used to colormap and make the colorbar.

  • plt_colorbar (bool) – – if True, colorbar will be plotted.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_fracture_variable_as_surface(var_value, mesh, fig=None, plot_prop=None, plot_colorbar=True, elements=None, vmin=None, vmax=None)[source]

This function plots the 2D fracture variable in the form of a surface.

Parameters
  • var_value (ndarray) – – a ndarray of the length of the number of cells in the mesh.

  • mesh (CartesianMesh) – – a CartesianMesh object giving the descritization of the domain.

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • elements (ndarray) – – the elements to be plotted.

  • vmin (float) – – the minimum value to be used to colormap and make the colorbar.

  • vmax (float) – – the maximum value to be used to colormap and make the colorbar.

  • plot_colorbar (bool) – – if True, colorbar will be plotted.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_fracture_variable_as_vector(var_value, mesh, Elements_to_plot, fig=None)[source]

This function plots a given 2D vector field.

Parameters
  • var_value

    – an array with each column having the following information: [fx left edge, fy left edge, fx right edge, fy right edge, fx bottom edge,

    fy bottom edge, fx top edge, fy top edge]

    note that “fx left edge” is the component along the x direction of the vector at the left edge of the cell. The name of the cell is coincident with the column position.

  • mesh (CartesianMesh) – – a CartesianMesh object giving the descritization of the domain.

  • Elements_to_plot – – list of cell names on whose edges plot the vectors.

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_injection_source(frac, fig=None, plot_prop=None)[source]

This function plots the location of the source.

visualization.plot_points_to_mkmtTriangle(fig, rgbpoints)[source]

This function plots a set of points in the m-k-mtilde triangle

Parameters
  • fig (figure) – – The figure with the Maxwell triangle to place the points.

  • rgbpoints (ndarraz) – – Color code in RGB of the points to plot.

visualization.plot_regime(var_value, mesh, fig=None, elements=None)[source]

This function plots the fracture regime with the color code defined by Dontsov. Plotting is done at the ribbon cells. The colorbar is replaced by the colorcoded triangle.

Parameters
  • var_value (list) – – List containing the color code at the tip.

  • mesh (object) – – mesh of the current timestep

  • fig (figure) – – Figure of the current footprint

  • elements – – the elements to be plotted.

visualization.plot_scale_3D(fracture, fig=None, plot_prop=None)[source]

This function plots lines with dimensions on the 3D fracture plot.

visualization.plot_slice_3D(var_value, mesh, point1=None, point2=None, fig=None, plot_prop=None, vmin=None, vmax=None, label=None)[source]

This function plots the fracture on a given slice of the domain in 3D. Two points are to be given that will be joined to form the slice. The values on the slice are interpolated from the values available on the cell centers.

Parameters
  • var_value (ndarray) – – a ndarray with the length of the number of cells in the mesh.

  • mesh (CartesianMesh) – – a CartesianMesh object giving the descritization of the domain.

  • point1 (list or ndarray) – – the left point from which the slice should pass [x, y].

  • point2 (list or ndarray) – – the right point from which the slice should pass [x, y].

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • vmin (float) – – the minimum value to be used to colormap and make the colorbar.

  • vmax (float) – – the maximum value to be used to colormap and make the colorbar.

  • label (LabelProperties) – – the label of plotted line to be used for legend.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.plot_variable_vs_time(time_list, value_list, fig=None, plot_prop=None, label=None)[source]

This function plots a given list of values against time.

Parameters
  • time_list (list or array) – – the list of times.

  • value_list (list or array) – – the list of values.

  • fig (Figure) – – the figure to superimpose on. New figure will be made if not provided.

  • plot_prop (PlotProperties) – – the properties to be used for the plot.

  • label (string) – – the label given to the plot line.

Returns

– A Figure object that can be used superimpose further plots.

Return type

(Figure)

visualization.remove_zeros(var_value, mesh, plot_boundary=False)[source]
visualization.save_images_to_video(image_folder, video_name='movie')[source]

This function makes a video from the images in the given folder.

visualization.text3d(ax, xyz, s, zdir='z', size=None, angle=0, usetex=False, **kwargs)[source]

Plots the string ‘s’ on the axes ‘ax’, with position ‘xyz’, size ‘size’, and rotation angle ‘angle’. ‘zdir’ gives the axis which is to be treated as the third dimension. usetex is a boolean indicating whether the string should be interpreted as latex or not. Any additional keyword arguments are passed on to transform_path.

Note: zdir affects the interpretation of xyz.

visualization.to_precision(x, p)[source]

returns a string representation of x formatted with a precision of p

Based on the webkit javascript implementation taken from here: https://code.google.com/p/webkit-mirror/source/browse/JavaScriptCore/kjs/number_object.cpp

visualization.zoom_factory(ax, base_scale=2.0)[source]