FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ > Class Template Reference

Solver conversion module. More...

#include <convert_precond.hpp>

Inheritance diagram for FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >:
FEAT::Solver::SolverBase< VectorOuter_ >

Public Types

using BaseClass = SolverBase< VectorTypeOuter >
 
using SolverTypeInner = SolverBase< VectorTypeInner >
 
typedef VectorOuter_ VectorType
 The type of vector this solver can be applied to. More...
 
using VectorTypeInner = VectorInner_
 
using VectorTypeOuter = VectorOuter_
 

Public Member Functions

 ConvertPrecond (std::shared_ptr< SolverTypeInner > inner_solver)
 Constructor. More...
 
virtual Status apply (VectorTypeOuter &vec_cor, const VectorTypeOuter &vec_def) override
 Solver application method. More...
 
virtual void done ()
 Finalization method. More...
 
virtual void done_numeric () override
 Numeric finalization method. More...
 
virtual void done_symbolic () override
 Symbolic finalization method. More...
 
virtual void init ()
 Initialization method. More...
 
virtual void init_numeric () override
 Numeric initialization method. More...
 
virtual void init_symbolic () override
 Symbolic initialization method. More...
 
virtual String name () const override
 Returns the name of the solver. More...
 

Protected Attributes

std::shared_ptr< SolverTypeInner_inner_solver
 

Detailed Description

template<typename VectorOuter_, typename VectorInner_>
class FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >

Solver conversion module.

This class implements a simple solver module, which converts data before and after the inner solver call

There are two typical applications:

  • mixed precission iterative refinement The outer loop calls the ConvertPrecond object, which calls the inner solver, that is running in lower precission
  • mixed arch intra solver For example a v-cycle multigrid can solve the finer levels on the gpu and switch completly to the cpu for the coarser levels. This can be easily obtained by passing the ConvertPrecond object as a coarse solver to the 'finer' v cycle and let the let the ConvertPrecond object call the 'coarser' v cycle as its own solver.
Note
This class template is specialized for Global::Matrix and Global::Filter instances below.
Author
Dirk Ribbrock

Definition at line 39 of file convert_precond.hpp.

Member Typedef Documentation

◆ BaseClass

template<typename VectorOuter_ , typename VectorInner_ >
using FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::BaseClass = SolverBase<VectorTypeOuter>

Definition at line 44 of file convert_precond.hpp.

◆ SolverTypeInner

template<typename VectorOuter_ , typename VectorInner_ >
using FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::SolverTypeInner = SolverBase<VectorTypeInner>

Definition at line 47 of file convert_precond.hpp.

◆ VectorType

typedef VectorOuter_ FEAT::Solver::SolverBase< VectorOuter_ >::VectorType
inherited

The type of vector this solver can be applied to.

Definition at line 186 of file base.hpp.

◆ VectorTypeInner

template<typename VectorOuter_ , typename VectorInner_ >
using FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::VectorTypeInner = VectorInner_

Definition at line 46 of file convert_precond.hpp.

◆ VectorTypeOuter

template<typename VectorOuter_ , typename VectorInner_ >
using FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::VectorTypeOuter = VectorOuter_

Definition at line 43 of file convert_precond.hpp.

Constructor & Destructor Documentation

◆ ConvertPrecond()

template<typename VectorOuter_ , typename VectorInner_ >
FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::ConvertPrecond ( std::shared_ptr< SolverTypeInner inner_solver)
inlineexplicit

Constructor.

Parameters
[in]inner_solverThe actual solver, which shall be executed with converted rhs/sol vectors

Definition at line 59 of file convert_precond.hpp.

Member Function Documentation

◆ apply()

template<typename VectorOuter_ , typename VectorInner_ >
virtual Status FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::apply ( VectorTypeOuter &  vec_cor,
const VectorTypeOuter &  vec_def 
)
inlineoverridevirtual

Solver application method.

This method applies the solver represented by this object onto a given defect vector and returns the corresponding correction vector.

Note
Solvers which derive from the IterativeSolver base class also provide a correct() method which corrects an initial solution instead of starting with the null vector.
Parameters
[out]vec_corThe vector that shall receive the solution of the linear system. It is assumed to be allocated, but its numerical contents may be undefined upon calling this method.
[in]vec_defThe vector that represents the right-hand-side of the linear system to be solved.
Attention
vec_cor and vec_def must not refer to the same vector object!
Returns
A Status code that represents the status of the solution step.

Implements FEAT::Solver::SolverBase< VectorOuter_ >.

Definition at line 98 of file convert_precond.hpp.

References FEAT::LAFEM::Layout, FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::name(), FEAT::Solver::status_success(), and FEAT::Solver::success.

◆ done()

virtual void FEAT::Solver::SolverBase< VectorOuter_ >::done ( )
inlinevirtualinherited

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 283 of file base.hpp.

◆ done_numeric()

template<typename VectorOuter_ , typename VectorInner_ >
virtual void FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::done_numeric ( )
inlineoverridevirtual

Numeric finalization method.

This method is called to release any data allocated in the numeric initialization step.

Reimplemented from FEAT::Solver::SolverBase< VectorOuter_ >.

Definition at line 84 of file convert_precond.hpp.

References FEAT::Solver::SolverBase< Vector_ >::done_numeric().

◆ done_symbolic()

template<typename VectorOuter_ , typename VectorInner_ >
virtual void FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::done_symbolic ( )
inlineoverridevirtual

Symbolic finalization method.

This method is called to release any data allocated in the symbolic initialization step.

Reimplemented from FEAT::Solver::SolverBase< VectorOuter_ >.

Definition at line 91 of file convert_precond.hpp.

References FEAT::Solver::SolverBase< Vector_ >::done_symbolic().

◆ init()

virtual void FEAT::Solver::SolverBase< VectorOuter_ >::init ( )
inlinevirtualinherited

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 268 of file base.hpp.

◆ init_numeric()

template<typename VectorOuter_ , typename VectorInner_ >
virtual void FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::init_numeric ( )
inlineoverridevirtual

Numeric initialization method.

This method is called to perform numeric initialization of the solver.
Before this function can be called, the symbolic initialization must be performed.

Reimplemented from FEAT::Solver::SolverBase< VectorOuter_ >.

Definition at line 77 of file convert_precond.hpp.

References FEAT::Solver::SolverBase< Vector_ >::init_numeric().

◆ init_symbolic()

template<typename VectorOuter_ , typename VectorInner_ >
virtual void FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::init_symbolic ( )
inlineoverridevirtual

Symbolic initialization method.

This method is called to perform symbolic initialization of the solver.

Reimplemented from FEAT::Solver::SolverBase< VectorOuter_ >.

Definition at line 70 of file convert_precond.hpp.

References FEAT::Solver::SolverBase< Vector_ >::init_symbolic().

◆ name()

template<typename VectorOuter_ , typename VectorInner_ >
virtual String FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::name ( ) const
inlineoverridevirtual

Member Data Documentation

◆ _inner_solver

template<typename VectorOuter_ , typename VectorInner_ >
std::shared_ptr<SolverTypeInner> FEAT::Solver::ConvertPrecond< VectorOuter_, VectorInner_ >::_inner_solver
protected

Definition at line 50 of file convert_precond.hpp.


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