ug4
Loading...
Searching...
No Matches
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.
 
typedef TAlgebra::vector_type domain_function_type
 Domain space.
 
typedef TAlgebra::matrix_type matrix_type
 Matrix type.
 
- Public Types inherited from ug::ILinearOperatorInverse< X, Y >
typedef Y codomain_function_type
 Range space.
 
typedef X domain_function_type
 Domain space.
 
- Public Types inherited from ug::ILinearIterator< X, Y >
typedef Y codomain_function_type
 Range space.
 
typedef X domain_function_type
 Domain space.
 
- Public Types inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type >
typedef TAlgebra::vector_type vector_type
 type of vector
 

Public Member Functions

SmartPtr< ILinearIterator< vector_type > > clone ()
 clone
 
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
 
void set_disable_preprocessing (bool bDisable)
 disable preprocessing (if underlying matrix has not changed)
 
virtual bool supports_parallel () const
 returns if parallel solving is supported
 
- 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
 
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
 
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
 
virtual ~IMatrixOperatorInverse ()
 virtual destructor
 
- Public Member Functions inherited from ug::ILinearOperatorInverse< X, Y >
virtual bool apply (Y &u, const X &f)=0
 applies inverse operator, i.e. returns u = A^{-1} f
 
virtual bool apply_return_defect (Y &u, X &f)=0
 applies inverse operator, i.e. returns u = A^{-1} f and returns defect d := f - A*u
 
virtual bool apply_update_defect (Y &u, X &f)
 compute new correction c = B*d and update defect d := d - A*c
 
virtual std::string config_string () const
 returns information about configuration parameters
 
SmartPtr< IConvergenceCheck< X > > convergence_check ()
 returns the convergence check
 
ConstSmartPtr< IConvergenceCheck< X > > convergence_check () const
 returns the convergence check
 
number defect () const
 returns the current defect
 
 ILinearOperatorInverse ()
 constructor setting convergence check to (100, 1e-12, 1e-12, true)
 
 ILinearOperatorInverse (SmartPtr< IConvergenceCheck< X > > spConvCheck)
 Default constructor.
 
virtual bool init (SmartPtr< ILinearOperator< Y, X > > J, const Y &u)
 initializes for the inverse for a linearized operator at linearization point u
 
virtual bool init (SmartPtr< ILinearOperator< Y, X > > L)
 initializes for the inverse for a linear operator
 
SmartPtr< ILinearOperator< Y, X > > linear_operator ()
 returns the current Operator this Inverse Operator is initialized for
 
number reduction () const
 returns the current relative reduction
 
void set_convergence_check (SmartPtr< IConvergenceCheck< X > > spConvCheck)
 set the convergence check
 
virtual int standard_offset () const
 returns the standard offset for output
 
int step () const
 returns the current number of steps
 
virtual ~ILinearOperatorInverse ()
 virtual destructor
 
- Public Member Functions inherited from ug::ILinearIterator< X, Y >
SmartPtr< IDamping< X, Y > > damping ()
 returns the scaling
 
 ILinearIterator ()
 constructor
 
 ILinearIterator (const ILinearIterator< X, Y > &parent)
 copy constructor
 
void set_damp (number factor)
 sets the damping to a constant factor
 
void set_damp (SmartPtr< IDamping< X, Y > > spScaling)
 sets a scaling for the correction
 
virtual ~ILinearIterator ()
 virtual destructor
 
- Public Member Functions inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type >
virtual void set_debug (SmartPtr< IVectorDebugWriter< vector_type > > spDebugWriter)
 set debug writer
 
SmartPtr< IVectorDebugWriter< vector_type > > vector_debug_writer ()
 returns the debug writer
 
ConstSmartPtr< IVectorDebugWriter< vector_type > > vector_debug_writer () const
 
bool vector_debug_writer_valid () const
 returns true if the debug writer is set
 
 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)
 
virtual ~VectorDebugWritingObject ()
 virtual destructor
 

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
 
virtual bool apply_return_defect (vector_type &u, vector_type &f)
 applies the inverse operator and updates the defect
 
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
 
void enter_vector_debug_writer_section (std::string secDir)
 enters a debugging section
 
void leave_vector_debug_writer_section ()
 leaves a debugging section
 
void print_debugger_message (const char *msg)
 prints a debugger message (listing all the sections)
 
void print_debugger_message (std::string msg)
 prints a debugger message (listing all the sections)
 
virtual void write_debug (const vector_type &vec, std::string name)
 writing debug output for a vector (if debug writer set)
 

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< X, Y >
SmartPtr< IConvergenceCheck< X > > m_spConvCheck
 smart pointer holding the convergence check
 
SmartPtr< ILinearOperator< Y, X > > m_spLinearOperator
 Operator that is inverted by this Inverse Operator.
 
- Protected Attributes inherited from ug::ILinearIterator< X, Y >
SmartPtr< IDamping< X, Y > > m_spDamping
 the scaling
 
- Protected Attributes inherited from ug::VectorDebugWritingObject< TAlgebra::vector_type >
SmartPtr< IVectorDebugWriter< vector_type > > m_spVectorDebugWriter
 Debug Writer.
 

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()

template<typename TAlgebra >
ug::IExternalSolver< TAlgebra >::IExternalSolver ( )
inline

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

clone

Reimplemented from ug::ILinearOperatorInverse< X, Y >.

References SPNULL, and UG_THROW.

◆ 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()

◆ 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< X, Y >.

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< X, Y >.

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: