Anasazi Version of the Day
Loading...
Searching...
No Matches
MyIncompleteChol.h
1// @HEADER
2// *****************************************************************************
3// Anasazi: Block Eigensolvers Package
4//
5// Copyright 2004 NTESS and the Anasazi contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10// This software is a result of the research described in the report
11//
12// "A comparison of algorithms for modal analysis in the absence
13// of a sparse direct method", P. Arbenz, R. Lehoucq, and U. Hetmaniuk,
14// Sandia National Laboratories, Technical report SAND2003-1028J.
15//
16// It is based on the Epetra, AztecOO, and ML packages defined in the Trilinos
17// framework ( http://trilinos.org/ ).
18
19#ifndef MY_INCOMPLETE_CHOL_H
20#define MY_INCOMPLETE_CHOL_H
21
22#include "Epetra_ConfigDefs.h"
23#include "Epetra_BLAS.h"
24#include "Epetra_Comm.h"
25#include "Epetra_LAPACK.h"
26#include "Epetra_Map.h"
27#include "Epetra_MultiVector.h"
28#include "Epetra_Operator.h"
29#include "Epetra_RowMatrix.h"
30
31#include "Ifpack_ConfigDefs.h"
32#include "Ifpack_CrsIct.h"
33
34class MyIncompleteChol : public virtual Epetra_Operator {
35
36 private:
37
38 const Epetra_Comm &MyComm;
39 const Epetra_BLAS callBLAS;
40 const Epetra_LAPACK callLAPACK;
41
42 const Epetra_Operator *K;
43
44 Ifpack_CrsIct *Prec;
45 double dropTol;
46 int lFill;
47
48 const Epetra_MultiVector *Q;
49 double *QtQ;
50
51 bool leftProjection;
52 bool rightProjection;
53
54 // Don't define these functions
55 MyIncompleteChol(const MyIncompleteChol &ref);
56 MyIncompleteChol& operator=(const MyIncompleteChol &ref);
57
58 public:
59
60 MyIncompleteChol(const Epetra_Comm& _Com, const Epetra_Operator *KK,
61 double dropTol = Epetra_MinDouble, int lFill = 0, const Epetra_MultiVector *Z = 0);
62
63 int SetUseLeftProjection(bool proj) { leftProjection = proj; return 0; }
64 int SetUseRightProjection(bool proj) { rightProjection = proj; return 0; }
65
66 ~MyIncompleteChol();
67
68 char * Label() const { return "Epetra_Operator for incomplete Cholesky preconditioner"; };
69
70 bool UseTranspose() const { return (false); };
71 int SetUseTranspose(bool UseTranspose) { return 0; };
72
73 bool HasNormInf() const { return (false); };
74 double NormInf() const { return (-1.0); };
75
76 int Apply(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const;
77 int ApplyInverse(const Epetra_MultiVector &X, Epetra_MultiVector &Y) const;
78
79 const Epetra_Comm& Comm() const { return MyComm; };
80
81 const Epetra_Map& OperatorDomainMap() const { return K->OperatorDomainMap(); };
82 const Epetra_Map& OperatorRangeMap() const { return K->OperatorRangeMap(); };
83
84};
85
86#endif