FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ > Class Template Reference

Multigrid hierarchy management class template. More...

#include <multigrid.hpp>

Classes

class  LevelInfo
 Multigrid level info class. More...
 

Public Types

typedef MultiGridLevelBase< SystemMatrix_, SystemFilter_, TransferOperator_ > LevelType
 the level base class type More...
 
typedef LevelType::SolverType SolverType
 the coarse-grid solver/smoother type More...
 
typedef MultiGridLevelStd< SystemMatrix_, SystemFilter_, TransferOperator_ > StdLevelType
 the standard level class type More...
 
typedef LevelType::SystemFilterType SystemFilterType
 the system filter type More...
 
typedef LevelType::SystemMatrixType SystemMatrixType
 the system matrix type More...
 
typedef LevelType::SystemVectorType SystemVectorType
 the system vector type More...
 
typedef LevelType::TransferOperatorType TransferOperatorType
 the transfer operator type More...
 

Public Member Functions

 MultiGridHierarchy (std::size_t size_virt)
 Constructor. More...
 
virtual ~MultiGridHierarchy ()
 Destructor. More...
 
void done ()
 Finalization method. More...
 
void done_numeric ()
 Numeric finalization method. More...
 
void done_symbolic ()
 Symbolic finalization method. More...
 
LevelTypeget_level (Index lvl)
 Returns a level in the hierarchy. More...
 
const LevelTypeget_level (Index lvl) const
 Returns a level in the hierarchy. More...
 
double get_time_coarse (int lvl=-1) const
 Returns the time for coarse grid solver application. More...
 
double get_time_defect (int lvl=-1) const
 Returns the time for defect computation. More...
 
double get_time_smooth (int lvl=-1) const
 Returns the time for smoother application. More...
 
double get_time_transfer (int lvl=-1) const
 Returns the time for grid transfer application. More...
 
bool have_numeric () const
 Specifies whether the symbolic initialization was performed. More...
 
bool have_symbolic () const
 Specifies whether the symbolic initialization was performed. More...
 
void init ()
 Initialization method. More...
 
void init_numeric ()
 Numeric initialization method. More...
 
void init_symbolic ()
 Symbolic initialization method. More...
 
void push_level (const SystemMatrixType &system_matrix, const SystemFilterType &system_filter, const TransferOperatorType &transfer_operator, std::shared_ptr< SolverType > smoother_pre, std::shared_ptr< SolverType > smoother_post, std::shared_ptr< SolverType > smoother_peak, std::shared_ptr< SolverType > coarse_solver=nullptr)
 Pushes a standard refined level into the hierarchy. More...
 
void push_level (const SystemMatrixType &system_matrix, const SystemFilterType &system_filter, std::shared_ptr< SolverType > coarse_solver)
 Pushes a standard coarse-grid level into the hierarchy. More...
 
void push_level (std::shared_ptr< LevelType > level)
 Pushes a new (custom) level into the hierarchy. More...
 
void reset_timings ()
 Resets the internal timing statistics. More...
 
Index size_physical () const
 Returns the physical hierarchy size. More...
 
Index size_virtual () const
 Returns the virtual hierarchy size. More...
 

Protected Member Functions

LevelInfo_get_level_info (Index lvl)
 Returns a level info in the hierarchy. More...
 

Protected Attributes

bool _have_init_numeric
 specifies whether init_numeric() has been called More...
 
bool _have_init_symbolic
 specifies whether init_symbolic() has been called More...
 
std::deque< LevelInfo_levels
 the deque of all level info objects More...
 
std::size_t _virt_size
 the virtual multigrid hierarchy sizes More...
 

Friends

class MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >
 MultiGrid is our friend. More...
 

Detailed Description

template<typename SystemMatrix_, typename SystemFilter_, typename TransferOperator_>
class FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >

Multigrid hierarchy management class template.

Todo:
document this
Template Parameters
SystemMatrix_The class representing the system matrix.
SystemFilter_The class representing the system filter.
TransferOperator_The class representing the transfer operator.
Author
Peter Zajac

Definition at line 417 of file multigrid.hpp.

Member Typedef Documentation

◆ LevelType

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
typedef MultiGridLevelBase<SystemMatrix_, SystemFilter_, TransferOperator_> FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::LevelType

the level base class type

Definition at line 424 of file multigrid.hpp.

◆ SolverType

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
typedef LevelType::SolverType FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::SolverType

the coarse-grid solver/smoother type

Definition at line 437 of file multigrid.hpp.

