> 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 > (https://dealii.org/current/doxygen/deal.II/step_40.html#LaplaceProblemsetup_system) > | > DynamicSparsityPattern > <https://dealii.org/current/doxygen/deal.II/classDynamicSparsityPattern.html>dsp(locally_relevant_dofs); > DoFTools::make_sparsity_pattern > <https://dealii.org/current/doxygen/deal.II/group__constraints.html#gad93530ee35c780e9ef7bc5e4856039df>(dof_handler,dsp,constraints,false); > SparsityTools::distribute_sparsity_pattern > <https://dealii.org/current/doxygen/deal.II/namespaceSparsityTools.html#ae2c7bdbdb62642f60d60087e4cb6195f>( > 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. Correct. > However, the sparsity pattern is made > in a completely different way in step-32 > (https://dealii.org/current/doxygen/deal.II/step_32.html) 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? Cheers W. -- ------------------------------------------------------------------------ Wolfgang Bangerth email: bange...@colostate.edu 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 dealii+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/dealii/daeb73c6-cee8-8a0f-2abe-074c44d30a59%40colostate.edu.