solin / hermes

hp-FEM library
http://hpfem.org/
4 stars 2 forks source link

order of basis function and test function in assemble() may be wrong #47

Closed solin closed 14 years ago

solin commented 14 years ago

The weak forms have parameters Func u, Func v. The former should be the basis function (whose global index refers to a column in the global stiffness matrix) and the latter a test function (row in the stiffness matrix), This may be switched. For symmetric problems the results are the same, but for nonsymmetric problems this would yield wrong solutions. This needs to be checked both in H2D and in H3D (in the step-1 branch).

l-korous commented 14 years ago

Hello Pavel, do you mean just going throught the examples, checking the forms?

solin commented 14 years ago

No: One needs to go into the assembling procedure. There you will find two embedded loops over shape functions. They have global matrix column/row indices associated with them. One needs to look whether a basis function (comes first in the argument list of the weak form) is associated with a COLUMN (i.e. second) coordinate in the global matrix. Analogously, a test function (coming after the basis function in the argument list of weak forms) should be associated with a global index which means a ROW (first coordinate) in the global stiffness matrix. This needs to be checked both in H2D and H3D.

l-korous commented 14 years ago

It looks okay to me. Also I remember that a week or two ago, we were solving this with Milan that in H2D's assembling, it was the other way round at some places and Milan fixed that.

solin commented 14 years ago

Ok. This is so important that we should have one benchmark problem with exact solution for a nonsymmetric PDE. So far, if I am not mistaken, all benchmarks are with symmetric bilinear forms, so this error would not pop up. I will create a new issue for this.