This module contains functions employing the VTK toolkit to plot grid functions and solutions of integral equations.
Visualize multiple scalar or vector data sets in the same plot.
This function plots an arbitrary number of grids, grid functions and data sets sampled on regular 2D grids of points in a single window. The grid functions and structured grid data can be scalar- or vector-valued depending on the value of the parameter ‘scalar’.
None, an object returned by tvtkGrid(), or a list of such objects.
None, an object returned by tvtkGridFunction(), or a list of such objects.
None, an object returned by tvtkStructuredGridData(), or a list of such objects.
Can be None or a tuple of two floats. In the first case, the data range of the plot will be determined automatically, otherwise it will be set to the specified tuple.
If True, the arguments tvtkGridFunctions and tvtkStructuredGridData should represent scalar-valued data sets, otherwise vector-valued data sets.
Returns a Traits object that contains the visualization.
Visualize a grid.
The grid to be plotted.
Plot type (e.g. ‘wireframe’, ‘surface’).
Returns a Traits object that contains the visualization.
Visualize a grid function.
The grid function to be plotted.
Returns a Traits object that contains the visualization.
Visualize multiple scalar data sets in the same plot.
None, an object returned by tvtkGrid(), or a list of such objects.
None, an object returned by tvtkGridFunction(), or a list of such objects.
None, an object returned by tvtkStructuredGridData(), or a list of such objects.
Can be None or a tuple of two floats. In the first case, the data range of the plot will be determined automatically, otherwise it will be set to the specified tuple.
Returns a Traits object that contains the visualization.
Visualize data sampled on a regular 2D grid of points.
Array of point coordinates of dimension (3, np), where np is the number of points. The points should be lying on a regular grid.
Array of data values corresponding to each point. It can be either a 1D array of length np (number of points) or a 2D array of dimensions (1, np) or (3, np).
A tuple of two numbers representing the first and second dimension of the grid of points. Their product must be equal to np.
Can be None or a tuple of two floats. In the first case, the data range of the plot will be determined automatically, otherwise it will be set to the specified tuple.
Returns a Traits object that contains the visualization.
Example usage:
import numpy as np
from bempp import visualization2 as vis
x, y, z = np.mgrid[0:1:5j, 0:2:10j, 0:0:1j]
nx, ny = x.shape[:2]
points = np.vstack((x.ravel(), y.ravel(), z.ravel()))
evaluationOptions = createEvaluationOptions()
field = somePotentialOperator.evaluateAtPoints(someGridFunction, points,
evaluationOptions)
vis.plotStructuredGridData(points, field, (nx, ny))
Plot a three planes view of data.
An mgrid object defining points in a box.
The corresponding values.
Potential values in the correct format are returned by the function tools.evaluatePotentialInBox.
Visualize multiple scalar data sets in the same plot.
This function plots an arbitrary number of grids, vector-valued grid functions and data sets sampled on regular 2D grids of points in a single window.
None, an object returned by tvtkGrid(), or a list of such objects.
None, an object returned by tvtkGridFunction(), or a list of such objects.
None, an object returned by tvtkStructuredGridData(), or a list of such objects.
Can be None or a tuple of two floats. In the first case, the data range of the plot will be determined automatically, otherwise it will be set to the specified tuple.
Returns a Traits object that contains the visualization.
Display the graphical objects created so far
Return a TVTK object visualizing the specified grid.
Return a TVTK object visualizing the specified grid function.
Return a TVTK object visualizing data on a structured grid.
Array of point coordinates of dimension (3, np), where np is the number of points. The points should be lying on a regular grid.
Array of data values corresponding to each point. It can be either a 1D array of length np (number of points) or a 2D array of dimensions (1, np) or (3, np).
A tuple of two numbers representing the first and second dimension of the grid of points. Their product must be equal to np.
Example usage:
import numpy as np
from bempp import visualization2 as vis
evaluationOptions = createEvaluationOptions()
x, y, z = np.mgrid[0:1:5j, 0:2:10j, 0:0:1j]
nx, ny = x.shape[:2]
points = np.vstack((x.ravel(), y.ravel(), z.ravel()))
field = somePotentialOperator.evaluateAtPoints(someGridFunction, points,
evaluationOptions)
tvtkObj1 = vis.tvtkStructuredGridData(points, field, (nx, ny))
x, y, z = np.mgrid[0:0:1j, 0:2:10j, 0:5:7j]
ny, nz = x.shape[1:]
points = np.vstack((x.ravel(), y.ravel(), z.ravel()))
field = somePotentialOperator.evaluateAtPoints(someGridFunction, points,
evaluationOptions)
tvtkObj2 = vis.tvtkStructuredGridData(points, field, (ny, nz))
plotScalarData(tvtkStructuredData=[tvtkObj1, tvtkObj2])