Debian Codegraph @

packages/trilinoscouplings/src/epetraext/EpetraExt_AmesosBTFGlobal_LinearProblem.h

raw
1 // @HEADER
2 // *****************************************************************************
3 // Trilinos: An Object-Oriented Solver Framework
4 //
5 // Copyright 2001-2024 NTESS and the Trilinos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 #ifndef EpetraExt_AMESOS_BTF_GLOBAL_LINEARPROBLEM_H
11 #define EpetraExt_AMESOS_BTF_GLOBAL_LINEARPROBLEM_H
12
13 #include <EpetraExt_Transform.h>
14 #include <Teuchos_RCP.hpp>
15 #include <vector>
16 #include <string>
17
18 class Epetra_CrsMatrix;
19 class Epetra_MultiVector;
20 class Epetra_CrsGraph;
21 class Epetra_Map;
22 class Epetra_Import;
23 class Epetra_LinearProblem;
24
25 namespace EpetraExt {
26
27 ///
28 /** Block Triangular Factorization (Reordering) of an Epetra_CrsMatrix
29 *
30 * Uses Tim Davis' BTF algorithm to find a block lower or upper triangular
31 * ordering form a Epetra_CrsMatrix.
32 */
33
34 class AmesosBTFGlobal_LinearProblem: public SameTypeTransform<Epetra_LinearProblem> {
35
36 public:
37
38 ~AmesosBTFGlobal_LinearProblem();
39
40 AmesosBTFGlobal_LinearProblem( double thresh = 0.0, const std::string& balanceType="linear",
41 bool upperTri = false, bool verbose = false, bool debug = false )
42 : numBlocks_(0),
43 analysisDone_(false),
44 threshold_(thresh),
45 upperTri_(upperTri),
46 verbose_(verbose),
47 debug_(debug),
48 balance_(balanceType)
49 {}
50
51 NewTypeRef operator()( OriginalTypeRef orig );
52
53 bool fwd();
54 bool rvs();
55
56 Teuchos::RCP<Epetra_Import> Importer() { return Importer_; }
57 std::vector<int> RowPerm() { return rowPerm_; }
58 std::vector<int> ColPerm() { return colPerm_; }
59 std::vector<int> BlockPtr() { return blockPtr_; }
60 int NumBlocks() { return numBlocks_; }
61
62 private:
63
64 Teuchos::RCP<Epetra_Map> NewRowMap_;
65 Teuchos::RCP<Epetra_Map> NewColMap_;
66
67 // Old linear system (pre-transform)
68 Teuchos::RCP<Epetra_CrsMatrix> OldMatrix_;
69 Teuchos::RCP<Epetra_MultiVector> OldRHS_;
70 Teuchos::RCP<Epetra_MultiVector> OldLHS_;
71
72 Teuchos::RCP<Epetra_CrsMatrix> NewMatrix_;
73 Teuchos::RCP<Epetra_MultiVector> NewRHS_;
74 Teuchos::RCP<Epetra_MultiVector> NewLHS_;
75
76 Teuchos::RCP<Epetra_CrsGraph> NewGraph_;
77
78 Teuchos::RCP<Epetra_Import> Importer_, Importer2_;
79
80 std::vector<int> rowPerm_, colPerm_, blockPtr_;
81
82 int numBlocks_;
83 bool analysisDone_;
84
85 const double threshold_;
86
87 const bool upperTri_, verbose_, debug_;
88
89 std::string balance_;
90
91 };
92
93 } //namespace EpetraExt
94
95 #endif //EpetraExt_AMESOS_BTF_GLOBAL_LINEARPROBLEM_H