From d39322e738b269fe9c23adfe876955f03df2a89b Mon Sep 17 00:00:00 2001 From: guido Date: Fri, 30 May 2003 19:19:16 +0000 Subject: [PATCH] test for psor added and disabled git-svn-id: https://svn.dealii.org/trunk@7691 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/lac/solver.cc | 8 +------- tests/lac/testmatrix.cc | 25 +++++++++++++++++++++++++ tests/lac/testmatrix.h | 6 ++++++ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/tests/lac/solver.cc b/tests/lac/solver.cc index 0dd3b17fab..dab73b01c2 100644 --- a/tests/lac/solver.cc +++ b/tests/lac/solver.cc @@ -190,28 +190,22 @@ int main() deallog.push("psor"); - if(false) - { - check_Tsolve(rich,A,u,f,prec_psor); check_solve(rich,A,u,f,prec_psor); check_solve(cg,A,u,f,prec_psor); check_solve(bicgstab,A,u,f,prec_psor); check_solve(gmres,A,u,f,prec_psor); check_solve(gmresright,A,u,f,prec_psor); - } deallog.pop(); } catch (std::exception& e) { - std::cerr << e.what() << std::endl; + std::cerr << "Exception: " << e.what() << std::endl; } }; // Solve advection problem - - // Disabled for the time being for (unsigned int size=4; size <= 3; size *= 3) { unsigned int dim = (size-1)*(size-1); diff --git a/tests/lac/testmatrix.cc b/tests/lac/testmatrix.cc index c6ee0f897a..ad5ff5f51c 100644 --- a/tests/lac/testmatrix.cc +++ b/tests/lac/testmatrix.cc @@ -207,6 +207,27 @@ FDMatrix::five_point(MATRIX& A, bool nonsymmetric) const } } +template +void +FDMatrix::upwind(MATRIX& A, bool back) const +{ + for(unsigned int i=0;i<=ny-2;i++) + { + for(unsigned int j=0;j<=nx-2; j++) + { + // Number of the row to be entered + unsigned int row = j+(nx-1)*i; + A.set(row, row, 3.); + + if (j>0 && !back) + A.set(row, row-1, -1.); + + if (j void FDMatrix::gnuplot_print(std::ostream& s, const Vector& V) const @@ -234,6 +255,10 @@ template void FDMatrix::nine_point(SparseMatrix&, bool) const; template void FDMatrix::nine_point(SparseMatrix&, bool) const; template void FDMatrix::nine_point(SparseMatrixEZ&, bool) const; template void FDMatrix::nine_point(SparseMatrix&, bool) const; +template void FDMatrix::upwind(SparseMatrix&, bool) const; +template void FDMatrix::upwind(SparseMatrix&, bool) const; +template void FDMatrix::upwind(SparseMatrixEZ&, bool) const; +template void FDMatrix::upwind(SparseMatrix&, bool) const; template void FDMatrix::gnuplot_print(std::ostream& s, const Vector& V) const; template void FDMatrix::gnuplot_print(std::ostream& s, const Vector& V) const; template void FDMatrix::gnuplot_print(std::ostream& s, const Vector& V) const; diff --git a/tests/lac/testmatrix.h b/tests/lac/testmatrix.h index 5dacd3f07b..0a42e96271 100644 --- a/tests/lac/testmatrix.h +++ b/tests/lac/testmatrix.h @@ -41,6 +41,12 @@ class FDMatrix template void nine_point(MATRIX&, bool nonsymmetric = false) const; + /** + * Fill the matrix with values. + */ + template + void upwind(MATRIX&, bool back = false) const; + template void gnuplot_print(std::ostream&, const Vector&) const; -- 2.39.5