42#ifndef EPETRAEXT_HYPREIJMATRIX_H_
43#define EPETRAEXT_HYPREIJMATRIX_H_
46#include "Epetra_Object.h"
47#include "Epetra_CompObject.h"
48#include "Epetra_BasicRowMatrix.h"
49#include "Epetra_Map.h"
50#include "Epetra_Import.h"
51#include "Epetra_MpiComm.h"
55#include "HYPRE_parcsr_ls.h"
56#include "_hypre_parcsr_mv.h"
57#include "HYPRE_parcsr_mv.h"
58#include "HYPRE_IJ_mv.h"
59#include "_hypre_IJ_mv.h"
129 int ExtractMyRowCopy(
int MyRow,
int Length,
int & NumEntries,
double *Values,
int * Indices)
const;
364 {
return HYPRE_BoomerAMGCreate(solver);}
368 {
return HYPRE_ParaSailsCreate(comm, solver);}
372 {
return HYPRE_EuclidCreate(comm, solver);}
376 {
return HYPRE_AMSCreate(solver);}
380 {
return HYPRE_ParCSRHybridCreate(solver);}
384 {
return HYPRE_ParCSRPCGCreate(comm, solver);}
388 {
return HYPRE_ParCSRGMRESCreate(comm, solver);}
392 {
return HYPRE_ParCSRFlexGMRESCreate(comm, solver);}
396 {
return HYPRE_ParCSRLGMRESCreate(comm, solver);}
400 {
return HYPRE_ParCSRBiCGSTABCreate(comm, solver);}
428 int (*
SolverSetupPtr_)(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector);
429 int (*
SolverSolvePtr_)(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector);
430 int (*
SolverPrecondPtr_)(HYPRE_Solver, HYPRE_PtrToParSolverFcn, HYPRE_PtrToParSolverFcn, HYPRE_Solver);
433 int (*
PrecondSetupPtr_)(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector);
434 int (*
PrecondSolvePtr_)(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector);
Hypre_Chooser
Enumerated type to choose to solve or precondition.
Hypre_Solver
Enumerated type for Hypre solvers.
int SetParameter(Hypre_Chooser chooser, int(*pt2Func)(HYPRE_Solver, int, int), int parameter1, int parameter2)
Set a parameter that takes two int parameters.
virtual bool UseTranspose() const
Returns the current UseTranspose setting.
int Multiply(bool TransA, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a EpetraExt_HypreIJMatrix multiplied by a Epetra_MultiVector X in Y.
int(* SolverPrecondPtr_)(HYPRE_Solver, HYPRE_PtrToParSolverFcn, HYPRE_PtrToParSolverFcn, HYPRE_Solver)
int Hypre_ParCSRBiCGSTABCreate(MPI_Comm comm, HYPRE_Solver *solver)
BiCGSTAB Create passing function.
bool * IsSolverSetup_
Flag to know if solver needs to be destoyed.
int(* SolverSolvePtr_)(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
int(* SolverSetupPtr_)(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
int MyRowStart_
First row on local processor.
int SetParameter(bool UsePreconditioner)
Sets the solver to use the selected preconditioner.
int InitializeDefaults()
Set global variables to default values.
int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_Operator inverse applied to an Epetra_MultiVector X in Y.
HYPRE_ParCSRMatrix ParMatrix_
int CreatePrecond()
Create the preconditioner with selected type.
int Hypre_EuclidCreate(MPI_Comm comm, HYPRE_Solver *solver)
Euclid Create passing function.
int SetParameter(Hypre_Chooser chooser)
Choose to solve the problem or apply the preconditioner.
bool TransposeSolve_
Do a transpose solve, only BoomerAMG.
int NumGlobalCols_
Number of columns across all processors.
int(* PrecondSolvePtr_)(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
int(EpetraExt_HypreIJMatrix::* PrecondCreatePtr_)(MPI_Comm, HYPRE_Solver *)
int ExtractMyEntryView(int CurEntry, double *&Value, int &RowIndex, int &ColIndex)
Returns a reference to the ith entry in the matrix, along with its row and column index.
int CreateSolver()
Create the solver with selected type.
int Hypre_BoomerAMGCreate(MPI_Comm comm, HYPRE_Solver *solver)
AMG Create passing function.
int Hypre_ParCSRHybridCreate(MPI_Comm comm, HYPRE_Solver *solver)
Hybrid Create passing function.
int LeftScale(const Epetra_Vector &X)
Scales the EpetraExt_HypreIJMatrix on the left with a Epetra_Vector x.
int SetParameter(Hypre_Chooser chooser, int(*pt2Func)(HYPRE_Solver, int), int parameter)
Set a parameter that takes a single int.
int NumGlobalRows_
Number of rows across all processors.
int Hypre_AMSCreate(MPI_Comm comm, HYPRE_Solver *solver)
AMS Create passing function.
int Hypre_ParCSRFlexGMRESCreate(MPI_Comm comm, HYPRE_Solver *solver)
FlexGMRES Create passing function.
int(* SolverDestroyPtr_)(HYPRE_Solver)
EpetraExt_HypreIJMatrix(HYPRE_IJMatrix matrix)
Epetra_HypreIJMatrix constructor.
int SetParameter(Hypre_Chooser chooser, int(*pt2Func)(HYPRE_Solver, double), double parameter)
Set a parameter that takes a single double.
int(EpetraExt_HypreIJMatrix::* SolverCreatePtr_)(MPI_Comm, HYPRE_Solver *)
int(* PrecondDestroyPtr_)(HYPRE_Solver)
int SetParameter(Hypre_Chooser chooser, Hypre_Solver Solver, bool transpose=false)
Sets the solver that is used by the Solve() and ApplyInverse() methods. Until this is called,...
Hypre_Chooser SolveOrPrec_
Choose to solve or apply preconditioner.
int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a Epetra_Operator applied to a Epetra_MultiVector X in Y.
int Solve(bool Upper, bool Trans, bool UnitDiagonal, const Epetra_MultiVector &X, Epetra_MultiVector &Y) const
Returns the result of a EpetraExt_HypreIJMatrix solving a Epetra_MultiVector X in Y.
int SetParameter(Hypre_Chooser chooser, int(*pt2Func)(HYPRE_Solver, double *), double *parameter)
Set a parameter that takes a double*.
virtual ~EpetraExt_HypreIJMatrix()
EpetraExt_HypreIJMatrix Destructor.
int NumMyRows_
Number of rows on local processor.
int Hypre_ParCSRPCGCreate(MPI_Comm comm, HYPRE_Solver *solver)
PCG Create passing function.
int Hypre_ParCSRLGMRESCreate(MPI_Comm comm, HYPRE_Solver *solver)
LGMRES Create passing function.
int SetParameter(Hypre_Chooser chooser, int(*pt2Func)(HYPRE_Solver, int *), int *parameter)
Set a parameter that takes an int*.
int SetParameter(Hypre_Chooser chooser, int(*pt2Func)(HYPRE_Solver, double, int), double parameter1, int parameter2)
Set a parameter that takes a double then an int.
int NumMyRowEntries(int MyRow, int &NumEntries) const
Return the current number of values stored for the specified local row.
int MyRowEnd_
Last row on local processor.
int Hypre_ParaSailsCreate(MPI_Comm comm, HYPRE_Solver *solver)
ParaSails Create passing function.
int Hypre_ParCSRGMRESCreate(MPI_Comm comm, HYPRE_Solver *solver)
GMRES Create passing function.
HYPRE_Solver Preconditioner_
HYPRE_IJMatrix & GetMatrix()
Return a reference to the Hypre matrix.
int ExtractMyEntryView(int CurEntry, const double *&Value, int &RowIndex, int &ColIndex) const
Returns a const reference to the ith entry in the matrix, along with its row and column index.
bool * IsPrecondSetup_
Flag to know if preconditioner needs to be destroyed.
int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const
Returns a copy of the specified local row in user-provided arrays.
int(* PrecondSetupPtr_)(HYPRE_Solver, HYPRE_ParCSRMatrix, HYPRE_ParVector, HYPRE_ParVector)
int MatType_
Hypre matrix type (parCSR).
int RightScale(const Epetra_Vector &X)
Scales the EpetraExt_HypreIJMatrix on the right with a Epetra_Vector x.
virtual bool UpperTriangular() const