MueLu
Version of the Day
|
Provides methods to build a multigrid hierarchy and apply multigrid cycles. More...
#include <MueLu_Hierarchy_decl.hpp>
Classes | |
struct | ConvData |
Data struct for defining stopping criteria of multigrid iteration. More... | |
Public Member Functions | |
void | AddLevel (const RCP< Level > &level) |
Add a level at the end of the hierarchy. More... | |
void | AddNewLevel () |
Add a new level at the end of the hierarchy. More... | |
RCP< Level > & | GetLevel (const int levelID=0) |
Retrieve a certain level from hierarchy. More... | |
int | GetNumLevels () const |
int | GetGlobalNumLevels () const |
MagnitudeType | GetRate () const |
double | GetOperatorComplexity () const |
void | CheckLevel (Level &level, int levelID) |
Helper function. More... | |
bool | Setup (int coarseLevelID, const RCP< const FactoryManagerBase > fineLevelManager, const RCP< const FactoryManagerBase > coarseLevelManager, const RCP< const FactoryManagerBase > nextLevelManager=Teuchos::null) |
Multi-level setup phase: build a new level of the hierarchy. More... | |
void | Setup (const FactoryManagerBase &manager=FactoryManager(), int startLevel=0, int numDesiredLevels=GetDefaultMaxLevels()) |
void | SetupRe () |
void | Clear (int startLevel=0) |
Clear impermanent data from previous setup. More... | |
void | ExpertClear () |
CycleType | GetCycle () const |
Returns multigrid cycle type (supports VCYCLE and WCYCLE) More... | |
void | SetCycle (CycleType Cycle) |
Supports VCYCLE and WCYCLE types. More... | |
ReturnType | Iterate (const MultiVector &B, MultiVector &X, ConvData conv=ConvData(), bool InitialGuessIsZero=false, LO startLevel=0) |
Apply the multigrid preconditioner. More... | |
void | Write (const LO &start=-1, const LO &end=-1, const std::string &suffix="") |
Print matrices in the multigrid hierarchy to file. More... | |
void | EnableGraphDumping (const std::string &filename, int levelID=1) |
template<class Node2 > | |
Teuchos::RCP< Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node2 > > | clone (const RCP< Node2 > &node2) const |
void | setlib (Xpetra::UnderlyingLib inlib) |
Xpetra::UnderlyingLib | lib () |
![]() | |
virtual | ~BaseClass () |
Destructor. More... | |
![]() | |
VerbLevel | GetVerbLevel () const |
Get the verbosity level. More... | |
void | SetVerbLevel (const VerbLevel verbLevel) |
Set the verbosity level of this object. More... | |
int | GetProcRankVerbose () const |
Get proc rank used for printing. Do not use this information for any other purpose. More... | |
int | SetProcRankVerbose (int procRank) const |
Set proc rank used for printing. More... | |
bool | IsPrint (MsgType type, int thisProcRankOnly=-1) const |
Find out whether we need to print out information for a specific message type. More... | |
Teuchos::FancyOStream & | GetOStream (MsgType type, int thisProcRankOnly=0) const |
Get an output stream for outputting the input message type. More... | |
Teuchos::FancyOStream & | GetBlackHole () const |
VerboseObject () | |
virtual | ~VerboseObject () |
Destructor. More... | |
![]() | |
VerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null) | |
VerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null) | |
virtual const VerboseObject & | setVerbLevel (const EVerbosityLevel verbLevel) const |
virtual const VerboseObject & | setVerbLevel (const EVerbosityLevel verbLevel) const |
virtual const VerboseObject & | setOverridingVerbLevel (const EVerbosityLevel verbLevel) const |
virtual const VerboseObject & | setOverridingVerbLevel (const EVerbosityLevel verbLevel) const |
virtual EVerbosityLevel | getVerbLevel () const |
virtual EVerbosityLevel | getVerbLevel () const |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT RCP< const ParameterList > | getValidVerboseObjectSublist () |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | setupVerboseObjectSublist (ParameterList *paramList) |
TEUCHOSPARAMETERLIST_LIB_DLL_EXPORT void | readVerboseObjectSublist (ParameterList *paramList, RCP< FancyOStream > *oStream, EVerbosityLevel *verbLevel) |
void | readVerboseObjectSublist (ParameterList *paramList, VerboseObject< ObjectType > *verboseObject) |
![]() | |
virtual | ~VerboseObjectBase () |
VerboseObjectBase (const RCP< FancyOStream > &oStream=Teuchos::null) | |
virtual const VerboseObjectBase & | setOStream (const RCP< FancyOStream > &oStream) const |
virtual const VerboseObjectBase & | setOverridingOStream (const RCP< FancyOStream > &oStream) const |
virtual VerboseObjectBase & | setLinePrefix (const std::string &linePrefix) |
virtual RCP< FancyOStream > | getOStream () const |
virtual RCP< FancyOStream > | getOverridingOStream () const |
virtual std::string | getLinePrefix () const |
virtual OSTab | getOSTab (const int tabs=1, const std::string &linePrefix="") const |
virtual | ~VerboseObjectBase () |
VerboseObjectBase (const RCP< FancyOStream > &oStream=Teuchos::null) | |
virtual const VerboseObjectBase & | setOStream (const RCP< FancyOStream > &oStream) const |
virtual const VerboseObjectBase & | setOverridingOStream (const RCP< FancyOStream > &oStream) const |
virtual VerboseObjectBase & | setLinePrefix (const std::string &linePrefix) |
virtual RCP< FancyOStream > | getOStream () const |
virtual RCP< FancyOStream > | getOverridingOStream () const |
virtual std::string | getLinePrefix () const |
virtual OSTab | getOSTab (const int tabs=1, const std::string &linePrefix="") const |
![]() | |
virtual | ~Describable () |
Destructor. More... | |
virtual std::string | ShortClassName () const |
Return the class name of the object, without template parameters and without namespace. More... | |
![]() | |
void | describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
DescribableStreamManipulatorState | describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default) |
std::ostream & | operator<< (std::ostream &os, const DescribableStreamManipulatorState &d) |
void | describe (std::ostream &out, const EVerbosityLevel verbLevel=verbLevel_default) const |
![]() | |
LabeledObject () | |
virtual | ~LabeledObject () |
virtual void | setObjectLabel (const std::string &objectLabel) |
virtual std::string | getObjectLabel () const |
Protected Member Functions | |
const RCP< const FactoryManagerBase > & | GetLevelManager (const int levelID) const |
![]() | |
void | initializeVerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null) |
![]() | |
void | initializeVerboseObjectBase (const RCP< FancyOStream > &oStream=Teuchos::null) |
virtual void | informUpdatedVerbosityState () const |
Private Types | |
typedef Teuchos::ScalarTraits< SC > | STS |
typedef STS::magnitudeType | MagnitudeType |
Private Member Functions | |
int | LastLevelID () const |
void | DumpCurrentGraph () const |
Hierarchy (const Hierarchy &h) | |
Copy constructor is not implemented. More... | |
void | ReplaceCoordinateMap (Level &level) |
Private Attributes | |
Array< RCP< Level > > | Levels_ |
Container for Level objects. More... | |
Xpetra::global_size_t | maxCoarseSize_ |
bool | implicitTranspose_ |
bool | doPRrebalance_ |
bool | isPreconditioner_ |
CycleType | Cycle_ |
Xpetra::UnderlyingLib | lib_ |
bool | isDumpingEnabled_ |
Graph dumping. More... | |
int | dumpLevel_ |
std::string | dumpFile_ |
MagnitudeType | rate_ |
Convergece rate. More... | |
Array< RCP< const FactoryManagerBase > > | levelManagers_ |
Friends | |
template<class S2 , class LO2 , class GO2 , class N2 > | |
class | Hierarchy |
Constructors/Destructors | |
Hierarchy () | |
Default constructor. More... | |
Hierarchy (const RCP< Matrix > &A) | |
Constructor. More... | |
virtual | ~Hierarchy () |
Destructor. More... | |
Set/Get Methods. | |
Xpetra::global_size_t | GetMaxCoarseSize () const |
bool | GetImplicitTranspose () const |
void | SetMaxCoarseSize (Xpetra::global_size_t maxCoarseSize) |
void | SetPRrebalance (bool doPRrebalance) |
void | SetImplicitTranspose (const bool &implicit) |
static CycleType | GetDefaultCycle () |
static bool | GetDefaultImplicitTranspose () |
static Xpetra::global_size_t | GetDefaultMaxCoarseSize () |
static int | GetDefaultMaxLevels () |
static bool | GetDefaultPRrebalance () |
Permanent storage | |
void | Keep (const std::string &ename, const FactoryBase *factory=NoFactory::get()) |
Call Level::Keep(ename, factory) for each level of the Hierarchy. More... | |
void | Delete (const std::string &ename, const FactoryBase *factory=NoFactory::get()) |
Call Level::Delete(ename, factory) for each level of the Hierarchy. More... | |
void | AddKeepFlag (const std::string &ename, const FactoryBase *factory=NoFactory::get(), KeepType keep=MueLu::Keep) |
Call Level::AddKeepFlag for each level of the Hierarchy. More... | |
void | RemoveKeepFlag (const std::string &ename, const FactoryBase *factory, KeepType keep=MueLu::All) |
Call Level::RemoveKeepFlag for each level of the Hierarchy. More... | |
Overridden from Teuchos::Describable | |
std::string | description () const |
Return a simple one-line description of this object. More... | |
void | describe (Teuchos::FancyOStream &out, const VerbLevel verbLevel=Default) const |
Print the Hierarchy with some verbosity level to a FancyOStream object. More... | |
void | describe (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::VERB_HIGH) const |
Print the object with some verbosity level to an FancyOStream object. More... | |
void | print (std::ostream &out=std::cout, const VerbLevel verbLevel=(MueLu::Parameters|MueLu::Statistics0)) const |
void | IsPreconditioner (const bool flag) |
Additional Inherited Members | |
![]() | |
static void | SetDefaultOStream (const Teuchos::RCP< Teuchos::FancyOStream > &defaultOStream) |
static Teuchos::RCP< Teuchos::FancyOStream > | GetDefaultOStream () |
static void | SetDefaultVerbLevel (const VerbLevel defaultVerbLevel) |
Set the default (global) verbosity level. More... | |
static VerbLevel | GetDefaultVerbLevel () |
Get the default (global) verbosity level. More... | |
![]() | |
static void | setDefaultVerbLevel (const EVerbosityLevel defaultVerbLevel) |
static void | setDefaultVerbLevel (const EVerbosityLevel defaultVerbLevel) |
static EVerbosityLevel | getDefaultVerbLevel () |
static EVerbosityLevel | getDefaultVerbLevel () |
![]() | |
static void | setDefaultOStream (const RCP< FancyOStream > &defaultOStream) |
static RCP< FancyOStream > | getDefaultOStream () |
static void | setDefaultOStream (const RCP< FancyOStream > &defaultOStream) |
static RCP< FancyOStream > | getDefaultOStream () |
![]() | |
static const EVerbosityLevel | verbLevel_default |
Provides methods to build a multigrid hierarchy and apply multigrid cycles.
Allows users to manually populate operators at different levels within a multigrid method and push them into the hierarchy via SetLevel() and/or to supply factories for automatically generating prolongators, restrictors, and coarse level discretizations. Additionally, this class contains an apply method that supports V and W cycles.
Definition at line 103 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 107 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 108 of file MueLu_Hierarchy_decl.hpp.
MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Hierarchy | ( | ) |
Default constructor.
Definition at line 79 of file MueLu_Hierarchy_def.hpp.
MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Hierarchy | ( | const RCP< Matrix > & | A | ) |
Constructor.
Definition at line 88 of file MueLu_Hierarchy_def.hpp.
|
inlinevirtual |
Destructor.
Definition at line 133 of file MueLu_Hierarchy_decl.hpp.
|
private |
Copy constructor is not implemented.
|
inlinestatic |
Definition at line 141 of file MueLu_Hierarchy_decl.hpp.
|
inlinestatic |
Definition at line 142 of file MueLu_Hierarchy_decl.hpp.
|
inlinestatic |
Definition at line 143 of file MueLu_Hierarchy_decl.hpp.
|
inlinestatic |
Definition at line 144 of file MueLu_Hierarchy_decl.hpp.
|
inlinestatic |
Definition at line 145 of file MueLu_Hierarchy_decl.hpp.
|
inline |
Definition at line 147 of file MueLu_Hierarchy_decl.hpp.
|
inline |
Definition at line 148 of file MueLu_Hierarchy_decl.hpp.
|
inline |
Definition at line 150 of file MueLu_Hierarchy_decl.hpp.
|
inline |
Definition at line 151 of file MueLu_Hierarchy_decl.hpp.
|
inline |
Definition at line 152 of file MueLu_Hierarchy_decl.hpp.
|
inlineprivate |
Definition at line 162 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 1210 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::AddLevel | ( | const RCP< Level > & | level | ) |
Add a level at the end of the hierarchy.
Definition at line 102 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::AddNewLevel | ( | ) |
Add a new level at the end of the hierarchy.
Definition at line 118 of file MueLu_Hierarchy_def.hpp.
RCP< Level > & MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetLevel | ( | const int | levelID = 0 | ) |
Retrieve a certain level from hierarchy.
Definition at line 125 of file MueLu_Hierarchy_def.hpp.
int MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetNumLevels | ( | ) | const |
Definition at line 132 of file MueLu_Hierarchy_def.hpp.
int MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetGlobalNumLevels | ( | ) | const |
Definition at line 137 of file MueLu_Hierarchy_def.hpp.
|
inline |
Definition at line 179 of file MueLu_Hierarchy_decl.hpp.
double MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetOperatorComplexity | ( | ) | const |
Definition at line 149 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::CheckLevel | ( | Level & | level, |
int | levelID | ||
) |
Helper function.
Definition at line 173 of file MueLu_Hierarchy_def.hpp.
bool MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Setup | ( | int | coarseLevelID, |
const RCP< const FactoryManagerBase > | fineLevelManager, | ||
const RCP< const FactoryManagerBase > | coarseLevelManager, | ||
const RCP< const FactoryManagerBase > | nextLevelManager = Teuchos::null |
||
) |
Multi-level setup phase: build a new level of the hierarchy.
This method is aimed to be used in a loop building the hierarchy level by level. See Hierarchy::Setup(manager, startLevel, numDesiredLevels) for an example of usage.
coarseLevelID | ID of the level to be built. |
fineLevelManager | defines how to build missing data of the fineLevel (example: aggregates) |
coarseLevelManager | defines how to build the level |
nextLevelManager | defines how the next coarse level will be built. This is used to post corresponding request before building the coarse level to keep useful data. |
CoarseLevel is considered to be the last level if:
Pre-condition: FineLevel:
Post-condition: FineLevel:
Definition at line 185 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Setup | ( | const FactoryManagerBase & | manager = FactoryManager() , |
int | startLevel = 0 , |
||
int | numDesiredLevels = GetDefaultMaxLevels() |
||
) |
Definition at line 452 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::SetupRe | ( | ) |
Definition at line 419 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Clear | ( | int | startLevel = 0 | ) |
Clear impermanent data from previous setup.
Definition at line 510 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::ExpertClear | ( | ) |
Definition at line 519 of file MueLu_Hierarchy_def.hpp.
|
inline |
Returns multigrid cycle type (supports VCYCLE and WCYCLE)
Definition at line 238 of file MueLu_Hierarchy_decl.hpp.
|
inline |
Supports VCYCLE and WCYCLE types.
Definition at line 241 of file MueLu_Hierarchy_decl.hpp.
ReturnType MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Iterate | ( | const MultiVector & | B, |
MultiVector & | X, | ||
ConvData | conv = ConvData() , |
||
bool | InitialGuessIsZero = false , |
||
LO | startLevel = 0 |
||
) |
Apply the multigrid preconditioner.
In theory, more general cycle types than just V- and W-cycles are possible. However, the enumerated type CycleType would have to be extended.
B | right-hand side of linear problem |
X | initial and final (approximate) solution of linear problem |
ConvData | struct which stores convergence criteria (maximum number of multigrid iterations or stopping tolerance) |
InitialGuessIsZero | Indicates whether the initial guess is zero |
startLevel | index of starting level to build multigrid hierarchy (default = 0) |
Definition at line 734 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Write | ( | const LO & | start = -1 , |
const LO & | end = -1 , |
||
const std::string & | suffix = "" |
||
) |
Print matrices in the multigrid hierarchy to file.
[in] | start | start level |
[in] | end | end level |
Default behavior is to print system and transfer matrices from the entire hierarchy. Files are named "A_0.m", "P_1.m", "R_1.m", etc, and are in matrix market coordinate format.
Definition at line 1012 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Keep | ( | const std::string & | ename, |
const FactoryBase * | factory = NoFactory::get() |
||
) |
Call Level::Keep(ename, factory) for each level of the Hierarchy.
Definition at line 1037 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Delete | ( | const std::string & | ename, |
const FactoryBase * | factory = NoFactory::get() |
||
) |
Call Level::Delete(ename, factory) for each level of the Hierarchy.
Definition at line 1043 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::AddKeepFlag | ( | const std::string & | ename, |
const FactoryBase * | factory = NoFactory::get() , |
||
KeepType | keep = MueLu::Keep |
||
) |
Call Level::AddKeepFlag for each level of the Hierarchy.
Definition at line 1049 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::RemoveKeepFlag | ( | const std::string & | ename, |
const FactoryBase * | factory, | ||
KeepType | keep = MueLu::All |
||
) |
Call Level::RemoveKeepFlag for each level of the Hierarchy.
Definition at line 1055 of file MueLu_Hierarchy_def.hpp.
|
virtual |
Return a simple one-line description of this object.
Reimplemented from MueLu::Describable.
Definition at line 1061 of file MueLu_Hierarchy_def.hpp.
|
virtual |
Print the Hierarchy with some verbosity level to a FancyOStream object.
[in] | out | The Teuchos::FancyOstream. |
[in] | verbLevel | Controls amount of output. |
Reimplemented from MueLu::Describable.
Definition at line 1074 of file MueLu_Hierarchy_def.hpp.
|
virtual |
Print the object with some verbosity level to an FancyOStream object.
Reimplemented from MueLu::Describable.
Definition at line 1069 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::print | ( | std::ostream & | out = std::cout , |
const VerbLevel | verbLevel = (MueLu::Parameters | MueLu::Statistics0) |
||
) | const |
Definition at line 1198 of file MueLu_Hierarchy_def.hpp.
void MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::IsPreconditioner | ( | const bool | flag | ) |
Indicate whether the multigrid method is a preconditioner or a solver.
This is used in conjunction with the verbosity level to determine whether the residuals can be printed.
Definition at line 1205 of file MueLu_Hierarchy_def.hpp.
|
inline |
Definition at line 313 of file MueLu_Hierarchy_decl.hpp.
Teuchos::RCP< Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node2 > > MueLu::Hierarchy< Scalar, LocalOrdinal, GlobalOrdinal, Node >::clone | ( | const RCP< Node2 > & | node2 | ) | const |
Definition at line 383 of file MueLu_Hierarchy_decl.hpp.
|
inline |
Definition at line 323 of file MueLu_Hierarchy_decl.hpp.
|
inline |
Definition at line 324 of file MueLu_Hierarchy_decl.hpp.
|
inlineprotected |
Definition at line 327 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 1258 of file MueLu_Hierarchy_def.hpp.
|
friend |
Definition at line 159 of file MueLu_Hierarchy_decl.hpp.
|
private |
Container for Level objects.
Definition at line 336 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 346 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 350 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 354 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 357 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 360 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 363 of file MueLu_Hierarchy_decl.hpp.
|
private |
Graph dumping.
Definition at line 367 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 368 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 369 of file MueLu_Hierarchy_decl.hpp.
|
private |
Convergece rate.
Definition at line 372 of file MueLu_Hierarchy_decl.hpp.
|
private |
Definition at line 375 of file MueLu_Hierarchy_decl.hpp.