MueLu  Version of the Day
MueLu_RefMaxwell_decl.hpp
Go to the documentation of this file.
1 // @HEADER
2 //
3 // ***********************************************************************
4 //
5 // MueLu: A package for multigrid based preconditioning
6 // Copyright 2012 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact
39 // Jonathan Hu (jhu@sandia.gov)
40 // Andrey Prokopenko (aprokop@sandia.gov)
41 // Ray Tuminaro (rstumin@sandia.gov)
42 //
43 // ***********************************************************************
44 //
45 // @HEADER
46 #ifndef MUELU_REFMAXWELL_DECL_HPP
47 #define MUELU_REFMAXWELL_DECL_HPP
48 
49 #include "MueLu.hpp"
50 #include "MueLu_ConfigDefs.hpp"
51 #include "MueLu_BaseClass.hpp"
52 #include "MueLu_Utilities.hpp"
53 #include "MueLu_SaPFactory.hpp"
54 #include "MueLu_TentativePFactory.hpp"
55 #include "MueLu_SmootherFactory.hpp"
56 #include "MueLu_CoalesceDropFactory.hpp"
57 #include "MueLu_UncoupledAggregationFactory.hpp"
58 #include "MueLu_TrilinosSmoother.hpp"
59 
60 #if defined(HAVE_MUELU_TPETRA) && defined(HAVE_MUELU_IFPACK2)
61 
62 #include "Tpetra_Operator.hpp"
63 #include "Tpetra_CrsMatrix.hpp"
64 #include "Tpetra_MultiVector_decl.hpp"
65 #include "MatrixMarket_Tpetra.hpp"
66 #include "Xpetra_Matrix.hpp"
67 #include "Xpetra_MatrixFactory.hpp"
68 #include "Xpetra_CrsMatrixWrap.hpp"
71 #include "Xpetra_ExportFactory.hpp"
72 
73 namespace MueLu {
74 
87  template <class Scalar =
88  Tpetra::Operator<>::scalar_type,
89  class LocalOrdinal =
90  typename Tpetra::Operator<Scalar>::local_ordinal_type,
91  class GlobalOrdinal =
92  typename Tpetra::Operator<Scalar, LocalOrdinal>::global_ordinal_type,
93  class Node =
94  typename Tpetra::Operator<Scalar, LocalOrdinal, GlobalOrdinal>::node_type>
95  class RefMaxwell : public Tpetra::Operator<Scalar,LocalOrdinal,GlobalOrdinal,Node> {
96 
97 #undef MUELU_REFMAXWELL_SHORT
98 #include "MueLu_UseShortNames.hpp"
99 
100  public:
101 
102  typedef Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> TMap;
103  typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> TCRS;
104  typedef Tpetra::RowMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> TROW;
105  typedef Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> TMV;
113 
116  Hierarchy11_(Teuchos::null),
117  Hierarchy22_(Teuchos::null),
118  disable_addon_(true),
119  mode_("additive")
120  {
121  }
122 
124  RefMaxwell(Teuchos::RCP<Hierarchy> H11, Teuchos::RCP<Hierarchy> H22) :
125  Hierarchy11_(H11),
126  Hierarchy22_(H22),
127  disable_addon_(false),
128  mode_("additive")
129  {
130  }
131 
143  RefMaxwell(const Teuchos::RCP<TCRS> & SM_Matrix,
144  const Teuchos::RCP<TCRS> & D0_Matrix,
145  const Teuchos::RCP<TCRS> & M0inv_Matrix,
146  const Teuchos::RCP<TCRS> & M1_Matrix,
147  const Teuchos::RCP<TMV> & Nullspace,
148  const Teuchos::RCP<TMV> & Coords,
149  Teuchos::ParameterList& List,
150  bool ComputePrec = true)
151  {
152  initialize(D0_Matrix,M0inv_Matrix,M1_Matrix,Nullspace,Coords,List);
153 
154  resetMatrix(SM_Matrix);
155 
156  // compute preconditioner (optionally)
157  if(ComputePrec)
158  compute();
159  }
160 
170  RefMaxwell(const Teuchos::RCP<TCRS> & D0_Matrix,
171  const Teuchos::RCP<TCRS> & M0inv_Matrix,
172  const Teuchos::RCP<TCRS> & M1_Matrix,
173  const Teuchos::RCP<TMV> & Nullspace,
174  const Teuchos::RCP<TMV> & Coords,
175  Teuchos::ParameterList& List)
176  {
177  initialize(D0_Matrix,M0inv_Matrix,M1_Matrix,Nullspace,Coords,List);
178  }
179 
190  RefMaxwell(const Teuchos::RCP<TCRS> & SM_Matrix,
191  const Teuchos::RCP<TCRS> & D0_Matrix,
192  const Teuchos::RCP<TCRS> & M1_Matrix,
193  const Teuchos::RCP<TMV> & Nullspace,
194  const Teuchos::RCP<TMV> & Coords,
195  Teuchos::ParameterList& List,
196  bool ComputePrec = true)
197  {
198  initialize(D0_Matrix,Teuchos::null,M1_Matrix,Nullspace,Coords,List);
199 
200  resetMatrix(SM_Matrix);
201 
202  // compute preconditioner (optionally)
203  if(ComputePrec)
204  compute();
205  }
206 
215  RefMaxwell(const Teuchos::RCP<TCRS> & D0_Matrix,
216  const Teuchos::RCP<TCRS> & M1_Matrix,
217  const Teuchos::RCP<TMV> & Nullspace,
218  const Teuchos::RCP<TMV> & Coords,
219  Teuchos::ParameterList& List)
220  {
221  initialize(D0_Matrix,Teuchos::null,M1_Matrix,Nullspace,Coords,List);
222  }
223 
225  virtual ~RefMaxwell() {}
226 
228  Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > getDomainMap() const;
229 
231  Teuchos::RCP<const Tpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > getRangeMap() const;
232 
234  void setParameters(Teuchos::ParameterList& list);
235 
237  void compute();
238 
240  void buildProlongator();
241 
243  void formCoarseMatrix();
244 
246  void resetMatrix(Teuchos::RCP<TCRS> SM_Matrix_new);
247 
249  void applyInverseAdditive(const XTMV& RHS, XTMV& X) const;
250 
252  void applyInverse121(const XTMV& RHS, XTMV& X) const;
253 
255  void applyInverse212(const XTMV& RHS, XTMV& X) const;
256 
260  void apply(const Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>& X,
261  Tpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>& Y,
262  Teuchos::ETransp mode = Teuchos::NO_TRANS,
263  Scalar alpha = Teuchos::ScalarTraits<Scalar>::one(),
264  Scalar beta = Teuchos::ScalarTraits<Scalar>::one()) const;
265 
267  bool hasTransposeApply() const;
268 
269  template <class NewNode>
270  Teuchos::RCP< RefMaxwell<Scalar, LocalOrdinal, GlobalOrdinal, NewNode> >
271  clone (const RCP<NewNode>& new_node) const {
273  (Hierarchy11_->template clone<NewNode> (new_node),
274  Hierarchy22_->template clone<NewNode> (new_node)));
275  }
276 
277  private:
278 
280  std::vector<LocalOrdinal>& dirichletRows) {
281  dirichletRows.resize(0);
282  for(size_t i=0; i<A->getNodeNumRows(); i++) {
283  Teuchos::ArrayView<const LocalOrdinal> indices;
284  Teuchos::ArrayView<const Scalar> values;
285  A->getLocalRowView(i,indices,values);
286  int nnz=0;
287  for (int j=0; j<indices.size(); j++) {
288  // FIXME (mfh 12 Sep 2015) I just replaced abs with the
289  // appropriate ScalarTraits call. However, this is NOT
290  // correct for arbitrary scalar types!!! I'm guessing you
291  // should use the equivalent of LAPACK's SFMIN or machine
292  // epsilon here.
293  if (Teuchos::ScalarTraits<Scalar>::magnitude(values[j]) > 1.0e-16) {
294  nnz++;
295  }
296  }
297  if (nnz == 1 || nnz == 2) {
298  dirichletRows.push_back(i);
299  }
300  }
301  }
302 
304  std::vector<LocalOrdinal>& dirichletRows,
305  std::vector<LocalOrdinal>& dirichletCols) {
306  Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > domMap = A->getDomainMap();
307  Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > colMap = A->getColMap();
308  Teuchos::RCP< Xpetra::Export<LocalOrdinal,GlobalOrdinal,Node> > exporter
310  Teuchos::RCP<Xpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > myColsToZero = Xpetra::MultiVectorFactory<Scalar,LocalOrdinal,GlobalOrdinal,Node> ::Build(colMap,1);
311  Teuchos::RCP<Xpetra::MultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node> > globalColsToZero = Xpetra::MultiVectorFactory<Scalar,LocalOrdinal,GlobalOrdinal,Node> ::Build(domMap,1);
312  myColsToZero->putScalar((Scalar)0.0);
313  globalColsToZero->putScalar((Scalar)0.0);
314  for(size_t i=0; i<dirichletRows.size(); i++) {
315  Teuchos::ArrayView<const LocalOrdinal> indices;
316  Teuchos::ArrayView<const Scalar> values;
317  A->getLocalRowView(dirichletRows[i],indices,values);
318  for(int j=0; j<indices.size(); j++)
319  myColsToZero->replaceLocalValue(indices[j],0,(Scalar)1.0);
320  }
321  globalColsToZero->doExport(*myColsToZero,*exporter,Xpetra::ADD);
322  myColsToZero->doImport(*globalColsToZero,*exporter,Xpetra::INSERT);
323  Teuchos::ArrayRCP<const Scalar> myCols = myColsToZero->getData(0);
324  dirichletCols.resize(colMap->getNodeNumElements());
325  for(size_t i=0; i<colMap->getNodeNumElements(); i++) {
326  if(Teuchos::ScalarTraits<Scalar>::magnitude(myCols[i])>0.0)
327  dirichletCols[i]=1;
328  else
329  dirichletCols[i]=0;
330  }
331  }
332 
334  std::vector<LocalOrdinal>& dirichletRows) {
335  for(size_t i=0; i<dirichletRows.size(); i++) {
336  Teuchos::ArrayView<const LocalOrdinal> indices;
337  Teuchos::ArrayView<const Scalar> values;
338  A->getLocalRowView(dirichletRows[i],indices,values);
339  std::vector<Scalar> vec;
340  vec.resize(indices.size());
341  Teuchos::ArrayView<Scalar> zerovalues(vec);
342  for(int j=0; j<indices.size(); j++)
343  zerovalues[j]=(Scalar)1.0e-32;
344  A->replaceLocalValues(dirichletRows[i],indices,zerovalues);
345  }
346  }
347 
349  std::vector<LocalOrdinal>& dirichletCols) {
350  for(size_t i=0; i<A->getNodeNumRows(); i++) {
351  Teuchos::ArrayView<const LocalOrdinal> indices;
352  Teuchos::ArrayView<const Scalar> values;
353  A->getLocalRowView(i,indices,values);
354  std::vector<Scalar> vec;
355  vec.resize(indices.size());
356  Teuchos::ArrayView<Scalar> zerovalues(vec);
357  for(int j=0; j<indices.size(); j++) {
358  if(dirichletCols[indices[j]]==1)
359  zerovalues[j]=(Scalar)1.0e-32;
360  else
361  zerovalues[j]=values[j];
362  }
363  A->replaceLocalValues(i,indices,zerovalues);
364  }
365  }
366 
368  Teuchos::RCP<const Xpetra::Map<LocalOrdinal,GlobalOrdinal,Node> > rowMap = A->getRowMap();
369  RCP<Xpetra::Matrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > DiagMatrix = Xpetra::MatrixFactory<Scalar,LocalOrdinal,GlobalOrdinal,Node>::Build(rowMap,1);
370  RCP<Xpetra::Matrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > NewMatrix = Xpetra::MatrixFactory<Scalar,LocalOrdinal,GlobalOrdinal,Node>::Build(rowMap,1);
371  for(size_t i=0; i<A->getNodeNumRows(); i++) {
372  Teuchos::ArrayView<const LocalOrdinal> indices;
373  Teuchos::ArrayView<const Scalar> values;
374  A->getLocalRowView(i,indices,values);
375  int nnz=0;
376  for (int j=0; j<indices.size(); j++) {
377  if (Teuchos::ScalarTraits<Scalar>::magnitude(values[j]) > tol) {
378  nnz++;
379  }
380  }
381  Scalar one = (Scalar)1.0;
382  Scalar zero = (Scalar)0.0;
383  GlobalOrdinal row = rowMap->getGlobalElement(i);
384  if (nnz == 0) {
385  DiagMatrix->insertGlobalValues(row,
386  Teuchos::ArrayView<GlobalOrdinal>(&row,1),
387  Teuchos::ArrayView<Scalar>(&one,1));
388  }
389  else {
390  DiagMatrix->insertGlobalValues(row,
391  Teuchos::ArrayView<GlobalOrdinal>(&row,1),
392  Teuchos::ArrayView<Scalar>(&zero,1));
393  }
394  }
395  DiagMatrix->fillComplete();
396  A->fillComplete();
397  // add matrices together
398  RCP<Teuchos::FancyOStream> out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
399  Xpetra::MatrixMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node>::TwoMatrixAdd(*DiagMatrix,false,(Scalar)1.0,*A,false,(Scalar)1.0,NewMatrix,*out);
400  NewMatrix->fillComplete();
401  A=NewMatrix;
402  }
403 
404 
414  void initialize(const Teuchos::RCP<TCRS> & D0_Matrix,
415  const Teuchos::RCP<TCRS> & M0inv_Matrix,
416  const Teuchos::RCP<TCRS> & M1_Matrix,
417  const Teuchos::RCP<TMV> & Nullspace,
418  const Teuchos::RCP<TMV> & Coords,
419  Teuchos::ParameterList& List);
420 
422  Teuchos::RCP<Hierarchy> Hierarchy11_, Hierarchy22_, HierarchySmoother_;
424  Teuchos::RCP<Level> TopLevel_;
427  Teuchos::RCP<XMat> TMT_Matrix_, TMT_Agg_Matrix_, P11_, A11_, A22_;
429  std::vector<LocalOrdinal> BCrows_, BCcols_;
431  Teuchos::RCP<XMV> Nullspace_, Coords_;
436  std::string mode_;
437 
438  };
439 
440 } // namespace
441 
442 #endif //ifdef HAVE_MUELU_TPETRA
443 
444 #define MUELU_REFMAXWELL_SHORT
445 #endif // MUELU_REFMAXWELL_DECL_HPP
RefMaxwell(Teuchos::RCP< Hierarchy > H11, Teuchos::RCP< Hierarchy > H22)
Constructor with Hierarchies.
static RCP< Export< LocalOrdinal, GlobalOrdinal, Node > > Build(const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &source, const RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &target)
Teuchos::RCP< XMat > Ms_Matrix_
RefMaxwell(const Teuchos::RCP< TCRS > &D0_Matrix, const Teuchos::RCP< TCRS > &M0inv_Matrix, const Teuchos::RCP< TCRS > &M1_Matrix, const Teuchos::RCP< TMV > &Nullspace, const Teuchos::RCP< TMV > &Coords, Teuchos::ParameterList &List)
Xpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > XCRS
Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > XMV
Teuchos::RCP< XMat > M0inv_Matrix_
Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > TROW
void applyInverse121(const XTMV &RHS, XTMV &X) const
apply 1-2-1 algorithm for 2x2 solve
std::vector< LocalOrdinal > BCcols_
Teuchos::ParameterList smootherList_
Teuchos::RCP< XMat > TMT_Matrix_
RefMaxwell(const Teuchos::RCP< TCRS > &SM_Matrix, const Teuchos::RCP< TCRS > &D0_Matrix, const Teuchos::RCP< TCRS > &M0inv_Matrix, const Teuchos::RCP< TCRS > &M1_Matrix, const Teuchos::RCP< TMV > &Nullspace, const Teuchos::RCP< TMV > &Coords, Teuchos::ParameterList &List, bool ComputePrec=true)
std::vector< LocalOrdinal > BCrows_
Vectors for BCs.
void Remove_Zeroed_Rows(Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &A, double tol=1.0e-14)
Teuchos::RCP< Hierarchy > HierarchySmoother_
Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > XMat
RefMaxwell(const Teuchos::RCP< TCRS > &D0_Matrix, const Teuchos::RCP< TCRS > &M1_Matrix, const Teuchos::RCP< TMV > &Nullspace, const Teuchos::RCP< TMV > &Coords, Teuchos::ParameterList &List)
Namespace for MueLu classes and methods.
Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > TMap
Teuchos::RCP< XMat > A22_
void setParameters(Teuchos::ParameterList &list)
Set parameters.
void buildProlongator()
Setup the prolongator for the (1,1)-block.
Teuchos::RCP< XMat > D0_Matrix_
Xpetra::TpetraMultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > XTMV
Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getRangeMap() const
Returns the Tpetra::Map object associated with the range of this operator.
Preconditioner (wrapped as a Tpetra::Operator) for Maxwell&#39;s equations in curl-curl form...
void applyInverse212(const XTMV &RHS, XTMV &X) const
apply 2-1-2 algorithm for 2x2 solve
Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > XMap
void findDirichletCols(Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > A, std::vector< LocalOrdinal > &dirichletRows, std::vector< LocalOrdinal > &dirichletCols)
Teuchos::ParameterList precList11_
Xpetra::CrsMatrixWrap< Scalar, LocalOrdinal, GlobalOrdinal, Node > XCrsWrap
void compute()
Setup the preconditioner.
Teuchos::RCP< XMat > SM_Matrix_
Various matrices.
Teuchos::RCP< XMat > A11_
Teuchos::RCP< Hierarchy > Hierarchy22_
Teuchos::RCP< XMat > TMT_Agg_Matrix_
Tpetra::CrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > TCRS
void applyInverseAdditive(const XTMV &RHS, XTMV &X) const
apply additive algorithm for 2x2 solve
void Apply_BCsToMatrixCols(Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &A, std::vector< LocalOrdinal > &dirichletCols)
Teuchos::RCP< Hierarchy > Hierarchy11_
Two hierarchies: one for the (1,1)-block, another for the (2,2)-block.
bool disable_addon_
Some options.
static void TwoMatrixAdd(const Matrix &A, bool transposeA, SC alpha, Matrix &B, SC beta)
Teuchos::RCP< Level > TopLevel_
Top Level.
virtual ~RefMaxwell()
Destructor.
Teuchos::ParameterList parameterList_
Parameter lists.
bool hasTransposeApply() const
Indicates whether this operator supports applying the adjoint operator.
void findDirichletRows(Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > A, std::vector< LocalOrdinal > &dirichletRows)
void Apply_BCsToMatrixRows(Teuchos::RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &A, std::vector< LocalOrdinal > &dirichletRows)
Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > TMV
Teuchos::RCP< RefMaxwell< Scalar, LocalOrdinal, GlobalOrdinal, NewNode > > clone(const RCP< NewNode > &new_node) const
Teuchos::RCP< XMat > P11_
void initialize(const Teuchos::RCP< TCRS > &D0_Matrix, const Teuchos::RCP< TCRS > &M0inv_Matrix, const Teuchos::RCP< TCRS > &M1_Matrix, const Teuchos::RCP< TMV > &Nullspace, const Teuchos::RCP< TMV > &Coords, Teuchos::ParameterList &List)
Teuchos::RCP< XMV > Coords_
RefMaxwell(const Teuchos::RCP< TCRS > &SM_Matrix, const Teuchos::RCP< TCRS > &D0_Matrix, const Teuchos::RCP< TCRS > &M1_Matrix, const Teuchos::RCP< TMV > &Nullspace, const Teuchos::RCP< TMV > &Coords, Teuchos::ParameterList &List, bool ComputePrec=true)
static Teuchos::RCP< MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Build(const Teuchos::RCP< const Map< LocalOrdinal, GlobalOrdinal, Node > > &map, size_t NumVectors, bool zeroOut=true)
Xpetra::TpetraCrsMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > XTCRS
void apply(const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, Scalar alpha=Teuchos::ScalarTraits< Scalar >::one(), Scalar beta=Teuchos::ScalarTraits< Scalar >::one()) const
void formCoarseMatrix()
Compute P11^{T}*A*P11 efficiently.
static RCP< Matrix > Build(const RCP< const Map > &rowMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype=Xpetra::DynamicProfile)
Teuchos::RCP< XMat > M1_Matrix_
void resetMatrix(Teuchos::RCP< TCRS > SM_Matrix_new)
Reset system matrix.
Teuchos::RCP< const Tpetra::Map< LocalOrdinal, GlobalOrdinal, Node > > getDomainMap() const
Returns the Tpetra::Map object associated with the domain of this operator.
Teuchos::ParameterList precList22_
Teuchos::RCP< XMV > Nullspace_
Nullspace.