EpetraExt Package Browser (Single Doxygen Collection)  Development
EpetraExt_BTF_LinearProblem.h
Go to the documentation of this file.
1 //@HEADER
2 // ***********************************************************************
3 //
4 // EpetraExt: Epetra Extended - Linear Algebra Services Package
5 // Copyright (2011) Sandia Corporation
6 //
7 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8 // the U.S. Government retains certain rights in this software.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
38 //
39 // ***********************************************************************
40 //@HEADER
41 
42 #ifndef EpetraExt_LINEARPROBLEM_BTF_H
43 #define EpetraExt_LINEARPROBLEM_BTF_H
44 
45 #include <EpetraExt_Transform.h>
46 
47 #include <vector>
48 #include <map>
49 #include <set>
50 
52 class Epetra_VbrMatrix;
53 class Epetra_MultiVector;
54 class Epetra_Vector;
55 class Epetra_CrsMatrix;
56 class Epetra_CrsGraph;
57 class Epetra_Map;
58 class Epetra_BlockMap;
60 
61 namespace EpetraExt {
62 
63 class LinearProblem_BTF : public SameTypeTransform<Epetra_LinearProblem> {
64 
65  public:
66 
68 
69  LinearProblem_BTF( double thres = 0.0,
70  int verbose = 0 )
71  : NewMap_(0),
72  NewMatrix_(0),
73  NewGraph_(0),
74  NewLHS_(0),
75  NewRHS_(0),
76  NewProblem_(0),
77  OrigGraph_(0),
78  OrigMatrix_(0),
79  OrigRHS_(0),
80  OrigLHS_(0),
81  OrigProblem_(0),
82  threshold_(thres),
83  verbose_(verbose),
84  changedLP_(false)
85  {}
86 
88 
89  bool fwd();
90  bool rvs();
91 
92  bool changedLP() { return changedLP_; }
93 
94  private:
95 
96  void deleteNewObjs_();
97 
99 
101 
104 
107 
115 
116  std::vector<int> OldGlobalElements_;
117 
118  std::vector< std::set<int> > ZeroElements_;
119 
120  std::vector< std::vector<Epetra_SerialDenseMatrix*> > Blocks_;
121  std::vector<int> BlockDim_;
122  std::vector<int> BlockCnt_;
123  std::map<int,int> BlockRowMap_;
124  std::map<int,int> SubBlockRowMap_;
125  std::map<int,int> BlockColMap_;
126  std::map<int,int> SubBlockColMap_;
127 
128  std::vector< std::vector<int> > NewBlockRows_;
129 
130  const double threshold_;
131  const int verbose_;
132 
134 };
135 
136 } //namespace EpetraExt
137 
138 #endif //EpetraExt_LINEARPROBLEM_BTF_H
EpetraExt::Transform< Epetra_LinearProblem, Epetra_LinearProblem >::NewTypeRef
Epetra_LinearProblem & NewTypeRef
Definition: EpetraExt_Transform.h:79
EpetraExt::LinearProblem_BTF::BlockRowMap_
std::map< int, int > BlockRowMap_
Definition: EpetraExt_BTF_LinearProblem.h:123
EpetraExt::LinearProblem_BTF
Definition: EpetraExt_BTF_LinearProblem.h:63
EpetraExt::LinearProblem_BTF::OrigRHS_
Epetra_MultiVector * OrigRHS_
Definition: EpetraExt_BTF_LinearProblem.h:114
EpetraExt::LinearProblem_BTF::changedLP_
bool changedLP_
Definition: EpetraExt_BTF_LinearProblem.h:133
EpetraExt::LinearProblem_BTF::OrigRowMap_
Epetra_Map * OrigRowMap_
Definition: EpetraExt_BTF_LinearProblem.h:108
EpetraExt::LinearProblem_BTF::OrigGraph_
Epetra_CrsGraph * OrigGraph_
Definition: EpetraExt_BTF_LinearProblem.h:111
EpetraExt::LinearProblem_BTF::OrigMatrix_
Epetra_CrsMatrix * OrigMatrix_
Definition: EpetraExt_BTF_LinearProblem.h:112
EpetraExt::SameTypeTransform
Definition: EpetraExt_Transform.h:270
EpetraExt::LinearProblem_BTF::operator()
NewTypeRef operator()(OriginalTypeRef orig)
Definition: EpetraExt_BTF_LinearProblem.cpp:98
EpetraExt::LinearProblem_BTF::BlockColMap_
std::map< int, int > BlockColMap_
Definition: EpetraExt_BTF_LinearProblem.h:125
EpetraExt::LinearProblem_BTF::BlockCnt_
std::vector< int > BlockCnt_
Definition: EpetraExt_BTF_LinearProblem.h:122
EpetraExt::LinearProblem_BTF::OrigColMap_
Epetra_Map * OrigColMap_
Definition: EpetraExt_BTF_LinearProblem.h:109
EpetraExt::LinearProblem_BTF::verbose_
const int verbose_
Definition: EpetraExt_BTF_LinearProblem.h:131
EpetraExt::LinearProblem_BTF::Blocks_
std::vector< std::vector< Epetra_SerialDenseMatrix * > > Blocks_
Definition: EpetraExt_BTF_LinearProblem.h:120
EpetraExt::LinearProblem_BTF::threshold_
const double threshold_
Definition: EpetraExt_BTF_LinearProblem.h:130
EpetraExt::LinearProblem_BTF::deleteNewObjs_
void deleteNewObjs_()
Definition: EpetraExt_BTF_LinearProblem.cpp:80
EpetraExt::LinearProblem_BTF::NewMap_
Epetra_BlockMap * NewMap_
Definition: EpetraExt_BTF_LinearProblem.h:98
Epetra_CrsMatrix
EpetraExt::LinearProblem_BTF::NewBlockRows_
std::vector< std::vector< int > > NewBlockRows_
Definition: EpetraExt_BTF_LinearProblem.h:128
EpetraExt::Transform< Epetra_LinearProblem, Epetra_LinearProblem >::OriginalTypeRef
Epetra_LinearProblem & OriginalTypeRef
Definition: EpetraExt_Transform.h:74
EpetraExt::LinearProblem_BTF::NewRHS_
Epetra_MultiVector * NewRHS_
Definition: EpetraExt_BTF_LinearProblem.h:106
EpetraExt::LinearProblem_BTF::SubBlockColMap_
std::map< int, int > SubBlockColMap_
Definition: EpetraExt_BTF_LinearProblem.h:126
EpetraExt::LinearProblem_BTF::SubBlockRowMap_
std::map< int, int > SubBlockRowMap_
Definition: EpetraExt_BTF_LinearProblem.h:124
EpetraExt::LinearProblem_BTF::fwd
bool fwd()
Forward transfer of data from orig object input in the operator() method call to the new object creat...
Definition: EpetraExt_BTF_LinearProblem.cpp:497
EpetraExt::LinearProblem_BTF::NewLHS_
Epetra_MultiVector * NewLHS_
Definition: EpetraExt_BTF_LinearProblem.h:105
Epetra_LinearProblem
EpetraExt::LinearProblem_BTF::NewGraph_
Epetra_CrsGraph * NewGraph_
Definition: EpetraExt_BTF_LinearProblem.h:103
EpetraExt::LinearProblem_BTF::BlockDim_
std::vector< int > BlockDim_
Definition: EpetraExt_BTF_LinearProblem.h:121
Epetra_BlockMap
Epetra_Vector
EpetraExt::LinearProblem_BTF::OrigLHS_
Epetra_MultiVector * OrigLHS_
Definition: EpetraExt_BTF_LinearProblem.h:113
EpetraExt::LinearProblem_BTF::changedLP
bool changedLP()
Definition: EpetraExt_BTF_LinearProblem.h:92
EpetraExt_Transform.h
Epetra_CrsGraph
Epetra_MultiVector
EpetraExt::LinearProblem_BTF::~LinearProblem_BTF
~LinearProblem_BTF()
Definition: EpetraExt_BTF_LinearProblem.cpp:73
EpetraExt::LinearProblem_BTF::NewProblem_
Epetra_LinearProblem * NewProblem_
Definition: EpetraExt_BTF_LinearProblem.h:100
EpetraExt::LinearProblem_BTF::NewMatrix_
Epetra_VbrMatrix * NewMatrix_
Definition: EpetraExt_BTF_LinearProblem.h:102
EpetraExt::LinearProblem_BTF::ZeroElements_
std::vector< std::set< int > > ZeroElements_
Definition: EpetraExt_BTF_LinearProblem.h:118
EpetraExt::LinearProblem_BTF::LinearProblem_BTF
LinearProblem_BTF(double thres=0.0, int verbose=0)
Definition: EpetraExt_BTF_LinearProblem.h:69
Epetra_VbrMatrix
EpetraExt::LinearProblem_BTF::OrigProblem_
Epetra_LinearProblem * OrigProblem_
Definition: EpetraExt_BTF_LinearProblem.h:110
EpetraExt
EpetraExt::BlockCrsMatrix: A class for constructing a distributed block matrix.
Definition: EpetraExt_BlockCrsMatrix.cpp:46
Epetra_SerialDenseMatrix
Epetra_Map
EpetraExt::LinearProblem_BTF::rvs
bool rvs()
Reverse transfer of data from new object created in the operator() method call to the orig object inp...
Definition: EpetraExt_BTF_LinearProblem.cpp:557
EpetraExt::LinearProblem_BTF::OldGlobalElements_
std::vector< int > OldGlobalElements_
Definition: EpetraExt_BTF_LinearProblem.h:116