MueLu  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node > Class Template Reference

Generic Smoother Factory for generating the smoothers of the MG hierarchy. More...

#include <MueLu_SmootherFactory_decl.hpp>

Inheritance diagram for MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >:
MueLu::SmootherFactoryBase MueLu::SingleLevelFactoryBase MueLu::Factory MueLu::FactoryBase MueLu::FactoryAcceptor MueLu::ParameterListAcceptorImpl MueLu::BaseClass MueLu::ParameterListAcceptor MueLu::VerboseObject MueLu::Describable Teuchos::VerboseObject< VerboseObject > Teuchos::Describable Teuchos::VerboseObjectBase Teuchos::LabeledObject

Public Types

typedef Scalar scalar_type
 
typedef LocalOrdinal local_ordinal_type
 
typedef GlobalOrdinal global_ordinal_type
 
typedef Node node_type
 

Private Member Functions

void CheckPrototypes () const
 

Private Attributes

RCP< SmootherPrototypepreSmootherPrototype_
 
RCP< SmootherPrototypepostSmootherPrototype_
 

Constructors/Destructors.

 SmootherFactory (RCP< SmootherPrototype > preAndPostSmootherPrototype=Teuchos::null)
 Constructor. More...
 
 SmootherFactory (RCP< SmootherPrototype > preSmootherPrototype, RCP< SmootherPrototype > postSmootherPrototype)
 
virtual ~SmootherFactory ()
 

Set/Get methods.

void SetSmootherPrototypes (RCP< SmootherPrototype > preAndPostSmootherPrototype)
 Set smoother prototypes. More...
 
void SetSmootherPrototypes (RCP< SmootherPrototype > preSmootherPrototype, RCP< SmootherPrototype > postSmootherPrototype)
 Set smoother prototypes. More...
 
void GetSmootherPrototypes (RCP< SmootherPrototype > &preSmootherPrototype, RCP< SmootherPrototype > &postSmootherPrototype) const
 Get smoother prototypes. More...
 
RCP< const ParameterListGetValidParameterList () const
 Input. More...
 
void DeclareInput (Level &currentLevel) const
 Specifies the data that this class needs, and the factories that generate that data. More...
 

Build methods.

void Build (Level &currentLevel) const
 Creates pre and post smoothers. More...
 
void BuildSmoother (Level &currentLevel, const PreOrPost preOrPost=BOTH) const
 

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
 

Additional Inherited Members

- Public Member Functions inherited from MueLu::SmootherFactoryBase
 SmootherFactoryBase ()
 
virtual ~SmootherFactoryBase ()
 
- Public Member Functions inherited from MueLu::SingleLevelFactoryBase
 SingleLevelFactoryBase ()
 Constructor. More...
 
virtual ~SingleLevelFactoryBase ()
 Destructor. More...
 
virtual void CallBuild (Level &requestedLevel) const
 
virtual void CallDeclareInput (Level &requestedLevel) const
 
- Public Member Functions inherited from MueLu::Factory
void EnableMultipleCallCheck () const
 Constructor. More...
 
void DisableMultipleCallCheck () const
 
void ResetDebugData () const
 
- Public Member Functions inherited from MueLu::FactoryBase
 FactoryBase ()
 Constructor. More...
 
virtual ~FactoryBase ()
 Destructor. More...
 
int GetID () const
 return unique factory id More...
 
- Public Member Functions inherited from MueLu::BaseClass
virtual ~BaseClass ()
 Destructor. More...
 
- Public Member Functions inherited from MueLu::VerboseObject
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::FancyOStreamGetOStream (MsgType type, int thisProcRankOnly=0) const
 Get an output stream for outputting the input message type. More...
 
Teuchos::FancyOStreamGetBlackHole () const
 
 VerboseObject ()
 
virtual ~VerboseObject ()
 Destructor. More...
 
- Public Member Functions inherited from Teuchos::VerboseObject< VerboseObject >
 VerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null)
 
virtual const VerboseObjectsetVerbLevel (const EVerbosityLevel verbLevel) const
 
virtual const VerboseObjectsetOverridingVerbLevel (const EVerbosityLevel verbLevel) 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)
 
- Public Member Functions inherited from Teuchos::VerboseObjectBase
virtual ~VerboseObjectBase ()
 
 VerboseObjectBase (const RCP< FancyOStream > &oStream=Teuchos::null)
 
virtual const VerboseObjectBasesetOStream (const RCP< FancyOStream > &oStream) const
 
virtual const VerboseObjectBasesetOverridingOStream (const RCP< FancyOStream > &oStream) const
 
virtual VerboseObjectBasesetLinePrefix (const std::string &linePrefix)
 
virtual RCP< FancyOStreamgetOStream () const
 
virtual RCP< FancyOStreamgetOverridingOStream () const
 
virtual std::string getLinePrefix () const
 
virtual OSTab getOSTab (const int tabs=1, const std::string &linePrefix="") const
 
