I already had a look on the constraints and they seemed reasonable. I
now also tried to check the matrix itself, but need some help here.
In order to check it, I looked up the used test functions using
LagrangeEquidistant::generate_complete_basis(1) and initializing a
TensorProductPolyomials object.
Printing the polynomials I got -1 x^1 1 x^0 and 1 x^1 0 x^0. Outputting
the indices of the TensorProductPolynomials made me assume that the
following test functions are used:
0 (-x+1)(-y+1)
1 x(-y+1)
2 (-x+1)y
3 xy
I then tried to reproduce the matrix of my actual problem and failed. So
I started integrating just one single test function and it was just
fine, same results using deal.II and doing it by hand.
But as soon as I compute a product of two functions I get differing
results. E.g. integrating the product 0*0 using deal.II on my mesh
results in 3.90625e-08, integrating by hand gives 6.9444444e-08.
Where the JxW value is the same and equals 6.25e-07.
I'm pretty sure deal.II is working, so somehow I'm doing some things
wrong here. I would be very glad if you can help me out.
Thanks.
Timo
Wolfgang Bangerth wrote:
thanks for your reply. I also did think that the order might be a
problem, so I applied the periodic boundaries first as I wanted the
Dirichlet conditions to "win".
I now tried also your decision using two constraints and merging them
and set the dirichlet ones as the winner. But didn't hasn't had any
effect. I got the same matrix and rhs and the same result.
I than tried it also the other way round, which again gave the same
behavior.
So, something else must be the problem. In addition I found out the
number of dofs common to both constraints and explicitly skipped setting
periodic constraints to them. Still the same...
Btw, this behavior only occurs for one of the two components.
The way to debug these kinds of problems is to use, say, a 2x2 mesh for which
you can compute the system matrix (without constraints) by hand, print it to
the screen and verify that it's correct. Then also print to screen all the
constraints in your ConstraintMatrix and see whether they make any sense.
I'm fairly confident that the ConstraintMatrix does the right thing if the
constraints stored in it are correct, so if your solution is wrong then it's
either the assembly of the matrix or rhs, or that the constraints are filled
the wrong way. You should be able to find out which it is for a small enough
problem.
Best
W.
-------------------------------------------------------------------------
Wolfgang Bangerth email: [email protected]
www: http://www.math.tamu.edu/~bangerth/
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii