changeset: 13688:b996e19b22dd branch: ts-fixes tag: tip user: Kai Germaschewski date: Tue May 19 19:19:34 2009 -0400 summary: TS: Add forgotten testexample output file. diff -r 0edfbed82743 -r b996e19b22dd src/ts/examples/tests/output/ex4_7.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/ts/examples/tests/output/ex4_7.out Tue May 19 19:19:34 2009 -0400 @@ -0,0 +1,12 @@ +At t[0] = 0.00e+00 u= 1.00e+00 at the center +At t[1] = 1.00e-01 u= 5.73e-01 at the center +At t[2] = 2.00e-01 u= 3.28e-01 at the center +At t[3] = 3.00e-01 u= 1.89e-01 at the center +At t[4] = 4.00e-01 u= 1.09e-01 at the center +At t[5] = 5.00e-01 u= 6.35e-02 at the center +At t[6] = 6.00e-01 u= 3.73e-02 at the center +At t[7] = 7.00e-01 u= 2.20e-02 at the center +At t[8] = 8.00e-01 u= 1.30e-02 at the center +At t[9] = 9.00e-01 u= 7.78e-03 at the center +At t[10] = 1.00e+00 u= 4.67e-03 at the center + PostStep, t: 1 changeset: 13687:0edfbed82743 branch: ts-fixes user: Kai Germaschewski date: Tue May 19 19:12:05 2009 -0400 summary: TS: Fix a bug with "-ts_view". diff -r ea766e6ef723 -r 0edfbed82743 src/ts/interface/ts.c --- a/src/ts/interface/ts.c Tue May 19 19:09:28 2009 -0400 +++ b/src/ts/interface/ts.c Tue May 19 19:12:05 2009 -0400 @@ -171,6 +171,7 @@ ierr = TSView(ts, viewer);CHKERRQ(ierr); ierr = PetscViewerDestroy(viewer);CHKERRQ(ierr); } + opt = PETSC_FALSE; ierr = PetscOptionsGetTruth(((PetscObject)ts)->prefix, "-ts_view_draw", &opt,PETSC_NULL);CHKERRQ(ierr); if (opt) { ierr = PetscViewerDrawOpen(((PetscObject)ts)->comm, 0, 0, 0, 0, 300, 300, &viewer);CHKERRQ(ierr); changeset: 13686:ea766e6ef723 branch: ts-fixes user: Kai Germaschewski date: Tue May 19 19:09:28 2009 -0400 summary: TS: Cleanup unused/broken TS methods. diff -r ea96e68ed8c9 -r ea766e6ef723 include/petscts.h --- a/include/petscts.h Tue May 19 19:05:11 2009 -0400 +++ b/include/petscts.h Tue May 19 19:09:28 2009 -0400 @@ -93,8 +93,6 @@ EXTERN PetscErrorCode PETSCTS_DLLEXPORT TSDefaultComputeJacobian(TS,PetscReal,Vec,Mat*,Mat*,MatStructure*,void*); EXTERN PetscErrorCode PETSCTS_DLLEXPORT TSSetPreStep(TS, PetscErrorCode (*)(TS)); -EXTERN PetscErrorCode PETSCTS_DLLEXPORT TSSetUpdate(TS, PetscErrorCode (*)(TS, PetscReal, PetscReal *)); -EXTERN PetscErrorCode PETSCTS_DLLEXPORT TSSetPostUpdate(TS, PetscErrorCode (*)(TS, PetscReal, PetscReal *)); EXTERN PetscErrorCode PETSCTS_DLLEXPORT TSSetPostStep(TS, PetscErrorCode (*)(TS)); EXTERN PetscErrorCode PETSCTS_DLLEXPORT TSDefaultPreStep(TS); EXTERN PetscErrorCode PETSCTS_DLLEXPORT TSDefaultUpdate(TS, PetscReal, PetscReal *); diff -r ea96e68ed8c9 -r ea766e6ef723 include/private/tsimpl.h --- a/include/private/tsimpl.h Tue May 19 19:05:11 2009 -0400 +++ b/include/private/tsimpl.h Tue May 19 19:09:28 2009 -0400 @@ -22,11 +22,7 @@ PetscErrorCode (*rhsfunction)(TS, PetscReal, Vec, Vec, void *); PetscErrorCode (*rhsjacobian)(TS, PetscReal, Vec, Mat *, Mat *, MatStructure *, void *); PetscErrorCode (*prestep)(TS); - PetscErrorCode (*update)(TS, PetscReal, PetscReal *); - PetscErrorCode (*postupdate)(TS, PetscReal, PetscReal *); PetscErrorCode (*poststep)(TS); - PetscErrorCode (*reform)(TS); - PetscErrorCode (*reallocate)(TS); PetscErrorCode (*setup)(TS); PetscErrorCode (*step)(TS,PetscInt *, PetscReal *); PetscErrorCode (*setfromoptions)(TS); diff -r ea96e68ed8c9 -r ea766e6ef723 src/ts/examples/tests/ex4.c --- a/src/ts/examples/tests/ex4.c Tue May 19 19:05:11 2009 -0400 +++ b/src/ts/examples/tests/ex4.c Tue May 19 19:09:28 2009 -0400 @@ -32,7 +32,6 @@ extern PetscErrorCode RHSFunction(TS,PetscReal,Vec,Vec,void*); extern PetscErrorCode RHSJacobian(TS,PetscReal,Vec,Mat*,Mat*,MatStructure *,void*); extern PetscErrorCode PostStep(TS); -extern PetscErrorCode PostUpdate(TS,PetscReal, PetscReal*); #undef __FUNCT__ #define __FUNCT__ "main" @@ -153,10 +152,6 @@ ierr = PetscOptionsHasName(PETSC_NULL,"-test_PostStep",&flg);CHKERRQ(ierr); if (flg){ ierr = TSSetPostStep(ts,PostStep);CHKERRQ(ierr); - } - ierr = PetscOptionsHasName(PETSC_NULL,"-test_PostUpdate",&flg);CHKERRQ(ierr); - if (flg){ - ierr = TSSetPostUpdate(ts,PostUpdate);CHKERRQ(ierr); } /* Pick up a Petsc preconditioner */ @@ -498,12 +493,3 @@ PetscFunctionReturn(0); } -#undef __FUNCT__ -#define __FUNCT__ "PostUpdate" -PetscErrorCode PostUpdate(TS ts,PetscReal t, PetscReal *dt) -{ - PetscErrorCode ierr; - PetscFunctionBegin; - ierr = PetscPrintf(PETSC_COMM_SELF," PostUpdate, t: %g\n",t); - PetscFunctionReturn(0); -} diff -r ea96e68ed8c9 -r ea766e6ef723 src/ts/impls/implicit/sundials/sundials.c --- a/src/ts/impls/implicit/sundials/sundials.c Tue May 19 19:05:11 2009 -0400 +++ b/src/ts/impls/implicit/sundials/sundials.c Tue May 19 19:09:28 2009 -0400 @@ -196,9 +196,6 @@ for (i = 0; i < max_steps; i++) { if (ts->ptime >= ts->max_time) break; ierr = CVode(mem,tout,cvode->y,&t,CV_ONE_STEP);CHKERRQ(ierr); - if (ts->ops->postupdate){ - ierr = (*ts->ops->postupdate)(ts,ts->ptime,PETSC_NULL);CHKERRQ(ierr); - } if (t > ts->max_time && cvode->exact_final_time) { /* interpolate to final requested time */ ierr = CVodeGetDky(mem,tout,0,cvode->y);CHKERRQ(ierr); diff -r ea96e68ed8c9 -r ea766e6ef723 src/ts/interface/ts.c --- a/src/ts/interface/ts.c Tue May 19 19:05:11 2009 -0400 +++ b/src/ts/interface/ts.c Tue May 19 19:09:28 2009 -0400 @@ -1131,91 +1131,6 @@ } #undef __FUNCT__ -#define __FUNCT__ "TSSetUpdate" -/*@C - TSSetUpdate - Sets the general-purpose update function called - at the beginning of every time step. This function can change - the time step. - - Collective on TS - - Input Parameters: -+ ts - The TS context obtained from TSCreate() -- func - The function - - Calling sequence of func: -. func (TS ts, double t, double *dt); - -+ t - The current time -- dt - The current time step - - Level: intermediate - -.keywords: TS, update, timestep -@*/ -PetscErrorCode PETSCTS_DLLEXPORT TSSetUpdate(TS ts, PetscErrorCode (*func)(TS, PetscReal, PetscReal *)) -{ - PetscFunctionBegin; - PetscValidHeaderSpecific(ts, TS_COOKIE,1); - ts->ops->update = func; - PetscFunctionReturn(0); -} - -#undef __FUNCT__ -#define __FUNCT__ "TSSetPostUpdate" -/*@C - TSSetPostUpdate - Sets the general-purpose update function called - after every time step. - - Collective on TS - - Input Parameters: -+ ts - The TS context obtained from TSCreate() -- func - The function - - Calling sequence of func: -. func (TS ts, double t, double *dt); - -+ t - The current time -- dt - The current time step - - Level: intermediate - -.keywords: TS, update, timestep -@*/ -PetscErrorCode PETSCTS_DLLEXPORT TSSetPostUpdate(TS ts, PetscErrorCode (*func)(TS, PetscReal, PetscReal *)) -{ - PetscFunctionBegin; - PetscValidHeaderSpecific(ts, TS_COOKIE,1); - ts->ops->postupdate = func; - PetscFunctionReturn(0); -} - -#undef __FUNCT__ -#define __FUNCT__ "TSDefaultUpdate" -/*@ - TSDefaultUpdate - The default update function which does nothing. - - Collective on TS - - Input Parameters: -+ ts - The TS context obtained from TSCreate() -- t - The current time - - Output Parameters: -. dt - The current time step - - Level: developer - -.keywords: TS, update, timestep -@*/ -PetscErrorCode PETSCTS_DLLEXPORT TSDefaultUpdate(TS ts, PetscReal t, PetscReal *dt) -{ - PetscFunctionBegin; - PetscFunctionReturn(0); -} - -#undef __FUNCT__ #define __FUNCT__ "TSSetPostStep" /*@C TSSetPostStep - Sets the general-purpose function diff -r ea96e68ed8c9 -r ea766e6ef723 src/ts/interface/tscreate.c --- a/src/ts/interface/tscreate.c Tue May 19 19:05:11 2009 -0400 +++ b/src/ts/interface/tscreate.c Tue May 19 19:09:28 2009 -0400 @@ -46,7 +46,6 @@ ierr = PetscMemzero(t->ops, sizeof(struct _TSOps));CHKERRQ(ierr); t->ops->prestep = TSDefaultPreStep; - t->ops->update = TSDefaultUpdate; t->ops->poststep = TSDefaultPostStep; /* General TS description */ changeset: 13685:ea96e68ed8c9 branch: ts-fixes user: Kai Germaschewski date: Tue May 19 19:05:11 2009 -0400 summary: TS: Add a testcase for TSSetPostStep(). diff -r acd7d9204093 -r ea96e68ed8c9 src/ts/examples/tests/makefile --- a/src/ts/examples/tests/makefile Tue May 19 19:04:33 2009 -0400 +++ b/src/ts/examples/tests/makefile Tue May 19 19:05:11 2009 -0400 @@ -206,10 +206,18 @@ else echo "Possible problem with ex4_6, diffs above"; fi; \ ${RM} -f ex4.tmp +runex4_7: + -@${MPIEXEC} -n 1 ./ex4 -ts_fd -ts_type beuler -test_PostStep > ex4.tmp 2>&1; \ + if (${DIFF} output/ex4_7.out ex4.tmp) then true; \ + else echo "Possible problem with ex4_7, diffs above"; fi; \ + ${RM} -f ex4.tmp + TESTEXAMPLES_C = ex1.PETSc runex1_euler runex1_euler_2 runex1_euler_3 runex1_euler_4 runex1_euler_5 \ runex1_beuler runex1_beuler_2 runex1_beuler_3 runex1_beuler_4 runex1_beuler_5 \ runex1_cn runex1_cn_2 runex1_cn_3 ex1.rm \ - ex4.PETSc runex4 runex4_1 runex4_2 runex4_3 runex4_4 runex4_5 runex4_6 ex4.rm + ex4.PETSc runex4 runex4_1 runex4_2 runex4_3 runex4_4 runex4_5 runex4_6 \ + runex4_7 ex4.rm + testexamples_C_NoComplex = ex3.PETSc runex3 runex3_2 ex3.rm TESTEXAMPLES_C_X11 = TESTEXAMPLES_FORTRAN = ex1f.PETSc runex1f ex1f.rm changeset: 13684:acd7d9204093 branch: ts-fixes parent: 13656:e25f6a1a73bc user: Kai Germaschewski date: Tue May 19 19:04:33 2009 -0400 summary: TS: Small TSRegisterDynamic() doc fix. diff -r e25f6a1a73bc -r acd7d9204093 include/petscts.h --- a/include/petscts.h Thu May 14 14:20:53 2009 -0500 +++ b/include/petscts.h Tue May 19 19:04:33 2009 -0400 @@ -150,8 +150,9 @@ Then, your ts type can be chosen with the procedural interface via .vb - TSCreate(MPI_Comm, TS *); - TSSetType(vec, "my_ts") + TS ts; + TSCreate(MPI_Comm, &ts); + TSSetType(ts, "my_ts") .ve or at runtime via the option .vb