[petsc-users] several MPIDense functions

Yujie recrusader at gmail.com
Thu May 20 15:32:06 CDT 2010


Dear PETSc developers,

Currently, I am using PETSc-3.0.0-p8 version for my application. There
are not MatCojugate, MatRealPart, MatImaginaryPart for SEQ and
MPIDense.

Since some revisions in 3.1 version result in large changes in my
codes, I don't want to update PETSc to 3.1 version currently.

Thank you very much for your previous help. I have added relevant
codes for SEQDense. Now, I use similar method to add corresponding
functions for MPIDense.
However, when I compiled the codes, I get the following errors:
"
libfast in: /home/yujie/codes/petsc-3.0.0-p8_complex_dbg/src/mat/impls/dense/seq/ftn-custom
libfast in: /home/yujie/codes/petsc-3.0.0-p8_complex_dbg/src/mat/impls/dense/mpi
mpidense.c:1580: error: invalid conversion from 'PetscErrorCode
(*)(_p_Mat*)' to 'PetscErrorCode (*)(_p_Mat*, _p_Mat*, _p_Mat*)'
mpidense.c:1580: error: invalid conversion from 'PetscErrorCode
(*)(_p_Mat*)' to 'PetscErrorCode (*)(_p_Mat*, PetscInt, const
PetscScalar*)'
/usr/bin/ar: mpidense.o: No such file or directory
libfast in: /home/yujie/codes/petsc-3.0.0-p8_complex_dbg/src/mat/impls/dense/mpi/ftn-auto

"
Could you give me some help? Thanks a lot.

The codes are as following,
for "static struct _MatOps MatOps_Values"
I add
"
/*95*/ 0,
       0,
       0,
       0,
       0,
/*100*/0,
       0,
       0,
       MatConjugate_MPIDense, //by Yujie
       0,
/*105*/0,
       MatRealPart_MPIDense,  //by Yujie
       MatImaginaryPart_MPIDense,
       0,
       0,
       0
}; //here is Line 1580!!!
"


The codes for relevant functions:

"
//----------------------------------------------------------------------------------------
#undef __FUNCT__
#define __FUNCT__ "MatConjugate_MPIDense"
static PetscErrorCode  MatConjugate_MPIDense(Mat mat)
{
   Mat_MPIDense   *a = (Mat_MPIDense *)mat->data;

   PetscFunctionBegin;
   MatConjugate(a->A);
   PetscFunctionReturn(0);
}

#undef __FUNCT__
#define __FUNCT__ "MatRealPart_MPIDense"
static PetscErrorCode MatRealPart_MPIDense(Mat A)
{
  Mat_MPIDense   *a = (Mat_MPIDense*)A->data;

  PetscFunctionBegin;
  MatRealPart(a->A);
  PetscFunctionReturn(0);
}

#undef __FUNCT__
#define __FUNCT__ "MatImaginaryPart_MPIDense"
static PetscErrorCode MatImaginaryPart_MPIDense(Mat A)
{
  Mat_MPIDense   *a = (Mat_MPIDense*)A->data;

  PetscFunctionBegin;
  MatImaginaryPart(a->A);
  PetscFunctionReturn(0);
}
//-------------------------------------------------------------------------------------------
"

Regards,
Yujie


More information about the petsc-users mailing list