MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu_HierarchyUtils_decl.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_HIERARCHYUTILS_DECL_HPP
11 #define MUELU_HIERARCHYUTILS_DECL_HPP
12 
13 #include "MueLu_ConfigDefs.hpp"
14 
18 #include "MueLu_Level_fwd.hpp"
21 #include "MueLu_Hierarchy_fwd.hpp"
23 
24 // Warning: on TopRAPFactory and TopSmootherFactory constructors, Teuchos::null doesn't mean "default factory" but "no build"
25 
26 namespace MueLu {
27 
30  public:
32 
38  SetFactoryManager(const RCP<Level>& level, const RCP<const FactoryManagerBase>& factoryManager)
39  : level_(level)
40  , prevFactoryManager_(level->GetFactoryManager()) {
41  // set new factory manager
42  level->SetFactoryManager(factoryManager);
43  }
44 
46  virtual ~SetFactoryManager() {
47  // restore previous factory manager
48  level_->SetFactoryManager(prevFactoryManager_);
49  }
50 
52 
53  private:
57 };
58 
59 template <class Scalar,
62  class Node = DefaultNode>
64 #undef MUELU_HIERARCHYUTILS_SHORT
65 #include "MueLu_UseShortNames.hpp"
66  public:
93  static void AddNonSerializableDataToHierarchy(HierarchyManager& HM, Hierarchy& H, const ParameterList& nonSerialList);
94  static void CopyBetweenHierarchies(Hierarchy& fromHierarchy, Hierarchy& toHierarchy, const std::string fromLabel, const std::string toLabel, const std::string dataType);
95 };
96 
97 } // namespace MueLu
98 
99 #define MUELU_HIERARCHYUTILS_SHORT
100 #endif // MUELU_HIERARCHYUTILS_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode
static void AddNonSerializableDataToHierarchy(HierarchyManager &HM, Hierarchy &H, const ParameterList &nonSerialList)
Add non-serializable data to Hierarchy.
virtual ~SetFactoryManager()
Destructor.
const RCP< Level > level_
needed to save &amp; restore previous factoryManager
MueLu::DefaultNode Node
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
An exception safe way to call the method &#39;Level::SetFactoryManager()&#39;.
const RCP< const FactoryManagerBase > prevFactoryManager_
Provides methods to build a multigrid hierarchy and apply multigrid cycles.
SetFactoryManager(const RCP< Level > &level, const RCP< const FactoryManagerBase > &factoryManager)
Constructor.
static void CopyBetweenHierarchies(Hierarchy &fromHierarchy, Hierarchy &toHierarchy, const std::string fromLabel, const std::string toLabel, const std::string dataType)