It solves the problem. Thank you very much! As a reference for the others:

sparsity_pattern.reinit(n_block_rows,n_block_cols);
sparsity_pattern.block(0,0).reinit(n_rows,n_cols,max_per_row);
//reinitialize the other blocks as well
sparsity_pattern.collect_sizes();
if(something happens)
sparsity_pattern.block(0,0).add(row_i,col_j); //these kind of operations
for the other blocks too.
sparsity_pattern.compress();
system_matrix.reinit(sparsity_pattern);

On Sat, Dec 15, 2018 at 6:27 PM Wolfgang Bangerth <[email protected]>
wrote:

> On 12/15/18 12:48 AM, Mustafa Aggul wrote:
> >
> > As their sparsity patterns look to be created correctly, system matrices
> > initialized with these sparsity patterns looks empty.
>
> I don't see you call the 'collect_sizes()' function of the block sparsity
> pattern. What happens if you add that?
>
> Best
>   WB
>
>
> --
> ------------------------------------------------------------------------
> Wolfgang Bangerth          email:                 [email protected]
>                             www: http://www.math.colostate.edu/~bangerth/
>
> --
> 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.
>


-- 
*Mustafa Ağgül*
*Department of Mathematics*
*Michigan Technological University*
*1400 Townsend Drive*
*Houghton, Michigan 49931-1295*
*Tel: 906-487-3135*

-- 
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