- Public Member Functions inherited from MueLu::Describable
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 (Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
 Print the object with some verbosity level to an FancyOStream object. More...
 
- Public Member Functions inherited from Teuchos::Describable
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
 
DescribableStreamManipulatorState describe (const Describable &describable, const EVerbosityLevel verbLevel=Describable::verbLevel_default)
 
std::ostream & operator<< (std::ostream &os, const DescribableStreamManipulatorState &d)
 
- Public Member Functions inherited from MueLu::FactoryAcceptor
virtual ~FactoryAcceptor ()
 
virtual void SetFactory (const std::string &varName, const RCP< const FactoryBase > &factory)=0
 Configuration. More...
 
virtual const RCP< const
FactoryBase
GetFactory (const std::string &varName) const =0
 
- Public Member Functions inherited from MueLu::ParameterListAcceptorImpl
 ParameterListAcceptorImpl ()
 
virtual ~ParameterListAcceptorImpl ()=default
 
virtual void SetParameterList (const Teuchos::ParameterList &paramList)
 Set parameters from a parameter list and return with default values. More...
 
virtual const
Teuchos::ParameterList
GetParameterList () const
 
void SetParameter (const std::string &name, const ParameterEntry &entry)
 Set a parameter directly as a ParameterEntry. More...
 
const ParameterEntryGetParameter (const std::string &name) const
 Retrieves a const entry with the name name. More...
 
virtual void GetDocumentation (std::ostream &os) const
 
- Public Member Functions inherited from MueLu::ParameterListAcceptor
 ParameterListAcceptor ()
 
virtual ~ParameterListAcceptor ()=default
 
- Static Public Member Functions inherited from MueLu::Factory
static void EnableMultipleCheckGlobally ()
 
static void DisableMultipleCheckGlobally ()
 
- Static Public Member Functions inherited from MueLu::VerboseObject
static void SetMueLuOStream (const Teuchos::RCP< Teuchos::FancyOStream > &mueluOStream)
 
static void SetMueLuOFileStream (const std::string &filename)
 
static Teuchos::RCP
< Teuchos::FancyOStream
GetMueLuOStream ()
 
static void SetDefaultVerbLevel (const VerbLevel defaultVerbLevel)
 Set the default (global) verbosity level. More...
 
static VerbLevel GetDefaultVerbLevel ()
 Get the default (global) verbosity level. More...
 
- Static Public Member Functions inherited from Teuchos::VerboseObject< VerboseObject >
static void setDefaultVerbLevel (const EVerbosityLevel defaultVerbLevel)
 
static EVerbosityLevel getDefaultVerbLevel ()
 
- Static Public Member Functions inherited from Teuchos::VerboseObjectBase
static void setDefaultOStream (const RCP< FancyOStream > &defaultOStream)
 
static RCP< FancyOStreamgetDefaultOStream ()
 
- Static Public Attributes inherited from Teuchos::Describable
static const EVerbosityLevel verbLevel_default
 
- Protected Member Functions inherited from Teuchos::VerboseObject< VerboseObject >
void initializeVerboseObject (const EVerbosityLevel verbLevel=VERB_DEFAULT, const RCP< FancyOStream > &oStream=Teuchos::null)
 
- Protected Member Functions inherited from Teuchos::VerboseObjectBase
void initializeVerboseObjectBase (const RCP< FancyOStream > &oStream=Teuchos::null)
 
virtual void informUpdatedVerbosityState () const
 

Detailed Description

template<class Scalar = double, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
class MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >

Generic Smoother Factory for generating the smoothers of the MG hierarchy.

This factory is generic and can produce any kind of Smoother.

The design of the Smoother factory is based on the prototype design pattern. The smoother factory uses prototypical instances of smoothers, and prototypes are cloned to produce the smoothers of the MG hierarchy.

See also:

There is one prototype for the pre-smoother and one for the post-smoother. Thus, this factory can produce two different smoothers for pre and post-smoothing. Prototypes are stored in this factory.

The type of smoother to create is determined by the prototypical instances. Prototypes store their own parameters (nits, omega), and the factory doesn't have any knowledge about that.

Definition at line 91 of file MueLu_SmootherFactory_decl.hpp.

Member Typedef Documentation

template<class Scalar = double, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
typedef Scalar MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::scalar_type

Definition at line 93 of file MueLu_SmootherFactory_decl.hpp.

template<class Scalar = double, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
typedef LocalOrdinal MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::local_ordinal_type

Definition at line 94 of file MueLu_SmootherFactory_decl.hpp.

template<class Scalar = double, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
typedef GlobalOrdinal MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::global_ordinal_type

Definition at line 95 of file MueLu_SmootherFactory_decl.hpp.

template<class Scalar = double, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
typedef Node MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::node_type

Definition at line 96 of file MueLu_SmootherFactory_decl.hpp.

Constructor & Destructor Documentation

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::SmootherFactory ( RCP< SmootherPrototype preAndPostSmootherPrototype = Teuchos::null)

Constructor.

TODO update the documentation from Matlab syntax

The constructor takes as arguments pre-configured smoother object(s). They are used as prototypes by the factory.

SYNTAX

SmootherFactory(preSmootherPrototype_, postSmootherPrototype_);

preSmootherPrototype_ - prototype for pre-smoothers (SmootherPrototype) postSmootherPrototype_ - prototype for post-smoothers (SmootherPrototype,optional,default=preSmootherPrototype_)

EXAMPLES:

SmootherFactory = SmootherFactory(ChebySmoother(5,1/30))

or

nIts = 5; lambdaRatio = 1/30; Smoother = ChebySmoother() Smoother = Smoother.SetIts(nIts); Smoother = Smoother.SetLambdaRatio(1/30); SmootherFactory = SmootherFactory(Smoother);

To use different smoothers for pre and post smoothing, two prototypes can be passed in as argument: PreSmoother = ChebySmoother(2, 1/30) PostSmoother = ChebySmoother(10,1/30) SmootherFactory = SmootherFactory(PreSmoother, PostSmoother);

[] is also a valid smoother which do nothing: PostSmoother = ChebySmoother(10,1/30) SmootherFactory = SmootherFactory([], PostSmoother);

Definition at line 60 of file MueLu_SmootherFactory_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::SmootherFactory ( RCP< SmootherPrototype preSmootherPrototype,
RCP< SmootherPrototype postSmootherPrototype 
)

Definition at line 65 of file MueLu_SmootherFactory_def.hpp.

template<class Scalar = double, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
virtual MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::~SmootherFactory ( )
inlinevirtual

Definition at line 150 of file MueLu_SmootherFactory_decl.hpp.

Member Function Documentation

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::SetSmootherPrototypes ( RCP< SmootherPrototype preAndPostSmootherPrototype)

Set smoother prototypes.

Definition at line 71 of file MueLu_SmootherFactory_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::SetSmootherPrototypes ( RCP< SmootherPrototype preSmootherPrototype,
RCP< SmootherPrototype postSmootherPrototype 
)

Set smoother prototypes.

Definition at line 77 of file MueLu_SmootherFactory_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetSmootherPrototypes ( RCP< SmootherPrototype > &  preSmootherPrototype,
RCP< SmootherPrototype > &  postSmootherPrototype 
) const

Get smoother prototypes.

Definition at line 105 of file MueLu_SmootherFactory_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
RCP< const ParameterList > MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::GetValidParameterList ( ) const
virtual

Input.

Implements MueLu::ParameterListAcceptor.

Definition at line 85 of file MueLu_SmootherFactory_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::DeclareInput ( Level currentLevel) const
virtual

Specifies the data that this class needs, and the factories that generate that data.

If the Build method of this class requires some data, but the generating factory is not specified in DeclareInput, then this class will fall back to the settings in FactoryManager.

Implements MueLu::SingleLevelFactoryBase.

Definition at line 112 of file MueLu_SmootherFactory_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::Build ( Level currentLevel) const
virtual

Creates pre and post smoothers.

Factory.Build() clones its prototypes and calls Setup() on the new objects to create fully functional smoothers for the current hierarchy level. Note that smoothers do their own setup (ie: ILUSmoother.Setup() computes the ILU factorization).

If pre and post smoother are identical, the Setup() phase is done only once: to create the post-smoother, the pre-smoother is duplicated and its parameters are changed according to the parameters of the post-smoother prototype.

If the parameters of pre and post smoothers are not the same, the Setup() phase is also done only once when parameters don't change the result of the setup computation.

Implements MueLu::SmootherFactoryBase.

Definition at line 121 of file MueLu_SmootherFactory_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::BuildSmoother ( Level currentLevel,
const PreOrPost  preOrPost = BOTH 
) const
virtual

Implements MueLu::SmootherFactoryBase.

Definition at line 126 of file MueLu_SmootherFactory_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
std::string MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::description ( ) const
virtual

Return a simple one-line description of this object.

Reimplemented from MueLu::Describable.

Definition at line 248 of file MueLu_SmootherFactory_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::describe ( Teuchos::FancyOStream out,
const VerbLevel  verbLevel = Default 
) const
virtual

Reimplemented from MueLu::Describable.

Definition at line 258 of file MueLu_SmootherFactory_def.hpp.

template<class Scalar , class LocalOrdinal , class GlobalOrdinal , class Node >
void MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::CheckPrototypes ( ) const
private

Definition at line 97 of file MueLu_SmootherFactory_def.hpp.

Member Data Documentation

template<class Scalar = double, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
RCP<SmootherPrototype> MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::preSmootherPrototype_
private

Definition at line 213 of file MueLu_SmootherFactory_decl.hpp.

template<class Scalar = double, class LocalOrdinal = int, class GlobalOrdinal = LocalOrdinal, class Node = KokkosClassic::DefaultNode::DefaultNodeType>
RCP<SmootherPrototype> MueLu::SmootherFactory< Scalar, LocalOrdinal, GlobalOrdinal, Node >::postSmootherPrototype_
private

Definition at line 214 of file MueLu_SmootherFactory_decl.hpp.


The documentation for this class was generated from the following files: