ug4
ug::UzawaBase< TDomain, TAlgebra > Class Template Reference

#include <uzawa.h>

+ Inheritance diagram for ug::UzawaBase< TDomain, TAlgebra >:

Public Types

typedef TGridFunction::element_type TElement
 
typedef GridFunction< TDomain, TAlgebra > TGridFunction
 
typedef TGridFunction::side_type TSide
 
typedef TAlgebra algebra_type
 
typedef TAlgebra::vector_type vector_type
 
typedef TAlgebra::matrix_type matrix_type
 
typedef MatrixOperator< matrix_type, vector_typematrix_operator_type
 
- Public Types inherited from ug::IPreconditioner< TAlgebra >
typedef TAlgebra algebra_type
 Algebra type. More...
 
typedef MatrixOperator< matrix_type, vector_typematrix_operator_type
 Matrix Operator type. More...
 
typedef TAlgebra::matrix_type matrix_type
 Matrix type. More...
 
typedef TAlgebra::vector_type vector_type
 Vector type. More...
 
- Public Types inherited from ug::ILinearIterator< TAlgebra::vector_type >
typedef TAlgebra::vector_type codomain_function_type
 Range space. More...
 
typedef TAlgebra::vector_type domain_function_type
 Domain space. More...
 
- Public Types inherited from ug::DebugWritingObject< TAlgebra >
typedef TAlgebra algebra_type
 type of algebra More...
 
typedef TAlgebra::matrix_type matrix_type
 type of matrix More...
 
typedef TAlgebra::vector_type vector_type
 type of vector More...
 
- Public Types inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type >
typedef TAlgebra::vector_type vector_type
 type of vector More...
 

Public Member Functions

SmartPtr< ILinearIterator< typename TAlgebra::vector_type > > clone ()
 clone More...
 
void extract_schur_update (const matrix_type &K, const TGridFunction &c)
 Update C22 block by matrix. More...
 
void extract_sub_matrices (const matrix_type &K, const TGridFunction &c)
 extract block matrix operators (called once) More...
 
virtual bool init (SmartPtr< ILinearOperator< vector_type > > J, const vector_type &u)
 Overriding base type. More...
 
void init_block_iterations ()
 
void init_block_operators ()
 allocate block matrix operators More...
 
void postprocess_block_iterations ()
 
void set_backward_iter (SmartPtr< ILinearIterator< vector_type > > iter)
 
void set_forward_iter (SmartPtr< ILinearIterator< vector_type > > iter)
 
void set_schur_iter (SmartPtr< ILinearIterator< vector_type > > iter)
 
void set_schur_operator_update (SmartPtr< AssembledLinearOperator< TAlgebra > > spSchurUpdateOp, double theta=0.0)
 
virtual bool supports_parallel () const
 returns if parallel solving is supported More...
 
 UzawaBase (const char *sSchurCmp)
 
 UzawaBase (const std::vector< std::string > &vSchurCmp)
 default constructor More...
 
virtual ~UzawaBase ()
 
- Public Member Functions inherited from ug::IPreconditioner< TAlgebra >
virtual bool apply (vector_type &c, const vector_type &d)
 compute new correction c = B*d More...
 
virtual bool apply_update_defect (vector_type &c, vector_type &d)
 compute new correction c = B*d and update defect d:= d - L*c More...
 
SmartPtr< MatrixOperator< matrix_type, vector_type > > approx_operator ()
 underlying matrix based operator used for the preconditioner More...
 
SmartPtr< MatrixOperator< matrix_type, vector_type > > defect_operator ()
 underlying matrix based operator for calculation of defect More...
 
bool init (SmartPtr< ILinearOperator< vector_type > > L)
 implements the ILinearIterator-interface for matrix based preconditioner More...
 
bool init (SmartPtr< MatrixOperator< matrix_type, vector_type > > Op)
 initializes the preconditioner for a matrix based operator More...
 
 IPreconditioner ()
 default constructor More...
 
 IPreconditioner (const IPreconditioner< TAlgebra > &parent)
 clone constructor More...
 
 IPreconditioner (SmartPtr< IDebugWriter< algebra_type > > spDebugWriter)
 constructor setting debug writer More...
 
virtual void set_approximation (SmartPtr< MatrixOperator< matrix_type, vector_type > > approx)
 
virtual ~IPreconditioner ()
 virtual destructor More...
 
- Public Member Functions inherited from ug::ILinearIterator< TAlgebra::vector_type >
virtual std::string config_string () const
 
