Comment 14 for bug 927539

Revision history for this message
Cian Wilson (cwilson) wrote : Re: [Bug 927539] Re: Missing diagonals after subdomain assembly

On 07/23/2012 07:00 AM, Garth Wells wrote:
> On 22 July 2012 01:14, Cian Wilson <email address hidden> wrote:
>> Afraid this problem has arisen for me again. My previous solution depended on being able to not finalize the tensor then add the zeros in after the first assembly but before collapsing the sparsity.
> Did you try using the setting the assembler argument
>
> bool finalize_tensor
>
> to false? This would only work for PETSc anyway at the moment.
Yes, this was essentially my previous strategy. Assemble with
finalize_tensor set to false then add zeros on the diagonal then
finalize the tensor myself. This now throws an error when adding the
zeros because they're not in the preallocated sparsity.

>> The addition of:
>> MatSetOption(*A, MAT_NEW_NONZERO_ALLOCATION_ERR, PETSC_TRUE);
>> in PetscMatrix::init in r6784-5 has meant that this is no longer possible.
>>
> I set this since it has become the default in PETSc 3.3. It also helps
> catch issues that can have a major impact on efficiency.
I agree with setting it. Also the changes to including periodic bcs in
the sparsity are great as I'd previously written off periodic bcs with
petsc > 3.3.

>
>> I've had another go at implementing a fix (see lp:~ldeo-
>> magma/dolfin/diagonalentries ) that includes the diagonal in the
>> sparsity and sets zeros in the matrix to ensure they're not collapsed
>> out. It's controlled by the parameter keep_diagonal, which can be
>> passed into any assembly routine (that calls init_global_tensor) but
>> defaults to the current behaviour (false). This is all based on the
>> changes to incorporate periodic bcs into the sparsity.
>>
> Thanks. I'll take a look shortly.
Many thanks,
Cian

>
> Garth
>
>> Cheers,
>> Cian
>>
>> ** Branch unlinked: lp:~ldeo-magma/dolfin/diag
>>
>> ** Branch linked: lp:~ldeo-magma/dolfin/diagonalentries
>>
>> --
>> You received this bug notification because you are a member of DOLFIN
>> Core Team, which is subscribed to DOLFIN.
>> https://bugs.launchpad.net/bugs/927539
>>
>> Title:
>> Missing diagonals after subdomain assembly
>>
>> To manage notifications about this bug go to:
>> https://bugs.launchpad.net/dolfin/+bug/927539/+subscriptions