22#include "Epetra_ConfigDefs.h"
25#include "ml_include.h"
26#include "ml_epetra_operator.h"
27#include "ml_epetra_utils.h"
28#include "ml_agg_METIS.h"
30#include "Epetra_BLAS.h"
31#include "Epetra_Comm.h"
32#include "Epetra_LAPACK.h"
33#include "Epetra_Map.h"
34#include "Epetra_MultiVector.h"
35#include "Epetra_Operator.h"
36#include "Epetra_RowMatrix.h"
39#include "singularCoarse.h"
42class AMGOperator :
public virtual Epetra_Operator {
46 const Epetra_Comm &MyComm;
47 const Epetra_BLAS callBLAS;
48 const Epetra_LAPACK callLAPACK;
50 const Epetra_Operator *K;
51 Epetra_Operator *Prec;
53 const Epetra_MultiVector *Q;
69 double *ZcoarseTZcoarse;
73 void preProcess(
int maxCoarseSize);
74 void setCoarseSolver_Cycle(
int coarseSolver,
int cycle);
77 AMGOperator(
const AMGOperator &ref);
78 AMGOperator& operator=(
const AMGOperator &ref);
82 AMGOperator(
const Epetra_Comm& _Com,
const Epetra_Operator *KK,
int verb = 0,
83 int nLevel = 10,
int smoother = 1,
int param = 2,
84 int coarseSolver = -1,
int cycle = 0,
85 int _numDofs = 1,
const Epetra_MultiVector *Z = 0);
87 AMGOperator(
const Epetra_Comm& _Com,
const Epetra_Operator *KK,
int verb = 0,
88 int nLevel = 10,
int smoother = 1,
int *param = 0,
89 int coarseSolver = -1,
int cycle = 0,
90 int _numDofs = 1,
const Epetra_MultiVector *Z = 0);
92 int SetUseLeftProjection(
bool proj) { leftProjection = proj;
return 0; }
93 int SetUseRightProjection(
bool proj) { rightProjection = proj;
return 0; }
97 char * Label()
const {
return "Epetra_Operator for AMG preconditioner"; };
99 bool UseTranspose()
const {
return (
false); };
100 int SetUseTranspose(
bool UseTranspose) {
return 0; };
102 bool HasNormInf()
const {
return (
false); };
103 double NormInf()
const {
return (-1.0); };
105 int Apply(
const Epetra_MultiVector &X, Epetra_MultiVector &Y)
const;
106 int ApplyInverse(
const Epetra_MultiVector &X, Epetra_MultiVector &Y)
const;
108 const Epetra_Comm& Comm()
const {
return MyComm; };
110 const Epetra_Map& OperatorDomainMap()
const {
return K->OperatorDomainMap(); };
111 const Epetra_Map& OperatorRangeMap()
const {
return K->OperatorRangeMap(); };
113 int getAMG_NLevels()
const {
return AMG_NLevels; };