Dear all, 

we just discovered a tiny bug in the version of interpolate_boundary_values 
that uses constraint matrices. This bug is reproducible by setting non zero 
dirichlet boundary conditions in step 45. 

When calling the above function, what is done is the following:

1. find out which ones are the boundary dofs
2. for each i:

interpolate the function on support point i;
 
constraints.add_line(i);
constraints.set_inhomogeneity(i, bv);

Now this is perfect if line(i) does not contain already another constraint. If 
this is not the case, the above does not work as expected, because the 
inhomogeneity is *added* to the already existing constraints.

To give an example, suppose i have node 1 and 2 on which I applied a periodic 
boundary condition, by setting

constraints.add_line(1);
constraints.add_entry(1,2, 1.0);

And suppose that these nodes are on two corners of a square, on a side where I 
want to also have dirichlet bc. When calling the function above, say with a 
constant function equal to 3, I'll end up with the following entries:

x_1 = x_2 + 3;
x_2 = 3;

which gives me x_1 = 6.

Now... in the library we cannot remove entries from the constraints (as far as 
I know)... a possible solution would be to add a default argument to add_line, 
for example, reset_existing_entries = false, which would behave as normal in 
the default case (false), and which would remove the constraints from the given 
line if set to true, so that we could use this method in 
interpolate_boundary_values, by doing

constraints.add_line(i, true);
constraints.set_inhomogeneity(i, bv);

Any thoughts? 

L. 

--
Luca Heltai <[email protected]>
http://people.sissa.it/~heltai/
Scuola Internazionale Superiore di Studi Avanzati
Phone:  +39 040 3787 449, Office: 732
--
There are no answers, only cross references

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

Reply via email to