

Public Member Functions | |
| def | SetUseTranspose |
| def | Apply |
| def | ApplyInverse |
| def | NormInf |
| def | Label |
| def | UseTranspose |
| def | HasNormInf |
| def | Comm |
| def | OperatorDomainMap |
| def | OperatorRangeMap |
| def | __init__ |
| def | __disown__ |
Public Attributes | |
| this | |
For cross-language polymorphism to work in python, you must call this
constructor::
from PyTrilinos import Epetra
class MyOperator(Epetra.Operator):
def __init__(self):
Epetra.Operator.__init__(self)
Other than that, the Epetra.Operator class is much more forgiving than
its C++ counterpart. Often, you can override just the Label() and
Apply() methods.
| def PyTrilinos.NOX.Epetra.Operator.__init__ | ( | self, | |
| args | |||
| ) |
__init__(Epetra_Operator self) -> Operator
Reimplemented in PyTrilinos.NOX.Epetra.MatrixFree, PyTrilinos.NOX.Epetra.FiniteDifferenceColoring, PyTrilinos.NOX.Epetra.FiniteDifference, PyTrilinos.NOX.Epetra.JadMatrix, PyTrilinos.NOX.Epetra.FEVbrMatrix, PyTrilinos.NOX.Epetra.VbrMatrix, PyTrilinos.NOX.Epetra.FECrsMatrix, PyTrilinos.NOX.Epetra.CrsMatrix, PyTrilinos.NOX.Epetra.BasicRowMatrix, PyTrilinos.NOX.Epetra.RowMatrix, and PyTrilinos.NOX.Epetra.InvOperator.
| def PyTrilinos.NOX.Epetra.Operator.Apply | ( | self, | |
| args | |||
| ) |
Apply(self, MultiVector x, MultiVector y) -> int
In C++, the Apply() method is pure virtual, thus intended to be
overridden by derived classes. In python, cross-language polymorphism
is supported, and you are expected to derive classes from this base
class and redefine the Apply() method. C++ code (e.g., AztecOO
solvers) can call back to your Apply() method as needed. You must
support two arguments, labeled here MultiVector x and MultiVector y.
These will be converted from Epetra_MultiVector C++ objects to
numpy-hybrid Epetra.MultiVector objects before they are passed to you.
Thus, it is legal to use slice indexing and other numpy features to
compute y from x.
If application of your operator is successful, return 0; else return
some non-zero error code.
It is strongly suggested that you prevent Apply() from raising any
exceptions. Accidental errors can be prevented by wrapping your code
in a try block:
try:
# Your code goes here...
except Exception, e:
print 'A python exception was raised by method Apply:'
print e
return -1
By returning a -1, you inform the calling routine that Apply() was
unsuccessful.
Reimplemented in PyTrilinos.NOX.Epetra.MatrixFree, PyTrilinos.NOX.Epetra.FiniteDifference, PyTrilinos.NOX.Epetra.VbrMatrix, PyTrilinos.NOX.Epetra.CrsMatrix, PyTrilinos.NOX.Epetra.BasicRowMatrix, and PyTrilinos.NOX.Epetra.InvOperator.
| def PyTrilinos.NOX.Epetra.Operator.ApplyInverse | ( | self, | |
| args | |||
| ) |
ApplyInverse(self, MultiVector x, MultiVector y) -> int
In C++, the ApplyInverse() method is pure virtual, thus intended to be
overridden by derived classes. In python, cross-language polymorphism
is supported, and you are expected to derive classes from this base
class and redefine the ApplyInverse() method. C++ code (e.g., AztecOO
solvers) can call back to your ApplyInverse() method as needed. You
must support two arguments, labeled here MultiVector x and MultiVector
y. These will be converted from Epetra_MultiVector C++ objects to
numpy-hybrid Epetra.MultiVector objects before they are passed to you.
Thus, it is legal to use slice indexing and other numpy features to
compute y from x.
If application of your operator is successful, return 0; else return
some non-zero error code.
It is strongly suggested that you prevent ApplyInverse() from raising
any exceptions. Accidental errors can be prevented by wrapping your
code in a try block:
try:
# Your code goes here...
except Exception, e:
print 'A python exception was raised by method ApplyInverse:'
print e
return -1
By returning a -1, you inform the calling routine that ApplyInverse()
was unsuccessful.
Reimplemented in PyTrilinos.NOX.Epetra.MatrixFree, PyTrilinos.NOX.Epetra.FiniteDifference, PyTrilinos.NOX.Epetra.VbrMatrix, PyTrilinos.NOX.Epetra.CrsMatrix, PyTrilinos.NOX.Epetra.BasicRowMatrix, and PyTrilinos.NOX.Epetra.InvOperator.
| def PyTrilinos.NOX.Epetra.Operator.Comm | ( | self, | |
| args | |||
| ) |
Comm(Operator self) -> Comm
Reimplemented in PyTrilinos.NOX.Epetra.MatrixFree, PyTrilinos.NOX.Epetra.FiniteDifference, PyTrilinos.NOX.Epetra.VbrMatrix, PyTrilinos.NOX.Epetra.CrsMatrix, PyTrilinos.NOX.Epetra.BasicRowMatrix, and PyTrilinos.NOX.Epetra.InvOperator.
| def PyTrilinos.NOX.Epetra.Operator.HasNormInf | ( | self, | |
| args | |||
| ) |
HasNormInf(Operator self) -> bool
Reimplemented in PyTrilinos.NOX.Epetra.MatrixFree, PyTrilinos.NOX.Epetra.FiniteDifference, PyTrilinos.NOX.Epetra.VbrMatrix, PyTrilinos.NOX.Epetra.CrsMatrix, PyTrilinos.NOX.Epetra.BasicRowMatrix, and PyTrilinos.NOX.Epetra.InvOperator.
| def PyTrilinos.NOX.Epetra.Operator.Label | ( | self, | |
| args | |||
| ) |
Label(Operator self) -> char const *
Reimplemented in PyTrilinos.NOX.Epetra.MatrixFree, PyTrilinos.NOX.Epetra.FiniteDifference, PyTrilinos.NOX.Epetra.VbrMatrix, PyTrilinos.NOX.Epetra.CrsMatrix, PyTrilinos.NOX.Epetra.BasicRowMatrix, and PyTrilinos.NOX.Epetra.InvOperator.
| def PyTrilinos.NOX.Epetra.Operator.NormInf | ( | self, | |
| args | |||
| ) |
NormInf(Operator self) -> double
Reimplemented in PyTrilinos.NOX.Epetra.MatrixFree, PyTrilinos.NOX.Epetra.FiniteDifference, PyTrilinos.NOX.Epetra.VbrMatrix, PyTrilinos.NOX.Epetra.CrsMatrix, PyTrilinos.NOX.Epetra.BasicRowMatrix, PyTrilinos.NOX.Epetra.RowMatrix, and PyTrilinos.NOX.Epetra.InvOperator.
| def PyTrilinos.NOX.Epetra.Operator.OperatorDomainMap | ( | self, | |
| args | |||
| ) |
OperatorDomainMap(Operator self) -> Map
Reimplemented in PyTrilinos.NOX.Epetra.MatrixFree, PyTrilinos.NOX.Epetra.FiniteDifference, PyTrilinos.NOX.Epetra.VbrMatrix, PyTrilinos.NOX.Epetra.CrsMatrix, PyTrilinos.NOX.Epetra.BasicRowMatrix, and PyTrilinos.NOX.Epetra.InvOperator.
| def PyTrilinos.NOX.Epetra.Operator.OperatorRangeMap | ( | self, | |
| args | |||
| ) |
OperatorRangeMap(Operator self) -> Map
Reimplemented in PyTrilinos.NOX.Epetra.MatrixFree, PyTrilinos.NOX.Epetra.FiniteDifference, PyTrilinos.NOX.Epetra.VbrMatrix, PyTrilinos.NOX.Epetra.CrsMatrix, PyTrilinos.NOX.Epetra.BasicRowMatrix, and PyTrilinos.NOX.Epetra.InvOperator.
| def PyTrilinos.NOX.Epetra.Operator.SetUseTranspose | ( | self, | |
| args | |||
| ) |
SetUseTranspose(Operator self, bool UseTranspose) -> int
Reimplemented in PyTrilinos.NOX.Epetra.MatrixFree, PyTrilinos.NOX.Epetra.FiniteDifference, PyTrilinos.NOX.Epetra.VbrMatrix, PyTrilinos.NOX.Epetra.CrsMatrix, PyTrilinos.NOX.Epetra.BasicRowMatrix, and PyTrilinos.NOX.Epetra.InvOperator.
| def PyTrilinos.NOX.Epetra.Operator.UseTranspose | ( | self, | |
| args | |||
| ) |
UseTranspose(Operator self) -> bool
Reimplemented in PyTrilinos.NOX.Epetra.MatrixFree, PyTrilinos.NOX.Epetra.FiniteDifference, PyTrilinos.NOX.Epetra.VbrMatrix, PyTrilinos.NOX.Epetra.CrsMatrix, PyTrilinos.NOX.Epetra.BasicRowMatrix, and PyTrilinos.NOX.Epetra.InvOperator.
1.7.6.1