PyTrilinos Logo PyTrilinos.EpetraExt


The EpetraExt package supports a wide variety of extensons to the Epetra package, only a handful of which have been given python wrappers. These wrappers can be categorized as follows:

Graph Coloring Classes

EpetraExt has two classes for aiding with creating color maps.

  • EpetraExt.CrsGraph_MapColoring
  • EpetraExt.CrsGraph_MapColoringIndex

The first is the functor CrsGraph_MapColoring. Note than only the default constructor is currently supported. Once such an object is created, you can call it with an Epetra.CrsGraph argument to call a coloring algorithm and obtain an Epetra.MapColoring object.

The second class is the CrsGraph_MapColoringIndex functor. Use an Epetra.MapColoring object in the constructor and an Epetra.CrsGraph object as the argument when you call it.

Input Functions

  • EpetraExt.MatlabFileToCrsMatrix(str filename, Epetra.Comm) -> Epetra.CrsMatrix
  • EpetraExt.MatrixMarketFileToBlockMap(str filename, Epetra.Comm) -> Epetra.BlockMap
  • EpetraExt.MatrixMarketFileToBlockMaps(str filename, Epetra.Comm) -> (Epetra.BlockMap rowMap, Epetra.BlockMap colMap, Epetra.BlockMap rangeMap, Epetra.BlockMap domainMap)
  • EpetraExt.MatrixMarketFileToCrsMatrix(str filename, Epetra.Map rowMap, Epetra.Map colMap=None, Epetra.Map rangeMap=None, Epetra.Map domainMap=None) -> Epetra.CrsMatrix
  • EpetraExt.MatrixMarketFileToMap(str filename, Epetra.Comm) -> Epetra.Map
  • EpetraExt.MatrixMarketFileToMultiVector(str filename, Epetra.BlockMap) -> Epetra.MultiVector

Output Functions

  • EpetraExt.BlockMapToHandle(file handle, Epetra.BlockMap map) -> int
  • EpetraExt.BlockMapToMatrixMarketFile(str filename, Epetra.BlockMap map, str mapName=None, str descr=None, bool writeHeader=True) -> int
  • EpetraExt.MultiVectorToHandle(file handle, Epetra.MultiVector) -> int
  • EpetraExt.MultiVectorToMatlabFile(str filename, Epetra.MultiVector) -> int
  • EpetraExt.MultiVectorToMatlabHandle(file handle, Epetra.MultiVector) -> int
  • EpetraExt.MultiVectorToMatrixMarketFile(str filename, Epetra.MultiVector) -> int
  • EpetraExt.MultiVectorToMatrixMarketHandle(file handle, Epetra.MuiltiVector) -> int
  • EpetraExt.RowMatrixToHandle(file handle, Epetra.RowMatrix) -> int
  • EpetraExt.RowMatrixToMatlabFile(str filename, Epetra.RowMatrix) -> int
  • EpetraExt.RowMatrixToMatrixMarketFile(str filename, Epetra.RowMatrix) -> int

Input/Output Classes

  • EpetraExt.HDF5
  • EpetraExt.XMLReader
  • EpetraExt.XMLWriter

The EpetraExt.HDF5 and EpetraExt.XMLReader classes both support overloaded Read() methods in C++, but these cannot be type-disambiguated in python. Therefore, the Read() methods are ignored and replaced with python versions that have the type name in the method. Therefore, if obj is an EpetraExt.HDF5 or EpetraExt.XMLReader object, then, these methods are supported:

  • obj.ReadMap(str) -> Epetra.Map
  • obj.ReadMultiVector(str) -> Epetra.MultiVector
  • obj.ReadCrsGraph(str) -> Epetra.CrsGraph
  • obj.ReadCrsMatrix(str) -> Epetra.CrsMatrix

In addition, the EpetraExt.HDF5 objects support the following additional methods:

  • obj.ReadBlockMap(str) -> Epetra.BlockMap
  • obj.ReadIntVector(str) -> Epetra.IntVector

Matrix-Matrix Functions

So far, only addition is supported:

  • EpetraExt.Add(Epetra.CrsMatrix A, bool flag, float valA, Epetra.CrsMatrix B, float valB) -> int

    Compute B <- valA * A + valB * B. If flag is True, use the transpose of A. B must either have the structure of A+B or not yet have FillComplete() called on it.