Solving step-22 using a direct solver UMFPACK

59 views
Skip to first unread message

Oded Yaakobi

unread,
Oct 12, 2017, 2:53:32 PM10/12/17
to deal.II User Group

Hello,

 

In step-22, I replaced the solve() function with the following function that is based on the solve() function of step-29, where a direct solver UMFPACK is used.

 

  template <int dim>

  void StokesProblem<dim>::solve ()

  {

      SparseDirectUMFPACK  A_direct;

      A_direct.initialize(system_matrix);

      A_direct.vmult (solution, system_rhs);

  }

 

To my surprise, the solution that was obtained using UMFPACK solver is very different than the one that was obtained by the original solver of step-22. Attached are screenshots of the velocity x-component of the original solution and the one that was obtained from the direct solver. 

 

Does anyone have any explanation to the discrepancy?

 

Thanks,

Oded   
step-22-original.jpg
step-22-direct_solver.jpg

Wolfgang Bangerth

unread,
Oct 12, 2017, 2:58:11 PM10/12/17
to dea...@googlegroups.com
On 10/12/2017 12:53 PM, Oded Yaakobi wrote:
> To my surprise, the solution that was obtained using UMFPACK solver is
> very different than the one that was obtained by the original solver of
> step-22. Attached are screenshots of the velocity x-component of the
> original solution and the one that was obtained from the direct solver.
>
> Does anyone have any explanation to the discrepancy?

At the very least you'll have to fix up hanging nodes via
hanging_node_constraints.distribute (solution);

How do things look after that?

But there is also the issue that in step-22, we put something into the
bottom right block of the matrix (namely, a pressure mass matrix) that
does not belong there. The solver in step-22 doesn't actually solve with
system_matrix, but only with the top left, top right, and bottom left
block. If you want to use a direct solver, you need to remove the code
that puts the mass matrix into that block.

Best
W.


--
------------------------------------------------------------------------
Wolfgang Bangerth email: bang...@colostate.edu
www: http://www.math.colostate.edu/~bangerth/

Oded Yaakobi

unread,
Oct 12, 2017, 3:25:33 PM10/12/17
to deal.II User Group
Dear Wolfgang,

Thank you for your quick answer.
I addressed the two points that you have mentioned and now the direct solver gives the same solution as the original one.

Best,
Oded

Reply all
Reply to author
Forward
0 new messages