Hey fname? :-)

does the following code do what you want?

CompressedSparsityPattern c_emptysparsity(dof_handler.n_dofs());
sparsity_pattern.block(i,j).copy_from(c_emptysparsity);


--
Timo Heister
http://num.math.uni-goettingen.de/~heister



On Tue, Sep 21, 2010 at 10:32 PM, fname lname <[email protected]> wrote:
> Hello everyone
>
> I'm trying to make a block sparsity pattern for an uncoupled system, only
> the blocks in the diagonal have nonzero elements.
>
> I can't find how to make a "null" sparsity block.
>
> ----------------------
>
> // I defined the spasity pattern of the nonzero blocks
>
>  CompressedSparsityPattern c_sparsity(dof_handler.n_dofs());
>
>  DoFTools::make_sparsity_pattern (dof_handler, c_sparsity);
>
> // Then the block sparsity pattern
>
>  sparsity_pattern.reinit(nd,nd);
>
> // then each block
>
>   for (int i=0; i<nd; ++i) {
>     for (int j=0; j<nd; ++j) {
>       if (i==j) {
>     sparsity_pattern.block(i,j).copy_from(c_sparsity);
>       } else {
>
> sparsity_pattern.block(i,j).reinit(dof_handler.n_dofs(),dof_handler.n_dofs(),0);
> // here I should define a "null" block
>       }
>     }
>   }
>
> _______________________________________________
> dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii
>
>
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii

Reply via email to