[petsc-users] MatMatMult Question

Nachiket Gokhale gokhalen at gmail.com
Mon Dec 17 15:54:44 CST 2012


I am trying to multiply the transpose of a matrix with another matrix using
matmatmult.  The transpose operator is created using MatTranspose. I get
the error at the end of the email. Is this an error saying that cols of
matrix 1 and not equal to the rows of matrix 2? I checked and the rows and
columns seem to allow matrix multiplication: Left = (54,1760),
Right=(1760,54).  The snipped of the code which produces this is

  ierr =
MatMatMult(*KFullMat,ProjR,MAT_INITIAL_MATRIX,PETSC_DEFAULT,&TempMat);CHKERRQ(ierr);
  ierr = MatGetSize(ProjLT,&nrowl,&ncoll); CHKERRQ(ierr);
  ierr = MatGetSize(TempMat,&nrowr,&ncolr); CHKERRQ(ierr);
  ierr = PetscPrintf(PETSC_COMM_WORLD,"Left = (%d,%d),
Right=(%d,%d)\n",nrowl,ncoll,nrowr,ncolr); CHKERRQ(ierr);
  ierr =
MatMatMult(ProjLT,TempMat,MAT_INITIAL_MATRIX,PETSC_DEFAULT,&KProj);
CHKERRQ(ierr);
  ierr = MatDestroy(&TempMat);

Thanks,

-Nachiket

[0]PETSC ERROR: --------------------- Error Message
------------------------------------
[0]PETSC ERROR: Arguments are incompatible!
[0]PETSC ERROR: MatMatMult requires A, seqdense, to be compatible with B,
seqdense!
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: Petsc Release Version 3.3.0, Patch 2, Fri Jul 13 15:42:00
CDT 2012
[0]PETSC ERROR: See docs/changes/index.html for recent updates.
[0]PETSC ERROR: See docs/faq.html for hints about trouble shooting.
[0]PETSC ERROR: See docs/index.html for manual pages.
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: /home/gokhale/WAIGEN/GDEB-WAIGEN2012/bin/waigen on a
linux-gcc named asd1.wai.com by gokhale Mon Dec 17 16:58:13 2012
[0]PETSC ERROR: Libraries linked from
/opt/petsc/petsc-3.3-p2/linux-gcc-g++-mpich-mumps-complex-debug/lib
[0]PETSC ERROR: Configure run at Mon Oct 29 18:41:24 2012
[0]PETSC ERROR: Configure options --with-x=0 --with-mpi=1
--download-mpich=yes --with-x11=0 --with-debugging=1 --with-clanguage=C++
--with-shared-libraries=1 --download-mumps=yes --download-f-blas-lapack=1
--download-parmetis=1 --download-metis --download-scalapack=1
--download-blacs=1 --with-cmake=/usr/bin/cmake28 --with-scalar-type=complex
[0]PETSC ERROR:
------------------------------------------------------------------------
[0]PETSC ERROR: MatMatMult() line 8601 in
/opt/petsc/petsc-3.3-p2/src/mat/interface/matrix.c
[0]PETSC ERROR: waigensolvprojforc() line 33 in
src/examples/waigensolvprojforc.c
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20121217/0f7ce6d6/attachment.html>


More information about the petsc-users mailing list