MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_Amesos2Smoother_def.hpp
Go to the documentation of this file.
1// @HEADER
2// *****************************************************************************
3// MueLu: A package for multigrid based preconditioning
4//
5// Copyright 2012 NTESS and the MueLu contributors.
6// SPDX-License-Identifier: BSD-3-Clause
7// *****************************************************************************
8// @HEADER
9
10#ifndef MUELU_AMESOS2SMOOTHER_DEF_HPP
11#define MUELU_AMESOS2SMOOTHER_DEF_HPP
12
13#include <algorithm>
14
15#include "MueLu_ConfigDefs.hpp"
16#include <Xpetra_Matrix.hpp>
17#include <Xpetra_IO.hpp>
18
19#include <Amesos2_config.h>
20#include <Amesos2.hpp>
21
23#include "MueLu_Level.hpp"
24#include "MueLu_Utilities.hpp"
25#include "MueLu_Monitor.hpp"
26
27namespace MueLu {
28
29template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
31 Projection(RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >& Nullspace) {
32 localMap_ = Xpetra::MapFactory<LocalOrdinal, GlobalOrdinal, Node>::Build(Nullspace->getMap()->lib(),
33 Nullspace->getNumVectors(),
34 Nullspace->getMap()->getIndexBase(),
35 Nullspace->getMap()->getComm(),
36 Xpetra::LocallyReplicated);
37
38 Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> > tempMV = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(localMap_, Nullspace->getNumVectors(), false);
39 const Scalar ONE = Teuchos::ScalarTraits<Scalar>::one();
40 const Scalar ZERO = Teuchos::ScalarTraits<Scalar>::zero();
41 tempMV->multiply(Teuchos::CONJ_TRANS, Teuchos::NO_TRANS, ONE, *Nullspace, *Nullspace, ZERO);
42
43 Kokkos::View<Scalar**, Kokkos::LayoutLeft, Kokkos::HostSpace> Q("Q", Nullspace->getNumVectors(), Nullspace->getNumVectors());
44 int LDQ;
45 {
46 auto dots = tempMV->getLocalViewHost(Tpetra::Access::ReadOnly);
47 Kokkos::deep_copy(Q, dots);
48 LDQ = Q.stride(1);
49 }
50
51 Teuchos::LAPACK<LocalOrdinal, Scalar> lapack;
52 int info = 0;
53 lapack.POTRF('L', Nullspace->getNumVectors(), Q.data(), LDQ, &info);
54 TEUCHOS_ASSERT(info == 0);
55 lapack.TRTRI('L', 'N', Nullspace->getNumVectors(), Q.data(), LDQ, &info);
56 TEUCHOS_ASSERT(info == 0);
57
58 Nullspace_ = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(Nullspace->getMap(), Nullspace->getNumVectors());
59
60 for (size_t i = 0; i < Nullspace->getNumVectors(); i++) {
61 for (size_t j = 0; j <= i; j++) {
62 Nullspace_->getVectorNonConst(i)->update(Q(i, j), *Nullspace->getVector(j), ONE);
63 }
64 }
65}
66
67template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
69 projectOut(Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node>& X) {
70 const Scalar ONE = Teuchos::ScalarTraits<Scalar>::one();
71 const Scalar ZERO = Teuchos::ScalarTraits<Scalar>::zero();
72
73 // Project X onto orthonormal nullspace
74 // Nullspace_ ^T * X
75 if (tempMV_.is_null() || tempMV_->getNumVectors() != X.getNumVectors())
76 tempMV_ = Xpetra::MultiVectorFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Build(localMap_, X.getNumVectors());
77 Teuchos::RCP<Xpetra::MultiVector<Scalar, LocalOrdinal, GlobalOrdinal, Node> >& tempMV = tempMV_;
78 tempMV->multiply(Teuchos::CONJ_TRANS, Teuchos::NO_TRANS, ONE, *Nullspace_, X, ZERO);
79 auto dots = tempMV->getLocalViewHost(Tpetra::Access::ReadOnly);
80 bool doProject = true;
81 for (size_t i = 0; i < X.getNumVectors(); i++) {
82 for (size_t j = 0; j < Nullspace_->getNumVectors(); j++) {
83 doProject = doProject || (Teuchos::ScalarTraits<Scalar>::magnitude(dots(j, i)) > 100 * Teuchos::ScalarTraits<Scalar>::eps());
84 }
85 }
86 if (doProject) {
87 for (size_t i = 0; i < X.getNumVectors(); i++) {
88 for (size_t j = 0; j < Nullspace_->getNumVectors(); j++) {
89 X.getVectorNonConst(i)->update(-dots(j, i), *Nullspace_->getVector(j), ONE);
90 }
91 }
92 }
93}
94
95template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
96Amesos2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Amesos2Smoother(const std::string& type, const Teuchos::ParameterList& paramList)
97 : type_(type)
98 , useTransformation_(false) {
99 this->SetParameterList(paramList);
100
101 if (!type_.empty()) {
102 // Transform string to "Abcde" notation
103 std::transform(type_.begin(), type_.end(), type_.begin(), ::tolower);
104 std::transform(type_.begin(), ++type_.begin(), type_.begin(), ::toupper);
105 }
106 if (type_ == "Superlu_dist")
107 type_ = "Superludist";
108
109 // Try to come up with something availble
110 // Order corresponds to our preference
111 // TODO: It would be great is Amesos2 provides directly this kind of logic for us
112 if (type_ == "" || Amesos2::query(type_) == false) {
113 std::string oldtype = type_;
114#if defined(HAVE_AMESOS2_KLU2)
115 type_ = "Klu";
116#elif defined(HAVE_AMESOS2_SUPERLU)
117 type_ = "Superlu";
118#elif defined(HAVE_AMESOS2_SUPERLUDIST)
119 type_ = "Superludist";
120#elif defined(HAVE_AMESOS2_BASKER)
121 type_ = "Basker";
122#else
123 this->declareConstructionOutcome(true, std::string("Amesos2 has been compiled without SuperLU_DIST, SuperLU, Klu, or Basker. By default, MueLu tries") +
124 "to use one of these libraries. Amesos2 must be compiled with one of these solvers, " +
125 "or a valid Amesos2 solver has to be specified explicitly.");
126 return;
127#endif
128 if (oldtype != "")
129 this->GetOStream(Warnings0) << "MueLu::Amesos2Smoother: \"" << oldtype << "\" is not available. Using \"" << type_ << "\" instead" << std::endl;
130 else
131 this->GetOStream(Runtime1) << "MueLu::Amesos2Smoother: using \"" << type_ << "\"" << std::endl;
132 }
133
134 // Check the validity of the solver type parameter
135 this->declareConstructionOutcome(Amesos2::query(type_) == false, "The Amesos2 library reported that the solver '" + type_ + "' is not available. " +
136 "Amesos2 has been compiled without the support of this solver, or the solver name is misspelled.");
137}
138
139template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
141
142template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
144 RCP<ParameterList> validParamList = rcp(new ParameterList());
145 validParamList->set<RCP<const FactoryBase> >("A", null, "Factory of the coarse matrix");
146 validParamList->set<RCP<const FactoryBase> >("Nullspace", null, "Factory of the nullspace");
147 validParamList->set<bool>("fix nullspace", false, "Remove zero eigenvalue by adding rank one correction.");
148 ParameterList norecurse;
149 norecurse.disableRecursiveValidation();
150 validParamList->set<ParameterList>("Amesos2", norecurse, "Parameters that are passed to Amesos2");
151 return validParamList;
152}
153
154template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
156 ParameterList pL = this->GetParameterList();
157
158 this->Input(currentLevel, "A");
159 if (pL.get<bool>("fix nullspace"))
160 this->Input(currentLevel, "Nullspace");
161}
162
163template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
165 FactoryMonitor m(*this, "Setup Smoother", currentLevel);
166
167 if (SmootherPrototype::IsSetup() == true)
168 this->GetOStream(Warnings0) << "MueLu::Amesos2Smoother::Setup(): Setup() has already been called" << std::endl;
169
170 RCP<Matrix> A = Factory::Get<RCP<Matrix> >(currentLevel, "A");
171 auto A_block = rcp_dynamic_cast<BlockedCrsMatrix>(A);
172 if (A_block) {
173 A = A_block->Merge();
174 }
175
176 // Do a quick check if we need to modify the matrix
177 RCP<const Map> rowMap = A->getRowMap();
178 RCP<Matrix> factorA;
179 Teuchos::ParameterList pL = this->GetParameterList();
180
181 if (pL.get<bool>("fix nullspace")) {
182 this->GetOStream(Runtime1) << "MueLu::Amesos2Smoother::Setup(): fixing nullspace" << std::endl;
183
184 rowMap = A->getRowMap();
185 size_t gblNumCols = rowMap->getGlobalNumElements();
186
187 RCP<MultiVector> NullspaceOrig = Factory::Get<RCP<MultiVector> >(currentLevel, "Nullspace");
188
189 projection_ = rcp(new Projection<Scalar, LocalOrdinal, GlobalOrdinal, Node>(NullspaceOrig));
190 RCP<MultiVector> Nullspace = projection_->Nullspace_;
191
192 RCP<MultiVector> ghostedNullspace;
193 RCP<const Map> colMap;
194 RCP<const Import> importer;
195 if (rowMap->getComm()->getSize() > 1) {
196 this->GetOStream(Warnings0) << "MueLu::Amesos2Smoother::Setup(): Applying nullspace fix on distributed matrix. Try rebalancing to single rank!" << std::endl;
197 ArrayRCP<GO> elements_RCP;
198 elements_RCP.resize(gblNumCols);
199 ArrayView<GO> elements = elements_RCP();
200 for (size_t k = 0; k < gblNumCols; k++)
201 elements[k] = Teuchos::as<GO>(k);
202 colMap = MapFactory::Build(rowMap->lib(), gblNumCols * rowMap->getComm()->getSize(), elements, Teuchos::ScalarTraits<GO>::zero(), rowMap->getComm());
203 importer = ImportFactory::Build(rowMap, colMap);
204 ghostedNullspace = MultiVectorFactory::Build(colMap, Nullspace->getNumVectors(), false);
205 ghostedNullspace->doImport(*Nullspace, *importer, Xpetra::INSERT);
206 } else {
207 ghostedNullspace = Nullspace;
208 colMap = rowMap;
209 }
210
211 using ATS = KokkosKernels::ArithTraits<SC>;
212 using impl_Scalar = typename ATS::val_type;
213 using impl_ATS = KokkosKernels::ArithTraits<impl_Scalar>;
214 using range_type = Kokkos::RangePolicy<LO, typename NO::execution_space>;
215
216 typedef typename Matrix::local_matrix_device_type KCRS;
217 typedef typename KCRS::StaticCrsGraphType graph_t;
218 typedef typename graph_t::row_map_type::non_const_type lno_view_t;
219 typedef typename graph_t::entries_type::non_const_type lno_nnz_view_t;
220 typedef typename KCRS::values_type::non_const_type scalar_view_t;
221
222 const impl_Scalar impl_SC_ZERO = impl_ATS::zero();
223
224 size_t lclNumRows = rowMap->getLocalNumElements();
225 LocalOrdinal lclNumCols = Teuchos::as<LocalOrdinal>(gblNumCols);
226 lno_view_t newRowPointers("newRowPointers", lclNumRows + 1);
227 lno_nnz_view_t newColIndices("newColIndices", lclNumRows * gblNumCols);
228 scalar_view_t newValues("newValues", lclNumRows * gblNumCols);
229
230 impl_Scalar shift;
231 {
232 RCP<Vector> diag = VectorFactory::Build(A->getRowMap());
233 A->getLocalDiagCopy(*diag);
234 shift = diag->normInf();
235 }
236
237 // form normalization * nullspace * nullspace^T
238 {
239 auto lclNullspace = Nullspace->getLocalViewDevice(Tpetra::Access::ReadOnly);
240 auto lclGhostedNullspace = ghostedNullspace->getLocalViewDevice(Tpetra::Access::ReadOnly);
241 Kokkos::parallel_for(
242 "MueLu:Amesos2Smoother::fixNullspace_1", range_type(0, lclNumRows + 1),
243 KOKKOS_LAMBDA(const size_t i) {
244 if (i < lclNumRows) {
245 newRowPointers(i) = i * gblNumCols;
246 for (LocalOrdinal j = 0; j < lclNumCols; j++) {
247 newColIndices(i * gblNumCols + j) = j;
248 newValues(i * gblNumCols + j) = impl_SC_ZERO;
249 for (size_t I = 0; I < lclNullspace.extent(1); I++)
250 for (size_t J = 0; J < lclGhostedNullspace.extent(1); J++)
251 newValues(i * gblNumCols + j) += shift * lclNullspace(i, I) * impl_ATS::conjugate(lclGhostedNullspace(j, J));
252 }
253 } else
254 newRowPointers(lclNumRows) = lclNumRows * gblNumCols;
255 });
256 }
257
258 // add A
259 if (colMap->lib() == Xpetra::UseTpetra) {
260 auto lclA = A->getLocalMatrixDevice();
261 auto lclColMapA = A->getColMap()->getLocalMap();
262 auto lclColMapANew = colMap->getLocalMap();
263 Kokkos::parallel_for(
264 "MueLu:Amesos2Smoother::fixNullspace_2", range_type(0, lclNumRows),
265 KOKKOS_LAMBDA(const size_t i) {
266 for (size_t jj = lclA.graph.row_map(i); jj < lclA.graph.row_map(i + 1); jj++) {
267 LO j = lclColMapANew.getLocalElement(lclColMapA.getGlobalElement(lclA.graph.entries(jj)));
268 impl_Scalar v = lclA.values(jj);
269 newValues(i * gblNumCols + j) += v;
270 }
271 });
272 } else {
273 auto lclA = A->getLocalMatrixHost();
274 for (size_t i = 0; i < lclNumRows; i++) {
275 for (size_t jj = lclA.graph.row_map(i); jj < lclA.graph.row_map(i + 1); jj++) {
276 LO j = colMap->getLocalElement(A->getColMap()->getGlobalElement(lclA.graph.entries(jj)));
277 SC v = lclA.values(jj);
278 newValues(i * gblNumCols + j) += v;
279 }
280 }
281 }
282
283 RCP<Matrix> newA = rcp(new CrsMatrixWrap(rowMap, colMap, 0));
284 RCP<CrsMatrix> newAcrs = toCrsMatrix(newA);
285 newAcrs->setAllValues(newRowPointers, newColIndices, newValues);
286 newAcrs->expertStaticFillComplete(A->getDomainMap(), A->getRangeMap(),
287 importer, A->getCrsGraph()->getExporter());
288
289 factorA = newA;
290 rowMap = factorA->getRowMap();
291 } else {
292 factorA = A;
293 }
294
295 RCP<const Tpetra_CrsMatrix> tA = toTpetra(factorA);
296
297 prec_ = Amesos2::create<Tpetra_CrsMatrix, Tpetra_MultiVector>(type_, tA);
298 TEUCHOS_TEST_FOR_EXCEPTION(prec_ == Teuchos::null, Exceptions::RuntimeError, "Amesos2::create returns Teuchos::null");
299 RCP<Teuchos::ParameterList> amesos2_params = Teuchos::rcpFromRef(pL.sublist("Amesos2"));
300 amesos2_params->setName("Amesos2");
301 if ((rowMap->getGlobalNumElements() != as<size_t>((rowMap->getMaxAllGlobalIndex() - rowMap->getMinAllGlobalIndex()) + 1)) ||
302 (!rowMap->isContiguous() && (rowMap->getComm()->getSize() == 1))) {
303 if (((type_ != "Cusolver") && (type_ != "Tacho")) && !(amesos2_params->sublist(prec_->name()).template isType<bool>("IsContiguous")))
304 amesos2_params->sublist(prec_->name()).set("IsContiguous", false, "Are GIDs Contiguous");
305 }
306 prec_->setParameters(amesos2_params);
307
308 prec_->numericFactorization();
309
311}
312
313template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
314void Amesos2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Apply(MultiVector& X, const MultiVector& B, bool /* InitialGuessIsZero */) const {
315 TEUCHOS_TEST_FOR_EXCEPTION(SmootherPrototype::IsSetup() == false, Exceptions::RuntimeError, "MueLu::Amesos2Smoother::Apply(): Setup() has not been called");
316
317 RCP<BlockedMultiVector> blockedX = rcp_dynamic_cast<BlockedMultiVector>(rcpFromRef(X));
318 bool blocked = blockedX != Teuchos::null;
319 if (blocked) {
320 this->ApplyBlocked(X, B);
321 return;
322 }
323
324 RCP<Tpetra_MultiVector> tX, tB;
325 if (!useTransformation_) {
326 tX = toTpetra(Teuchos::rcpFromRef(X));
327 tB = toTpetra(Teuchos::rcpFromRef(const_cast<MultiVector&>(B)));
328 } else {
329 // Copy data of the original vectors into the transformed ones
330 size_t numVectors = X.getNumVectors();
331 size_t length = X.getLocalLength();
332
333 TEUCHOS_TEST_FOR_EXCEPTION(numVectors > 1, Exceptions::RuntimeError,
334 "MueLu::Amesos2Smoother::Apply: Fixing coarse matrix for Amesos2 for multivectors has not been implemented yet.");
335 ArrayRCP<const SC> Xdata = X.getData(0), Bdata = B.getData(0);
336 ArrayRCP<SC> X_data = X_->getDataNonConst(0), B_data = B_->getDataNonConst(0);
337
338 for (size_t i = 0; i < length; i++) {
339 X_data[i] = Xdata[i];
340 B_data[i] = Bdata[i];
341 }
342
343 tX = toTpetra(X_);
344 tB = toTpetra(B_);
345 }
346
347 prec_->setX(tX);
348 prec_->setB(tB);
349
350 prec_->solve();
351
352 prec_->setX(Teuchos::null);
353 prec_->setB(Teuchos::null);
354
355 if (useTransformation_) {
356 // Copy data from the transformed vectors into the original ones
357 size_t length = X.getLocalLength();
358
359 ArrayRCP<SC> Xdata = X.getDataNonConst(0);
360 ArrayRCP<const SC> X_data = X_->getData(0);
361
362 for (size_t i = 0; i < length; i++)
363 Xdata[i] = X_data[i];
364 }
365
366 {
367 Teuchos::ParameterList pL = this->GetParameterList();
368 if (pL.get<bool>("fix nullspace")) {
369 projection_->projectOut(X);
370 }
371 }
372}
373
374template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
375void Amesos2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::ApplyBlocked(MultiVector& X, const MultiVector& B) const {
376 TEUCHOS_TEST_FOR_EXCEPTION(useTransformation_, Exceptions::RuntimeError,
377 "MueLu::Amesos2Smoother::ApplyBlocked: useTransformation_ == true is not supported");
378
379 Teuchos::ParameterList pL = this->GetParameterList();
380 const auto fixNullspace = pL.get<bool>("fix nullspace");
381 TEUCHOS_TEST_FOR_EXCEPTION(fixNullspace, Exceptions::RuntimeError,
382 "MueLu::Amesos2Smoother::ApplyBlocked: \"fix nullspace\" == true is not supported");
383
384 RCP<BlockedMultiVector> blockedX = rcp_dynamic_cast<BlockedMultiVector>(rcpFromRef(X));
385 RCP<const BlockedMultiVector> blockedB = rcp_dynamic_cast<const BlockedMultiVector>(rcpFromRef(B));
386 TEUCHOS_TEST_FOR_EXCEPTION(blockedX == Teuchos::null || blockedB == Teuchos::null, Exceptions::RuntimeError,
387 "MueLu::Amesos2Smoother::ApplyBlocked: Input and/or output vector are not BlockedMultiVector!");
388
389 RCP<MultiVector> mergedX = blockedX->Merge();
390 RCP<MultiVector> mergedB = blockedB->Merge();
391
392 RCP<Tpetra_MultiVector> tX, tB;
393 tX = toTpetra(mergedX);
394 tB = toTpetra(mergedB);
395
396 prec_->setX(tX);
397 prec_->setB(tB);
398
399 prec_->solve();
400
401 prec_->setX(Teuchos::null);
402 prec_->setB(Teuchos::null);
403
404 RCP<MultiVector> xx = Teuchos::rcp(new BlockedMultiVector(blockedX->getBlockedMap(), mergedX));
405 SC zero = Teuchos::ScalarTraits<SC>::zero(), one = Teuchos::ScalarTraits<SC>::one();
406 X.update(one, *xx, zero);
407}
408
409template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
410RCP<MueLu::SmootherPrototype<Scalar, LocalOrdinal, GlobalOrdinal, Node> >
415
416template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
418 std::ostringstream out;
419
420 if (SmootherPrototype::IsSetup() == true) {
421 out << prec_->description();
422
423 } else {
425 out << "{type = " << type_ << "}";
426 }
427 return out.str();
428}
429
430template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
431void Amesos2Smoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::print(Teuchos::FancyOStream& out, const VerbLevel verbLevel) const {
433
434 if (verbLevel & Parameters0)
435 out0 << "Prec. type: " << type_ << std::endl;
436
437 if (verbLevel & Parameters1) {
438 out0 << "Parameter list: " << std::endl;
439 Teuchos::OSTab tab2(out);
440 out << this->GetParameterList();
441 }
442
443 if ((verbLevel & External) && prec_ != Teuchos::null) {
444 Teuchos::OSTab tab2(out);
445 out << *prec_ << std::endl;
446 }
447
448 if (verbLevel & Debug)
449 out0 << "IsSetup: " << Teuchos::toString(SmootherPrototype::IsSetup()) << std::endl
450 << "-" << std::endl
451 << "RCP<prec_>: " << prec_ << std::endl;
452}
453
454template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
456 if (!prec_.is_null())
457 return prec_->getStatus().getNnzLU();
458 else
459 return 0.0;
460}
461} // namespace MueLu
462
463#endif // MUELU_AMESOS2SMOOTHER_DEF_HPP
#define MUELU_DESCRIBE
Helper macro for implementing Describable::describe() for BaseClass objects.
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
Class that encapsulates Amesos2 direct solvers.
void DeclareInput(Level &currentLevel) const
Input.
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
std::string type_
amesos2-specific key phrase that denote smoother type
void ApplyBlocked(MultiVector &X, const MultiVector &B) const
RCP< SmootherPrototype > Copy() const
std::string description() const
Return a simple one-line description of this object.
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
RCP< const ParameterList > GetValidParameterList() const
Return a const parameter list of valid parameters that setParameterList() will accept.
void Setup(Level &currentLevel)
Set up the direct solver. This creates the underlying Amesos2 solver object according to the paramete...
void Apply(MultiVector &X, const MultiVector &B, bool InitialGuessIsZero=false) const
Apply the direct solver. Solves the linear system AX=B using the constructed solver.
Amesos2Smoother(const std::string &type="", const Teuchos::ParameterList &paramList=Teuchos::ParameterList())
Constructor Creates a MueLu interface to the direct solvers in the Amesos2 package....
virtual std::string description() const
Return a simple one-line description of this object.
Exception throws to report errors in the internal logical of the program.
Timer to be used in factories. Similar to Monitor but with additional timers.
Class that holds all level-specific information.
virtual void SetParameterList(const Teuchos::ParameterList &paramList)
Set parameters from a parameter list and return with default values.
Projection(RCP< Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > > &Nullspace)
void projectOut(Xpetra::MultiVector< Scalar, LocalOrdinal, GlobalOrdinal, Node > &X)
void declareConstructionOutcome(bool fail, std::string msg)
bool IsSetup() const
Get the state of a smoother prototype.
Teuchos::FancyOStream & GetOStream(MsgType type, int thisProcRankOnly=0) const
Get an output stream for outputting the input message type.
Namespace for MueLu classes and methods.
@ Warnings0
Important warning messages (one line)
@ Debug
Print additional debugging information.
@ External
Print external lib objects.
@ Runtime1
Description of what is happening (more verbose)
@ Parameters0
Print class parameters.
@ Parameters1
Print class parameters (more parameters, more verbose)