MueLu Version of the Day
Loading...
Searching...
No Matches
MueLu_HierarchyUtils_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#ifndef MUELU_HIERARCHYUTILS_DEF_HPP
47#define MUELU_HIERARCHYUTILS_DEF_HPP
48
49#include "Teuchos_ScalarTraits.hpp"
50
51#include <Xpetra_Matrix.hpp>
52#include <Xpetra_Operator.hpp>
53
56#include "MueLu_FactoryManager.hpp"
57
58//TODO/FIXME: DeclareInput(, **this**) cannot be used here
59#ifdef HAVE_MUELU_INTREPID2
60#include "Kokkos_DynRankView.hpp"
61#endif
62
63namespace MueLu {
64
65 // Copy object from one hierarchy to another calling AddNewLevel as appropriate.
66 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
67 void HierarchyUtils<Scalar, LocalOrdinal, GlobalOrdinal, Node>::CopyBetweenHierarchies(Hierarchy& fromHierarchy, Hierarchy& toHierarchy, const std::string fromLabel, const std::string toLabel, const std::string dataType) {
68
69 // add any necessary levels
70 for (int i = toHierarchy.GetNumLevels(); i < fromHierarchy.GetNumLevels(); i++)
71 toHierarchy.AddNewLevel();
72
73 for (int i = 0; i < fromHierarchy.GetNumLevels(); i++) {
74 RCP<Level> fromLevel = fromHierarchy.GetLevel(i);
75 RCP<Level> toLevel = toHierarchy.GetLevel(i);
76
77 TEUCHOS_TEST_FOR_EXCEPTION(dataType != "RCP<Matrix>" && dataType != "RCP<const Import>"
79 std::string("MueLu::Utils::CopyBetweenHierarchies: unknown data type(") + dataType + ")");
80 if (fromLevel->IsAvailable(fromLabel)) {
81 if (dataType == "RCP<Matrix>" ) {
82 // Normally, we should only do
83 // toLevel->Set(toLabel,fromLevel->Get<RCP<Matrix> >(fromLabel));
84 // The logic below is meant to handle a special case when we
85 // repartition a processor away, leaving behind a RCP<Operator> on
86 // on the level instead of an RCP<Matrix>
87
88 auto tempOp = fromLevel->Get<RCP<Operator> >(fromLabel);
89 auto tempMatrix = rcp_dynamic_cast<Matrix>(tempOp);
90 if(!tempMatrix.is_null()) toLevel->Set(toLabel,tempMatrix);
91 else toLevel->Set(toLabel,tempOp);
92 }
93 if (dataType == "RCP<const Import>") {
94 toLevel->Set(toLabel,fromLevel->Get<RCP<const Import> >(fromLabel));
95 }
96 }
97 }
98 }
99
100 // Adds the following non-serializable data (A,P,R,Nullspace,Coordinates) from level-specific sublist nonSerialList,
101 // calling AddNewLevel as appropriate.
102 template <class Scalar, class LocalOrdinal, class GlobalOrdinal, class Node>
104 typedef typename Xpetra::MultiVector<typename Teuchos::ScalarTraits<Scalar>::coordinateType,
105 LocalOrdinal, GlobalOrdinal, Node> realvaluedmultivector_type;
106
107 for (ParameterList::ConstIterator nonSerialEntry = nonSerialList.begin(); nonSerialEntry != nonSerialList.end(); nonSerialEntry++) {
108 const std::string& levelName = nonSerialEntry->first;
109 // Check for match of the form "level X" where X is a positive integer
110 if (nonSerialList.isSublist(levelName) && levelName.find("level ") == 0 && levelName.size() > 6) {
111 int levelID = strtol(levelName.substr(6).c_str(), 0, 0);
112 if (levelID > 0)
113 {
114 // Do enough level adding so we can be sure to add the data to the right place
115 for (int i = H.GetNumLevels(); i <= levelID; i++)
116 H.AddNewLevel();
117 }
118 RCP<Level> level = H.GetLevel(levelID);
119
120 RCP<FactoryManager> M = Teuchos::rcp_dynamic_cast<FactoryManager>(HM.GetFactoryManager(levelID));
121 TEUCHOS_TEST_FOR_EXCEPTION(M.is_null(), Exceptions::InvalidArgument, "MueLu::Utils::AddNonSerializableDataToHierarchy: cannot get FactoryManager");
122
123 // Grab the level sublist & loop over parameters
124 const ParameterList& levelList = nonSerialList.sublist(levelName);
125 for (ParameterList::ConstIterator levelListEntry = levelList.begin(); levelListEntry != levelList.end(); levelListEntry++) {
126 const std::string& name = levelListEntry->first;
127 TEUCHOS_TEST_FOR_EXCEPTION(name != "A" && name != "P" && name != "R" && name != "K" && name != "M" && name != "Mdiag" &&
128 name != "D0" && name != "M1" && name != "Ms" && name != "M0inv" &&
129 name != "Pnodal" && name != "NodeMatrix" && name != "NodeAggMatrix" &&
130 name != "Nullspace" && name != "Coordinates" && name != "pcoarsen: element to node map" &&
131 name != "Node Comm" && name != "DualNodeID2PrimalNodeID" && name != "Primal interface DOF map" &&
133 std::string("MueLu::Utils::AddNonSerializableDataToHierarchy: parameter list contains unknown data type(") + name + ")");
134
135 // Get a valid communicator and lib
136 RCP<const Teuchos::Comm<int> > comm;
137 if (!level->GetComm().is_null())
138 comm = level->GetComm();
139 else if (level->IsAvailable("A")) {
140 RCP<Matrix> mat;
141 level->Get("A", mat);
142 comm = mat->getMap()->getComm();
143 } else {
144 RCP<Level> level0 = H.GetLevel(0);
145 if (!level0->GetComm().is_null())
146 comm = level0->GetComm();
147 else {
148 RCP<Matrix> mat;
149 level0->Get("A", mat);
150 comm = mat->getMap()->getComm();
151 }
152 }
153 Xpetra::UnderlyingLib lib = level->lib();
154
155 if (name == "A") {
156 RCP<Matrix> mat;
157 if (levelListEntry->second.isType<std::string>())
158 // We might also want to read maps here.
159 mat = Xpetra::IO<Scalar,LocalOrdinal,GlobalOrdinal,Node>::Read(Teuchos::getValue<std::string>(levelListEntry->second), lib, comm);
160 else
161 mat = Teuchos::getValue<RCP<Matrix > > (levelListEntry->second);
162 level->Set(name, mat, NoFactory::get());
163 M->SetFactory(name, NoFactory::getRCP()); // TAW: not sure about this: be aware that this affects all levels
164 // However, A is accessible through NoFactory anyway, so it should
165 // be fine here.
166 }
167 else if(name == "P" || name == "R" || name == "K" || name == "M" ) {
168 if (levelListEntry->second.isType<RCP<Operator> >()) {
169 RCP<Operator> mat;
170 mat = Teuchos::getValue<RCP<Operator> > (levelListEntry->second);
171
172 RCP<const FactoryBase> fact = M->GetFactory(name);
173 level->AddKeepFlag(name,fact.get(),MueLu::UserData);
174 level->Set(name, mat, fact.get());
175
176 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
177 level->Set(name, mat, NoFactory::get());
178 } else {
179 RCP<Matrix> mat;
180 if (levelListEntry->second.isType<std::string>())
181 // We might also want to read maps here.
182 mat = Xpetra::IO<Scalar,LocalOrdinal,GlobalOrdinal,Node>::Read(Teuchos::getValue<std::string>(levelListEntry->second), lib, comm);
183 else
184 mat = Teuchos::getValue<RCP<Matrix > > (levelListEntry->second);
185
186 RCP<const FactoryBase> fact = M->GetFactory(name);
187 level->AddKeepFlag(name,fact.get(),MueLu::UserData);
188 level->Set(name, mat, fact.get());
189
190 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
191 level->Set(name, mat, NoFactory::get());
192 }
193 }
194 else if (name == "D0" || name == "M1" || name == "Ms" || name == "M0inv" || name == "Pnodal" || name == "NodeMatrix" || name == "NodeAggMatrix") {
195 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
196 if (levelListEntry->second.isType<RCP<Operator> >())
197 level->Set(name, Teuchos::getValue<RCP<Operator> > (levelListEntry->second), NoFactory::get());
198 else
199 level->Set(name, Teuchos::getValue<RCP<Matrix> > (levelListEntry->second), NoFactory::get());
200 }
201 else if (name == "Mdiag")
202 {
203 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
204 level->Set(name, Teuchos::getValue<RCP<Vector > > (levelListEntry->second), NoFactory::get());
205 }
206 else if (name == "Nullspace")
207 {
208 RCP<MultiVector> vec;
209 if (levelListEntry->second.isType<std::string>()) {
210 TEUCHOS_ASSERT(level->IsAvailable("A"));
211 RCP<Matrix> mat;
212 level->Get("A", mat);
213 auto map = mat->getMap();
214 vec = Xpetra::IO<Scalar,LocalOrdinal,GlobalOrdinal,Node>::ReadMultiVector(Teuchos::getValue<std::string>(levelListEntry->second), map);
215 } else
216 vec = Teuchos::getValue<RCP<MultiVector> > (levelListEntry->second);
217 level->AddKeepFlag(name, NoFactory::get(), MueLu::UserData);
218 level->Set(name, vec, NoFactory::get());
219 //M->SetFactory(name, NoFactory::getRCP()); // TAW: generally it is a bad idea to overwrite the factory manager data here
220 // One should do this only in very special cases
221 }
222 else if(name == "Coordinates") //Scalar of Coordinates MV is always double
223 {
224 RCP<realvaluedmultivector_type> vec;
225 if (levelListEntry->second.isType<std::string>()) {
226 TEUCHOS_ASSERT(level->IsAvailable("A"));
227 RCP<Matrix> mat;
228 level->Get("A", mat);
229 size_t blkSize = mat->GetFixedBlockSize();
230 RCP<const Map> nodeMap = mat->getRowMap();
231 if (blkSize > 1) {
232 // Create a nodal map, as coordinates have not been expanded to a DOF map yet.
233 RCP<const Map> dofMap = mat->getRowMap();
234 GO indexBase = dofMap->getIndexBase();
235 size_t numLocalDOFs = dofMap->getLocalNumElements();
236 TEUCHOS_TEST_FOR_EXCEPTION(numLocalDOFs % blkSize, Exceptions::RuntimeError,
237 "HierarchyUtils: block size (" << blkSize << ") is incompatible with the number of local dofs in a row map (" << numLocalDOFs);
238 ArrayView<const GO> GIDs = dofMap->getLocalElementList();
239
240 Array<GO> nodeGIDs(numLocalDOFs/blkSize);
241 for (size_t i = 0; i < numLocalDOFs; i += blkSize)
242 nodeGIDs[i/blkSize] = (GIDs[i] - indexBase)/blkSize + indexBase;
243
244 Xpetra::global_size_t INVALID = Teuchos::OrdinalTraits<Xpetra::global_size_t>::invalid();
245 nodeMap = MapFactory::Build(dofMap->lib(), INVALID, nodeGIDs(), indexBase, dofMap->getComm());
246 }
247 vec = Xpetra::IO<typename Teuchos::ScalarTraits<Scalar>::coordinateType,LocalOrdinal,GlobalOrdinal,Node>::ReadMultiVector(Teuchos::getValue<std::string>(levelListEntry->second), nodeMap);
248 } else
249 vec = Teuchos::getValue<RCP<realvaluedmultivector_type > > (levelListEntry->second);
250 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
251 level->Set(name, vec, NoFactory::get());
252 //M->SetFactory(name, NoFactory::getRCP()); // TAW: generally it is a bad idea to overwrite the factory manager data here
253 }
254 else if(name == "Node Comm")
255 {
256 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
257 level->Set(name, Teuchos::getValue<RCP<const Teuchos::Comm<int> > >(levelListEntry->second), NoFactory::get());
258 }
259 else if(name == "DualNodeID2PrimalNodeID")
260 {
261 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
262 level->Set(name, Teuchos::getValue<RCP<std::map<LO, LO>>>(levelListEntry->second), NoFactory::get());
263 }
264 else if(name == "Primal interface DOF map")
265 {
266 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
267 level->Set(name, Teuchos::getValue<RCP<const Map>>(levelListEntry->second), NoFactory::get());
268 }
269#ifdef HAVE_MUELU_INTREPID2
270 else if (name == "pcoarsen: element to node map")
271 {
272 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
273 level->Set(name, Teuchos::getValue<RCP<Kokkos::DynRankView<LocalOrdinal,typename Node::device_type> > >(levelListEntry->second), NoFactory::get());
274 }
275#endif
276 else
277#ifdef HAVE_MUELU_MATLAB
278 {
279 //Custom variable for Muemex
280 size_t typeNameStart = name.find_first_not_of(' ');
281 size_t typeNameEnd = name.find(' ', typeNameStart);
282 std::string typeName = name.substr(typeNameStart, typeNameEnd - typeNameStart);
283 std::transform(typeName.begin(), typeName.end(), typeName.begin(), ::tolower);
284 level->AddKeepFlag(name, NoFactory::get(), MueLu::UserData);
285 if(typeName == "matrix")
286 level->Set(name, Teuchos::getValue<RCP<Matrix> >(levelListEntry->second), NoFactory::get());
287 else if(typeName == "multivector")
288 level->Set(name, Teuchos::getValue<RCP<MultiVector> >(levelListEntry->second), NoFactory::get());
289 else if(typeName == "map")
290 level->Set(name, Teuchos::getValue<RCP<Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > >(levelListEntry->second), NoFactory::get());
291 else if(typeName == "ordinalvector")
292 level->Set(name, Teuchos::getValue<RCP<Xpetra::Vector<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node> > >(levelListEntry->second), NoFactory::get());
293 else if(typeName == "scalar")
294 level->Set(name, Teuchos::getValue<Scalar>(levelListEntry->second), NoFactory::get());
295 else if(typeName == "double")
296 level->Set(name, Teuchos::getValue<double>(levelListEntry->second), NoFactory::get());
297 else if(typeName == "complex")
298 level->Set(name, Teuchos::getValue<std::complex<double> >(levelListEntry->second), NoFactory::get());
299 else if(typeName == "int")
300 level->Set(name, Teuchos::getValue<int>(levelListEntry->second), NoFactory::get());
301 else if(typeName == "string")
302 level->Set(name, Teuchos::getValue<std::string>(levelListEntry->second), NoFactory::get());
303 }
304#else
305 {
306 throw std::runtime_error("Invalid non-serializable data on list");
307 }
308#endif
309 }
310 } else if (nonSerialList.isSublist(levelName) && levelName.find("user data") != std::string::npos) {
311 // So far only put data on level 0
312 int levelID = 0;
313 RCP<Level> level = H.GetLevel(levelID);
314
315 RCP<FactoryManager> M = Teuchos::rcp_dynamic_cast<FactoryManager>(HM.GetFactoryManager(levelID));
316 TEUCHOS_TEST_FOR_EXCEPTION(M.is_null(), Exceptions::InvalidArgument, "MueLu::Utils::AddNonSerializableDataToHierarchy: cannot get FactoryManager");
317
318 // Grab the user data sublist & loop over parameters
319 const ParameterList& userList = nonSerialList.sublist(levelName);
320 for (ParameterList::ConstIterator userListEntry = userList.begin(); userListEntry != userList.end(); userListEntry++) {
321 const std::string& name = userListEntry->first;
322 TEUCHOS_TEST_FOR_EXCEPTION(name != "P" && name != "R" && name != "K" && name != "M" && name != "Mdiag" &&
323 name != "D0" && name != "M1" && name != "Ms" && name != "M0inv" &&
324 name != "Nullspace" && name != "Coordinates" && name != "pcoarsen: element to node map" &&
325 name != "Node Comm" && name != "DualNodeID2PrimalNodeID" && name != "Primal interface DOF map" &&
326 name != "output stream" &&
328 std::string("MueLu::Utils::AddNonSerializableDataToHierarchy: user data parameter list contains unknown data type (") + name + ")");
329 if( name == "P" || name == "R" || name == "K" || name == "M" || name == "D0" || name == "M1" || name == "Ms" || name == "M0inv" ) {
330 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
331 level->Set(name, Teuchos::getValue<RCP<Matrix > > (userListEntry->second), NoFactory::get());
332 } else if (name == "Mdiag") {
333 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
334 level->Set(name, Teuchos::getValue<RCP<Vector > >(userListEntry->second), NoFactory::get());
335 } else if (name == "Nullspace") {
336 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
337 level->Set(name, Teuchos::getValue<RCP<MultiVector > >(userListEntry->second), NoFactory::get());
338 //M->SetFactory(name, NoFactory::getRCP()); // TAW: generally it is a bad idea to overwrite the factory manager data here
339 // One should do this only in very special cases
340 } else if(name == "Coordinates") {//Scalar of Coordinates MV is always double
341 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
342 level->Set(name, Teuchos::getValue<RCP<realvaluedmultivector_type> >(userListEntry->second), NoFactory::get());
343 }
344 else if(name == "Node Comm") {
345 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
346 level->Set(name, Teuchos::getValue<RCP<const Teuchos::Comm<int> > >(userListEntry->second), NoFactory::get());
347 }
348 else if(name == "DualNodeID2PrimalNodeID")
349 {
350 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
351 level->Set(name, Teuchos::getValue<RCP<std::map<LO, LO>>>(userListEntry->second), NoFactory::get());
352 }
353 else if(name == "Primal interface DOF map")
354 {
355 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
356 level->Set(name, Teuchos::getValue<RCP<const Map>>(userListEntry->second), NoFactory::get());
357 }
358#ifdef HAVE_MUELU_INTREPID2
359 else if (name == "pcoarsen: element to node map")
360 {
361 level->AddKeepFlag(name,NoFactory::get(),MueLu::UserData);
362 level->Set(name, Teuchos::getValue<RCP<Kokkos::DynRankView<LocalOrdinal,typename Node::device_type> > >(userListEntry->second), NoFactory::get());
363 }
364#endif
365 else if (name == "output stream")
366 {
367 H.SetMueLuOStream(Teuchos::getValue<RCP<Teuchos::FancyOStream> >(userListEntry->second));
368 }
369 else {
370 //Custom variable
371 size_t typeNameStart = name.find_first_not_of(' ');
372 size_t typeNameEnd = name.find(' ', typeNameStart);
373 std::string typeName = name.substr(typeNameStart, typeNameEnd - typeNameStart);
374 size_t varNameStart = name.find_first_not_of(' ', typeNameEnd);
375 std::string varName = name.substr(varNameStart, name.size());
376 std::transform(typeName.begin(), typeName.end(), typeName.begin(), ::tolower);
377 level->AddKeepFlag(varName, NoFactory::get(), MueLu::UserData);
378 if(typeName == "matrix")
379 level->Set(varName, Teuchos::getValue<RCP<Matrix> >(userListEntry->second), NoFactory::get());
380 else if(typeName == "multivector")
381 level->Set(varName, Teuchos::getValue<RCP<MultiVector> >(userListEntry->second), NoFactory::get());
382 else if(typeName == "vector")
383 level->Set(varName, Teuchos::getValue<RCP<Vector> >(userListEntry->second), NoFactory::get());
384 else if(typeName == "map")
385 level->Set(varName, Teuchos::getValue<RCP<Xpetra::Map<LocalOrdinal, GlobalOrdinal, Node> > >(userListEntry->second), NoFactory::get());
386 else if(typeName == "ordinalvector")
387 level->Set(varName, Teuchos::getValue<RCP<Xpetra::Vector<LocalOrdinal, LocalOrdinal, GlobalOrdinal, Node> > >(userListEntry->second), NoFactory::get());
388 else if(typeName == "scalar")
389 level->Set(varName, Teuchos::getValue<Scalar>(userListEntry->second), NoFactory::get());
390 else if(typeName == "double")
391 level->Set(varName, Teuchos::getValue<double>(userListEntry->second), NoFactory::get());
392 else if(typeName == "complex")
393 level->Set(varName, Teuchos::getValue<std::complex<double> >(userListEntry->second), NoFactory::get());
394 else if(typeName == "int")
395 level->Set(varName, Teuchos::getValue<int>(userListEntry->second), NoFactory::get());
396 else if(typeName == "string")
397 level->Set(varName, Teuchos::getValue<std::string>(userListEntry->second), NoFactory::get());
398 else if(typeName == "array<go>")
399 level->Set(varName, Teuchos::getValue<Array<GlobalOrdinal> > (userListEntry->second), NoFactory::get());
400 else if(typeName == "array<lo>")
401 level->Set(varName, Teuchos::getValue<Array<LocalOrdinal> >(userListEntry->second), NoFactory::get());
402 else if(typeName == "arrayrcp<lo>")
403 level->Set(varName, Teuchos::getValue<ArrayRCP<LocalOrdinal> >(userListEntry->second), NoFactory::get());
404 else if(typeName == "arrayrcp<go>")
405 level->Set(varName, Teuchos::getValue<ArrayRCP<GlobalOrdinal> >(userListEntry->second), NoFactory::get());
406 else
407 throw std::runtime_error("Invalid non-serializable data on list");
408 }
409 }
410 // level->print(std::cout, MueLu::Debug);
411 }
412 }
413 }
414} // namespace MueLu
415
416#define MUELU_HIERARCHY_UTILS_SHORT
417#endif // MUELU_HIERARCHYHELPERS_DEF_HPP
MueLu::DefaultLocalOrdinal LocalOrdinal
MueLu::DefaultGlobalOrdinal GlobalOrdinal
MueLu::DefaultNode Node
Exception throws to report invalid user entry.
Exception throws to report errors in the internal logical of the program.
RCP< FactoryManagerBase > GetFactoryManager(int levelID) const
MueLu::HierarchyManager< Scalar, LocalOrdinal, GlobalOrdinal, Node > HierarchyManager
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.
RCP< Level > & GetLevel(const int levelID=0)
Retrieve a certain level from hierarchy.
void AddNewLevel()
Add a new level at the end of the hierarchy.
static const RCP< const NoFactory > getRCP()
Static Get() functions.
static const NoFactory * get()
static void SetMueLuOStream(const Teuchos::RCP< Teuchos::FancyOStream > &mueluOStream)
Namespace for MueLu classes and methods.
bool IsParamMuemexVariable(const std::string &name)
@ UserData
User data are always kept. This flag is set automatically when Level::Set("data", data) is used....
bool IsParamValidVariable(const std::string &name)