Module Expr Str Import alias identifier ImportFrom alias alias alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num Num Num If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num BinOpMult Num NameLoad Num If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num Num Num Assign NameStore Call AttributeLoad BinOpMult Call NameLoad NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad attr Assign NameStore Call AttributeLoad BinOpMult Call NameLoad NameLoad SubscriptLoad NameLoad ExtSlice Slice Index NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad BinOpMult Call NameLoad NameLoad Call NameLoad NameLoad Num Assign NameStore Num For NameStore NameLoad body Assign NameStore BinOpAdd NameLoad Call NameLoad NameLoad Assign NameStore SubscriptLoad NameLoad Slice NameLoad NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index Num NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index Num NameLoad Assign SubscriptStore NameLoad ExtSlice Slice Index Num NameLoad Assign NameStore NameLoad Return NameLoad decorator_list Assign NameStore TupleLoad Num Num Num Assign NameStore Call AttributeLoad NameLoad attr Num BinOpMult Num AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr Num Num SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr Num Num SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr BinOpAdd BinOpAdd BinOpPow SubscriptLoad NameLoad ExtSlice Slice Index Num Num BinOpPow SubscriptLoad NameLoad ExtSlice Slice Index Num Num BinOpPow SubscriptLoad NameLoad ExtSlice Slice Index Num Num Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr Str FunctionDef arguments args defaults body ImportFrom alias ImportFrom alias alias Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Assign NameStore Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr If CompareEq NameLoad Str body Expr Call NameLoad
N/A N/A An example of how to generate a structured grid dataset using
numpy arrays.  Also shown is a way to visualize this data with
the mayavi2 application.

The script can be run like so::

  $ mayavi2 -x structured_grid.py

Alternatively, it can be run as::

  $ python structured_grid.py


 N/A numpy np numpy cos sin pi tvtk.api tvtk mayavi.scripts mayavi2 generate_annulus N/A N/A r theta z N/A None None None N/A N/A  Generate points for structured grid for a cylindrical annular
        volume.  This method is useful for generating a structured
        cylindrical mesh for VTK (and perhaps other tools).

        Parameters
        ----------
        r : array : The radial values of the grid points.
                    It defaults to linspace(1.0, 2.0, 11).

        theta : array : The angular values of the x axis for the grid
                        points. It defaults to linspace(0,2*pi,11).

        z: array : The values along the z axis of the grid points.
                   It defaults to linspace(0,0,1.0, 11).

        Return
        ------
        points : array
            Nx3 array of points that make up the volume of the annulus.
            They are organized in planes starting with the first value
            of z and with the inside "ring" of the plane as the first
            set of points.  The default point array will be 1331x3.
     N/A N/A r None N/A N/A r N/A N/A np linspace 1.0 2.0 11 N/A N/A theta None N/A N/A theta N/A N/A np linspace 0 N/A 2 pi 11 N/A N/A z None N/A N/A z N/A N/A np linspace 0.0 1.0 11 N/A x_plane N/A N/A N/A N/A cos theta N/A r N/A N/A N/A None ravel N/A y_plane N/A N/A N/A N/A sin theta N/A r N/A N/A N/A None ravel N/A points N/A N/A np empty N/A N/A N/A len x_plane N/A len z 3 N/A start 0 N/A z_plane z N/A N/A end N/A start N/A len x_plane N/A plane_points N/A points N/A start end N/A N/A plane_points N/A N/A N/A 0 x_plane N/A N/A plane_points N/A N/A N/A 1 y_plane N/A N/A plane_points N/A N/A N/A 2 z_plane N/A start end N/A points N/A N/A dims N/A 51 25 25 N/A theta N/A N/A np linspace 0 N/A 2 N/A np pi N/A dims N/A 0 N/A r N/A N/A np linspace 1 10 N/A dims N/A 1 N/A z N/A N/A np linspace 0 5 N/A dims N/A 2 N/A pts N/A generate_annulus r theta z N/A sgrid N/A N/A tvtk StructuredGrid dimensions dims N/A N/A sgrid points pts N/A s N/A N/A np sqrt N/A N/A N/A N/A pts N/A N/A N/A 0 2 N/A N/A pts N/A N/A N/A 1 2 N/A N/A pts N/A N/A N/A 2 2 N/A N/A N/A sgrid point_data scalars N/A N/A np ravel N/A N/A s copy N/A N/A N/A N/A sgrid point_data scalars name scalars view N/A N/A N/A N/A mayavi.sources.vtk_data_source VTKDataSource mayavi.modules.api Outline GridPlane N/A N/A N/A mayavi new_scene N/A src N/A VTKDataSource data sgrid N/A N/A N/A mayavi add_source src N/A N/A N/A mayavi add_module N/A Outline N/A g N/A GridPlane N/A N/A N/A g grid_plane axis x N/A N/A N/A mayavi add_module g N/A g N/A GridPlane N/A N/A N/A g grid_plane axis y N/A N/A N/A mayavi add_module g N/A g N/A GridPlane N/A N/A N/A g grid_plane axis z N/A N/A N/A mayavi add_module g N/A N/A mayavi2 standalone N/A N/A __name__ __main__ N/A N/A N/A view