19 #if defined(MFEM_USE_MPI) && defined(MFEM_USE_PETSC)
20 #if (defined(HYPRE_BIGINT) && !defined(PETSC_USE_64BIT_INDICES)) || \
21 (!defined(HYPRE_BIGINT) && defined(PETSC_USE_64BIT_INDICES))
22 #error HYPRE and PETSC do not use the same size integers!
30 "Operator::Type is not supported: type_id = ";
41 MFEM_ABORT(
"cannot use HYPRE parallel matrix format: "
42 "MFEM is not built with HYPRE support");
49 MFEM_ABORT(
"cannot use PETSc matrix formats: "
50 "MFEM is not built with PETSc support");
53 MFEM_ABORT(
"invalid Operator::Type, type_id = " << (
int)
type_id);
60 HYPRE_Int *row_starts,
84 HYPRE_Int glob_num_cols, HYPRE_Int *row_starts,
93 row_starts, col_starts, diag);
100 row_starts, col_starts, diag,
type_id);
107 #endif // MFEM_USE_MPI
111 MFEM_VERIFY(A.
Type() == P.
Type(),
"type mismatch in A and P");
128 #ifdef MFEM_USE_PETSC
144 MFEM_VERIFY(A.
Type() == Rt.
Type(),
"type mismatch in A and Rt");
145 MFEM_VERIFY(A.
Type() == P.
Type(),
"type mismatch in A and P");
160 #ifdef MFEM_USE_PETSC
191 #ifdef MFEM_USE_PETSC
200 MFEM_VERIFY(
oper != NULL,
"conversion from type id = " << A.
Type()
201 <<
" to type id = " <<
Type() <<
" is not supported");
213 const int preserve_diag = 1;
216 for (
int i = 0; i < ess_dof_list.
Size(); i++)
229 MFEM_ABORT(
"type id = Hypre_ParCSR requires MFEM_USE_MPI");
236 #ifdef MFEM_USE_PETSC
239 MFEM_ABORT(
"type id = Operator::PETSC_* requires MFEM_USE_PETSC");
256 As<SparseMatrix>()->PartMult(ess_dof_list, X, B);
265 MFEM_ABORT(
"type id = Hypre_ParCSR requires MFEM_USE_MPI");
272 #ifdef MFEM_USE_PETSC
276 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()...
HypreParMatrix * RAP(const HypreParMatrix *A, const HypreParMatrix *P)
Returns the matrix P^t * A * P.
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...
Operator::Type CheckType(Operator::Type tid)
void EliminateRowsCols(const Array< int > &rows_cols, const PetscParVector &X, PetscParVector &B)
Eliminate rows and columns from the matrix, and rows from the vector B. Modify B with the BC values i...
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 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.