33 #ifndef __H__UG__LIB_DISC__OPERATOR__LINEAR_OPERATOR__ILUT_SCALAR__
34 #define __H__UG__LIB_DISC__OPERATOR__LINEAR_OPERATOR__ILUT_SCALAR__
51 template <
typename TAlgebra>
134 std::vector<IndexLayout::Element> vIndex;
141 STATIC_ASSERT(matrix_type::rows_sorted, Matrix_has_to_have_sorted_rows);
159 convCheck->set_maximum_steps(100);
160 convCheck->set_minimum_defect(1e-50);
161 convCheck->set_reduction(1e-20);
162 convCheck->set_verbose(
false);
170 virtual const char*
name()
const {
return "ILUTScalar";}
184 for(
size_t i=0, k=0; i<v.size(); i++)
186 for(
size_t j=0; j<
GetSize(v[i]); j++)
193 for(
size_t i=0, k=0; i<v.size(); i++)
195 for(
size_t j=0; j<
GetSize(v[i]); j++)
267 std::stringstream ss ; ss <<
"ILUTScalar(threshold = " <<
m_eps <<
", sort = " << (
m_bSort?
"true":
"false") <<
")";
268 if(
m_eps == 0.0) ss <<
" = Sparse LU";
Definition: smart_pointer.h:108
TAlgebra::vector_type vector_type
type of vector
Definition: debug_writer.h:360
TAlgebra::matrix_type matrix_type
type of matrix
Definition: debug_writer.h:363
Definition: ilut_scalar.h:53
virtual std::string config_string() const
Definition: ilut_scalar.h:265
void set_sort(bool b)
Definition: ilut_scalar.h:119
bool solve(vector_type &c, const vector_type &d)
Definition: ilut_scalar.h:242
virtual bool supports_parallel() const
returns if parallel solving is supported
Definition: ilut_scalar.h:99
void set_info(bool info)
sets storage information output to true or false
Definition: ilut_scalar.h:108
void set_vector(CPUAlgebra::vector_type &v_scalar, vector_type &v)
Definition: ilut_scalar.h:191
CPUAlgebra::vector_type m_d
Definition: ilut_scalar.h:280
SmartPtr< MatrixOperator< CPUAlgebra::matrix_type, CPUAlgebra::vector_type > > mo
Definition: ilut_scalar.h:278
bool m_bSort
Definition: ilut_scalar.h:282
SmartPtr< ILUTPreconditioner< CPUAlgebra > > ilut
Definition: ilut_scalar.h:277
size_t m_size
Definition: ilut_scalar.h:283
TAlgebra algebra_type
Definition: ilut_scalar.h:56
virtual const char * name() const
returns the name of iterator
Definition: ilut_scalar.h:170
void set_show_progress(bool b)
sets the indication of the progress to true or false
Definition: ilut_scalar.h:114
virtual bool postprocess()
cleans the operator
Definition: ilut_scalar.h:274
double m_eps
Definition: ilut_scalar.h:281
IPreconditioner< TAlgebra >::matrix_operator_type matrix_operator_type
Matrix Operator type.
Definition: ilut_scalar.h:65
virtual bool preprocess(SmartPtr< MatrixOperator< matrix_type, vector_type > > pOp)
initializes the preconditioner
Definition: ilut_scalar.h:174
LinearSolver< CPUAlgebra::vector_type > linearSolver
Definition: ilut_scalar.h:279
bool apply_double(vector_type &c, const vector_type &d)
Definition: ilut_scalar.h:217
virtual ~ILUTScalarPreconditioner()
Definition: ilut_scalar.h:94
virtual bool step(SmartPtr< MatrixOperator< matrix_type, vector_type > > pOp, vector_type &c, const vector_type &d)
computes a new correction c = B*d
Definition: ilut_scalar.h:201
TAlgebra::vector_type vector_type
Definition: ilut_scalar.h:59
bool m_show_progress
Definition: ilut_scalar.h:282
void preprocess(const matrix_type &M)
Definition: ilut_scalar.h:125
bool m_info
Definition: ilut_scalar.h:282
TAlgebra::matrix_type matrix_type
Definition: ilut_scalar.h:62
void get_vector(CPUAlgebra::vector_type &v_scalar, const vector_type &v)
Definition: ilut_scalar.h:182
ILUTScalarPreconditioner(const ILUTScalarPreconditioner< TAlgebra > &parent)
clone constructor
Definition: ilut_scalar.h:78
matrix_type::value_type block_type
Definition: ilut_scalar.h:68
void set_threshold(number thresh)
sets threshold for incomplete LU factorisation (added 01122010ih)
Definition: ilut_scalar.h:102
IPreconditioner< TAlgebra > base_type
Definition: ilut_scalar.h:69
ILUTScalarPreconditioner(double eps=1e-6)
Definition: ilut_scalar.h:73
virtual SmartPtr< ILinearIterator< vector_type > > clone()
Clone.
Definition: ilut_scalar.h:88
CPUAlgebra::vector_type m_c
Definition: ilut_scalar.h:280
describes a linear iterator that is based on a matrix operator
Definition: preconditioner.h:103
linear solver using abstract preconditioner interface
Definition: linear_solver.h:57
Definition: matrix_operator.h:49
Wrapper for sequential matrices to handle them in parallel.
Definition: parallel_matrix.h:65
void set_storage_type(uint type)
sets the storage type
Definition: parallel_matrix.h:101
void set_layouts(ConstSmartPtr< AlgebraLayouts > layouts)
sets the algebra layouts
Definition: parallel_matrix.h:97
void set(number w, ParallelStorageType type)
set all entries to value and the storage type
Definition: parallel_vector_impl.h:223
void set_storage_type(uint type)
sets the storage type
Definition: parallel_vector.h:104
void set_layouts(ConstSmartPtr< AlgebraLayouts > layouts)
sets the algebra layouts
Definition: parallel_vector.h:100
Definition: convergence_check.h:179
void resize(size_t newSize, bool bCopyValues=true)
Definition: vector.h:109
void MatAddSlaveRowsToMasterRowOverlap0(TMatrix &mat)
Generates a set of unique global algebra ids.
Definition: parallelization_util.h:106
@ PST_CONSISTENT
Definition: parallel_storage_type.h:68
@ PST_UNIQUE
Definition: parallel_storage_type.h:70
@ PST_ADDITIVE
Definition: parallel_storage_type.h:69
size_t GetDoubleSparseFromBlockSparse(TDoubleSparse &A, const TSparseMatrix &S)
Definition: sparsematrix_util.h:1217
void SetDirichletRow(TSparseMatrix &A, size_t i, size_t alpha)
Definition: sparsematrix_util.h:796
void CollectUniqueElements(std::vector< typename TLayout::Element > &elemsOut, const TLayout &layout)
writes all elements in the interfaces into the resulting vector. avoids doubles.
Definition: pcl_layout_util.h:142
#define STATIC_ASSERT(expr, msg)
Definition: common.h:61
double number
Definition: types.h:124
double & BlockRef(T &vec, size_t i)
Definition: blocks.h:66
SmartPtr< AlgebraLayouts > CreateLocalAlgebraLayouts()
Definition: parallelization_util.cpp:936
size_t GetSize(const T &t)
SmartPtr< T, FreePolicy > make_sp(T *inst)
returns a SmartPtr for the passed raw pointer
Definition: smart_pointer.h:836
T value_type
Definition: sparsematrix_interface.h:2