[petsc-users] Error in using MatTranspose

Eda Oktay eda.oktay at metu.edu.tr
Thu Feb 28 02:14:43 CST 2019


Hello,

I am trying to use MatTranspose function as in below (last row) but I get
an error like this:
[0]PETSC ERROR: --------------------- Error Message
--------------------------------------------------------------
[0]PETSC ERROR: Object is in wrong state
[0]PETSC ERROR: Not for unassembled matrix
[0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for
trouble shooting.
[0]PETSC ERROR: Petsc Release Version 3.10.3, Dec, 18, 2018
[0]PETSC ERROR: ./FINAL on a arch-linux2-c-debug named
localhost.localdomain by edaoktay Wed Feb 27 16:36:34 2019
[0]PETSC ERROR: Configure options --with-cc=gcc --with-cxx=g++
--with-fc=gfortran --with-cxx-dialect=C++11 --download-openblas
--download-metis --download-parmetis --download-superlu_dist
--download-slepc --download-mpich
[0]PETSC ERROR: #1 MatTranspose() line 4821 in
/home/edaoktay/petsc-3.10.3/src/mat/interface/matrix.c
[0]PETSC ERROR: #2 main() line 185 in
/home/edaoktay/petsc-3.10.3/arch-linux2-c-debug/share/slepc/examples/src/eda/FINAL.c
[0]PETSC ERROR: PETSc Option Table entries:
[0]PETSC ERROR: -f
/home/edaoktay/petsc-3.10.3/share/petsc/datafiles/matrices/small
[0]PETSC ERROR: -unweighted
[0]PETSC ERROR: ----------------End of Error Message -------send entire
error message to petsc-maint at mcs.anl.gov----------

I understood that error states that there is an unassembled matrix but
there is not, as it can be seen below, I defined NSymmA and I want to get
NSymmAtr.

This not the first time I use MatTranspose but I only get this error here.
What can be the reason?

Best regards,

Eda


ierr = MatGetOwnershipRange(L,&mm,&nn);CHKERRQ(ierr);


        ierr =
MatDuplicate(A,MAT_DO_NOT_COPY_VALUES,&NSymmA);CHKERRQ(ierr);
        for(rw = mm; rw<nn; ++rw){

            ierr = MatGetRow(L,rw,&ncols,&cols,&vals);CHKERRQ(ierr);

            s = sizeof(vals);

            ierr = PetscMalloc1(s,&arr);CHKERRQ(ierr);

            for(j=0;j<s;++j){

                arr[j]=-1;
            }
            ierr =
MatSetValues(NSymmA,1,&rw,ncols,cols,arr,INSERT_VALUES);CHKERRQ(ierr);
            ierr = MatRestoreRow(L,rw,&ncols,&cols,&vals);CHKERRQ(ierr);
        }

        ierr =
MatTranspose(NSymmA,MAT_INITIAL_MATRIX,&NSymmAtr);CHKERRQ(ierr);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20190228/74500a58/attachment.html>


More information about the petsc-users mailing list