[petsc-users] Another question about MatAXPY

Michael Povolotskyi mpovolot at purdue.edu
Mon Jun 29 13:28:36 CDT 2015


Thank you.
Is there a way to disable the squeeze?
Michael.

On 06/29/2015 01:58 PM, Barry Smith wrote:
>> On Jun 29, 2015, at 10:49 AM, Michael Povolotskyi <mpovolot at purdue.edu> wrote:
>>
>> Dear developers,
>> I have the following question:
>>
>> Imagine that I have two matrices A and B
>> Both are created using MatCreateSeqAIJ(MPI_Comm comm,PetscInt m,PetscInt n,PetscInt nz,const PetscInt nnz[],Mat *A)
>> with the same first 5 arguments.
>> In addition, for both matrices I call
>>   MatSetOption(A,MAT_NEW_NONZERO_ALLOCATION_ERR,PETSC_TRUE);
>>
>> After this I set some entries to both A and B matrices and assemble them.
>> Question: can I use MatAXPY with SAME_NONZERO_PATTERN argument?
>     Only if you KNOW that they have the exact same nonzero pattern. The MatAssembly "squeezes" out any "extra" space that was preallocated but was not actually used when calling MatSetValues() so even if two matrices have the same preallocation it doesn't mean they have the same nonzero pattern.
>
>    Barry
>
>
>> Thank you,
>> Michael.
>> -- 
>> Michael Povolotskyi, PhD
>> Research Assistant Professor
>> Network for Computational Nanotechnology
>> Hall for Discover and Learning Research, Room 441
>> West Lafayette, IN 47907
>> Phone (765) 4949396
>>



More information about the petsc-users mailing list