On 12/4/21 10:14 AM, Kyle Schwiebert wrote:
Followed by only assembling the corresponding block and skipping all other
calculations with an if statement. I think the assembly function would still
work if system_matrix were not a block matrix, but I haven't been able to
discover an alternative for setting just one part of the matrix to zero.
Unfortunately, forming only part of the matrix is such a massive speedup that
it would be painful to have to drop that optimization. Could you suggest an
alternative?
Not really. You've discovered the limits of the separate use cases for block
and non-block matrices :-(
The best I can offer is to use DoFTools::extract_dofs() that correspond to a
specific vector component, and then loop through these DoFs with variables i,j
to set the entries (i,j) in the matrix to zero. That will ultimately not scale
well to large problems (it's quadratic in the number of variables that
correspond to this vector component), but it may be good enough for you. If
that's too inefficient, you can do the same on a cell-by-cell basis, based on
calling fe.component_to_system_index().
Best
W.
--
------------------------------------------------------------------------
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dealii/ab0b11e6-b562-9fe8-f53e-15cd45daa0ce%40colostate.edu.