[petsc-users] TSSetMaxSteps gives undefined reference error
Zhang, Hong
hongzhang at anl.gov
Tue Oct 10 09:14:23 CDT 2017
TSSetMaxSteps() was added in PETSc 3.8. You can either update PETSc or use TSSetDuration() in older versions.
Hong (Mr.)
> On Oct 10, 2017, at 7:56 AM, Ali Berk Kahraman <aliberkkahraman at yahoo.com> wrote:
>
> Hello All,
>
> When I try to use TSSetMaxSteps function in my code, the compiler gives me "undefined reference to TSSetMaxSteps" error. I have petscts.h included, and my makefile is also operational for ts. Any ideas why this might be? I use petsc 3.7.3. The code sample is as follows,
>
>
> #include <petscts.h>
>
> .
>
> .
>
> .
>
> .
>
> TS ts;
> ierr= TSCreate(PETSC_COMM_WORLD,&ts);
> CHKERRQ(ierr);
> ierr= TSSetProblemType(ts,TS_LINEAR);
> CHKERRQ(ierr);
> ierr= TSSetSolution(ts, dummyvec);
> CHKERRQ(ierr);
> ierr= TSSetType(ts,TSRK);
> CHKERRQ(ierr);
> ierr= TSSetTime(ts,time);
> CHKERRQ(ierr);
> ierr= TSSetTimeStep(ts,timestep);
> CHKERRQ(ierr);
> ierr=TSSetExactFinalTime(ts,TS_EXACTFINALTIME_STEPOVER);
> CHKERRQ(ierr);
> ierr=TSSetMaxSteps(ts,maxsteps);CHKERRQ(ierr);
> TSSetRHSFunction(ts,residual,
> FormRHSFunction,&mycontext);
> ierr= TSSolve(ts,uJi);
> CHKERRQ(ierr);
>
More information about the petsc-users
mailing list