SmartPtr< IDamping< TAlgebra::vector_type, TAlgebra::vector_type > > damping ()
 returns the scaling More...
 
 ILinearIterator ()
 constructor More...
 
 ILinearIterator (const ILinearIterator< TAlgebra::vector_type, TAlgebra::vector_type > &parent)
 copy constructor More...
 
virtual bool init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > J, const TAlgebra::vector_type &u)=0
 initialize for operator J(u) and linearization point u More...
 
virtual bool init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > L)=0
 initialize for linear operator L More...
 
void set_damp (number factor)
 sets the damping to a constant factor More...
 
void set_damp (SmartPtr< IDamping< TAlgebra::vector_type, TAlgebra::vector_type > > spScaling)
 sets a scaling for the correction More...
 
virtual ~ILinearIterator ()
 virtual destructor More...
 
- Public Member Functions inherited from ug::DebugWritingObject< TAlgebra >
SmartPtr< IDebugWriter< algebra_type > > debug_writer ()
 returns the debug writer More...
 
ConstSmartPtr< IDebugWriter< algebra_type > > debug_writer () const
 
bool debug_writer_valid () const
 returns true if the debug writer is set More...
 
 DebugWritingObject ()
 
 DebugWritingObject (const DebugWritingObject< algebra_type > &parent)
 clone constructor More...
 
 DebugWritingObject (SmartPtr< IDebugWriter< algebra_type > > spDebugWriter)
 
virtual ~DebugWritingObject ()
 virtual destructor More...
 
- Public Member Functions inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type >
virtual void set_debug (SmartPtr< IVectorDebugWriter< vector_type > > spDebugWriter)
 set debug writer More...
 
SmartPtr< IVectorDebugWriter< vector_type > > vector_debug_writer ()
 returns the debug writer More...
 
ConstSmartPtr< IVectorDebugWriter< vector_type > > vector_debug_writer () const
 
bool vector_debug_writer_valid () const
 returns true if the debug writer is set More...
 
 VectorDebugWritingObject ()
 
 VectorDebugWritingObject (SmartPtr< IVectorDebugWriter< vector_type > > spDebugWriter)
 
void write_debug (const vector_type &vec, const char *filename)
 writing debug output for a vector (if debug writer set) More...
 
virtual ~VectorDebugWritingObject ()
 virtual destructor More...
 

Static Public Attributes

static const int dim = TDomain::dim
 World dimension. More...
 

Protected Types

typedef IPreconditioner< TAlgebra > base_type
 
enum  BLOCK {
  AUX_A11 , B12 , B21 , AUX_C22 ,
  AUX_M22 , AUX_ARRAY_SIZE
}
 

Protected Member Functions

void create_slice_debug_writers ()
 
void init_in_first_step (const matrix_type &pMat, const TGridFunction &pC)
 
void my_write_debug (const matrix_type &mat, std::string name, const GridLevel &glTo, const GridLevel &glFrom)
 
void my_write_debug (const matrix_type &mat, std::string name, const TGridFunction &rTo, const TGridFunction &rFrom)
 auxiliary matrices (not cloned!) More...
 
virtual void my_write_debug (const TGridFunction &rGF, std::string name)
 
virtual const char * name () const
 name More...
 
virtual bool postprocess ()
 cleans the operator More...
 
virtual bool preprocess (SmartPtr< MatrixOperator< matrix_type, vector_type > > pOp)
 initializes the preconditioner More...
 
template<int d>
void reset_slice_debug_writers ()
 
void set_debug (SmartPtr< IDebugWriter< algebra_type > > spDebugWriter)
 set debug writer More...
 
virtual bool step (SmartPtr< MatrixOperator< matrix_type, vector_type > > pOp, vector_type &c, const vector_type &d)
 computes a new correction c = B*d More...
 
- Protected Member Functions inherited from ug::DebugWritingObject< TAlgebra >
void enter_debug_writer_section (const char *secDir)
 enters a debugging section More...
 
void enter_debug_writer_section (std::string secDir)
 enters a debugging section More...
 
void leave_debug_writer_section ()
 leaves a debugging section More...
 
void write_debug (const matrix_type &mat, const char *filename)
 write debug output for a matrix (if debug writer set) More...
 
void write_debug (const matrix_type &mat, std::string name)
 write debug output for a matrix (if debug writer set) More...
 
- Protected Member Functions inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type >
void enter_vector_debug_writer_section (const char *secDir)
 enters a debugging section More...
 
void enter_vector_debug_writer_section (std::string secDir)
 enters a debugging section More...
 
void leave_vector_debug_writer_section ()
 leaves a debugging section More...
 
void print_debugger_message (const char *msg)
 prints a debugger message (listing all the sections) More...
 
