Bruno,
> 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.
> <
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.
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