Chucui,

it is clearly suspicious that you don't use any of your ConstraintMatrix 
objects in the assembly loops.
Instead of calling 

system_matrix.add(local_dof_indices[i],
                             local_dof_indices[j],
                             local_matrix(i, j));

you should use 

constraints.distribute_local_to_global(local_matrix, local_dof_indices, 
system_matrix)

In case that you also have inhomogeneous boundary conditions, this is in 
general not sufficient
and you should asemble the respective right hand sides in the same loop you 
construct the matrix.
Then, call

constraints.distribute_local_to_global(cell_matrix, cell_rhs, 
local_dof_indices, system_matrix, system_rhs);

The error you are getting is only slightly related to using periodic 
boundary conditions. By saying

DoFTools::make_sparsity_pattern(dof_handler, dsp, constraints, false);

you are telling the sparsity pattern (or the matrix) that you will never 
write to the constraint entries.
This assumption is true, when you use 
constraints.distribute_local_to_global, but not when you copy the matrix 
entries manually 
(without taking the constraints into account at all).

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