◆ StdLevelType

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
typedef MultiGridLevelStd<SystemMatrix_, SystemFilter_, TransferOperator_> FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::StdLevelType

the standard level class type

Definition at line 426 of file multigrid.hpp.

◆ SystemFilterType

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
typedef LevelType::SystemFilterType FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::SystemFilterType

the system filter type

Definition at line 431 of file multigrid.hpp.

◆ SystemMatrixType

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
typedef LevelType::SystemMatrixType FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::SystemMatrixType

the system matrix type

Definition at line 429 of file multigrid.hpp.

◆ SystemVectorType

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
typedef LevelType::SystemVectorType FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::SystemVectorType

the system vector type

Definition at line 433 of file multigrid.hpp.

◆ TransferOperatorType

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
typedef LevelType::TransferOperatorType FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::TransferOperatorType

the transfer operator type

Definition at line 435 of file multigrid.hpp.

Constructor & Destructor Documentation

◆ MultiGridHierarchy()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::MultiGridHierarchy ( std::size_t  size_virt)
inlineexplicit

Constructor.

Parameters
[in]size_virtThe virtual multigrid hierarchy size on all processes.

Definition at line 586 of file multigrid.hpp.

◆ ~MultiGridHierarchy()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
virtual FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::~MultiGridHierarchy ( )
inlinevirtual

Member Function Documentation

◆ _get_level_info()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
LevelInfo & FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_get_level_info ( Index  lvl)
inlineprotected

Returns a level info in the hierarchy.

Note
This function is used by the MultiGrid solver class.
Parameters
[in]lvlThe index of the level info to be returned.
Returns
A reference to the corresponding level info object.

Definition at line 563 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_levels, FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::size_physical(), and XASSERTM.

◆ done()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
void FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::done ( )
inline

Finalization method.

This function performs both the symbolic and numeric finalization, i.e. it simply performs

this->done_numeric();
this->done_symbolic();

Definition at line 827 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::done_numeric(), and FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::done_symbolic().

◆ done_numeric()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
void FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::done_numeric ( )
inline

Numeric finalization method.

This method is called to release any data allocated in the numeric initialization step of the sub-solvers in the multigrid hierarchy.

Definition at line 792 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_have_init_numeric, FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_levels, and XASSERTM.

Referenced by FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::done().

◆ done_symbolic()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
void FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::done_symbolic ( )
inline

◆ get_level() [1/2]

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
LevelType & FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::get_level ( Index  lvl)
inline

Returns a level in the hierarchy.

Parameters
[in]lvlThe index of the level to be returned.
Returns
A (const) reference to the corresponding level object.

Definition at line 718 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_levels, FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::size_physical(), and XASSERTM.

◆ get_level() [2/2]

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
const LevelType & FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::get_level ( Index  lvl) const
inline

Returns a level in the hierarchy.

Parameters
[in]lvlThe index of the level to be returned.
Returns
A (const) reference to the corresponding level object.

Definition at line 725 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_levels, FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::size_physical(), and XASSERTM.

◆ get_time_coarse()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
double FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::get_time_coarse ( int  lvl = -1) const
inline

Returns the time for coarse grid solver application.

Parameters
[in]lvlThe level for which the timing is to be retrieved. If set to -1, the sum of all level timings is returned.
Returns
The time for coarse grid solver application.

Definition at line 896 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_levels, and XASSERT.

◆ get_time_defect()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
double FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::get_time_defect ( int  lvl = -1) const
inline

Returns the time for defect computation.

Parameters
[in]lvlThe level for which the timing is to be retrieved. If set to -1, the sum of all level timings is returned.
Returns
The time for defect computation.

Definition at line 919 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_levels, and XASSERT.

◆ get_time_smooth()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
double FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::get_time_smooth ( int  lvl = -1) const
inline

Returns the time for smoother application.

Parameters
[in]lvlThe level for which the timing is to be retrieved. If set to -1, the sum of all level timings is returned.
Returns
The time for smoother application.

Definition at line 873 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_levels, and XASSERT.

◆ get_time_transfer()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
double FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::get_time_transfer ( int  lvl = -1) const
inline

Returns the time for grid transfer application.

Parameters
[in]lvlThe level for which the timing is to be retrieved. If set to -1, the sum of all level timings is returned.
Returns
The time for grid transfer application.

Definition at line 942 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_levels, and XASSERT.

◆ have_numeric()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
bool FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::have_numeric ( ) const
inline

Specifies whether the symbolic initialization was performed.

Returns
true between a call of init_symbolic() and done_symbolic(), otherwise false.

