>   SparseDirectUMFPACK solver;
>   solver.initialize(this->matrix);
>   solver.solve(RHS_to_SOL);
>
> here this->matrix is a BlockSparseMatrix<double> type; but when I
> calculate the residuals via multiplying the coefficient matrix by the
> solution vector and detracting it from rhs vector the resulted vector
> has some unreasonable high values; but all the others are of the order
> 10^(-15)

You mean when you do something like

  Vector<double> solution (rhs.size());
  solution = rhs;
  SparseDirectUMFPACK solver;
  solver.solve (this->matrix, solution);

  Vector<double> tmp (rhs.size());
  this->matrix.vmult (tmp, solution);
  tmp -= rhs;

then tmp has large entries? That would mean that UMFPACK produces wrong 
solutions, since it is supposed to just solve the linear system -- whether 
the linear system is correct as is or not...


> Hence the problem is due to the coefficient matrix; I checked the
> coefficient matrix and got that the corresponding item for the Dirichlet
> boundary condition i.e. say u7=10 is not 1 (row=7 and col=7) as it is
> supposed to be; hence again this is a proof that the coefficient matrix
> is not the one which should be used for calculating the residuals.

That's not completely true. If you have u7=10, then all that needs to 
happen is that  f7/a77 = 10. In general, we try to choose the entry a77 so 
that it has roughly the same order of magnitude as other diagonal entries 
to ensure that round-off is not a problem -- otherwise, if, for example, 
you solve a problem where all matrix entries (except those that correspond 
to boundary nodes) were 10^{-20}, then solvers like CG would conclude that 
the problem is solved to a reasonable accuracy if only the boundary values 
are solved correctly.


> The question is; am I using the true matrix for calculating the
> residual? Do I need to multiply it by a constraint like matrix (to
> account for the boundary conditions) and then calculate the residuals?

You need to use the same matrix with which UMFPACK solved to see if UMFPACK 
computed the correct solution. If you have verified that UMFPACK does the 
right thing and the solution is still wrong, then one needs to check that 
the matrix is assembled correctly, of course.

Best
 W.

-------------------------------------------------------------------------
Wolfgang Bangerth                email:            [email protected]
                                 www: http://www.math.tamu.edu/~bangerth/

_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to