46 #ifndef MUELU_IFPACK2SMOOTHER_DEF_HPP
47 #define MUELU_IFPACK2SMOOTHER_DEF_HPP
51 #if defined(HAVE_MUELU_TPETRA) && defined(HAVE_MUELU_IFPACK2)
55 #include <Tpetra_RowMatrix.hpp>
57 #include <Ifpack2_Chebyshev.hpp>
58 #include <Ifpack2_Relaxation.hpp>
59 #include <Ifpack2_ILUT.hpp>
60 #include <Ifpack2_BlockRelaxation.hpp>
61 #include <Ifpack2_Factory.hpp>
62 #include <Ifpack2_Parameters.hpp>
69 #include <Xpetra_TpetraMultiVector.hpp>
74 #include "MueLu_Utilities.hpp"
77 #ifdef HAVE_MUELU_INTREPID2
80 #include "Intrepid2_Basis.hpp"
88 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
90 : type_(type), overlap_(overlap)
95 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
106 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
111 RCP<ParameterList> precList = this->RemoveFactoriesFromList(this->GetParameterList());
113 prec_->setParameters(*precList);
118 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
120 this->Input(currentLevel,
"A");
122 if (type_ ==
"LINESMOOTHING_TRIDI_RELAXATION" ||
123 type_ ==
"LINESMOOTHING_TRIDI RELAXATION" ||
124 type_ ==
"LINESMOOTHING_TRIDIRELAXATION" ||
125 type_ ==
"LINESMOOTHING_TRIDIAGONAL_RELAXATION" ||
126 type_ ==
"LINESMOOTHING_TRIDIAGONAL RELAXATION" ||
127 type_ ==
"LINESMOOTHING_TRIDIAGONALRELAXATION" ||
128 type_ ==
"LINESMOOTHING_BANDED_RELAXATION" ||
129 type_ ==
"LINESMOOTHING_BANDED RELAXATION" ||
130 type_ ==
"LINESMOOTHING_BANDEDRELAXATION" ||
131 type_ ==
"LINESMOOTHING_BLOCK_RELAXATION" ||
132 type_ ==
"LINESMOOTHING_BLOCK RELAXATION" ||
133 type_ ==
"LINESMOOTHING_BLOCKRELAXATION") {
134 this->Input(currentLevel,
"CoarseNumZLayers");
135 this->Input(currentLevel,
"LineDetection_VertLineIds");
137 else if (type_ ==
"BLOCK RELAXATION" ||
138 type_ ==
"BLOCK_RELAXATION" ||
139 type_ ==
"BLOCKRELAXATION" ||
141 type_ ==
"BANDED_RELAXATION" ||
142 type_ ==
"BANDED RELAXATION" ||
143 type_ ==
"BANDEDRELAXATION" ||
145 type_ ==
"TRIDI_RELAXATION" ||
146 type_ ==
"TRIDI RELAXATION" ||
147 type_ ==
"TRIDIRELAXATION" ||
148 type_ ==
"TRIDIAGONAL_RELAXATION" ||
149 type_ ==
"TRIDIAGONAL RELAXATION" ||
150 type_ ==
"TRIDIAGONALRELAXATION")
155 precList.
get<std::string>(
"partitioner: type") ==
"line") {
156 this->Input(currentLevel,
"Coordinates");
159 else if (type_ ==
"TOPOLOGICAL")
162 this->Input(currentLevel,
"pcoarsen: element to node map");
166 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
170 A_ = Factory::Get< RCP<Matrix> >(currentLevel,
"A");
172 if (type_ ==
"SCHWARZ")
173 SetupSchwarz(currentLevel);
175 else if (type_ ==
"LINESMOOTHING_TRIDI_RELAXATION" ||
176 type_ ==
"LINESMOOTHING_TRIDI RELAXATION" ||
177 type_ ==
"LINESMOOTHING_TRIDIRELAXATION" ||
178 type_ ==
"LINESMOOTHING_TRIDIAGONAL_RELAXATION" ||
179 type_ ==
"LINESMOOTHING_TRIDIAGONAL RELAXATION" ||
180 type_ ==
"LINESMOOTHING_TRIDIAGONALRELAXATION" ||
181 type_ ==
"LINESMOOTHING_BANDED_RELAXATION" ||
182 type_ ==
"LINESMOOTHING_BANDED RELAXATION" ||
183 type_ ==
"LINESMOOTHING_BANDEDRELAXATION" ||
184 type_ ==
"LINESMOOTHING_BLOCK_RELAXATION" ||
185 type_ ==
"LINESMOOTHING_BLOCK RELAXATION" ||
186 type_ ==
"LINESMOOTHING_BLOCKRELAXATION")
187 SetupLineSmoothing(currentLevel);
189 else if (type_ ==
"BLOCK_RELAXATION" ||
190 type_ ==
"BLOCK RELAXATION" ||
191 type_ ==
"BLOCKRELAXATION" ||
193 type_ ==
"BANDED_RELAXATION" ||
194 type_ ==
"BANDED RELAXATION" ||
195 type_ ==
"BANDEDRELAXATION" ||
197 type_ ==
"TRIDI_RELAXATION" ||
198 type_ ==
"TRIDI RELAXATION" ||
199 type_ ==
"TRIDIRELAXATION" ||
200 type_ ==
"TRIDIAGONAL_RELAXATION" ||
201 type_ ==
"TRIDIAGONAL RELAXATION" ||
202 type_ ==
"TRIDIAGONALRELAXATION")
203 SetupBlockRelaxation(currentLevel);
205 else if (type_ ==
"CHEBYSHEV")
206 SetupChebyshev(currentLevel);
208 else if (type_ ==
"TOPOLOGICAL")
210 #ifdef HAVE_MUELU_INTREPID2
211 SetupTopological(currentLevel);
218 SetupGeneric(currentLevel);
223 this->GetOStream(
Statistics1) << description() << std::endl;
226 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
228 typedef Tpetra::RowMatrix<SC,LO,GO,NO> tRowMatrix;
230 bool reusePreconditioner =
false;
231 if (this->IsSetup() ==
true) {
233 this->GetOStream(
Runtime1) <<
"MueLu::Ifpack2Smoother::SetupSchwarz(): Setup() has already been called, assuming reuse" << std::endl;
235 bool isTRowMatrix =
true;
240 isTRowMatrix =
false;
244 if (!prec.
is_null() && isTRowMatrix) {
245 #ifdef IFPACK2_HAS_PROPER_REUSE
246 prec->resetMatrix(tA);
247 reusePreconditioner =
true;
249 this->GetOStream(
Errors) <<
"Ifpack2 does not have proper reuse yet." << std::endl;
253 this->GetOStream(
Warnings0) <<
"MueLu::Ifpack2Smoother::SetupSchwarz(): reuse of this type is not available "
254 "(either failed cast to CanChangeMatrix, or to Tpetra Row Matrix), reverting to full construction" << std::endl;
258 if (!reusePreconditioner) {
261 bool isBlockedMatrix =
false;
264 std::string sublistName =
"subdomain solver parameters";
276 std::string partName =
"partitioner: type";
277 if (subList.
isParameter(partName) && subList.
get<std::string>(partName) ==
"user") {
278 isBlockedMatrix =
true;
282 "Matrix A must be of type BlockedCrsMatrix.");
284 size_t numVels = bA->getMatrix(0,0)->getNodeNumRows();
285 size_t numPres = bA->getMatrix(1,0)->getNodeNumRows();
286 size_t numRows = A_->getNodeNumRows();
290 size_t numBlocks = 0;
291 for (
size_t rowOfB = numVels; rowOfB < numVels+numPres; ++rowOfB)
292 blockSeeds[rowOfB] = numBlocks++;
296 "Matrix A must be of type BlockedCrsMatrix.");
298 merged2Mat = bA2->Merge();
302 bool haveBoundary =
false;
303 for (
LO i = 0; i < boundaryNodes.
size(); i++)
304 if (boundaryNodes[i]) {
308 blockSeeds[i] = numBlocks;
314 subList.
set(
"partitioner: map", blockSeeds);
315 subList.
set(
"partitioner: local parts", as<int>(numBlocks));
320 isBlockedMatrix =
true;
321 merged2Mat = bA->Merge();
339 #ifdef HAVE_MUELU_INTREPID2
340 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
350 if (this->IsSetup() ==
true) {
351 this->GetOStream(
Warnings0) <<
"MueLu::Ifpack2Smoother::SetupTopological(): Setup() has already been called" << std::endl;
352 this->GetOStream(
Warnings0) <<
"MueLu::Ifpack2Smoother::SetupTopological(): reuse of this type is not available, reverting to full construction" << std::endl;
355 ParameterList& paramList =
const_cast<ParameterList&
>(this->GetParameterList());
357 typedef typename Node::device_type::execution_space ES;
359 typedef Kokkos::DynRankView<LocalOrdinal,typename Node::device_type> FCO;
365 const Teuchos::RCP<FCO> elemToNode = Factory::Get<Teuchos::RCP<FCO> >(currentLevel,
"pcoarsen: element to node map");
367 string basisString = paramList.
get<
string>(
"pcoarsen: hi basis");
373 auto basis = MueLuIntrepid::BasisFactory<double,ES>(basisString, degree);
375 string topologyTypeString = paramList.get<
string>(
"smoother: neighborhood type");
377 if (topologyTypeString ==
"node")
379 else if (topologyTypeString ==
"edge")
381 else if (topologyTypeString ==
"face")
383 else if (topologyTypeString ==
"cell")
384 dimension = basis->getBaseCellTopology().getDimension();
386 TEUCHOS_TEST_FOR_EXCEPTION(
true,std::invalid_argument,
"Unrecognized smoother neighborhood type. Supported types are node, edge, face.");
387 vector<vector<LocalOrdinal>> seeds;
392 int myNodeCount = A_->getRowMap()->getNodeNumElements();
393 ArrayRCP<LocalOrdinal> nodeSeeds(myNodeCount,lo_invalid);
394 int localPartitionNumber = 0;
395 for (LocalOrdinal seed : seeds[dimension])
397 nodeSeeds[seed] = localPartitionNumber++;
400 paramList.remove(
"smoother: neighborhood type");
401 paramList.remove(
"pcoarsen: hi basis");
403 paramList.set(
"partitioner: map", nodeSeeds);
404 paramList.set(
"partitioner: type",
"user");
405 paramList.set(
"partitioner: overlap", 1);
406 paramList.set(
"partitioner: local parts",
int(seeds[dimension].size()));
410 type_ =
"BLOCKRELAXATION";
418 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
420 if (this->IsSetup() ==
true) {
421 this->GetOStream(
Warnings0) <<
"MueLu::Ifpack2Smoother::SetupLineSmoothing(): Setup() has already been called" << std::endl;
422 this->GetOStream(
Warnings0) <<
"MueLu::Ifpack2Smoother::SetupLineSmoothing(): reuse of this type is not available, reverting to full construction" << std::endl;
427 LO CoarseNumZLayers = Factory::Get<LO>(currentLevel,
"CoarseNumZLayers");
428 if (CoarseNumZLayers > 0) {
429 Teuchos::ArrayRCP<LO> TVertLineIdSmoo = Factory::Get< Teuchos::ArrayRCP<LO> >(currentLevel,
"LineDetection_VertLineIds");
433 for(
size_t k = 0; k < Teuchos::as<size_t>(TVertLineIdSmoo.
size()); k++) {
434 if(maxPart < TVertLineIdSmoo[k]) maxPart = TVertLineIdSmoo[k];
437 size_t numLocalRows = A_->getNodeNumRows();
439 "MueLu::Ifpack2Smoother::Setup(): the number of local nodes is incompatible with the TVertLineIdsSmoo.");
441 if (numLocalRows == Teuchos::as<size_t>(TVertLineIdSmoo.
size())) {
442 myparamList.
set(
"partitioner: type",
"user");
443 myparamList.
set(
"partitioner: map",TVertLineIdSmoo);
444 myparamList.
set(
"partitioner: local parts",maxPart+1);
447 size_t numDofsPerNode = numLocalRows / TVertLineIdSmoo.
size();
451 for (
size_t blockRow = 0; blockRow < Teuchos::as<size_t>(TVertLineIdSmoo.
size()); ++blockRow)
452 for (
size_t dof = 0; dof < numDofsPerNode; dof++)
453 partitionerMap[blockRow * numDofsPerNode + dof] = TVertLineIdSmoo[blockRow];
454 myparamList.
set(
"partitioner: type",
"user");
455 myparamList.
set(
"partitioner: map",partitionerMap);
456 myparamList.
set(
"partitioner: local parts",maxPart + 1);
459 if (type_ ==
"LINESMOOTHING_BANDED_RELAXATION" ||
460 type_ ==
"LINESMOOTHING_BANDED RELAXATION" ||
461 type_ ==
"LINESMOOTHING_BANDEDRELAXATION")
462 type_ =
"BANDEDRELAXATION";
463 else if (type_ ==
"LINESMOOTHING_TRIDI_RELAXATION" ||
464 type_ ==
"LINESMOOTHING_TRIDI RELAXATION" ||
465 type_ ==
"LINESMOOTHING_TRIDIRELAXATION" ||
466 type_ ==
"LINESMOOTHING_TRIDIAGONAL_RELAXATION" ||
467 type_ ==
"LINESMOOTHING_TRIDIAGONAL RELAXATION" ||
468 type_ ==
"LINESMOOTHING_TRIDIAGONALRELAXATION")
469 type_ =
"TRIDIAGONALRELAXATION";
471 type_ =
"BLOCKRELAXATION";
474 this->GetOStream(
Runtime0) <<
"Line detection failed: fall back to point-wise relaxation" << std::endl;
475 myparamList.
remove(
"partitioner: type",
false);
476 myparamList.
remove(
"partitioner: map",
false);
477 myparamList.
remove(
"partitioner: local parts",
false);
478 type_ =
"RELAXATION";
489 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
491 typedef Tpetra::RowMatrix<SC,LO,GO,NO> tRowMatrix;
499 bool reusePreconditioner =
false;
500 if (this->IsSetup() ==
true) {
502 this->GetOStream(
Runtime1) <<
"MueLu::Ifpack2Smoother::SetupBlockRelaxation(): Setup() has already been called, assuming reuse" << std::endl;
506 #ifdef IFPACK2_HAS_PROPER_REUSE
507 prec->resetMatrix(tA);
508 reusePreconditioner =
true;
510 this->GetOStream(
Errors) <<
"Ifpack2 does not have proper reuse yet." << std::endl;
514 this->GetOStream(
Warnings0) <<
"MueLu::Ifpack2Smoother::SetupBlockRelaxation(): reuse of this type is not available (failed cast to CanChangeMatrix), "
515 "reverting to full construction" << std::endl;
519 if (!reusePreconditioner) {
523 myparamList.
get<std::string>(
"partitioner: type") ==
"line") {
525 Factory::Get<Teuchos::RCP<Xpetra::MultiVector<typename Teuchos::ScalarTraits<Scalar>::magnitudeType,LO,GO,
NO> > >(currentLevel,
"Coordinates");
528 size_t numDofsPerNode = A_->getNodeNumRows() / xCoordinates->getMap()->getNodeNumElements();
529 myparamList.
set(
"partitioner: coordinates", coordinates);
530 myparamList.
set(
"partitioner: PDE equations", (
int) numDofsPerNode);
541 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
543 if (this->IsSetup() ==
true) {
544 this->GetOStream(
Warnings0) <<
"MueLu::Ifpack2Smoother::SetupChebyshev(): SetupChebyshev() has already been called" << std::endl;
545 this->GetOStream(
Warnings0) <<
"MueLu::Ifpack2Smoother::SetupChebyshev(): reuse of this type is not available, reverting to full construction" << std::endl;
549 SC negone = -STS::one();
551 SC lambdaMax = negone;
553 std::string maxEigString =
"chebyshev: max eigenvalue";
554 std::string eigRatioString =
"chebyshev: ratio eigenvalue";
560 if (paramList.
isType<
double>(maxEigString))
561 lambdaMax = paramList.
get<
double>(maxEigString);
563 lambdaMax = paramList.
get<
SC>(maxEigString);
564 this->GetOStream(
Statistics1) << maxEigString <<
" (cached with smoother parameter list) = " << lambdaMax << std::endl;
567 lambdaMax = A_->GetMaxEigenvalueEstimate();
568 if (lambdaMax != negone) {
569 this->GetOStream(
Statistics1) << maxEigString <<
" (cached with matrix) = " << lambdaMax << std::endl;
570 paramList.
set(maxEigString, lambdaMax);
575 const SC defaultEigRatio = 20;
577 SC ratio = defaultEigRatio;
579 if (paramList.
isType<
double>(eigRatioString))
580 ratio = paramList.
get<
double>(eigRatioString);
582 ratio = paramList.
get<
SC>(eigRatioString);
590 size_t nRowsFine = fineA->getGlobalNumRows();
591 size_t nRowsCoarse = A_->getGlobalNumRows();
593 SC levelRatio = as<SC>(as<float>(nRowsFine)/nRowsCoarse);
594 if (STS::magnitude(levelRatio) > STS::magnitude(ratio))
598 this->GetOStream(
Statistics1) << eigRatioString <<
" (computed) = " << ratio << std::endl;
599 paramList.
set(eigRatioString, ratio);
615 if (lambdaMax == negone) {
616 typedef Tpetra::RowMatrix<SC, LO, GO, NO> MatrixType;
619 if (chebyPrec != Teuchos::null) {
620 lambdaMax = chebyPrec->getLambdaMaxForApply();
621 A_->SetMaxEigenvalueEstimate(lambdaMax);
622 this->GetOStream(
Statistics1) <<
"chebyshev: max eigenvalue (calculated by Ifpack2)" <<
" = " << lambdaMax << std::endl;
628 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
630 typedef Tpetra::RowMatrix<SC,LO,GO,NO> tRowMatrix;
638 bool reusePreconditioner =
false;
639 if (this->IsSetup() ==
true) {
641 this->GetOStream(
Runtime1) <<
"MueLu::Ifpack2Smoother::SetupGeneric(): Setup() has already been called, assuming reuse" << std::endl;
645 #ifdef IFPACK2_HAS_PROPER_REUSE
646 prec->resetMatrix(tA);
647 reusePreconditioner =
true;
649 this->GetOStream(
Errors) <<
"Ifpack2 does not have proper reuse yet." << std::endl;
653 this->GetOStream(
Warnings0) <<
"MueLu::Ifpack2Smoother::SetupGeneric(): reuse of this type is not available (failed cast to CanChangeMatrix), "
654 "reverting to full construction" << std::endl;
658 if (!reusePreconditioner) {
667 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
681 bool supportInitialGuess =
false;
682 if (type_ ==
"CHEBYSHEV") {
683 paramList.
set(
"chebyshev: zero starting solution", InitialGuessIsZero);
684 SetPrecParameters(paramList);
685 supportInitialGuess =
true;
687 }
else if (type_ ==
"RELAXATION") {
688 paramList.
set(
"relaxation: zero starting solution", InitialGuessIsZero);
689 SetPrecParameters(paramList);
690 supportInitialGuess =
true;
692 }
else if (type_ ==
"KRYLOV") {
693 paramList.
set(
"krylov: zero starting solution", InitialGuessIsZero);
694 SetPrecParameters(paramList);
695 supportInitialGuess =
true;
697 }
else if (type_ ==
"SCHWARZ") {
698 paramList.
set(
"schwarz: zero starting solution", InitialGuessIsZero);
704 supportInitialGuess =
true;
714 if (InitialGuessIsZero || supportInitialGuess) {
717 prec_->apply(tpB, tpX);
721 RCP<MultiVector> Correction = MultiVectorFactory::Build(A_->getDomainMap(), X.getNumVectors());
726 prec_->apply(tpB, tpX);
728 X.update(TST::one(), *Correction, TST::one());
732 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
739 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
741 std::ostringstream out;
743 out << prec_->description();
746 out <<
"{type = " << type_ <<
"}";
751 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
756 out0 <<
"Prec. type: " << type_ << std::endl;
759 out0 <<
"Parameter list: " << std::endl;
761 out << this->GetParameterList();
762 out0 <<
"Overlap: " << overlap_ << std::endl;
766 if (prec_ != Teuchos::null) {
768 out << *prec_ << std::endl;
771 if (verbLevel &
Debug) {
774 <<
"RCP<prec_>: " << prec_ << std::endl;
778 template <
class Scalar,
class LocalOrdinal,
class GlobalOrdinal,
class Node>
780 typedef Tpetra::RowMatrix<SC,LO,GO,NO> MatrixType;
783 if(!pr.
is_null())
return pr->getNodeSmootherComplexity();
786 if(!pc.
is_null())
return pc->getNodeSmootherComplexity();
789 if(!pb.
is_null())
return pb->getNodeSmootherComplexity();
792 if(!pi.
is_null())
return pi->getNodeSmootherComplexity();
795 if(!pk.
is_null())
return pk->getNodeSmootherComplexity();
804 #endif // HAVE_MUELU_TPETRA && HAVE_MUELU_IFPACK2
805 #endif // MUELU_IFPACK2SMOOTHER_DEF_HPP
void DeclareInput(Level ¤tLevel) const
Input.
Important warning messages (one line)
void SetupGeneric(Level ¤tLevel)
Exception indicating invalid cast attempted.
RCP< Level > & GetPreviousLevel()
Previous level.
void FindGeometricSeedOrdinals(Teuchos::RCP< Basis > basis, const LOFieldContainer &elementToNodeMap, std::vector< std::vector< LocalOrdinal > > &seeds, const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &rowMap, const Xpetra::Map< LocalOrdinal, GlobalOrdinal, Node > &columnMap)
static RCP< const Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > MV2TpetraMV(RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > const vec)
Helper utility to pull out the underlying Tpetra objects from an Xpetra object.
Print external lib objects.
T & get(const std::string &name, T def_value)
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
friend class Ifpack2Smoother
Constructor.
static Teuchos::ArrayRCP< const bool > DetectDirichletRows(const Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > &A, const Magnitude &tol=Teuchos::ScalarTraits< Scalar >::magnitude(0.), const bool count_twos_as_dirichlet=false)
Timer to be used in factories. Similar to Monitor but with additional timers.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
Print additional debugging information.
One-liner description of what is happening.
void SetParameterList(const Teuchos::ParameterList ¶mList)
Set parameters from a parameter list and return with default values.
static RCP< Tpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > MV2NonConstTpetraMV(RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > vec)
void SetupBlockRelaxation(Level ¤tLevel)
bool isParameter(const std::string &name) const
void SetupSchwarz(Level ¤tLevel)
void SetupLineSmoothing(Level ¤tLevel)
bool remove(std::string const &name, bool throwIfNotExists=true)
static RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Residual(const Xpetra::Operator< Scalar, LocalOrdinal, GlobalOrdinal, Node > &Op, const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X, const Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &RHS)
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
virtual void SetParameterList(const Teuchos::ParameterList ¶mList)
Set parameters from a parameter list and return with default values.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
RCP< SmootherPrototype > Copy() const
Class that holds all level-specific information.
bool isSublist(const std::string &name) const
void Setup(Level ¤tLevel)
Set up the smoother.
Timer to be used in factories. Similar to SubMonitor but adds a timer level by level.
void SetupTopological(Level ¤tLevel)
std::string description() const
Return a simple one-line description of this object.
bool IsSetup() const
Get the state of a smoother prototype.
static Teuchos::RCP< Preconditioner< typename MatrixType::scalar_type, typename MatrixType::local_ordinal_type, typename MatrixType::global_ordinal_type, typename MatrixType::node_type > > create(const std::string &precType, const Teuchos::RCP< const MatrixType > &matrix)
#define MUELU_DESCRIBE
Helper macro for implementing Describable::describe() for BaseClass objects.
ParameterList & setParameters(const ParameterList &source)
void SetPrecParameters(const Teuchos::ParameterList &list=Teuchos::ParameterList()) const
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
RCP< const Tpetra::CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > toTpetra(const RCP< const CrsGraph< LocalOrdinal, GlobalOrdinal, Node > > &graph)
bool isType(const std::string &name) const
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply the preconditioner.
ParameterList & sublist(const std::string &name, bool mustAlreadyExist=false, const std::string &docString="")
int GetLevelID() const
Return level number.
Print class parameters (more parameters, more verbose)
Exception throws to report errors in the internal logical of the program.
void SetupChebyshev(Level ¤tLevel)
Description of what is happening (more verbose)
Class that encapsulates Ifpack2 smoothers.
static RCP< Tpetra::RowMatrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Op2NonConstTpetraRow(RCP< Xpetra::Matrix< Scalar, LocalOrdinal, GlobalOrdinal, Node > > Op)
virtual std::string description() const
Return a simple one-line description of this object.
std::string toString(const T &t)