void print_debugger_message (std::string msg)
 prints a debugger message (listing all the sections) More...
 
virtual void write_debug (const vector_type &vec, std::string name)
 writing debug output for a vector (if debug writer set) More...
 

Protected Attributes

matrix_type m_A
 
SmartPtr< matrix_operator_typem_auxMat [AUX_ARRAY_SIZE]
 
bool m_bInit
 flag indicating, whether operator must be initialized More...
 
double m_dSchurUpdateWeight
 scaling factor for (additive) Schur complement update More...
 
UzawaSlicing< TGridFunctionm_slicing
 object for slicing routines More...
 
SmartPtr< ILinearIterator< vector_type > > m_spBackwardInverse
 iteration for forward system More...
 
SmartPtr< ILinearIterator< vector_type > > m_spForwardInverse
 iteration for forward system More...
 
SmartPtr< GridFunctionDebugWriter< TDomain, TAlgebra > > m_spGridFunctionDebugWriter
 
SmartPtr< ILinearIterator< vector_type > > m_SpSchurComplementInverse
 iteration for forward system More...
 
SmartPtr< AssembledLinearOperator< TAlgebra > > m_spSchurUpdateOp
 assembly for (additive) Schur complement update More...
 
SmartPtr< IDebugWriter< algebra_type > > m_spSliceDebugWriter [2]
 
std::vector< std::string > m_vSchurCmp
 vector of strings identifying components used for Schur complement More...
 
- Protected Attributes inherited from ug::IPreconditioner< TAlgebra >
bool m_bInit
 init flag indicating if init has been called More...
 
bool m_bOtherApproxOperator
 
SmartPtr< MatrixOperator< matrix_type, vector_type > > m_spApproxOperator
 underlying matrix based operator used for the preconditioner More...
 
SmartPtr< ILinearOperator< vector_type > > m_spDefectOperator
 underlying matrix based operator for calculation of defect More...
 
- Protected Attributes inherited from ug::ILinearIterator< TAlgebra::vector_type >
SmartPtr< IDamping< TAlgebra::vector_type, TAlgebra::vector_type > > m_spDamping
 the scaling More...
 
- Protected Attributes inherited from ug::DebugWritingObject< TAlgebra >
SmartPtr< IDebugWriter< algebra_type > > m_spDebugWriter
 Debug Writer. More...
 
- Protected Attributes inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type >
SmartPtr< IVectorDebugWriter< vector_type > > m_spVectorDebugWriter
 Debug Writer. More...
 

Static Private Attributes

static const bool UZAWA_CMP_DEFAULT = false
 
static const bool UZAWA_CMP_SCHUR = true
 

Detailed Description

template<typename TDomain, typename TAlgebra>
class ug::UzawaBase< TDomain, TAlgebra >

Base class for an Uzawa iteration

Member Typedef Documentation

◆ algebra_type

template<typename TDomain , typename TAlgebra >
typedef TAlgebra ug::UzawaBase< TDomain, TAlgebra >::algebra_type

Algebra types

◆ base_type

template<typename TDomain , typename TAlgebra >
typedef IPreconditioner<TAlgebra> ug::UzawaBase< TDomain, TAlgebra >::base_type
protected

◆ matrix_operator_type

template<typename TDomain , typename TAlgebra >
typedef MatrixOperator<matrix_type, vector_type> ug::UzawaBase< TDomain, TAlgebra >::matrix_operator_type

Algebra types

◆ matrix_type

template<typename TDomain , typename TAlgebra >
typedef TAlgebra::matrix_type ug::UzawaBase< TDomain, TAlgebra >::matrix_type

Algebra types

◆ TElement

template<typename TDomain , typename TAlgebra >
typedef TGridFunction::element_type ug::UzawaBase< TDomain, TAlgebra >::TElement

◆ TGridFunction

template<typename TDomain , typename TAlgebra >
typedef GridFunction<TDomain, TAlgebra> ug::UzawaBase< TDomain, TAlgebra >::TGridFunction

◆ TSide

template<typename TDomain , typename TAlgebra >
typedef TGridFunction::side_type ug::UzawaBase< TDomain, TAlgebra >::TSide

◆ vector_type

template<typename TDomain , typename TAlgebra >
typedef TAlgebra::vector_type ug::UzawaBase< TDomain, TAlgebra >::vector_type

Algebra types

Member Enumeration Documentation

◆ BLOCK

template<typename TDomain , typename TAlgebra >
enum ug::UzawaBase::BLOCK
protected
Enumerator
AUX_A11 
B12 
B21 
AUX_C22 
AUX_M22 
AUX_ARRAY_SIZE 

