SERiF 0.0.1a
3+1D Stellar Structure and Evolution
|
A trampoline class for mfem::Matrix. More...
#include <PyMatrix.h>
Public Member Functions | |
mfem::real_t & | Elem (int i, int j) override |
Access element (i,j) for read/write. Pure virtual in mfem::Matrix. Must be overridden in Python. | |
const mfem::real_t & | Elem (int i, int j) const override |
Access element (i,j) for read-only. Pure virtual in mfem::Matrix. Must be overridden in Python. | |
mfem::MatrixInverse * | Inverse () const override |
Get the inverse of the matrix. Pure virtual in mfem::Matrix. Must be overridden in Python. The caller is responsible for deleting the returned MatrixInverse object. | |
void | Finalize (int skip_zeros) override |
Finalize matrix assembly. For sparse matrices, this typically involves finalizing the sparse structure. Can be overridden in Python. | |
void | Mult (const mfem::Vector &x, mfem::Vector &y) const override |
Perform the operator action: y = A*x. Inherited from mfem::Operator. Can be overridden in Python. If not overridden, mfem::Matrix's default implementation is used. | |
void | MultTranspose (const mfem::Vector &x, mfem::Vector &y) const override |
Perform the transpose operator action: y = A^T*x. Inherited from mfem::Operator. Can be overridden in Python. | |
void | AddMult (const mfem::Vector &x, mfem::Vector &y, const mfem::real_t a=1.0) const override |
Perform the action y += a*(A*x). Inherited from mfem::Operator. Can be overridden in Python. | |
void | AddMultTranspose (const mfem::Vector &x, mfem::Vector &y, const mfem::real_t a=1.0) const override |
Perform the action y += a*(A^T*x). Inherited from mfem::Operator. Can be overridden in Python. | |
mfem::Operator & | GetGradient (const mfem::Vector &x) const override |
Get the gradient operator (Jacobian) at a given point x. Inherited from mfem::Operator. Can be overridden in Python. For a linear matrix operator, the gradient is typically the matrix itself. | |
void | AssembleDiagonal (mfem::Vector &diag) const override |
Assemble the diagonal of the operator. Inherited from mfem::Operator. Can be overridden in Python. | |
const mfem::Operator * | GetProlongation () const override |
Get the prolongation operator. Inherited from mfem::Operator. Can be overridden in Python. | |
const mfem::Operator * | GetRestriction () const override |
Get the restriction operator. Inherited from mfem::Operator. Can be overridden in Python. | |
void | RecoverFEMSolution (const mfem::Vector &X, const mfem::Vector &b, mfem::Vector &x) override |
Recover the FEM solution. Inherited from mfem::Operator. Can be overridden in Python. | |
A trampoline class for mfem::Matrix.
This class allows Python classes to inherit from mfem::Matrix and correctly override its virtual functions, including those inherited from its base, mfem::Operator. This is useful for creating custom matrix types in Python that can interact seamlessly with MFEM's C++ components.
Definition at line 118 of file PyMatrix.h.
|
override |
Perform the action y += a*(A*x). Inherited from mfem::Operator. Can be overridden in Python.
x | The input vector. |
y | The vector to which a*(A*x) is added. |
a | Scalar multiplier (defaults to 1.0). |
Definition at line 70 of file PyMatrix.cpp.
|
override |
Perform the action y += a*(A^T*x). Inherited from mfem::Operator. Can be overridden in Python.
x | The input vector. |
y | The vector to which a*(A^T*x) is added. |
a | Scalar multiplier (defaults to 1.0). |
Definition at line 81 of file PyMatrix.cpp.
|
override |
Assemble the diagonal of the operator. Inherited from mfem::Operator. Can be overridden in Python.
diag | Output vector to store the diagonal entries. |
Definition at line 101 of file PyMatrix.cpp.
|
override |
Access element (i,j) for read-only. Pure virtual in mfem::Matrix. Must be overridden in Python.
i | Row index. |
j | Column index. |
Definition at line 18 of file PyMatrix.cpp.
|
override |
Access element (i,j) for read/write. Pure virtual in mfem::Matrix. Must be overridden in Python.
i | Row index. |
j | Column index. |
Definition at line 8 of file PyMatrix.cpp.
|
override |
Finalize matrix assembly. For sparse matrices, this typically involves finalizing the sparse structure. Can be overridden in Python.
skip_zeros | See mfem::SparseMatrix::Finalize documentation. |
Definition at line 38 of file PyMatrix.cpp.
|
override |
Get the gradient operator (Jacobian) at a given point x. Inherited from mfem::Operator. Can be overridden in Python. For a linear matrix operator, the gradient is typically the matrix itself.
x | The point at which to evaluate the gradient (often unused for linear operators). |
Definition at line 92 of file PyMatrix.cpp.
|
override |
Get the prolongation operator. Inherited from mfem::Operator. Can be overridden in Python.
Definition at line 110 of file PyMatrix.cpp.
|
override |
Get the restriction operator. Inherited from mfem::Operator. Can be overridden in Python.
Definition at line 118 of file PyMatrix.cpp.
|
override |
Get the inverse of the matrix. Pure virtual in mfem::Matrix. Must be overridden in Python. The caller is responsible for deleting the returned MatrixInverse object.
Definition at line 28 of file PyMatrix.cpp.
|
override |
Perform the operator action: y = A*x. Inherited from mfem::Operator. Can be overridden in Python. If not overridden, mfem::Matrix's default implementation is used.
x | The input vector. |
y | The output vector (result of A*x). |
Definition at line 49 of file PyMatrix.cpp.
|
override |
Perform the transpose operator action: y = A^T*x. Inherited from mfem::Operator. Can be overridden in Python.
x | The input vector. |
y | The output vector (result of A^T*x). |
Definition at line 60 of file PyMatrix.cpp.
|
override |
Recover the FEM solution. Inherited from mfem::Operator. Can be overridden in Python.
X | The reduced solution vector. |
b | The right-hand side vector. |
x | Output vector for the full FEM solution. |
Definition at line 126 of file PyMatrix.cpp.