ug4
ug::IExternalSolver< TAlgebra > Class Template Referenceabstract

#include <external_solvers.h>

+ Inheritance diagram for ug::IExternalSolver< TAlgebra >:

Public Types

typedef TAlgebra algebra_type
 
typedef TAlgebra::matrix_type matrix_type
 
typedef TAlgebra::vector_type vector_type
 
- Public Types inherited from ug::IMatrixOperatorInverse< TAlgebra::matrix_type, TAlgebra::vector_type >
typedef TAlgebra::vector_type codomain_function_type
 Range space. More...
 
typedef TAlgebra::vector_type domain_function_type
 Domain space. More...
 
typedef TAlgebra::matrix_type matrix_type
 Matrix type. More...
 
- Public Types inherited from ug::ILinearOperatorInverse< TAlgebra::vector_type, 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::ILinearIterator< X, Y >
typedef Y codomain_function_type
 Range space. More...
 
typedef X domain_function_type
 Domain space. 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< vector_type > > clone ()
 clone More...
 
template<int dim1, int dim2>
bool copy_pos (std::vector< MathVector< dim1 > > &dest, const std::vector< MathVector< dim2 > > &src)
 
virtual void double_init (const CPUAlgebra::matrix_type &mat)=0
 
virtual const char * double_name () const =0
 
void enable_consistent_interfaces (bool enable)
 
int get_dim ()
 
template<int dim>
const std::vector< MathVector< dim > > & get_positions ()
 
template<int Tdim>
bool get_positions (std::vector< MathVector< Tdim > > &coord)
 
bool get_positions3 (std::vector< MathVector< 3 > > &coord)
 
 IExternalSolver ()
 
virtual bool init (SmartPtr< MatrixOperator< matrix_type, vector_type > > Op)
 
void mat_preprocess (const matrix_type &A)
 
virtual const char * name () const
 returns the name of the operator inverse More...
 
void set_disable_preprocessing (bool bDisable)
 disable preprocessing (if underlying matrix has not changed) More...
 
virtual bool supports_parallel () const
 returns if parallel solving is supported More...
 
- Public Member Functions inherited from ug::IMatrixOperatorInverse< TAlgebra::matrix_type, TAlgebra::vector_type >
virtual bool init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > A)
 initializes this inverse operator for a linear operator More...
 
virtual bool init (SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > A, const TAlgebra::vector_type &u)
 initializes this inverse operator for a linear operator More...
 
virtual bool init (SmartPtr< MatrixOperator< TAlgebra::matrix_type, TAlgebra::vector_type, TAlgebra::vector_type > > A)=0
 initializes this inverse operator for a matrix-based operator More...
 
virtual ~IMatrixOperatorInverse ()
 virtual destructor More...
 
- Public Member Functions inherited from ug::ILinearOperatorInverse< TAlgebra::vector_type, TAlgebra::vector_type >
virtual bool apply_update_defect (TAlgebra::vector_type &u, TAlgebra::vector_type &f)
 
virtual std::string config_string () const
 returns information about configuration parameters More...
 
SmartPtr< IConvergenceCheck< TAlgebra::vector_type > > convergence_check ()
 returns the convergence check More...
 
ConstSmartPtr< IConvergenceCheck< TAlgebra::vector_type > > convergence_check () const
 returns the convergence check More...
 
number defect () const
 returns the current defect More...
 
 ILinearOperatorInverse ()
 constructor setting convergence check to (100, 1e-12, 1e-12, true) More...
 
 ILinearOperatorInverse (SmartPtr< IConvergenceCheck< TAlgebra::vector_type > > spConvCheck)
 Default constructor. More...
 
SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > linear_operator ()
 returns the current Operator this Inverse Operator is initialized for More...
 
number reduction () const
 returns the current relative reduction More...
 
void set_convergence_check (SmartPtr< IConvergenceCheck< TAlgebra::vector_type > > spConvCheck)
 set the convergence check More...
 
virtual int standard_offset () const
 returns the standard offset for output More...
 
int step () const
 returns the current number of steps More...
 
virtual ~ILinearOperatorInverse ()
 virtual destructor More...
 
- Public Member Functions inherited from ug::ILinearIterator< X, Y >
virtual bool apply (Y &c, const X &d)=0
 compute new correction c = B*d More...
 
