> Is there a different between how DynamicSparsityPatterns and 
> BlockDynamicSparsityPatterns behave?

The latter is just an array of the former. Under the hood, every block 
is simply a DynamicSparsityPattern that can be initialized in the same 
way one always does.

> When you look at step-40, which is the first "MPI" step, the way the 
> sparsity pattern is made is 
> (
> |
> DynamicSparsityPattern 
> <>dsp(locally_relevant_dofs);
> DoFTools::make_sparsity_pattern 
> <>(dof_handler,dsp,constraints,false);
> SparsityTools::distribute_sparsity_pattern 
> <>(
>     dsp,
>     dof_handler.n_locally_owned_dofs_per_processor(),
>     mpi_communicator,
>     locally_relevant_dofs);
> |
> My understanding was that you were only making the sparsity pattern for 
> your own locally relevants dofs and the distribution step would make 
> sure that everything was coherent.


> However, the sparsity pattern is made 
> in a completely different way in step-32 
> ( and the 
> TrilinosWrappers:BlockSparsityPattern is used.

Correct. In step-40, we use PETSc, which has no sparsity pattern data 
structure of its own, and so we need to initialize the PETSc matrices 
with our own. In contrast, Trilinos has its own sparsity pattern 
classes, and so to initialize a Trilinos matrix, we need to build one of 
their sparsity patterns. (Or block patterns, as it may be -- which again 
is just an array of patterns.)

> Consequently, I was a bit confused as to the difference between these 
> approaches. It seems like the second one is necessary for Block matrices?
> I will take a deeper look into this, but I must say my understanding of 
> that point right now is relatively poor :(

The difference has nothing to do with blocks and everything with whether 
you base your linear algebra on PETSc or Trilinos.

Does this help?


Wolfgang Bangerth          email:       

The deal.II project is located at
For mailing list/forum options, see
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 view this discussion on the web visit

Reply via email to