MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_BlockedGaussSeidelSmoother_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 /*
47  * MueLu_BlockedGaussSeidelSmoother_def.hpp
48  *
49  * Created on: 30.01.2012
50  * Author: tobias
51  */
52 
53 #ifndef MUELU_BLOCKEDGAUSSSEIDELSMOOTHER_DEF_HPP_
54 #define MUELU_BLOCKEDGAUSSSEIDELSMOOTHER_DEF_HPP_
55 
56 #include "Teuchos_ArrayViewDecl.hpp"
57 #include "Teuchos_ScalarTraits.hpp"
58 
59 #include "MueLu_ConfigDefs.hpp"
60 
61 #include <Xpetra_BlockReorderManager.hpp>
62 #include <Xpetra_Matrix.hpp>
63 #include <Xpetra_BlockedCrsMatrix.hpp>
64 #include <Xpetra_ReorderedBlockedCrsMatrix.hpp>
65 #include <Xpetra_ReorderedBlockedMultiVector.hpp>
66 #include <Xpetra_MultiVectorFactory.hpp>
67 
69 #include "MueLu_Level.hpp"
70 #include "MueLu_Utilities.hpp"
71 #include "MueLu_Monitor.hpp"
72 #include "MueLu_HierarchyUtils.hpp"
73 #include "MueLu_SmootherBase.hpp"
74 
75 namespace MueLu {
76 
77  template <class Scalar,class LocalOrdinal, class GlobalOrdinal, class Node>
79  : type_("blocked GaussSeidel"), A_(Teuchos::null)
80  {
81  FactManager_.reserve(10); // TODO fix me!
82  }
83 
84  template <class Scalar,class LocalOrdinal, class GlobalOrdinal, class Node>
86 
87  template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
89  RCP<ParameterList> validParamList = rcp(new ParameterList());
90 
91  validParamList->set< RCP<const FactoryBase> >("A", Teuchos::null, "Generating factory of the matrix A");
92  validParamList->set< Scalar > ("Damping factor", 1.0, "Damping/Scaling factor in BGS");
93  validParamList->set< LocalOrdinal > ("Sweeps", 1, "Number of BGS sweeps (default = 1)");
94 
95  return validParamList;
96  }
97 
98  template <class Scalar,class LocalOrdinal, class GlobalOrdinal, class Node>
100  TEUCHOS_TEST_FOR_EXCEPTION(pos < 0, Exceptions::RuntimeError, "MueLu::BlockedGaussSeidelSmoother::AddFactoryManager: parameter \'pos\' must not be negative! error.");
101 
102  size_t myPos = Teuchos::as<size_t>(pos);
103 
104  if (myPos < FactManager_.size()) {
105  // replace existing entris in FactManager_ vector
106  FactManager_.at(myPos) = FactManager;
107  } else if( myPos == FactManager_.size()) {
108  // add new Factory manager in the end of the vector
109  FactManager_.push_back(FactManager);
110  } else { // if(myPos > FactManager_.size())
111  RCP<Teuchos::FancyOStream> out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
112  *out << "Warning: cannot add new FactoryManager at proper position " << pos << ". The FactoryManager is just appended to the end. Check this!" << std::endl;
113 
114  // add new Factory manager in the end of the vector
115  FactManager_.push_back(FactManager);
116  }
117  }
118 
119  template <class Scalar,class LocalOrdinal, class GlobalOrdinal, class Node>
121  //this->Input(currentLevel, "A");
122  // TODO: check me: why is this->Input not freeing properly A in release mode?
123  currentLevel.DeclareInput("A",this->GetFactory("A").get());
124 
125  // loop over all factory managers for the subblocks of blocked operator A
126  std::vector<Teuchos::RCP<const FactoryManagerBase> >::const_iterator it;
127  for(it = FactManager_.begin(); it!=FactManager_.end(); ++it) {
128  SetFactoryManager currentSFM (rcpFromRef(currentLevel), *it);
129 
130  // request "Smoother" for current subblock row.
131  currentLevel.DeclareInput("PreSmoother",(*it)->GetFactory("Smoother").get());
132 
133  // request "A" for current subblock row (only needed for Thyra mode)
134  currentLevel.DeclareInput("A",(*it)->GetFactory("A").get());
135  }
136 
137  //RCP<Teuchos::FancyOStream> out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
138  }
139 
140  template <class Scalar,class LocalOrdinal, class GlobalOrdinal, class Node>
142  //typedef Xpetra::BlockedCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> BlockedCrsOMatrix;
143 
144  RCP<Teuchos::FancyOStream> out = Teuchos::fancyOStream(Teuchos::rcpFromRef(std::cout));
145 
146  FactoryMonitor m(*this, "Setup blocked Gauss-Seidel Smoother", currentLevel);
147  if (SmootherPrototype::IsSetup() == true) this->GetOStream(Warnings0) << "MueLu::BlockedGaussSeidelSmoother::Setup(): Setup() has already been called";
148 
149  // extract blocked operator A from current level
150  A_ = Factory::Get< RCP<Matrix> >(currentLevel, "A"); // A needed for extracting map extractors
151  RCP<BlockedCrsMatrix> bA = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(A_);
152  TEUCHOS_TEST_FOR_EXCEPTION(bA==Teuchos::null, Exceptions::BadCast, "MueLu::BlockedPFactory::Build: input matrix A is not of type BlockedCrsMatrix! error.");
153 
154  // plausibility check
155  TEUCHOS_TEST_FOR_EXCEPTION(bA->Rows() != FactManager_.size(), Exceptions::RuntimeError, "MueLu::BlockedGaussSeidelSmoother::Setup: number of block rows of A is " << bA->Rows() << " and does not match number of SubFactoryManagers " << FactManager_.size() << ". error.");
156  TEUCHOS_TEST_FOR_EXCEPTION(bA->Cols() != FactManager_.size(), Exceptions::RuntimeError, "MueLu::BlockedGaussSeidelSmoother::Setup: number of block cols of A is " << bA->Cols() << " and does not match number of SubFactoryManagers " << FactManager_.size() << ". error.");
157 
158  // store map extractors
159  rangeMapExtractor_ = bA->getRangeMapExtractor();
160  domainMapExtractor_ = bA->getDomainMapExtractor();
161 
162  // loop over all factory managers for the subblocks of blocked operator A
163  std::vector<Teuchos::RCP<const FactoryManagerBase> >::const_iterator it;
164  for(it = FactManager_.begin(); it!=FactManager_.end(); ++it) {
165  SetFactoryManager currentSFM (rcpFromRef(currentLevel), *it);
166 
167  // extract Smoother for current block row (BGS ordering)
168  RCP<const SmootherBase> Smoo = currentLevel.Get< RCP<SmootherBase> >("PreSmoother",(*it)->GetFactory("Smoother").get());
169  Inverse_.push_back(Smoo);
170 
171  // store whether subblock matrix is blocked or not!
172  RCP<Matrix> Aii = currentLevel.Get< RCP<Matrix> >("A",(*it)->GetFactory("A").get());
173  bIsBlockedOperator_.push_back(Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(Aii)!=Teuchos::null);
174  }
175 
177  }
178 
179  template <class Scalar,class LocalOrdinal, class GlobalOrdinal, class Node>
180  void BlockedGaussSeidelSmoother<Scalar, LocalOrdinal, GlobalOrdinal, Node>::Apply(MultiVector &X, const MultiVector& B, bool InitialGuessIsZero) const
181  {
182  TEUCHOS_TEST_FOR_EXCEPTION(SmootherPrototype::IsSetup() == false, Exceptions::RuntimeError, "MueLu::BlockedGaussSeidelSmoother::Apply(): Setup() has not been called");
183 
184 #if 0 // def HAVE_MUELU_DEBUG
185  // TODO simplify this debug check
186  RCP<MultiVector> rcpDebugX = Teuchos::rcpFromRef(X);
187  RCP<const MultiVector> rcpDebugB = Teuchos::rcpFromRef(B);
188  RCP<BlockedMultiVector> rcpBDebugX = Teuchos::rcp_dynamic_cast<BlockedMultiVector>(rcpDebugX);
189  RCP<const BlockedMultiVector> rcpBDebugB = Teuchos::rcp_dynamic_cast<const BlockedMultiVector>(rcpDebugB);
190  //RCP<BlockedCrsMatrix> bA = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(A_);
191  if(rcpBDebugB.is_null() == false) {
192  //this->GetOStream(Runtime1) << "BlockedGaussSeidel: B is a BlockedMultiVector of size " << B.getMap()->getGlobalNumElements() << " with " << rcpBDebugB->getBlockedMap()->getNumMaps() << " blocks." << std::endl;
193  //TEUCHOS_TEST_FOR_EXCEPTION(A_->getRangeMap()->isSameAs(*(B.getMap())) == false, Exceptions::RuntimeError, "MueLu::BlockedGaussSeidelSmoother::Apply(): The map of RHS vector B is not the same as range map of the blocked operator A. Please check the map of B and A.");
194  } else {
195  //this->GetOStream(Runtime1) << "BlockedGaussSeidel: B is a MultiVector of size " << B.getMap()->getGlobalNumElements() << std::endl;
196  //TEUCHOS_TEST_FOR_EXCEPTION(bA->getFullRangeMap()->isSameAs(*(B.getMap())) == false, Exceptions::RuntimeError, "MueLu::BlockedGaussSeidelSmoother::Apply(): The map of RHS vector B is not the same as range map of the blocked operator A. Please check the map of B and A.");
197  }
198  if(rcpBDebugX.is_null() == false) {
199  //this->GetOStream(Runtime1) << "BlockedGaussSeidel: X is a BlockedMultiVector of size " << X.getMap()->getGlobalNumElements() << " with " << rcpBDebugX->getBlockedMap()->getNumMaps() << " blocks." << std::endl;
200  //TEUCHOS_TEST_FOR_EXCEPTION(A_->getDomainMap()->isSameAs(*(X.getMap())) == false, Exceptions::RuntimeError, "MueLu::BlockedGaussSeidelSmoother::Apply(): The map of the solution vector X is not the same as domain map of the blocked operator A. Please check the map of X and A.");
201  } else {
202  //this->GetOStream(Runtime1) << "BlockedGaussSeidel: X is a MultiVector of size " << X.getMap()->getGlobalNumElements() << std::endl;
203  //TEUCHOS_TEST_FOR_EXCEPTION(bA->getFullDomainMap()->isSameAs(*(X.getMap())) == false, Exceptions::RuntimeError, "MueLu::BlockedGaussSeidelSmoother::Apply(): The map of the solution vector X is not the same as domain map of the blocked operator A. Please check the map of X and A.");
204  }
205 
206 
207 #endif
209 
210  // Input variables used for the rest of the algorithm
211  RCP<MultiVector> rcpX = Teuchos::rcpFromRef(X);
212  RCP<const MultiVector> rcpB = Teuchos::rcpFromRef(B);
213 
214  // make sure that both rcpX and rcpB are BlockedMultiVector objects
215  bool bCopyResultX = false;
216  RCP<BlockedCrsMatrix> bA = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(A_);
217  MUELU_TEST_FOR_EXCEPTION(bA.is_null() == true, Exceptions::RuntimeError, "MueLu::BlockedGaussSeidelSmoother::Apply(): A_ must be a BlockedCrsMatrix");
218  RCP<BlockedMultiVector> bX = Teuchos::rcp_dynamic_cast<BlockedMultiVector>(rcpX);
219  RCP<const BlockedMultiVector> bB = Teuchos::rcp_dynamic_cast<const BlockedMultiVector>(rcpB);
220 
221  if(bX.is_null() == true) {
222  RCP<MultiVector> test = Teuchos::rcp(new BlockedMultiVector(bA->getBlockedDomainMap(),rcpX));
223  rcpX.swap(test);
224  bCopyResultX = true;
225  }
226 
227  if(bB.is_null() == true) {
228  RCP<const MultiVector> test = Teuchos::rcp(new BlockedMultiVector(bA->getBlockedRangeMap(),rcpB));
229  rcpB.swap(test);
230  }
231 
232  // we now can guarantee that X and B are blocked multi vectors
233  bX = Teuchos::rcp_dynamic_cast<BlockedMultiVector>(rcpX);
234  bB = Teuchos::rcp_dynamic_cast<const BlockedMultiVector>(rcpB);
235 
236  // check the type of operator
237  RCP<Xpetra::ReorderedBlockedCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > rbA = Teuchos::rcp_dynamic_cast<Xpetra::ReorderedBlockedCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >(bA);
238  if(rbA.is_null() == false) {
239  // A is a ReorderedBlockedCrsMatrix
240  Teuchos::RCP<const Xpetra::BlockReorderManager > brm = rbA->getBlockReorderManager();
241 
242  // check type of X vector
243  if(bX->getBlockedMap()->getNumMaps() != bA->getDomainMapExtractor()->NumMaps()) {
244  // X is a blocked multi vector but incompatible to the reordered blocked operator A
246  buildReorderedBlockedMultiVector(brm, bX);
247  rcpX.swap(test);
248  }
249  if(bB->getBlockedMap()->getNumMaps() != bA->getRangeMapExtractor()->NumMaps()) {
250  // B is a blocked multi vector but incompatible to the reordered blocked operator A
252  buildReorderedBlockedMultiVector(brm, bB);
253  rcpB.swap(test);
254  }
255  }
256 
257 
258  // check the type of operator
259  /*RCP<BlockedCrsMatrix> bA = Teuchos::rcp_dynamic_cast<BlockedCrsMatrix>(A_);
260  MUELU_TEST_FOR_EXCEPTION(bA.is_null() == true, Exceptions::RuntimeError, "MueLu::BlockedGaussSeidelSmoother::Apply(): A_ must be a BlockedCrsMatrix");
261  RCP<Xpetra::ReorderedBlockedCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > rbA = Teuchos::rcp_dynamic_cast<Xpetra::ReorderedBlockedCrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> >(bA);
262  if(rbA.is_null() == false) {
263  // A is a ReorderedBlockedCrsMatrix
264  Teuchos::RCP<const Xpetra::BlockReorderManager > brm = rbA->getBlockReorderManager();
265 
266  // check type of vectors
267  RCP<BlockedMultiVector> bX = Teuchos::rcp_dynamic_cast<BlockedMultiVector>(rcpX);
268  RCP<const BlockedMultiVector> bB = Teuchos::rcp_dynamic_cast<const BlockedMultiVector>(rcpB);
269 
270  // check type of X vector
271  if(bX.is_null() == false && bX->getBlockedMap()->getNumMaps() != bA->getDomainMapExtractor()->NumMaps()) {
272  RCP<ReorderedBlockedMultiVector> rbX = Teuchos::rcp_dynamic_cast<ReorderedBlockedMultiVector>(bX);
273  if(rbX.is_null() == true) {
274  // X is a blocked multi vector but not reordered
275  // However, A is a reordered blocked operator
276  // We have to make sure, that A and X use compatible maps
277  Teuchos::RCP<MultiVector> test =
278  buildReorderedBlockedMultiVector(brm, bX);
279  rcpX.swap(test);
280  }
281  }
282  if(bB.is_null() == false && bB->getBlockedMap()->getNumMaps() != bA->getRangeMapExtractor()->NumMaps()) {
283  RCP<const ReorderedBlockedMultiVector> rbB = Teuchos::rcp_dynamic_cast<const ReorderedBlockedMultiVector>(bB);
284  if(rbB.is_null() == true) {
285  // B is a blocked multi vector but not reordered
286  // However, A is a reordered blocked operator
287  // We have to make sure, that A and X use compatible maps
288  Teuchos::RCP<const MultiVector> test =
289  buildReorderedBlockedMultiVector(brm, bB);
290  rcpB.swap(test);
291  }
292  }
293  }*/
294 
295  // Throughout the rest of the algorithm rcpX and rcpB are used for solution vector and RHS
296 
297  RCP<MultiVector> residual = MultiVectorFactory::Build(rcpB->getMap(), rcpB->getNumVectors());
298  RCP<MultiVector> tempres = MultiVectorFactory::Build(rcpB->getMap(), rcpB->getNumVectors());
299 
300  // extract parameters from internal parameter list
302  LocalOrdinal nSweeps = pL.get<LocalOrdinal>("Sweeps");
303  Scalar omega = pL.get<Scalar>("Damping factor");
304 
305  // outer Richardson loop
306  for (LocalOrdinal run = 0; run < nSweeps; ++run) {
307  // one BGS sweep
308  // loop over all block rows
309  for(size_t i = 0; i<Inverse_.size(); i++) {
310 
311  // calculate block residual r = B-A*X
312  // note: A_ is the full blocked operator
313  residual->update(1.0,*rcpB,0.0); // r = B
314  if(InitialGuessIsZero == false || i > 0 || run > 0)
315  bA->bgs_apply(*rcpX, *residual, i, Teuchos::NO_TRANS, -1.0, 1.0);
316  //A_->apply(*rcpX, *residual, Teuchos::NO_TRANS, -1.0, 1.0);
317 
318  // extract corresponding subvectors from X and residual
319  bool bRangeThyraMode = rangeMapExtractor_->getThyraMode();
320  bool bDomainThyraMode = domainMapExtractor_->getThyraMode();
321  Teuchos::RCP<MultiVector> Xi = domainMapExtractor_->ExtractVector(rcpX, i, bDomainThyraMode);
322  Teuchos::RCP<MultiVector> ri = rangeMapExtractor_->ExtractVector(residual, i, bRangeThyraMode);
323  Teuchos::RCP<MultiVector> tXi = domainMapExtractor_->getVector(i, X.getNumVectors(), bDomainThyraMode);
324 
325  // apply solver/smoother
326  Inverse_.at(i)->Apply(*tXi, *ri, false);
327 
328  // update vector
329  Xi->update(omega,*tXi,1.0); // X_{i+1} = X_i + omega \Delta X_i
330 
331  // update corresponding part of rhs and lhs
332  domainMapExtractor_->InsertVector(Xi, i, rcpX, bDomainThyraMode); // TODO wrong! fix me
333  }
334  }
335 
336  if (bCopyResultX == true) {
337  RCP<MultiVector> Xmerged = bX->Merge();
338  X.update(one, *Xmerged, zero);
339  }
340  }
341 
342  template <class Scalar,class LocalOrdinal, class GlobalOrdinal, class Node>
344  return rcp( new BlockedGaussSeidelSmoother(*this) );
345  }
346 
347  template <class Scalar,class LocalOrdinal, class GlobalOrdinal, class Node>
349  std::ostringstream out;
351  out << "{type = " << type_ << "}";
352  return out.str();
353  }
354 
355  template <class Scalar,class LocalOrdinal, class GlobalOrdinal, class Node>
358 
359  // extract parameters from internal parameter list
361  LocalOrdinal nSweeps = pL.get<LocalOrdinal>("Sweeps");
362  Scalar omega = pL.get<Scalar>("Damping factor");
363 
364  if (verbLevel & Parameters0) {
365  out0 << "Prec. type: " << type_ << " Sweeps: " << nSweeps << " damping: " << omega << std::endl;
366  }
367 
368  if (verbLevel & Debug) {
369  out0 << "IsSetup: " << Teuchos::toString(SmootherPrototype::IsSetup()) << std::endl;
370  }
371  }
372  template <class Scalar,class LocalOrdinal, class GlobalOrdinal, class Node>
374  // FIXME: This is a placeholder
376  }
377 
378 
379 
380 } // namespace MueLu
381 
382 
383 
384 #endif /* MUELU_BLOCKEDGAUSSSEIDELSMOOTHER_DEF_HPP_ */
Important warning messages (one line)
virtual const Teuchos::ParameterList & GetParameterList() const
Exception indicating invalid cast attempted.
MueLu::DefaultLocalOrdinal LocalOrdinal
T & get(const std::string &name, T def_value)
size_t getNodeSmootherComplexity() const
Get a rough estimate of cost per iteration.
ParameterList & set(std::string const &name, T const &value, std::string const &docString="", RCP< const ParameterEntryValidator > const &validator=null)
Timer to be used in factories. Similar to Monitor but with additional timers.
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
block Gauss-Seidel method for blocked matrices
void swap(RCP< T > &r_ptr)
Print additional debugging information.
void print(Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const
Print the object with some verbosity level to an FancyOStream object.
std::string description() const
Return a simple one-line description of this object.
void DeclareInput(Level &currentLevel) const
Input.
TEUCHOS_DEPRECATED RCP< T > rcp(T *p, Dealloc_T dealloc, bool owns_mem)
MueLu::DefaultScalar Scalar
Class that holds all level-specific information.
Definition: MueLu_Level.hpp:99
void Setup(Level &currentLevel)
Setup routine In the Setup method the Inverse_ vector is filled with the corresponding SmootherBase o...
bool IsSetup() const
Get the state of a smoother prototype.
std::vector< Teuchos::RCP< const FactoryManagerBase > > FactManager_
vector of factory managers
#define MUELU_DESCRIBE
Helper macro for implementing Describable::describe() for BaseClass objects.
RCP< const ParameterList > GetValidParameterList() const
Input.
Print class parameters.
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.
Exception throws to report errors in the internal logical of the program.
#define MUELU_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
An exception safe way to call the method &#39;Level::SetFactoryManager()&#39;.
void AddFactoryManager(RCP< const FactoryManagerBase > FactManager, int pos)
Add a factory manager.
void DeclareInput(const std::string &ename, const FactoryBase *factory, const FactoryBase *requestedBy=NoFactory::get())
Callback from FactoryBase::CallDeclareInput() and FactoryBase::DeclareInput()
virtual std::string description() const
Return a simple one-line description of this object.
std::string toString(const T &t)
bool is_null() const