1
$\begingroup$

I am trying to solve a linear elasticity model using finite element discretization in a rectangle domain [0,1]x[0,1]. For the solution of the the linear system $Ku=F$ I am using the CG algorithm. However, I have noticed some weird behaviour of the algorithm. For small grids (e.g 2x2 or 3x3 or 2x1 ...) the algorithm fails and doesn't converge while if the grid becomes larger(10x10 or 25x25 ...) the algorithm converges and the results seem reasonable.My first thought was If the application of homogeneous BC leads to an ill-conditioned matrix ,since I zero the columns and rows accosiated with BC and put 1 in diagonals, but this make no sense if the algorithm converges for some grids right? Any idea why is this happening?

$\endgroup$
4
  • 3
    $\begingroup$ Can you try with a direct solver? Does it work then? $\endgroup$ – knl Oct 12 '20 at 8:24
  • $\begingroup$ I tried only with CG.The funny thing is for grids larger than 3x3 converges and the results are the same as the ones if I impement my model in abaqus $\endgroup$ – spyros Oct 12 '20 at 13:05
  • $\begingroup$ Can you print out a numerical example of your small matrices? $\endgroup$ – Charlie S Oct 12 '20 at 15:44
  • $\begingroup$ @knl makes the right suggestion: Try with a direct solver. The point is that you don't know whether the matrix is wrong or the CG implementation is wrong. If you use a direct solver, you can eliminate one of these two causes. $\endgroup$ – Wolfgang Bangerth Oct 12 '20 at 23:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.