| 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_KEEPTYPE_HPP |
| 11 |
#define MUELU_KEEPTYPE_HPP |
| 12 |
|
| 13 |
namespace MueLu { |
| 14 |
|
| 15 |
//! Keep status of a variable of Level. |
| 16 |
// Several keep status can be set at the same time |
| 17 |
enum KeepEnum { |
| 18 |
UserData = 0x1, //!< User data are always kept. This flag is set automatically when Level::Set("data", data) is used. The keep status of the variable is not propagated to coarser level (if you use Level::Build()). |
| 19 |
Keep = 0x2, //!< Always keep data, even accross run. This flag is set by Level::Keep(). This flag is propagated to coarser level by Level::Build(). |
| 20 |
Final = 0x4, //!< Keep data only for this run. Used to keep data useful for Hierarchy::Iterate(). Data will be deleted if setup phase is re-run. This flag is set by default for A, P, R, PreSmoother and PostSmoother of NoFactory by Hierarchy::Setup(). Not propagated by Level::Build(). |
| 21 |
|
| 22 |
NextRun = UserData | Keep, //!< Both UserData and Keep flags force data to be kept and reused for the next run. Do not use MueLu::NextRun in AddKeepFlag. Use it only for testing keep == UserData || keep == Keep. |
| 23 |
All = UserData | Keep | Final |
| 24 |
}; |
| 25 |
|
| 26 |
//! |
| 27 |
typedef short KeepType; // TODO: name it KeepFlag? |
| 28 |
|
| 29 |
} // namespace MueLu |
| 30 |
|
| 31 |
#endif // MUELU_KEEPTYPE_HPP |