19 "Operator::Type is not supported: type_id = ";
30 MFEM_ABORT(
"cannot use HYPRE parallel matrix format: "
31 "MFEM is not built with HYPRE support");
38 MFEM_ABORT(
"cannot use PETSc matrix formats: "
39 "MFEM is not built with PETSc support");
42 MFEM_ABORT(
"invalid Operator::Type, type_id = " << (
int)
type_id);
49 HYPRE_Int *row_starts,
73 HYPRE_Int glob_num_cols, HYPRE_Int *row_starts,
82 row_starts, col_starts, diag);
89 row_starts, col_starts, diag,
type_id);
96 #endif // MFEM_USE_MPI
100 MFEM_VERIFY(A.
Type() == P.
Type(),
"type mismatch in A and P");
117 #ifdef MFEM_USE_PETSC
133 MFEM_VERIFY(A.
Type() == Rt.
Type(),
"type mismatch in A and Rt");
134 MFEM_VERIFY(A.
Type() == P.
Type(),
"type mismatch in A and P");
149 #ifdef MFEM_USE_PETSC
180 #ifdef MFEM_USE_PETSC
189 MFEM_VERIFY(
oper != NULL,
"conversion from type id = " << A.
Type()
190 <<
" to type id = " <<
Type() <<
" is not supported");
202 const int preserve_diag = 1;
205 for (
int i = 0; i < ess_dof_list.
Size(); i++)
218 MFEM_ABORT(
"type id = Operator::HYPRE_PARCSR requires MFEM_USE_MPI");
225 #ifdef MFEM_USE_PETSC
228 MFEM_ABORT(
"type id = Operator::PETSC_* requires MFEM_USE_PETSC");
245 As<SparseMatrix>()->PartMult(ess_dof_list, X, B);
254 MFEM_ABORT(
"type id = Operator::HYPRE_PARCSR requires MFEM_USE_MPI");
261 #ifdef MFEM_USE_PETSC
265 MFEM_ABORT(
"type id = Operator::PETSC_* requires MFEM_USE_PETSC");
int Size() const
Logical size of the array.
void EliminateRowsCols(const Array< int > &rows_cols, const HypreParVector &X, HypreParVector &B)
void ConvertFrom(OperatorHandle &A)
Convert the given OperatorHandle A to the currently set type id.
OpType * As() const
Return the Operator pointer statically cast to a specified OpType. Similar to the method Get()...
Wrapper for PETSc's matrix class.
void Mult(const Table &A, const Table &B, Table &C)
C = A * B (as boolean matrices)
Pointer to an Operator of a specified type.
Operator::Type Type() const
Get the currently set operator type id.
void EliminateBC(const OperatorHandle &A_e, const Array< int > &ess_dof_list, const Vector &X, Vector &B) const
Eliminate essential dofs from the solution X into the r.h.s. B.
void EliminateRowCol(int rc, const double sol, Vector &rhs, int d=0)
static const char not_supported_msg[]
void EliminateBC(HypreParMatrix &A, HypreParMatrix &Ae, const Array< int > &ess_dof_list, const Vector &X, Vector &B)
void AddMult(const DenseMatrix &b, const DenseMatrix &c, DenseMatrix &a)
Matrix matrix multiplication. A += B * C.
int Height() const
Get the height (size of output) of the Operator. Synonym with NumRows().
void EliminateRowsCols(OperatorHandle &A, const Array< int > &ess_dof_list)
Reset the OperatorHandle to be the eliminated part of A after elimination of the essential dofs ess_d...
HypreParMatrix * RAP(HypreParMatrix *A, HypreParMatrix *P)
Returns the matrix P^t * A * P.
Operator::Type CheckType(Operator::Type tid)
void Transpose(const Table &A, Table &At, int _ncols_A)
Transpose a Table.
Operator * Ptr() const
Access the underlying Operator pointer.
Type
Enumeration defining IDs for some classes derived from Operator.
void Clear()
Clear the OperatorHandle, deleting the held Operator (if owned), while leaving the type id unchanged...
void MakeSquareBlockDiag(MPI_Comm comm, HYPRE_Int glob_size, HYPRE_Int *row_starts, SparseMatrix *diag)
Reset the OperatorHandle to hold a parallel square block-diagonal matrix using the currently set type...
void pSet(OpType *A, bool own_A=true)
void EliminateRowsCols(const Array< int > &rows_cols, const HypreParVector &X, HypreParVector &B)
Eliminate rows and columns from the matrix, and rows from the vector B. Modify B with the BC values i...
void MakeRectangularBlockDiag(MPI_Comm comm, HYPRE_Int glob_num_rows, HYPRE_Int glob_num_cols, HYPRE_Int *row_starts, HYPRE_Int *col_starts, SparseMatrix *diag)
Reset the OperatorHandle to hold a parallel rectangular block-diagonal matrix using the currently set...
Wrapper for hypre's ParCSR matrix class.
void MakePtAP(OperatorHandle &A, OperatorHandle &P)
Reset the OperatorHandle to hold the product P^t A P.
void MakeRAP(OperatorHandle &Rt, OperatorHandle &A, OperatorHandle &P)
Reset the OperatorHandle to hold the product R A P, where R = Rt^t.