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);
}
}
+template<typename MATRIX>
+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<nx-2 && back)
+ A.set(row, row+1, -1.);
+ }
+ }
+}
+
template<typename number>
void
FDMatrix::gnuplot_print(std::ostream& s, const Vector<number>& V) const
template void FDMatrix::nine_point(SparseMatrix<double>&, bool) const;
template void FDMatrix::nine_point(SparseMatrixEZ<double>&, bool) const;
template void FDMatrix::nine_point(SparseMatrix<float>&, bool) const;
+template void FDMatrix::upwind(SparseMatrix<long double>&, bool) const;
+template void FDMatrix::upwind(SparseMatrix<double>&, bool) const;
+template void FDMatrix::upwind(SparseMatrixEZ<double>&, bool) const;
+template void FDMatrix::upwind(SparseMatrix<float>&, bool) const;
template void FDMatrix::gnuplot_print(std::ostream& s, const Vector<long double>& V) const;
template void FDMatrix::gnuplot_print(std::ostream& s, const Vector<double>& V) const;
template void FDMatrix::gnuplot_print(std::ostream& s, const Vector<float>& V) const;
template <typename MATRIX>
void nine_point(MATRIX&, bool nonsymmetric = false) const;
+ /**
+ * Fill the matrix with values.
+ */
+ template <typename MATRIX>
+ void upwind(MATRIX&, bool back = false) const;
+
template <typename number>
void gnuplot_print(std::ostream&, const Vector<number>&) const;