Pasha,
 

> I checked the the system residual assembly process. For a triangulation 
> with 28 cells, the dof index 17 is belong to cells 2, 5, 8 and 27. The 
> corresponding cell_rhs values for this index are,
>
>
> cell        cell_rhs value
>
> 2            2.88462e+00
>
> 5            2.88462e+00
>
> 8           -2.88462e+00
>
> 27         -1.44231e+00
>
>
> This dof is not constrained. When the following assembly method is used:
>
>
> *for* (*unsigned* *int* i = 0; i < dofs_per_cell; ++i)
>
> system_rhs(data.local_dof_indices[i]) += data.cell_rhs(i);
>
>
> the system_rhs(17) = 1.4423076, however, using the following method,
>
>
> constraints_update.distribute_local_to_global(data.cell_rhs,
>
> data.local_dof_indices, system_rhs);
>
>
>
> the system_rhs(17) = -1.33e-15. This is the source of the problem because 
> I have used the second method in the previous code and the first one 
> (similar to step-44) in the new code. I cant understand why the results are 
> different.
>
This looks like DoF 17 is constrained, possibly by hanging node 
constraints. Can you recheck the constraints stored in `constraints_update` 
via `constraints_update.print(std::cout)`?
In any case, you need to use a ConstraintMatrix for assembling the 
right-hand side either via calling `distribute_local_to_global` on each 
cell or calling `condense` after the loop over all cells. After solving you 
would call `constraints.distribute`.
Otherwise, you would not take the hanging node constraints into account.
Are you missing the call to `constraints.condense(system_matrix, 
system_rhs);` in the first approach?

Best,
Daniel

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to