33 #ifndef __H__UG__LIB_DISC__OPERATOR__LINEAR_OPERATOR__GAUSS_SEIDEL__
34 #define __H__UG__LIB_DISC__OPERATOR__LINEAR_OPERATOR__GAUSS_SEIDEL__
50 template<
typename TAlgebra>
108 virtual const char*
name()
const = 0;
124 m_oD.set_layouts(
m_A.layouts());
125 m_oC.set_layouts(
m_A.layouts());
126 m_oD.resize(
m_A.num_rows(),
false);
127 m_oC.resize(
m_A.num_rows(),
false);
139 std::vector<IndexLayout::Element> vIndex;
171 for(
size_t i = 0; i < d.size(); ++i)
173 for(
size_t i = d.size(); i <
m_oD.size(); ++i)
180 for(
size_t i = 0; i < c.size(); ++i)
253 std::vector<size_t> m_newIndex, m_oldIndex;
254 bool m_bSortIsIdentity;
270 template <
typename TAlgebra>
280 virtual const char*
name()
const {
return "Gauss-Seidel";}
315 template <
typename TAlgebra>
325 virtual const char*
name()
const {
return "Backward Gauss-Seidel";}
349 template <
typename TAlgebra>
359 virtual const char*
name()
const {
return "Symmetric Gauss-Seidel";}
Definition: smart_pointer.h:108
Gauss-Seidel preconditioner for the 'backward' ordering of the dofs.
Definition: gauss_seidel.h:317
virtual const char * name() const
returns the name of iterator
Definition: gauss_seidel.h:325
TAlgebra algebra_type
Definition: gauss_seidel.h:318
TAlgebra::matrix_type matrix_type
Definition: gauss_seidel.h:320
BackwardGaussSeidel()
constructor
Definition: gauss_seidel.h:328
GaussSeidelBase< TAlgebra > base_type
Definition: gauss_seidel.h:321
virtual SmartPtr< ILinearIterator< vector_type > > clone()
Clone.
Definition: gauss_seidel.h:336
BackwardGaussSeidel(const BackwardGaussSeidel< TAlgebra > &parent)
clone constructor
Definition: gauss_seidel.h:331
TAlgebra::vector_type vector_type
Definition: gauss_seidel.h:319
virtual void step(const matrix_type &A, vector_type &c, const vector_type &d, const number relax)
Definition: gauss_seidel.h:342
virtual void set_debug(SmartPtr< IDebugWriter< algebra_type > > spDebugWriter)
set debug writer
Definition: debug_writer.h:384
void write_debug(const matrix_type &mat, const char *filename)
write debug output for a matrix (if debug writer set)
Definition: debug_writer.h:399
TAlgebra::vector_type vector_type
type of vector
Definition: debug_writer.h:360
SmartPtr< IDebugWriter< algebra_type > > debug_writer()
returns the debug writer
Definition: debug_writer.h:391
TAlgebra::matrix_type matrix_type
type of matrix
Definition: debug_writer.h:363
Definition: gauss_seidel.h:52
IPreconditioner< TAlgebra > base_type
Base type.
Definition: gauss_seidel.h:67
void enable_overlap(bool enable)
Definition: gauss_seidel.h:101
void enable_consistent_interfaces(bool enable)
activates the new parallelization approach (disabled by default)
Definition: gauss_seidel.h:99
GaussSeidelBase(const GaussSeidelBase< TAlgebra > &parent)
clone constructor
Definition: gauss_seidel.h:86
void set_sor_relax(number relaxFactor)
set relaxation parameter to define a SOR-method
Definition: gauss_seidel.h:96
bool m_bConsistentInterfaces
Definition: gauss_seidel.h:245
number m_relax
relaxation parameter
Definition: gauss_seidel.h:239
bool m_useOverlap
Definition: gauss_seidel.h:246
TAlgebra::vector_type vector_type
Definition: gauss_seidel.h:58
void set_ordering_algorithm(SmartPtr< ordering_algo_type > ordering_algo)
sets an ordering algorithm
Definition: gauss_seidel.h:104
IPreconditioner< TAlgebra >::matrix_operator_type matrix_operator_type
Matrix Operator type.
Definition: gauss_seidel.h:64
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: gauss_seidel.h:163
GaussSeidelBase()
Definition: gauss_seidel.h:80
vector_type m_oD
for overlaps only
Definition: gauss_seidel.h:242
TAlgebra algebra_type
Definition: gauss_seidel.h:55
virtual const char * name() const =0
returns the name of iterator
SmartPtr< ordering_algo_type > m_spOrderingAlgo
for ordering algorithms
Definition: gauss_seidel.h:250
TAlgebra::matrix_type matrix_type
Definition: gauss_seidel.h:61
IOrderingAlgorithm< TAlgebra, ordering_container_type > ordering_algo_type
Definition: gauss_seidel.h:71
virtual bool postprocess()
cleans the operator
Definition: gauss_seidel.h:158
vector_type m_oC
Definition: gauss_seidel.h:243
virtual bool preprocess(SmartPtr< MatrixOperator< matrix_type, vector_type > > pOp)
initializes the preconditioner
Definition: gauss_seidel.h:114
matrix_type m_A
Definition: gauss_seidel.h:235
virtual void step(const matrix_type &A, vector_type &c, const vector_type &d, const number relax)=0
std::vector< size_t > ordering_container_type
Ordering type.
Definition: gauss_seidel.h:70
virtual bool supports_parallel() const
returns if parallel solving is supported
Definition: gauss_seidel.h:111
Gauss-Seidel preconditioner for the 'forward' ordering of the dofs.
Definition: gauss_seidel.h:272
GaussSeidel(const GaussSeidel< TAlgebra > &parent)
clone constructor
Definition: gauss_seidel.h:286
GaussSeidelBase< TAlgebra > base_type
Definition: gauss_seidel.h:276
TAlgebra::vector_type vector_type
Definition: gauss_seidel.h:274
virtual SmartPtr< ILinearIterator< vector_type > > clone()
Clone.
Definition: gauss_seidel.h:291
virtual const char * name() const
returns the name of iterator
Definition: gauss_seidel.h:280
TAlgebra algebra_type
Definition: gauss_seidel.h:273
GaussSeidel()
constructor
Definition: gauss_seidel.h:283
virtual void step(const matrix_type &A, vector_type &c, const vector_type &d, const number relax)
Definition: gauss_seidel.h:297
TAlgebra::matrix_type matrix_type
Definition: gauss_seidel.h:275
Definition: IOrderingAlgorithm.h:52
describes a linear iterator that is based on a matrix operator
Definition: preconditioner.h:103
Definition: matrix_operator.h:49
Definition: gauss_seidel.h:351
virtual SmartPtr< ILinearIterator< vector_type > > clone()
Clone.
Definition: gauss_seidel.h:370
SymmetricGaussSeidel(const SymmetricGaussSeidel< TAlgebra > &parent)
clone constructor
Definition: gauss_seidel.h:365
TAlgebra::matrix_type matrix_type
Definition: gauss_seidel.h:354
GaussSeidelBase< TAlgebra > base_type
Definition: gauss_seidel.h:355
SymmetricGaussSeidel()
constructor
Definition: gauss_seidel.h:362
virtual void step(const matrix_type &A, vector_type &c, const vector_type &d, const number relax)
Definition: gauss_seidel.h:376
virtual const char * name() const
returns the name of iterator
Definition: gauss_seidel.h:359
TAlgebra::vector_type vector_type
Definition: gauss_seidel.h:353
TAlgebra algebra_type
Definition: gauss_seidel.h:352
void SetLayoutValues(TVector *pVec, const IndexLayout &layout, typename TVector::value_type val)
sets the values of a vector to a given number only on the layout indices
Definition: parallelization_util.h:315
void MatMakeConsistentOverlap0(TMatrix &mat)
Generates a set of unique global algebra ids.
Definition: parallelization_util.h:126
@ PST_CONSISTENT
Definition: parallel_storage_type.h:68
@ PST_UNIQUE
Definition: parallel_storage_type.h:70
@ PST_ADDITIVE
Definition: parallel_storage_type.h:69
bool CheckDiagonalInvertible(const TSparseMatrix &A)
Definition: sparsematrix_util.h:1094
void gs_step_UR(const Matrix_type &A, Vector_type &c, const Vector_type &d, const number relaxFactor)
Performs a backward gauss-seidel-step, that is, solve on the upper right of A. Using gs_step_UR withi...
Definition: core_smoothers.h:150
void gs_step_LL(const Matrix_type &A, Vector_type &c, const Vector_type &d, const number relaxFactor)
Gauss-Seidel-Iterations.
Definition: core_smoothers.h:106
void SetDirichletRow(TSparseMatrix &A, size_t i, size_t alpha)
Definition: sparsematrix_util.h:796
void sgs_step(const Matrix_type &A, Vector_type &c, const Vector_type &d, const number relaxFactor)
Performs a symmetric gauss-seidel step. Using sgs_step within a preconditioner-scheme leads to the fa...
Definition: core_smoothers.h:189
int NumProcs()
returns the number of processes
Definition: pcl_base.cpp:91
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 THROW_IF_NOT_EQUAL_4(s1, s2, s3, s4)
Definition: error.h:183
#define THROW_IF_NOT_EQUAL_3(s1, s2, s3)
Definition: error.h:182
#define THROW_IF_NOT_EQUAL(s1, s2)
Definition: error.h:181
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
double number
Definition: types.h:124
bool MakeConsistent(const ParallelMatrix< matrix_type > &_mat, ParallelMatrix< matrix_type > &newMat)
Definition: parallel_matrix_overlap_impl.h:438
void CreateOverlap(TMatrix &matInOut)
Adds coefficients and connections to create an overlapping matrix.
Definition: matrix_overlap_impl.h:434
#define PROFILE_BEGIN_GROUP(name, groups)
Definition: profiler.h:255
SmartPtr< T, FreePolicy > make_sp(T *inst)
returns a SmartPtr for the passed raw pointer
Definition: smart_pointer.h:836