PyTrilinos  Development
 All Classes Functions
Public Member Functions | Public Attributes | Static Public Attributes
PyTrilinos.Isorropia.NestedEpetra.Visualizer Class Reference

List of all members.

Public Member Functions

def __init__
def processRow
def generateImage
def show
def save
def getPILImage
def simpleGenerate
def setBgColor
def setImageHeight
def setImageWidth
def setViewingWindow
def setVerbosity
def fillColorArray
def centralizeMatrix
def centralizePartitioner
def centralizePartitioner2D

Public Attributes

 comm
 numProcs
 verbosity
 loadThreshold
 matrixHeight
 matrixWidth
 pointBR
 regionHeight
 regionWidth
 imageHeight
 fillColors
 background
 imageWidth
 pointTL

Static Public Attributes

 data = None
 dataType = None
int numProcs = 0
int verbosity = 0
 iAmRoot = False
int loadThreshold = 0
 img = None
int background = 0x000000
int matrixHeight = 1
int matrixWidth = 1
int imageHeight = 1
int imageWidth = 1
tuple pointTL = (0,0)
tuple pointBR = (-1,-1)
int regionHeight = 1
int regionWidth = 1

Detailed Description

The Visualizer class provides a means of simply visualizing partitions
formed by Isorropia.Epetra.Partitioner or Partitioner2D. It can also draw
Epetra.CrsMatrix objects directly.

The Visualizer relies on the Python Imaging Library and ImageMagick.

To generate images of multiple sizes given the same partitioner, you'll
need to call generateImage() several times, calling getPILImage() after
each call and saving the result. You can then save or show those images as
necessary.


Constructor & Destructor Documentation

def PyTrilinos.Isorropia.NestedEpetra.Visualizer.__init__ (   self,
  data,
  numParts = -1,
  loadThreshold = 0,
  verbosity = 0 
)
Visualizer constructor.
Inputs: data      - CrsMatrix or Partitioner
numParts  - The number of parts to distribute into.
            Defaults to the number of processes in MPI.
loadThreshold - The threshold ratio that must be exceeded
            for the visualizer to display something in that
            pixel. Zero is a safe choice.
verbosity - Print debugging output. High number increases
            quantity of output.

       The initialization first reassigns the values in the matrix to represent
       the processor they reside on (or have been partitioned to), then
       redistributes the matrix onto the root processor for use in show().

Member Function Documentation

Performs two operations:
    1. Replaces all non-zero values in the matrix with a value
       representing that non-zero's global part ID
    2. Repartitions such that all elements in the matrix are owned by
       the main process.
Reset the values in each row of the matrix to this processor's ID 
Performs three operations:
    1. Replaces the partitioner with a new CrsMatrix, maintaining
       non-zero distribution (with the same RowMap).
    1. Replaces all non-zero values in the matrix with a value
       representing that non-zero's global part ID
    2. Repartitions such that all elements in the matrix are owned by
       the main process.

Exactly the same as centralizePartitioner(), but accepting a Partitioner2D.

Creates a new CrsMatrix to represent the Partitioner2D's matrix
structure. This new CrsMatrix has the same distribution as the
Partitioner2D's matrix, but the values of the nonzeroes represent their
'destination' processors in the Partitioner's new Map
Given the number of partitions, returns an array of at least that many
distinct color values
Opens an image window representing the matrix stored in this object's
data field. This opened window allows saving the image.

The colors chosen to represent each processor are evenly distributed
along the hue and presently can not be customized.

Returns the PIL Image object generated by generateImage(). Returns None
if no image has yet been generated.
def PyTrilinos.Isorropia.NestedEpetra.Visualizer.processRow (   self,
  row,
  draw 
)
processRow() is a private helper to draw an individual row of pixels of
the image when simpleGenerate() can't be used.

def PyTrilinos.Isorropia.NestedEpetra.Visualizer.save (   self,
  filename 
)
Saves the pre-generated image to the given file. The format is derived
from the filename. Must be preceded by a call to generateImage().

Shows the pre-generated image. Must be preceded by a call to generateImage().
Draws the matrix to the provided image object, provided that the width
and height of the image exceed the number of columns and rows of the matrix.

Used by generateImage().

The documentation for this class was generated from the following file:
 All Classes Functions