MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_HierarchyManager.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_HIERARCHYMANAGER_DECL_HPP
47#define MUELU_HIERARCHYMANAGER_DECL_HPP
48
49#include <string>
50#include <map>
51
52#include <Teuchos_Array.hpp>
53
54#include <Xpetra_Operator.hpp>
55#include <Xpetra_IO.hpp>
56
57#include "MueLu_ConfigDefs.hpp"
58
59#include "MueLu_Exceptions.hpp"
60#include "MueLu_Aggregates.hpp"
61#include "MueLu_Hierarchy.hpp"
63#include "MueLu_Level.hpp"
64#include "MueLu_MasterList.hpp"
65#include "MueLu_PerfUtils.hpp"
66
67#ifdef HAVE_MUELU_INTREPID2
68#include "Kokkos_DynRankView.hpp"
69#endif
70
71namespace MueLu {
72
73 // This class stores the configuration of a Hierarchy.
74 // The class also provides an algorithm to build a Hierarchy from the configuration.
75 //
76 // See also: FactoryManager
77 //
78 template <class Scalar = DefaultScalar,
81 class Node = DefaultNode>
82 class HierarchyManager : public HierarchyFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node> {
83#undef MUELU_HIERARCHYMANAGER_SHORT
85 typedef std::pair<std::string, const FactoryBase*> keep_pair;
86
87 public:
88
90 HierarchyManager(int numDesiredLevel = MasterList::getDefault<int>("max levels")) :
91 numDesiredLevel_(numDesiredLevel),
92 maxCoarseSize_(MasterList::getDefault<int>("coarse: max size")),
94 doPRrebalance_(MasterList::getDefault<bool>("repartition: rebalance P and R")),
95 doPRViaCopyrebalance_(MasterList::getDefault<bool>("repartition: explicit via new copy rebalance P and R")),
96 implicitTranspose_(MasterList::getDefault<bool>("transpose: use implicit")),
97 fuseProlongationAndUpdate_(MasterList::getDefault<bool>("fuse prolongation and update")),
98 suppressNullspaceDimensionCheck_(MasterList::getDefault<bool>("nullspace: suppress dimension check")),
99 sizeOfMultiVectors_(MasterList::getDefault<int>("number of vectors")),
100 graphOutputLevel_(-2) { }
101
103 virtual ~HierarchyManager() = default;
104
106 void AddFactoryManager(int startLevel, int numDesiredLevel, RCP<FactoryManagerBase> manager) {
107 const int lastLevel = startLevel + numDesiredLevel - 1;
108 if (levelManagers_.size() < lastLevel + 1)
109 levelManagers_.resize(lastLevel + 1);
110
111 for (int iLevel = startLevel; iLevel <= lastLevel; iLevel++)
112 levelManagers_[iLevel] = manager;
113 }
114
116 RCP<FactoryManagerBase> GetFactoryManager(int levelID) const {
117 // NOTE: last levelManager is used for all the remaining levels
118 return (levelID >= levelManagers_.size() ? levelManagers_[levelManagers_.size()-1] : levelManagers_[levelID]);
119 }
120
122 size_t getNumFactoryManagers() const {
123 return levelManagers_.size();
124 }
125
127 void CheckConfig() {
128 for (int i = 0; i < levelManagers_.size(); i++)
129 TEUCHOS_TEST_FOR_EXCEPTION(levelManagers_[i] == Teuchos::null, Exceptions::RuntimeError, "MueLu:HierarchyConfig::CheckConfig(): Undefined configuration for level:");
130 }
131
133
134 virtual RCP<Hierarchy> CreateHierarchy() const {
135 return rcp(new Hierarchy());
137
138 virtual RCP<Hierarchy> CreateHierarchy(const std::string& label) const {
139 return rcp(new Hierarchy(label));
140 }
141
143 virtual void SetupHierarchy(Hierarchy& H) const {
144 TEUCHOS_TEST_FOR_EXCEPTION(!H.GetLevel(0)->IsAvailable("A"), Exceptions::RuntimeError, "No fine level operator");
145
146 RCP<Level> l0 = H.GetLevel(0);
147 RCP<Operator> Op = l0->Get<RCP<Operator>>("A");
148
149 // Compare nullspace dimension to NumPDEs and throw/warn based on user input
150 if (l0->IsAvailable("Nullspace")) {
151 RCP<Matrix> A = Teuchos::rcp_dynamic_cast<Matrix>(Op);
152 if (A != Teuchos::null) {
153 RCP<MultiVector> nullspace = l0->Get<RCP<MultiVector>>("Nullspace");
154
155 if (static_cast<size_t>(A->GetFixedBlockSize()) > nullspace->getNumVectors())
156 {
157 std::stringstream msg;
158 msg << "User-provided nullspace has fewer vectors ("
159 << nullspace->getNumVectors() << ") than number of PDE equations ("
160 << A->GetFixedBlockSize() << "). ";
161
163 {
164 msg << "It depends on the PDE, if this is a problem or not.";
165 this->GetOStream(Warnings0) << msg.str() << std::endl;
166 }
167 else
168 {
169 msg << "Add the missing nullspace vectors! (You can suppress this check. See the MueLu user guide for details.)";
170 TEUCHOS_TEST_FOR_EXCEPTION(static_cast<size_t>(A->GetFixedBlockSize()) > nullspace->getNumVectors(), Exceptions::RuntimeError, msg.str());
171 }
172 }
173 } else {
174 this->GetOStream(Warnings0) << "Skipping dimension check of user-supplied nullspace because user-supplied operator is not a matrix" << std::endl;
175 }
176 }
177
178#ifdef HAVE_MUELU_DEBUG
179 // Reset factories' data used for debugging
180 for (int i = 0; i < levelManagers_.size(); i++)
181 levelManagers_[i]->ResetDebugData();
182
183#endif
184
185 // Setup Matrix
186 // TODO: I should certainly undo this somewhere...
187
188 Xpetra::UnderlyingLib lib = Op->getDomainMap()->lib();
189 H.setlib(lib);
190
191 SetupOperator(*Op);
192 SetupExtra(H);
193
194 // Setup Hierarchy
197 if (graphOutputLevel_ >= 0 || graphOutputLevel_ == -1)
199
201 RCP<Matrix> Amat = rcp_dynamic_cast<Matrix>(Op);
202
203 if (!Amat.is_null()) {
204 RCP<ParameterList> params = rcp(new ParameterList());
205 params->set("printLoadBalancingInfo", true);
206 params->set("printCommInfo", true);
207
209 } else {
210 VerboseObject::GetOStream(Warnings1) << "Fine level operator is not a matrix, statistics are not available" << std::endl;
211 }
212 }
213
218
219 H.Clear();
220
221 // There are few issues with using Keep in the interpreter:
222 // 1. Hierarchy::Keep interface takes a name and a factory. If
223 // factories are different on different levels, the AddNewLevel() call
224 // in Hierarchy does not work properly, as it assume that factories are
225 // the same.
226 // 2. FactoryManager does not have a Keep option, only Hierarchy and
227 // Level have it
228 // 3. Interpreter constructs factory managers, but not levels. So we
229 // cannot set up Keep flags there.
230 //
231 // The solution implemented here does the following:
232 // 1. Construct hierarchy with dummy levels. This avoids
233 // Hierarchy::AddNewLevel() calls which will propagate wrong
234 // inheritance.
235 // 2. Interpreter constructs keep_ array with names and factories for
236 // that level
237 // 3. For each level, we call Keep(name, factory) for each keep_
238 for (int i = 0; i < numDesiredLevel_; i++) {
239 std::map<int, std::vector<keep_pair> >::const_iterator it = keep_.find(i);
240 if (it != keep_.end()) {
241 RCP<Level> l = H.GetLevel(i);
242 const std::vector<keep_pair>& keeps = it->second;
243 for (size_t j = 0; j < keeps.size(); j++)
244 l->Keep(keeps[j].first, keeps[j].second);
245 }
246 if (i < numDesiredLevel_-1) {
247 RCP<Level> newLevel = rcp(new Level());
248 H.AddLevel(newLevel);
249 }
250 }
251
252 // Matrices to print
253 for(auto iter=matricesToPrint_.begin(); iter!=matricesToPrint_.end(); iter++)
254 ExportDataSetKeepFlags(H,iter->second,iter->first);
255
256 // Vectors, aggregates and other things that need special case handling
259 // NOTE: Aggregates use the next level's Factory
261#ifdef HAVE_MUELU_INTREPID2
262 ExportDataSetKeepFlags(H,elementToNodeMapsToPrint_, "pcoarsen: element to node map");
263#endif
264
265 // Data to save only (these do not have a level, so we do all levels)
266 for(int i=0; i<dataToSave_.size(); i++)
268
269 int levelID = 0;
270 int lastLevelID = numDesiredLevel_ - 1;
271 bool isLastLevel = false;
272
273 while (!isLastLevel) {
274 bool r = H.Setup(levelID,
275 LvlMngr(levelID-1, lastLevelID),
276 LvlMngr(levelID, lastLevelID),
277 LvlMngr(levelID+1, lastLevelID));
278 if (levelID < H.GetNumLevels())
279 H.GetLevel(levelID)->print(H.GetOStream(Developer), verbosity_);
280
281 isLastLevel = r || (levelID == lastLevelID);
282 levelID++;
283 }
284 if (!matvecParams_.is_null())
287 // Set hierarchy description.
288 // This is cached, but involves and MPI_Allreduce.
289 H.description();
291
292 // When we reuse hierarchy, it is necessary that we don't
293 // change the number of levels. We also cannot make requests
294 // for coarser levels, because we don't construct all the
295 // data on previous levels. For instance, let's say our first
296 // run constructed three levels. If we try to do requests during
297 // next setup for the fourth level, it would need Aggregates
298 // which we didn't construct for level 3 because we reused P.
299 // To fix this situation, we change the number of desired levels
300 // here.
301 numDesiredLevel_ = levelID;
302
303 // Matrix prints
304 for(auto iter = matricesToPrint_.begin(); iter != matricesToPrint_.end(); iter++) {
305 WriteData<Matrix>(H,iter->second,iter->first);
306 }
307
308 // Vectors, aggregates and all things we need to print manually
311 WriteDataAggregates(H, aggregatesToPrint_, "Aggregates");
312
313
314
315#ifdef HAVE_MUELU_INTREPID2
316 typedef Kokkos::DynRankView<LocalOrdinal,typename Node::device_type> FCi;
317 WriteDataFC<FCi>(H,elementToNodeMapsToPrint_, "pcoarsen: element to node map","el2node");
318#endif
319
320
321 } //SetupHierarchy
322
324
325 typedef std::map<std::string, RCP<const FactoryBase> > FactoryMap;
326
327 protected: //TODO: access function
328
330 virtual void SetupOperator(Operator& /* Op */) const { }
331
333 // TODO: merge with SetupMatrix ?
334 virtual void SetupExtra(Hierarchy& /* H */) const { }
335
336 // TODO this was private
337 // Used in SetupHierarchy() to access levelManagers_
338 // Inputs i=-1 and i=size() are allowed to simplify calls to hierarchy->Setup()
339 Teuchos::RCP<FactoryManagerBase> LvlMngr(int levelID, int lastLevelID) const {
340 // NOTE: the order of 'if' statements is important
341 if (levelID == -1) // levelID = -1 corresponds to the finest level
342 return Teuchos::null;
343
344 if (levelID == lastLevelID+1) // levelID = 'lastLevelID+1' corresponds to the last level (i.e., no nextLevel)
345 return Teuchos::null;
346
347 if (levelManagers_.size() == 0) { // default factory manager.
348 // The default manager is shared across levels, initialized only if needed and deleted with the HierarchyManager
349 static RCP<FactoryManagerBase> defaultMngr = rcp(new FactoryManager());
350 return defaultMngr;
351 }
352
353 return GetFactoryManager(levelID);
354 }
355
358
359 mutable int numDesiredLevel_;
360 Xpetra::global_size_t maxCoarseSize_;
362
367
375
377
380
382 // Items here get handled manually
383 Teuchos::Array<int> nullspaceToPrint_;
384 Teuchos::Array<int> coordinatesToPrint_;
385 Teuchos::Array<int> aggregatesToPrint_;
386 Teuchos::Array<int> elementToNodeMapsToPrint_;
387
388 // Data we'll need to save, not necessarily print
389 Teuchos::Array<std::string> dataToSave_;
390
391 // Matrices we'll need to print
392 std::map<std::string,Teuchos::Array<int> > matricesToPrint_;
393
394 Teuchos::RCP<Teuchos::ParameterList> matvecParams_;
395
396 std::map<int, std::vector<keep_pair> > keep_;
398
399 private:
400 // Set the keep flags for Export Data
401 void ExportDataSetKeepFlags(Hierarchy& H, const Teuchos::Array<int>& data, const std::string& name) const {
402 for (int i = 0; i < data.size(); ++i) {
403 if (data[i] < H.GetNumLevels()) {
404 RCP<Level> L = H.GetLevel(data[i]);
405 if(!L.is_null() && data[i] < levelManagers_.size())
406 L->AddKeepFlag(name, &*levelManagers_[data[i]]->GetFactory(name));
407 }
408 }
409 }
410
411 void ExportDataSetKeepFlagsNextLevel(Hierarchy& H, const Teuchos::Array<int>& data, const std::string& name) const {
412 for (int i = 0; i < data.size(); ++i) {
413 if (data[i] < H.GetNumLevels()) {
414 RCP<Level> L = H.GetLevel(data[i]);
415 if(!L.is_null() && data[i]+1 < levelManagers_.size())
416 L->AddKeepFlag(name, &*levelManagers_[data[i]+1]->GetFactory(name));
417 }
418 }
419 }
420
421 // Set the keep flags for Export Data
422 void ExportDataSetKeepFlagsAll(Hierarchy& H, const std::string& name) const {
423 for (int i=0; i < H.GetNumLevels(); i++ ) {
424 RCP<Level> L = H.GetLevel(i);
425 if(!L.is_null() && i < levelManagers_.size())
426 L->AddKeepFlag(name, &*levelManagers_[i]->GetFactory(name));
427 }
428 }
429
430
431 template<class T>
432 void WriteData(Hierarchy& H, const Teuchos::Array<int>& data, const std::string& name) const {
433 for (int i = 0; i < data.size(); ++i) {
434 std::string fileName;
435 if (H.getObjectLabel() != "")
436 fileName = H.getObjectLabel() + "_" + name + "_" + Teuchos::toString(data[i]) + ".m";
437 else
438 fileName = name + "_" + Teuchos::toString(data[i]) + ".m";
439
440 if (data[i] < H.GetNumLevels()) {
441 RCP<Level> L = H.GetLevel(data[i]);
442 if (data[i] < levelManagers_.size() && L->IsAvailable(name,&*levelManagers_[data[i]]->GetFactory(name))) {
443 // Try generating factory
444 RCP<T> M = L->template Get< RCP<T> >(name,&*levelManagers_[data[i]]->GetFactory(name));
445 if (!M.is_null()) {
446 Xpetra::IO<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Write(fileName,* M);
447 }
448 }
449 else if (L->IsAvailable(name)) {
450 // Try nofactory
451 RCP<T> M = L->template Get< RCP<T> >(name);
452 if (!M.is_null()) {
453 Xpetra::IO<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Write(fileName,* M);
454 }
455 }
456 }
457 }
458 }
459
460 void WriteDataAggregates(Hierarchy& H, const Teuchos::Array<int>& data, const std::string& name) const {
461 for (int i = 0; i < data.size(); ++i) {
462 const std::string fileName = name + "_" + Teuchos::toString(data[i]) + ".m";
463
464 if (data[i] < H.GetNumLevels()) {
465 RCP<Level> L = H.GetLevel(data[i]);
466
467 // NOTE: Aggregates use the next level's factory
468 RCP<Aggregates> agg;
469 if(data[i]+1 < H.GetNumLevels() && L->IsAvailable(name,&*levelManagers_[data[i]+1]->GetFactory(name))) {
470 // Try generating factory
471 agg = L->template Get< RCP<Aggregates> >(name,&*levelManagers_[data[i]+1]->GetFactory(name));
472 }
473 else if (L->IsAvailable(name)) {
474 agg = L->template Get<RCP<Aggregates> >("Aggregates");
475 }
476 if(!agg.is_null()) {
477 std::ofstream ofs(fileName);
478 Teuchos::FancyOStream fofs(rcp(&ofs,false));
479 agg->print(fofs,Teuchos::VERB_EXTREME);
480 }
481 }
482 }
483 }
484
485 template<class T>
486 void WriteDataFC(Hierarchy& H, const Teuchos::Array<int>& data, const std::string& name, const std::string & ofname) const {
487 for (int i = 0; i < data.size(); ++i) {
488 const std::string fileName = ofname + "_" + Teuchos::toString(data[i]) + ".m";
489
490 if (data[i] < H.GetNumLevels()) {
491 RCP<Level> L = H.GetLevel(data[i]);
492
493 if (L->IsAvailable(name)) {
494 RCP<T> M = L->template Get< RCP<T> >(name);
495 if (!M.is_null()) {
496 RCP<Matrix> A = L->template Get<RCP<Matrix> >("A");
497 RCP<const CrsGraph> AG = A->getCrsGraph();
498 WriteFieldContainer<T>(fileName,*M,*AG->getColMap());
499 }
500 }
501 }
502 }
503 }
504
505 // For dumping an IntrepidPCoarsening element-to-node map to disk
506 template<class T>
507 void WriteFieldContainer(const std::string& fileName, T & fcont,const Map &colMap) const {
508
509 size_t num_els = (size_t) fcont.extent(0);
510 size_t num_vecs =(size_t) fcont.extent(1);
511
512 // Generate rowMap
513 Teuchos::RCP<const Map> rowMap = Xpetra::MapFactory<LO,GO,NO>::Build(colMap.lib(),Teuchos::OrdinalTraits<Xpetra::global_size_t>::invalid(),fcont.extent(0),colMap.getIndexBase(),colMap.getComm());
514
515 // Fill multivector to use *petra dump routines
516 RCP<GOMultiVector> vec = Xpetra::MultiVectorFactory<GO, LO, GO, NO>::Build(rowMap,num_vecs);
517
518 for(size_t j=0; j<num_vecs; j++) {
519 Teuchos::ArrayRCP<GO> v = vec->getDataNonConst(j);
520 for(size_t i=0; i<num_els; i++)
521 v[i] = colMap.getGlobalElement(fcont(i,j));
522 }
523
524 Xpetra::IO<GO,LO,GO,NO>::Write(fileName,*vec);
525 }
526
527
528
529 // Levels
530 Array<RCP<FactoryManagerBase> > levelManagers_; // one FactoryManager per level (the last levelManager is used for all the remaining levels)
531
532 }; // class HierarchyManager
533
534} // namespace MueLu
535
536#define MUELU_HIERARCHYMANAGER_SHORT
537#endif // MUELU_HIERARCHYMANAGER_HPP
538
539//TODO: split into _decl/_def
540// TODO: default value for first param (FactoryManager()) should not be duplicated (code maintainability)
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Exception throws to report errors in the internal logical of the program.
This class specifies the default factory that should generate some data on a Level if the data does n...
void WriteFieldContainer(const std::string &fileName, T &fcont, const Map &colMap) const
void ExportDataSetKeepFlagsNextLevel(Hierarchy &H, const Teuchos::Array< int > &data, const std::string &name) const
virtual void SetupHierarchy(Hierarchy &H) const
Setup Hierarchy object.
MueLu::HierarchyFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node > HierarchyFactory
virtual void SetupExtra(Hierarchy &) const
Setup extra data.
void ExportDataSetKeepFlags(Hierarchy &H, const Teuchos::Array< int > &data, const std::string &name) const
void WriteDataFC(Hierarchy &H, const Teuchos::Array< int > &data, const std::string &name, const std::string &ofname) const
void WriteData(Hierarchy &H, const Teuchos::Array< int > &data, const std::string &name) const
MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node > Hierarchy
virtual void SetupOperator(Operator &) const
Setup Matrix object.
RCP< FactoryManagerBase > GetFactoryManager(int levelID) const
void WriteDataAggregates(Hierarchy &H, const Teuchos::Array< int > &data, const std::string &name) const
void AddFactoryManager(int startLevel, int numDesiredLevel, RCP< FactoryManagerBase > manager)
virtual RCP< Hierarchy > CreateHierarchy(const std::string &label) const
void ExportDataSetKeepFlagsAll(Hierarchy &H, const std::string &name) const
virtual ~HierarchyManager()=default
Destructor.
virtual RCP< Hierarchy > CreateHierarchy() const
Create an empty Hierarchy object.
HierarchyManager(int numDesiredLevel=MasterList::getDefault< int >("max levels"))
Constructor.
Teuchos::RCP< FactoryManagerBase > LvlMngr(int levelID, int lastLevelID) const
size_t getNumFactoryManagers() const
returns number of factory managers stored in levelManagers_ vector.
void AddLevel(const RCP< Level > &level)
Add a level at the end of the hierarchy.
RCP< Level > & GetLevel(const int levelID=0)
Retrieve a certain level from hierarchy.
std::string description() const
Return a simple one-line description of this object.
void setlib(Xpetra::UnderlyingLib inlib)
bool Setup(int coarseLevelID, const RCP< const FactoryManagerBase > fineLevelManager, const RCP< const FactoryManagerBase > coarseLevelManager, const RCP< const FactoryManagerBase > nextLevelManager=Teuchos::null)
Multi-level setup phase: build a new level of the hierarchy.
void SetFuseProlongationAndUpdate(const bool &fuse)
void describe(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the Hierarchy with some verbosity level to a FancyOStream object.
void SetPRrebalance(bool doPRrebalance)
void SetPRViaCopyrebalance(bool doPRViaCopyrebalance)
void SetMatvecParams(RCP< ParameterList > matvecParams)
void Clear(int startLevel=0)
Clear impermanent data from previous setup.
void EnableGraphDumping(const std::string &filename, int levelID=1)
void SetMaxCoarseSize(Xpetra::global_size_t maxCoarseSize)
void AllocateLevelMultiVectors(int numvecs, bool forceMapCheck=false)
void SetImplicitTranspose(const bool &implicit)
Class that holds all level-specific information.
Static class that holds the complete list of valid MueLu parameters.
static const T & getDefault(const std::string &name)
Returns default value on the "master" list for a parameter with the specified name and type.
static std::string PrintMatrixInfo(const Matrix &A, const std::string &msgTag, RCP< const Teuchos::ParameterList > params=Teuchos::null)
Teuchos::FancyOStream & GetOStream(MsgType type, int thisProcRankOnly=0) const
Get an output stream for outputting the input message type.
bool IsPrint(MsgType type, int thisProcRankOnly=-1) const
Find out whether we need to print out information for a specific message type.
static void SetDefaultVerbLevel(const VerbLevel defaultVerbLevel)
Set the default (global) verbosity level.
Namespace for MueLu classes and methods.
@ Warnings0
Important warning messages (one line).
@ Statistics2
Print even more statistics.
@ Developer
Print information primarily of interest to developers.
@ Runtime0
One-liner description of what is happening.
@ Warnings1
Additional warnings.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
Tpetra::Details::DefaultTypes::scalar_type DefaultScalar