Constructor & Destructor Documentation

◆ UzawaBase() [1/2]

template<typename TDomain , typename TAlgebra >
ug::UzawaBase< TDomain, TAlgebra >::UzawaBase ( const std::vector< std::string > &  vSchurCmp)
inline

◆ UzawaBase() [2/2]

template<typename TDomain , typename TAlgebra >
ug::UzawaBase< TDomain, TAlgebra >::UzawaBase ( const char *  sSchurCmp)
inline

◆ ~UzawaBase()

template<typename TDomain , typename TAlgebra >
virtual ug::UzawaBase< TDomain, TAlgebra >::~UzawaBase ( )
inlinevirtual

Member Function Documentation

◆ clone()

template<typename TDomain , typename TAlgebra >
SmartPtr< ILinearIterator< typename TAlgebra::vector_type > > ug::UzawaBase< TDomain, TAlgebra >::clone
virtual

◆ create_slice_debug_writers()

template<typename TDomain , typename TAlgebra >
void ug::UzawaBase< TDomain, TAlgebra >::create_slice_debug_writers
protected

References make_sp().

◆ extract_schur_update()

◆ extract_sub_matrices()

template<typename TDomain , typename TAlgebra >
void ug::UzawaBase< TDomain, TAlgebra >::extract_sub_matrices ( const matrix_type K,
const TGridFunction c 
)

extract block matrix operators (called once)

References ug::SchurDebug, and UG_DLOG.

Referenced by ug::UzawaBase< TDomain, TAlgebra >::init_in_first_step().

◆ init()

template<typename TDomain , typename TAlgebra >
virtual bool ug::UzawaBase< TDomain, TAlgebra >::init ( SmartPtr< ILinearOperator< vector_type > >  J,
const vector_type u 
)
inlinevirtual

◆ init_block_iterations()

◆ init_block_operators()

◆ init_in_first_step()

◆ my_write_debug() [1/3]

template<typename TDomain , typename TAlgebra >
void ug::UzawaBase< TDomain, TAlgebra >::my_write_debug ( const matrix_type mat,
std::string  name,
const GridLevel glTo,
const GridLevel glFrom 
)
inlineprotected

◆ my_write_debug() [2/3]

template<typename TDomain , typename TAlgebra >
void ug::UzawaBase< TDomain, TAlgebra >::my_write_debug ( const matrix_type mat,
std::string  name,
const TGridFunction rTo,
const TGridFunction rFrom 
)
inlineprotected

◆ my_write_debug() [3/3]

template<typename TDomain , typename TAlgebra >
virtual void ug::UzawaBase< TDomain, TAlgebra >::my_write_debug ( const TGridFunction rGF,
std::string  name 
)
inlineprotectedvirtual

◆ name()

template<typename TDomain , typename TAlgebra >
virtual const char* ug::UzawaBase< TDomain, TAlgebra >::name ( ) const
inlineprotectedvirtual

◆ postprocess()

template<typename TDomain , typename TAlgebra >
bool ug::UzawaBase< TDomain, TAlgebra >::postprocess
protectedvirtual

cleans the operator

Implements ug::IPreconditioner< TAlgebra >.

◆ postprocess_block_iterations()

template<typename TDomain , typename TAlgebra >
void ug::UzawaBase< TDomain, TAlgebra >::postprocess_block_iterations ( )
inline

◆ preprocess()

template<typename TDomain , typename TAlgebra >
bool ug::UzawaBase< TDomain, TAlgebra >::preprocess ( SmartPtr< MatrixOperator< matrix_type, vector_type > >  pOp)
protectedvirtual

◆ reset_slice_debug_writers()

template<typename TDomain , typename TAlgebra >
template<int dim>
void ug::UzawaBase< TDomain, TAlgebra >::reset_slice_debug_writers
protected

References UG_LOG.

◆ set_backward_iter()

template<typename TDomain , typename TAlgebra >
void ug::UzawaBase< TDomain, TAlgebra >::set_backward_iter ( SmartPtr< ILinearIterator< vector_type > >  iter)
inline

◆ set_debug()

template<typename TDomain , typename TAlgebra >
void ug::UzawaBase< TDomain, TAlgebra >::set_debug ( SmartPtr< IDebugWriter< algebra_type > >  spDebugWriter)
protectedvirtual

set debug writer

Reimplemented from ug::DebugWritingObject< TAlgebra >.

References UG_LOG.

◆ set_forward_iter()

template<typename TDomain , typename TAlgebra >
void ug::UzawaBase< TDomain, TAlgebra >::set_forward_iter ( SmartPtr< ILinearIterator< vector_type > >  iter)
inline

