MueLu Version of the Day
Loading...
Searching...
No Matches
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"
23
24// Warning: on TopRAPFactory and TopSmootherFactory constructors, Teuchos::null doesn't mean "default factory" but "no build"
25
26namespace 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
47 // restore previous factory manager
48 level_->SetFactoryManager(prevFactoryManager_);
49 }
50
52
53 private:
55 const RCP<Level> level_;
56 const RCP<const FactoryManagerBase> prevFactoryManager_;
57};
58
59template <class Scalar,
62 class Node = DefaultNode>
64#undef MUELU_HIERARCHYUTILS_SHORT
66 public:
93 static void AddNonSerializableDataToHierarchy(HierarchyManager& HM, Hierarchy& H, const ParameterList& nonSerialList);
94 static void CopyBetweenLevels(Level& fromLevel, Level& toLevel, const std::string fromLabel, const std::string toLabel, const std::string dataType);
95 static void CopyBetweenHierarchies(Hierarchy& fromHierarchy, Hierarchy& toHierarchy, const std::string fromLabel, const std::string toLabel, const std::string dataType);
96};
97
98} // namespace MueLu
99
100#define MUELU_HIERARCHYUTILS_SHORT
101#endif // MUELU_HIERARCHYUTILS_DECL_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultScalar Scalar
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
static void CopyBetweenLevels(Level &fromLevel, Level &toLevel, const std::string fromLabel, const std::string toLabel, const std::string dataType)
static void AddNonSerializableDataToHierarchy(HierarchyManager &HM, Hierarchy &H, const ParameterList &nonSerialList)
Add non-serializable data to Hierarchy.
static void CopyBetweenHierarchies(Hierarchy &fromHierarchy, Hierarchy &toHierarchy, const std::string fromLabel, const std::string toLabel, const std::string dataType)
Provides methods to build a multigrid hierarchy and apply multigrid cycles.
Class that holds all level-specific information.
An exception safe way to call the method 'Level::SetFactoryManager()'.
SetFactoryManager(const RCP< Level > &level, const RCP< const FactoryManagerBase > &factoryManager)
Constructor.
const RCP< Level > level_
needed to save & restore previous factoryManager
const RCP< const FactoryManagerBase > prevFactoryManager_
Namespace for MueLu classes and methods.
Tpetra::KokkosClassic::DefaultNode::DefaultNodeType DefaultNode