Definition at line 850 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_have_init_numeric.

◆ have_symbolic()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
bool FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::have_symbolic ( ) const
inline

Specifies whether the symbolic initialization was performed.

Returns
true between a call of init_symbolic() and done_symbolic(), otherwise false.

Definition at line 839 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_have_init_symbolic.

◆ init()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
void FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::init ( )
inline

Initialization method.

This function performs both the symbolic and numeric initialization, i.e. it simply performs

this->init_symbolic();
this->init_numeric();

Definition at line 812 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::init_numeric(), and FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::init_symbolic().

◆ init_numeric()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
void FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::init_numeric ( )
inline

Numeric initialization method.

This method is called to perform numeric initialization of the sub-solvers in the multigrid hierarchy.
Before this function can be called, the symbolic initialization must be performed.

Definition at line 774 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_have_init_numeric, FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_have_init_symbolic, FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_levels, and XASSERTM.

Referenced by FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::init().

◆ init_symbolic()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
void FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::init_symbolic ( )
inline

◆ push_level() [1/3]

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
void FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::push_level ( const SystemMatrixType system_matrix,
const SystemFilterType system_filter,
const TransferOperatorType transfer_operator,
std::shared_ptr< SolverType smoother_pre,
std::shared_ptr< SolverType smoother_post,
std::shared_ptr< SolverType smoother_peak,
std::shared_ptr< SolverType coarse_solver = nullptr 
)
inline

Pushes a standard refined level into the hierarchy.

Parameters
[in]system_matrixA reference to the system matrix.
[in]system_filterA reference to the system filter.
[in]transfer_operatorA reference to the transfer operator onto this level.
[in]smoother_preA shared pointer to the pre-smoother. May be nullptr if no pre-smoother is to be used.
[in]smoother_postA shared pointer to the post-smoother. May be nullptr if no post-smoother is to be used.
[in]smoother_peakA shared pointer to the peak-smoother. Is set to nullptr, the multigrid will use both the pre- and post-smoothers as the peak-smoother.
[in]coarse_solverA shared pointer to the coarse grid solver. This one is usually nullptr, unless one wants to use this refined level also as a coarse-grid level.
Note
The smoother_pre, smoother_post, smoother_peak and coarse_solver pointers need not point to different objects. This class will ensure the correct handling of unique solver objects independent of whether more that one pointer references the same unique object on one level.

Definition at line 675 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::push_level().

◆ push_level() [2/3]

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
void FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::push_level ( const SystemMatrixType system_matrix,
const SystemFilterType system_filter,
std::shared_ptr< SolverType coarse_solver 
)
inline

Pushes a standard coarse-grid level into the hierarchy.

Parameters
[in]system_matrixA reference to the system matrix.
[in]system_filterA reference to the system filter.
[in]coarse_solverA shared pointer to the coarse grid solver. May be nullptr if no coarse-grid solver is to be used.

Definition at line 631 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::push_level().

◆ push_level() [3/3]

◆ reset_timings()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
void FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::reset_timings ( )
inline

Resets the internal timing statistics.

Definition at line 858 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_levels.

◆ size_physical()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
Index FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::size_physical ( ) const
inline

◆ size_virtual()

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
Index FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::size_virtual ( ) const
inline

Returns the virtual hierarchy size.

Returns
The virtual hierarchy size.

Definition at line 704 of file multigrid.hpp.

References FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_virt_size.

Friends And Related Function Documentation

◆ MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
friend class MultiGrid< SystemMatrix_, SystemFilter_, TransferOperator_ >
friend

MultiGrid is our friend.

Definition at line 384 of file multigrid.hpp.

Member Data Documentation

◆ _have_init_numeric

◆ _have_init_symbolic

◆ _levels

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
std::deque<LevelInfo> FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_levels
protected

the deque of all level info objects

Definition at line 571 of file multigrid.hpp.

Referenced by FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::~MultiGridHierarchy(), FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_get_level_info(), FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::done_numeric(), FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::done_symbolic(), FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::get_level(), FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::get_time_coarse(), FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::get_time_defect(), FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::get_time_smooth(), FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::get_time_transfer(), FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::init_numeric(), FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::init_symbolic(), FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::push_level(), FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::reset_timings(), and FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::size_physical().

◆ _virt_size

template<typename SystemMatrix_ , typename SystemFilter_ , typename TransferOperator_ >
std::size_t FEAT::Solver::MultiGridHierarchy< SystemMatrix_, SystemFilter_, TransferOperator_ >::_virt_size
protected

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