◆ set_schur_iter()

template<typename TDomain , typename TAlgebra >
void ug::UzawaBase< TDomain, TAlgebra >::set_schur_iter ( SmartPtr< ILinearIterator< vector_type > >  iter)
inline

◆ set_schur_operator_update()

template<typename TDomain , typename TAlgebra >
void ug::UzawaBase< TDomain, TAlgebra >::set_schur_operator_update ( SmartPtr< AssembledLinearOperator< TAlgebra > >  spSchurUpdateOp,
double  theta = 0.0 
)
inline

◆ step()

template<typename TDomain , typename TAlgebra >
bool ug::UzawaBase< TDomain, TAlgebra >::step ( SmartPtr< MatrixOperator< matrix_type, vector_type > >  pOp,
vector_type c,
const vector_type d 
)
protectedvirtual

computes a new correction c = B*d

Single step of an (inexact) Uzawa iteration.

Implements ug::IPreconditioner< TAlgebra >.

References SmartPtr< T, FreePolicy >::get(), pcl::NumProcs(), ug::PST_UNIQUE, and UG_THROW.

◆ supports_parallel()

template<typename TDomain , typename TAlgebra >
virtual bool ug::UzawaBase< TDomain, TAlgebra >::supports_parallel ( ) const
inlinevirtual

Member Data Documentation

◆ dim

template<typename TDomain , typename TAlgebra >
const int ug::UzawaBase< TDomain, TAlgebra >::dim = TDomain::dim
static

World dimension.

◆ m_A

template<typename TDomain , typename TAlgebra >
matrix_type ug::UzawaBase< TDomain, TAlgebra >::m_A
protected

◆ m_auxMat

◆ m_bInit

template<typename TDomain , typename TAlgebra >
bool ug::UzawaBase< TDomain, TAlgebra >::m_bInit
protected

flag indicating, whether operator must be initialized

Referenced by ug::UzawaBase< TDomain, TAlgebra >::init().

◆ m_dSchurUpdateWeight

template<typename TDomain , typename TAlgebra >
double ug::UzawaBase< TDomain, TAlgebra >::m_dSchurUpdateWeight
protected

◆ m_slicing

template<typename TDomain , typename TAlgebra >
UzawaSlicing<TGridFunction> ug::UzawaBase< TDomain, TAlgebra >::m_slicing
protected

◆ m_spBackwardInverse

template<typename TDomain , typename TAlgebra >
SmartPtr<ILinearIterator<vector_type> > ug::UzawaBase< TDomain, TAlgebra >::m_spBackwardInverse
protected

◆ m_spForwardInverse

template<typename TDomain , typename TAlgebra >
SmartPtr<ILinearIterator<vector_type> > ug::UzawaBase< TDomain, TAlgebra >::m_spForwardInverse
protected

◆ m_spGridFunctionDebugWriter

template<typename TDomain , typename TAlgebra >
SmartPtr<GridFunctionDebugWriter<TDomain, TAlgebra> > ug::UzawaBase< TDomain, TAlgebra >::m_spGridFunctionDebugWriter
protected

◆ m_SpSchurComplementInverse

template<typename TDomain , typename TAlgebra >
SmartPtr<ILinearIterator<vector_type> > ug::UzawaBase< TDomain, TAlgebra >::m_SpSchurComplementInverse
protected

◆ m_spSchurUpdateOp

template<typename TDomain , typename TAlgebra >
SmartPtr<AssembledLinearOperator<TAlgebra> > ug::UzawaBase< TDomain, TAlgebra >::m_spSchurUpdateOp
protected

◆ m_spSliceDebugWriter

template<typename TDomain , typename TAlgebra >
SmartPtr<IDebugWriter<algebra_type> > ug::UzawaBase< TDomain, TAlgebra >::m_spSliceDebugWriter[2]
protected

◆ m_vSchurCmp

template<typename TDomain , typename TAlgebra >
std::vector<std::string> ug::UzawaBase< TDomain, TAlgebra >::m_vSchurCmp
protected

vector of strings identifying components used for Schur complement

Referenced by ug::UzawaBase< TDomain, TAlgebra >::init_in_first_step().

◆ UZAWA_CMP_DEFAULT

template<typename TDomain , typename TAlgebra >
const bool ug::UzawaBase< TDomain, TAlgebra >::UZAWA_CMP_DEFAULT = false
staticprivate

◆ UZAWA_CMP_SCHUR

template<typename TDomain , typename TAlgebra >
const bool ug::UzawaBase< TDomain, TAlgebra >::UZAWA_CMP_SCHUR = true
staticprivate

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