[petsc-users] dynamic matrix type & dense matrix.

Jed Brown jed at jedbrown.org
Mon Aug 25 17:48:04 CDT 2014


Mark Adams <mfadams at lbl.gov> writes:

> MatSetup was the issues: this seems to work with and w/o -mat_type dense:
>
>            call MatCreate(solver%comm,solver%schur,ierr);
>            call
> MatSetSizes(solver%schur,nloc,nloc,PETSC_DECIDE,PETSC_DECIDE,ierr)
>            call MatSetType(solver%schur,MATAIJ,ierr)
>            call
> MatSeqAIJSetPreallocation(solver%schur,nloc,PETSC_NULL_INTEGER,ierr)
>            call
> MatMPIAIJSetPreallocation(solver%schur,nloc,PETSC_NULL_INTEGER,i,PETSC_NULL_INTEGER,ierr)
>            call MatSetFromOptions(solver%schur,ierr)

Changing the matrix type (-mat_type) after calling the preallocation
functions above will lose that preallocation information.  Better to
call MatSetFromOptions first.

>            call MatSetup(solver%schur,ierr)

How is A->preallocated being set?  MatSetValues checks for it and
MatSetType makes it false.  We need to find out why so that users don't
stumble over this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20140825/3438ff2f/attachment-0001.pgp>


More information about the petsc-users mailing list