MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Thyra_MueLuRefMaxwellPreconditionerFactory_def.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 THYRA_MUELU_REFMAXWELL_PRECONDITIONER_FACTORY_DEF_HPP
47 #define THYRA_MUELU_REFMAXWELL_PRECONDITIONER_FACTORY_DEF_HPP
48 
50 
51 #ifdef HAVE_MUELU_STRATIMIKOS
52 
53 namespace Thyra {
54 
55  using Teuchos::RCP;
56  using Teuchos::rcp;
58 
59 
60  // Constructors/initializers/accessors
61 
62  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
64  paramList_(rcp(new ParameterList()))
65  {}
66 
67  // Overridden from PreconditionerFactoryBase
68 
69  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
71  const RCP<const LinearOpBase<Scalar> > fwdOp = fwdOpSrc.getOp();
72 
73 #ifdef HAVE_MUELU_TPETRA
74  if (Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::isTpetra(fwdOp)) return true;
75 #endif
76 
77  if (Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::isBlockedOperator(fwdOp)) return true;
78 
79  return false;
80  }
81 
82 
83  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
85  return Teuchos::rcp(new DefaultPreconditioner<Scalar>);
86  }
87 
88  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
90  initializePrec(const RCP<const LinearOpSourceBase<Scalar> >& fwdOpSrc, PreconditionerBase<Scalar>* prec, const ESupportSolveUse supportSolveUse) const {
91  using Teuchos::rcp_dynamic_cast;
92 
93  // we are using typedefs here, since we are using objects from different packages (Xpetra, Thyra,...)
96  typedef Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node> XpThyUtils;
101  typedef Xpetra::MultiVector<typename Teuchos::ScalarTraits<Scalar>::magnitudeType,LocalOrdinal,GlobalOrdinal,Node> XpMultVecDouble;
102  typedef Thyra::LinearOpBase<Scalar> ThyLinOpBase;
103  typedef Thyra::DiagonalLinearOpBase<Scalar> ThyDiagLinOpBase;
104 #ifdef HAVE_MUELU_TPETRA
105  typedef Thyra::TpetraLinearOp<Scalar,LocalOrdinal,GlobalOrdinal,Node> ThyTpLinOp;
106 #endif
107  Teuchos::TimeMonitor tM(*Teuchos::TimeMonitor::getNewTimer(std::string("ThyraMueLuRefMaxwell::initializePrec")));
108 
109  // Check precondition
110  TEUCHOS_ASSERT(Teuchos::nonnull(fwdOpSrc));
111  TEUCHOS_ASSERT(this->isCompatible(*fwdOpSrc));
112  TEUCHOS_ASSERT(prec);
113 
114  // Create a copy, as we may remove some things from the list
115  ParameterList paramList = *paramList_;
116 
117  // Retrieve wrapped concrete Xpetra matrix from FwdOp
118  const RCP<const ThyLinOpBase> fwdOp = fwdOpSrc->getOp();
120 
121  // Check whether it is Epetra/Tpetra
122  bool bIsEpetra = XpThyUtils::isEpetra(fwdOp);
123  bool bIsTpetra = XpThyUtils::isTpetra(fwdOp);
124  bool bIsBlocked = XpThyUtils::isBlockedOperator(fwdOp);
125  TEUCHOS_TEST_FOR_EXCEPT((bIsEpetra == true && bIsTpetra == true));
126  TEUCHOS_TEST_FOR_EXCEPT((bIsEpetra == bIsTpetra) && bIsBlocked == false);
127  TEUCHOS_TEST_FOR_EXCEPT((bIsEpetra != bIsTpetra) && bIsBlocked == true);
128 
129  RCP<XpMat> A = Teuchos::null;
130  if(bIsBlocked) {
132  Teuchos::rcp_dynamic_cast<const Thyra::BlockedLinearOpBase<Scalar> >(fwdOp);
134 
135  TEUCHOS_TEST_FOR_EXCEPT(ThyBlockedOp->blockExists(0,0)==false);
136 
137  Teuchos::RCP<const LinearOpBase<Scalar> > b00 = ThyBlockedOp->getBlock(0,0);
138  TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(b00));
139 
140  RCP<const XpCrsMat > xpetraFwdCrsMat00 = XpThyUtils::toXpetra(b00);
141  TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(xpetraFwdCrsMat00));
142 
143  // MueLu needs a non-const object as input
144  RCP<XpCrsMat> xpetraFwdCrsMatNonConst00 = Teuchos::rcp_const_cast<XpCrsMat>(xpetraFwdCrsMat00);
145  TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(xpetraFwdCrsMatNonConst00));
146 
147  // wrap the forward operator as an Xpetra::Matrix that MueLu can work with
149  TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(A00));
150 
151  RCP<const XpMap> rowmap00 = A00->getRowMap();
152  RCP< const Teuchos::Comm< int > > comm = rowmap00->getComm();
153 
154  // create a Xpetra::BlockedCrsMatrix which derives from Xpetra::Matrix that MueLu can work with
155  RCP<XpBlockedCrsMat> bMat = Teuchos::rcp(new XpBlockedCrsMat(ThyBlockedOp, comm));
156  TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(bMat));
157 
158  // save blocked matrix
159  A = bMat;
160  } else {
161  RCP<const XpCrsMat > xpetraFwdCrsMat = XpThyUtils::toXpetra(fwdOp);
162  TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(xpetraFwdCrsMat));
163 
164  // MueLu needs a non-const object as input
165  RCP<XpCrsMat> xpetraFwdCrsMatNonConst = Teuchos::rcp_const_cast<XpCrsMat>(xpetraFwdCrsMat);
166  TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(xpetraFwdCrsMatNonConst));
167 
168  // wrap the forward operator as an Xpetra::Matrix that MueLu can work with
169  A = rcp(new Xpetra::CrsMatrixWrap<Scalar,LocalOrdinal,GlobalOrdinal,Node>(xpetraFwdCrsMatNonConst));
170  }
172 
173  // Retrieve concrete preconditioner object
174  const Teuchos::Ptr<DefaultPreconditioner<Scalar> > defaultPrec = Teuchos::ptr(dynamic_cast<DefaultPreconditioner<Scalar> *>(prec));
176 
177  // extract preconditioner operator
178  RCP<ThyLinOpBase> thyra_precOp = Teuchos::null;
179  thyra_precOp = rcp_dynamic_cast<Thyra::LinearOpBase<Scalar> >(defaultPrec->getNonconstUnspecifiedPrecOp(), true);
180 
181  // Variable for RefMaxwell preconditioner: either build a new one or reuse the existing preconditioner
182  RCP<MueLu::RefMaxwell<Scalar,LocalOrdinal,GlobalOrdinal,Node> > preconditioner = Teuchos::null;
183 
184  // make a decision whether to (re)build the multigrid preconditioner or reuse the old one
185  // rebuild preconditioner if startingOver == true
186  // reuse preconditioner if startingOver == false
187  const bool startingOver = (thyra_precOp.is_null() || !paramList.isParameter("reuse: type") || paramList.get<std::string>("reuse: type") == "none");
188 
189  if (startingOver == true) {
190  // extract coordinates from parameter list
191  Teuchos::RCP<XpMultVecDouble> coordinates = Teuchos::null;
192  {
193  Teuchos::TimeMonitor tM_coords(*Teuchos::TimeMonitor::getNewTimer(std::string("ThyraMueLuRefMaxwell::initializePrec get coords")));
195  paramList.set<RCP<XpMultVecDouble> >("Coordinates", coordinates);
196  }
197 
198  // TODO check for Xpetra or Thyra vectors?
199 #ifdef HAVE_MUELU_TPETRA
200  if (bIsTpetra) {
201  typedef Tpetra::Vector<Scalar, LocalOrdinal, GlobalOrdinal, Node> tV;
202  typedef Tpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> tMV;
203  typedef Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> TpCrsMat;
204  Teuchos::TimeMonitor tMwrap(*Teuchos::TimeMonitor::getNewTimer(std::string("ThyraMueLuRefMaxwell::initializePrec wrap objects")));
205  if (paramList.isType<Teuchos::RCP<tMV> >("Nullspace")) {
206  Teuchos::TimeMonitor tM_nullspace(*Teuchos::TimeMonitor::getNewTimer(std::string("ThyraMueLuRefMaxwell::initializePrec wrap nullspace")));
207  RCP<tMV> tpetra_nullspace = paramList.get<RCP<tMV> >("Nullspace");
208  paramList.remove("Nullspace");
209  RCP<XpMultVec> nullspace = MueLu::TpetraMultiVector_To_XpetraMultiVector<Scalar,LocalOrdinal,GlobalOrdinal,Node>(tpetra_nullspace);
210  paramList.set<RCP<XpMultVec> >("Nullspace", nullspace);
212  }
213 
214  if (paramList.isParameter("M1")) {
215  if (paramList.isType<Teuchos::RCP<TpCrsMat> >("M1")) {
216  Teuchos::TimeMonitor tM_M1(*Teuchos::TimeMonitor::getNewTimer(std::string("ThyraMueLuRefMaxwell::initializePrec wrap M1")));
217  RCP<TpCrsMat> tM1 = paramList.get<RCP<TpCrsMat> >("M1");
218  paramList.remove("M1");
219  RCP<XpCrsMat> xM1 = rcp_dynamic_cast<XpCrsMat>(tM1, true);
220  paramList.set<RCP<XpCrsMat> >("M1", xM1);
221  } else if (paramList.isType<Teuchos::RCP<const ThyLinOpBase> >("M1")) {
222  Teuchos::TimeMonitor tM_M1(*Teuchos::TimeMonitor::getNewTimer(std::string("ThyraMueLuRefMaxwell::initializePrec wrap M1")));
223  RCP<const ThyLinOpBase> thyM1 = paramList.get<RCP<const ThyLinOpBase> >("M1");
224  paramList.remove("M1");
225  RCP<const XpCrsMat> crsM1 = XpThyUtils::toXpetra(thyM1);
227  // MueLu needs a non-const object as input
228  RCP<XpCrsMat> crsM1NonConst = Teuchos::rcp_const_cast<XpCrsMat>(crsM1);
230  // wrap as an Xpetra::Matrix that MueLu can work with
232  paramList.set<RCP<XpMat> >("M1", M1);
233  } else if (paramList.isType<Teuchos::RCP<XpMat> >("M1")) {
234  // do nothing
235  } else
236  TEUCHOS_TEST_FOR_EXCEPTION(true, MueLu::Exceptions::RuntimeError, "Parameter M1 has wrong type.");
237  } else
238  TEUCHOS_TEST_FOR_EXCEPTION(true, MueLu::Exceptions::RuntimeError, "Need to specify matrix M1.");
239 
240  if (paramList.isParameter("D0")) {
241  if (paramList.isType<Teuchos::RCP<TpCrsMat> >("D0")) {
242  Teuchos::TimeMonitor tM_D0(*Teuchos::TimeMonitor::getNewTimer(std::string("ThyraMueLuRefMaxwell::initializePrec wrap D0")));
243  RCP<TpCrsMat> tD0 = paramList.get<RCP<TpCrsMat> >("D0");
244  paramList.remove("D0");
245  RCP<XpCrsMat> xD0 = rcp_dynamic_cast<XpCrsMat>(tD0, true);
246  paramList.set<RCP<XpCrsMat> >("D0", xD0);
247  } else if (paramList.isType<Teuchos::RCP<const ThyLinOpBase> >("D0")) {
248  Teuchos::TimeMonitor tM_D0(*Teuchos::TimeMonitor::getNewTimer(std::string("ThyraMueLuRefMaxwell::initializePrec wrap D0")));
249  RCP<const ThyLinOpBase> thyD0 = paramList.get<RCP<const ThyLinOpBase> >("D0");
250  paramList.remove("D0");
251  RCP<const XpCrsMat> crsD0 = XpThyUtils::toXpetra(thyD0);
253  // MueLu needs a non-const object as input
254  RCP<XpCrsMat> crsD0NonConst = Teuchos::rcp_const_cast<XpCrsMat>(crsD0);
256  // wrap as an Xpetra::Matrix that MueLu can work with
258  paramList.set<RCP<XpMat> >("D0", D0);
259  } else if (paramList.isType<Teuchos::RCP<XpMat> >("D0")) {
260  // do nothing
261  } else
262  TEUCHOS_TEST_FOR_EXCEPTION(true, MueLu::Exceptions::RuntimeError, "Parameter D0 has wrong type.");
263  } else
264  TEUCHOS_TEST_FOR_EXCEPTION(true, MueLu::Exceptions::RuntimeError, "Need to specify matrix D0.");
265 
266  if (paramList.isParameter("M0inv")) {
267  if (paramList.isType<Teuchos::RCP<TpCrsMat> >("M0inv")) {
268  Teuchos::TimeMonitor tM_M0inv(*Teuchos::TimeMonitor::getNewTimer(std::string("ThyraMueLuRefMaxwell::initializePrec wrap M0inv")));
269  RCP<TpCrsMat> tM0inv = paramList.get<RCP<TpCrsMat> >("M0inv");
270  paramList.remove("M0inv");
271  RCP<XpCrsMat> xM0inv = rcp_dynamic_cast<XpCrsMat>(tM0inv, true);
272  paramList.set<RCP<XpCrsMat> >("M0inv", xM0inv);
273  } else if (paramList.isType<Teuchos::RCP<const ThyDiagLinOpBase> >("M0inv")) {
274  Teuchos::TimeMonitor tM_M0inv(*Teuchos::TimeMonitor::getNewTimer(std::string("ThyraMueLuRefMaxwell::initializePrec wrap M0inv")));
275  RCP<const ThyDiagLinOpBase> thyM0inv = paramList.get<RCP<const ThyDiagLinOpBase> >("M0inv");
276  paramList.remove("M0inv");
277  RCP<const Thyra::VectorBase<Scalar> > diag = thyM0inv->getDiag();
278  RCP<const tV> tDiag = Thyra::TpetraOperatorVectorExtraction<Scalar,LocalOrdinal,GlobalOrdinal,Node>::getConstTpetraVector(diag);
280  paramList.set<RCP<XpMat> >("M0inv", M0inv);
281  } else if (paramList.isType<Teuchos::RCP<const ThyLinOpBase> >("M0inv")) {
282  Teuchos::TimeMonitor tM_M0inv(*Teuchos::TimeMonitor::getNewTimer(std::string("ThyraMueLuRefMaxwell::initializePrec wrap M0inv")));
283  RCP<const ThyLinOpBase> thyM0inv = paramList.get<RCP<const ThyLinOpBase> >("M0inv");
284  paramList.remove("M0inv");
285  RCP<const XpCrsMat> crsM0inv = XpThyUtils::toXpetra(thyM0inv);
287  // MueLu needs a non-const object as input
288  RCP<XpCrsMat> crsM0invNonConst = Teuchos::rcp_const_cast<XpCrsMat>(crsM0inv);
289  TEUCHOS_TEST_FOR_EXCEPT(Teuchos::is_null(crsM0invNonConst));
290  // wrap as an Xpetra::Matrix that MueLu can work with
292  paramList.set<RCP<XpMat> >("M0inv", M0inv);
293  } else if (paramList.isType<Teuchos::RCP<XpMat> >("M0inv")) {
294  // do nothing
295  } else
296  TEUCHOS_TEST_FOR_EXCEPTION(true, MueLu::Exceptions::RuntimeError, "Parameter M0inv has wrong type.");
297  } else
298  TEUCHOS_TEST_FOR_EXCEPTION(true, MueLu::Exceptions::RuntimeError, "Need to specify matrix M0inv.");
299 
300  }
301 #endif
302 
303  {
304  // build a new MueLu RefMaxwell preconditioner
305  Teuchos::TimeMonitor tMbuild(*Teuchos::TimeMonitor::getNewTimer(std::string("ThyraMueLuRefMaxwell::initializePrec build prec")));
306  paramList.set<bool>("refmaxwell: use as preconditioner", true);
307  preconditioner = rcp(new MueLu::RefMaxwell<Scalar,LocalOrdinal,GlobalOrdinal,Node>(A, paramList, true));
308  }
309 
310  } else {
311  // reuse old MueLu preconditioner stored in MueLu Xpetra operator and put in new matrix
312 
313  // get old MueLu preconditioner
314 #if defined(HAVE_MUELU_TPETRA)
315  if (bIsTpetra) {
316 
317  RCP<ThyTpLinOp> tpetr_precOp = rcp_dynamic_cast<ThyTpLinOp>(thyra_precOp);
318  // RCP<XpOp> muelu_precOp = rcp_dynamic_cast<XpOp>(tpetr_precOp->getTpetraOperator(),true);
319  preconditioner = rcp_dynamic_cast<MueLu::RefMaxwell<Scalar,LocalOrdinal,GlobalOrdinal,Node> >(tpetr_precOp->getTpetraOperator(),true);
320  }
321 #endif
322  // TODO add the blocked matrix case here...
323 
324  }
325 
326  // wrap preconditioner in thyraPrecOp
327  RCP<ThyLinOpBase > thyraPrecOp = Teuchos::null;
328  RCP<const VectorSpaceBase<Scalar> > thyraRangeSpace = Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::toThyra(preconditioner->getRangeMap());
329  RCP<const VectorSpaceBase<Scalar> > thyraDomainSpace = Xpetra::ThyraUtils<Scalar,LocalOrdinal,GlobalOrdinal,Node>::toThyra(preconditioner->getDomainMap());
330 
331  RCP<XpOp> xpOp = Teuchos::rcp_dynamic_cast<XpOp>(preconditioner);
332  thyraPrecOp = Thyra::xpetraLinearOp<Scalar, LocalOrdinal, GlobalOrdinal, Node>(thyraRangeSpace, thyraDomainSpace,xpOp);
333 
335 
336  defaultPrec->initializeUnspecified(thyraPrecOp);
337 
338  }
339 
340  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
342  uninitializePrec(PreconditionerBase<Scalar>* prec, RCP<const LinearOpSourceBase<Scalar> >* fwdOp, ESupportSolveUse* supportSolveUse) const {
343  TEUCHOS_ASSERT(prec);
344 
345  // Retrieve concrete preconditioner object
346  const Teuchos::Ptr<DefaultPreconditioner<Scalar> > defaultPrec = Teuchos::ptr(dynamic_cast<DefaultPreconditioner<Scalar> *>(prec));
348 
349  if (fwdOp) {
350  // TODO: Implement properly instead of returning default value
351  *fwdOp = Teuchos::null;
352  }
353 
354  if (supportSolveUse) {
355  // TODO: Implement properly instead of returning default value
356  *supportSolveUse = Thyra::SUPPORT_SOLVE_UNSPECIFIED;
357  }
358 
359  defaultPrec->uninitialize();
360  }
361 
362 
363  // Overridden from ParameterListAcceptor
364  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
367  paramList_ = paramList;
368  }
369 
370  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
372  return paramList_;
373  }
374 
375  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
377  RCP<ParameterList> savedParamList = paramList_;
378  paramList_ = Teuchos::null;
379  return savedParamList;
380  }
381 
382  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
384  return paramList_;
385  }
386 
387  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
389  static RCP<const ParameterList> validPL;
390 
391  if (Teuchos::is_null(validPL))
392  validPL = rcp(new ParameterList());
393 
394  return validPL;
395  }
396 
397  // Public functions overridden from Teuchos::Describable
398  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
400  return "Thyra::MueLuRefMaxwellPreconditionerFactory";
401  }
402 } // namespace Thyra
403 
404 #endif // HAVE_MUELU_STRATIMIKOS
405 
406 #endif // ifdef THYRA_MUELU_REFMAXWELL_PRECONDITIONER_FACTORY_DEF_HPP
T & get(const std::string &name, T def_value)
static RCP< Xpetra::MultiVector< typename Teuchos::ScalarTraits< Scalar >::magnitudeType, LocalOrdinal, GlobalOrdinal, Node > > ExtractCoordinatesFromParameterList(ParameterList &paramList)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
bool nonnull(const std::shared_ptr< T > &p)
bool is_null(const std::shared_ptr< T > &p)
bool isCompatible(const LinearOpSourceBase< Scalar > &fwdOp) const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Teuchos::RCP< const Teuchos::ParameterList > getValidParameters() const
Teuchos::RCP< PreconditionerBase< Scalar > > createPrec() const
void uninitializePrec(PreconditionerBase< Scalar > *prec, Teuchos::RCP< const LinearOpSourceBase< Scalar > > *fwdOp, ESupportSolveUse *supportSolveUse) const
Preconditioner (wrapped as a Xpetra::Operator) for Maxwell&#39;s equations in curl-curl form...
static RCP< Time > getNewTimer(const std::string &name)
bool isParameter(const std::string &name) const
bool remove(std::string const &name, bool throwIfNotExists=true)
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
void initializePrec(const Teuchos::RCP< const LinearOpSourceBase< Scalar > > &fwdOp, PreconditionerBase< Scalar > *prec, const ESupportSolveUse supportSolveUse) const
void setParameterList(const Teuchos::RCP< Teuchos::ParameterList > &paramList)
RCP< const CrsGraph< int, GlobalOrdinal, Node > > toXpetra(const Epetra_CrsGraph &g)
bool isType(const std::string &name) const
static RCP< Matrix > Build(const RCP< const Map > &rowMap, size_t maxNumEntriesPerRow, Xpetra::ProfileType pftype=Xpetra::DynamicProfile)
Exception throws to report errors in the internal logical of the program.
#define TEUCHOS_ASSERT(assertion_test)
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Teuchos::RCP< const Teuchos::ParameterList > getParameterList() const
bool is_null() const