virtual bool apply_update_defect (Y &c, X &d)=0
 compute new correction c = B*d and update defect d := d - A*c More...
 
SmartPtr< IDamping< X, Y > > damping ()
 returns the scaling More...
 
 ILinearIterator ()
 constructor More...
 
 ILinearIterator (const ILinearIterator< X, Y > &parent)
 copy constructor More...
 
virtual bool init (SmartPtr< ILinearOperator< Y, X > > J, const Y &u)=0
 initialize for operator J(u) and linearization point u More...
 
virtual bool init (SmartPtr< ILinearOperator< Y, X > > 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< X, Y > > spScaling)
 sets a scaling for the correction More...
 
virtual ~ILinearIterator ()
 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...
 

Public Attributes

SmartPtr< MatrixOperator< matrix_type, vector_type > > m_spOperator
 

Protected Member Functions

virtual bool apply (vector_type &c, const vector_type &d)
 applies the inverse operator, i.e. returns u = A^{-1} * f More...
 
virtual bool apply_return_defect (vector_type &u, vector_type &f)
 applies the inverse operator and updates the defect More...
 
virtual bool double_apply (CPUAlgebra::vector_type &c, const CPUAlgebra::vector_type &d)=0
 
void get_vector (CPUAlgebra::vector_type &v_scalar, const vector_type &v)
 
virtual bool postprocess ()
 
virtual bool preprocess (SmartPtr< MatrixOperator< matrix_type, vector_type > > pOp)
 
void set_vector (CPUAlgebra::vector_type &v_scalar, vector_type &v)
 
- 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

bool m_bDisablePreprocessing
 
size_t m_blockSize
 
bool m_bUseConsistentInterfaces
 
CPUAlgebra::vector_type m_c
 
CPUAlgebra::vector_type m_d
 
size_t m_size
 
- Protected Attributes inherited from ug::ILinearOperatorInverse< TAlgebra::vector_type, TAlgebra::vector_type >
SmartPtr< IConvergenceCheck< TAlgebra::vector_type > > m_spConvCheck
 smart pointer holding the convergence check More...
 
SmartPtr< ILinearOperator< TAlgebra::vector_type, TAlgebra::vector_type > > m_spLinearOperator
 Operator that is inverted by this Inverse Operator. More...
 
- Protected Attributes inherited from ug::ILinearIterator< X, Y >
SmartPtr< IDamping< X, Y > > m_spDamping
 the scaling More...
 
- Protected Attributes inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type >
SmartPtr< IVectorDebugWriter< vector_type > > m_spVectorDebugWriter
 Debug Writer. More...
 

Member Typedef Documentation

◆ algebra_type

template<typename TAlgebra >
typedef TAlgebra ug::IExternalSolver< TAlgebra >::algebra_type

◆ matrix_type

template<typename TAlgebra >
typedef TAlgebra::matrix_type ug::IExternalSolver< TAlgebra >::matrix_type

◆ vector_type

template<typename TAlgebra >
typedef TAlgebra::vector_type ug::IExternalSolver< TAlgebra >::vector_type

Constructor & Destructor Documentation

◆ IExternalSolver()

Member Function Documentation

◆ apply()

◆ apply_return_defect()

template<typename TAlgebra >
virtual bool ug::IExternalSolver< TAlgebra >::apply_return_defect ( vector_type u,
vector_type f 
)
inlineprotectedvirtual

applies the inverse operator and updates the defect

This method applies the inverse operator and updates the defect, i.e. returns u = A^{-1} * f and in f the last defect d:= f - A*u is returned.

Parameters
[out]usolution
[in]fright-hand side on entry, defect on exit
Returns
bool success flag

Implements ug::IMatrixOperatorInverse< TAlgebra::matrix_type, TAlgebra::vector_type >.

References ug::IExternalSolver< TAlgebra >::apply(), ug::IExternalSolver< TAlgebra >::m_spOperator, and UG_LOG.

◆ clone()

template<typename TAlgebra >
SmartPtr<ILinearIterator<vector_type> > ug::IExternalSolver< TAlgebra >::clone ( )
inlinevirtual

◆ copy_pos()

