<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1256">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div>Hi, I use src\ts\examples\tutorials\ex19.c as an example to use PETSc DAE solver. I get the following problem while running my code:</div>
<div><font face="Times New Roman, serif"> </font></div>
<div>[d3m956@olympus ss00]$ make</div>
<div>mpicxx -I/pic/projects/ds/petsc-dev/include -I/pic/projects/ds/petsc-dev/arch-complex/include -I/share/apps/openmpi/1.5.4/gcc/4.1.2/include -g -c -o simulation.o simulation.C</div>
<div>simulation.C: In member function ‘PetscErrorCode Simulation::simu(_p_Mat*, _p_Mat*, _p_Mat*)’:</div>
<div>simulation.C:80: error: argument of type ‘PetscErrorCode (Simulation::)(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, _p_Vec*, void*)’ does not match ‘PetscErrorCode (*)(_p_TS*, PetscReal, _p_Vec*, _p_Vec*, _p_Vec*, void*)’</div>
<div>make: *** [simulation.o] Error 1</div>
<div><font face="Times New Roman, serif"> </font></div>
<div>What does it mean?</div>
<div><font face="Times New Roman, serif"> </font></div>
<div>The IFunction is copied from ex19.c,</div>
<div><font face="Times New Roman, serif"> </font></div>
<div>PetscErrorCode Simulation::IFunction(TS ts,PetscReal t,Vec X,Vec Xdot,Vec F,void *ctx)</div>
<div>{</div>
<div> PetscErrorCode ierr;</div>
<div> PetscScalar *x,*xdot,*f;</div>
<div> </div>
<div> PetscFunctionBegin;</div>
<div> ierr = VecGetArray(X,&x);CHKERRQ(ierr);</div>
<div> ierr = VecGetArray(Xdot,&xdot);CHKERRQ(ierr);</div>
<div> ierr = VecGetArray(F,&f);CHKERRQ(ierr);</div>
<div> f[0] = xdot[0] + x[1];</div>
<div> f[1] = (x[1]*x[1]*x[1]/3 - x[1])-x[0];</div>
<div> ierr = VecRestoreArray(X,&x);CHKERRQ(ierr);</div>
<div> ierr = VecRestoreArray(Xdot,&xdot);CHKERRQ(ierr);</div>
<div> ierr = VecRestoreArray(F,&f);CHKERRQ(ierr);</div>
<div> PetscFunctionReturn(0);</div>
<div>}</div>
<div><font face="Times New Roman, serif"> </font></div>
<div>And in Simulation::simu(Mat f1, Mat f2, Mat f3), I have: </div>
<div><font face="Times New Roman, serif"> </font></div>
<div>ierr = TSSetIFunction(ts,NULL,IFunction,&user);CHKERRQ(ierr);</div>
<div><font face="Times New Roman, serif"> </font></div>
<div>Thanks,</div>
<div>Shuangshuang</div>
<div><font face="Times New Roman, serif"> </font></div>
<div><font face="Times New Roman, serif"> </font></div>
</font>
</body>
</html>