template<typename TAlgebra >
template<int dim1, int dim2>
bool ug::IExternalSolver< TAlgebra >::copy_pos ( std::vector< MathVector< dim1 > > &  dest,
const std::vector< MathVector< dim2 > > &  src 
)
inline

◆ double_apply()

template<typename TAlgebra >
virtual bool ug::IExternalSolver< TAlgebra >::double_apply ( CPUAlgebra::vector_type c,
const CPUAlgebra::vector_type d 
)
protectedpure virtual

◆ double_init()

template<typename TAlgebra >
virtual void ug::IExternalSolver< TAlgebra >::double_init ( const CPUAlgebra::matrix_type mat)
pure virtual

◆ double_name()

template<typename TAlgebra >
virtual const char* ug::IExternalSolver< TAlgebra >::double_name ( ) const
pure virtual

◆ enable_consistent_interfaces()

template<typename TAlgebra >
void ug::IExternalSolver< TAlgebra >::enable_consistent_interfaces ( bool  enable)
inline

◆ get_dim()

◆ get_positions() [1/2]

template<typename TAlgebra >
template<int dim>
const std::vector<MathVector<dim> >& ug::IExternalSolver< TAlgebra >::get_positions ( )
inline

◆ get_positions() [2/2]

template<typename TAlgebra >
template<int Tdim>
bool ug::IExternalSolver< TAlgebra >::get_positions ( std::vector< MathVector< Tdim > > &  coord)
inline

◆ get_positions3()

◆ get_vector()

template<typename TAlgebra >
void ug::IExternalSolver< TAlgebra >::get_vector ( CPUAlgebra::vector_type v_scalar,
const vector_type v 
)
inlineprotected

◆ init()

template<typename TAlgebra >
virtual bool ug::IExternalSolver< TAlgebra >::init ( SmartPtr< MatrixOperator< matrix_type, vector_type > >  Op)
inlinevirtual

◆ mat_preprocess()

◆ name()

template<typename TAlgebra >
virtual const char* ug::IExternalSolver< TAlgebra >::name ( ) const
inlinevirtual

returns the name of the operator inverse

This method returns the name of the inverse operator. This function is typically needed, when the inverse operator is used inside of another and some debug output should be printed

Returns
const char* name of inverse operator

Implements ug::ILinearOperatorInverse< TAlgebra::vector_type, TAlgebra::vector_type >.

References ug::IExternalSolver< TAlgebra >::double_name().

◆ postprocess()

template<typename TAlgebra >
virtual bool ug::IExternalSolver< TAlgebra >::postprocess ( )
inlineprotectedvirtual

◆ preprocess()

template<typename TAlgebra >
virtual bool ug::IExternalSolver< TAlgebra >::preprocess ( SmartPtr< MatrixOperator< matrix_type, vector_type > >  pOp)
inlineprotectedvirtual

◆ set_disable_preprocessing()

template<typename TAlgebra >
void ug::IExternalSolver< TAlgebra >::set_disable_preprocessing ( bool  bDisable)
inline

disable preprocessing (if underlying matrix has not changed)

References ug::IExternalSolver< TAlgebra >::m_bDisablePreprocessing.

◆ set_vector()

template<typename TAlgebra >
void ug::IExternalSolver< TAlgebra >::set_vector ( CPUAlgebra::vector_type v_scalar,
vector_type v 
)
inlineprotected

◆ supports_parallel()

template<typename TAlgebra >
virtual bool ug::IExternalSolver< TAlgebra >::supports_parallel ( ) const
inlinevirtual

returns if parallel solving is supported

Implements ug::ILinearOperatorInverse< TAlgebra::vector_type, TAlgebra::vector_type >.

Member Data Documentation

◆ m_bDisablePreprocessing

template<typename TAlgebra >
bool ug::IExternalSolver< TAlgebra >::m_bDisablePreprocessing
protected

◆ m_blockSize

◆ m_bUseConsistentInterfaces

◆ m_c

template<typename TAlgebra >
CPUAlgebra::vector_type ug::IExternalSolver< TAlgebra >::m_c
protected

◆ m_d

template<typename TAlgebra >
CPUAlgebra::vector_type ug::IExternalSolver< TAlgebra >::m_d
protected

◆ m_size

◆ m_spOperator


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