Commits

Matt Knepley committed 0df3621

REVERT TS: Timestep gets set into DMTS

Comments (0)

Files changed (3)

include/petsc-private/tsimpl.h

 
 struct _p_DMTS {
   PETSCHEADER(struct _DMTSOps);
-  PetscInt steps;
-
   void *rhsfunctionctx;
   void *rhsjacobianctx;
 

include/petscts.h

 PETSC_EXTERN PetscErrorCode DMTSGetSolutionFunction(DM,TSSolutionFunction*,void**);
 PETSC_EXTERN PetscErrorCode DMTSSetForcingFunction(DM,PetscErrorCode (*)(TS,PetscReal,Vec,void*),void*);
 PETSC_EXTERN PetscErrorCode DMTSGetForcingFunction(DM,PetscErrorCode (**)(TS,PetscReal,Vec,void*),void**);
-PETSC_EXTERN PetscErrorCode DMTSSetTimeStepNumber(DM,PetscInt);
-PETSC_EXTERN PetscErrorCode DMTSGetTimeStepNumber(DM,PetscInt*);
 
 PETSC_EXTERN PetscErrorCode DMTSSetIFunctionSerialize(DM,PetscErrorCode (*)(void*,PetscViewer),PetscErrorCode (*)(void**,PetscViewer));
 PETSC_EXTERN PetscErrorCode DMTSSetIJacobianSerialize(DM,PetscErrorCode (*)(void*,PetscViewer),PetscErrorCode (*)(void**,PetscViewer));

src/ts/utils/dmts.c

   ierr = TSInitializePackage();CHKERRQ(ierr);
   ierr = PetscHeaderCreate(*kdm, _p_DMTS, struct _DMTSOps, DMTS_CLASSID, "DMTS", "DMTS", "DMTS", comm, DMTSDestroy, DMTSView);CHKERRQ(ierr);
   ierr = PetscMemzero((*kdm)->ops, sizeof(struct _DMTSOps));CHKERRQ(ierr);
-  (*kdm)->steps = -1;
   PetscFunctionReturn(0);
 }
 
 }
 
 #undef __FUNCT__
-#define __FUNCT__ "DMTSSetTimeStepNumber"
-/*@C
-  DMTSSetTimeStepNumber - set the number of timesteps completed
-
-  Not Collective
-
-  Input Arguments:
-+  dm    - DM to be used with TS
--  steps - the number of timesteps completed
-
-  Level: advanced
-
-.seealso: DMTSSetContext(), TSSetFunction(), DMTSSetJacobian()
-@*/
-PetscErrorCode DMTSSetTimeStepNumber(DM dm, PetscInt steps)
-{
-  DMTS           tsdm;
-  PetscErrorCode ierr;
-
-  PetscFunctionBegin;
-  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
-  ierr = DMGetDMTSWrite(dm, &tsdm);CHKERRQ(ierr);
-  tsdm->steps = steps;
-  PetscFunctionReturn(0);
-}
-
-#undef __FUNCT__
-#define __FUNCT__ "DMTSGetTimeStepNumber"
-/*@C
-  DMTSGetTimeStepNumber - get the number of timesteps completed
-
-  Not Collective
-
-  Input Arguments:
-.  dm    - DM to be used with TS
-
-  Output Arguments:
-.  steps - the number of timesteps completed
-
-  Level: advanced
-
-.seealso: DMTSSetContext(), TSSetFunction(), DMTSSetJacobian()
-@*/
-PetscErrorCode DMTSGetTimeStepNumber(DM dm, PetscInt *steps)
-{
-  DMTS           tsdm;
-  PetscErrorCode ierr;
-
-  PetscFunctionBegin;
-  PetscValidHeaderSpecific(dm, DM_CLASSID, 1);
-  PetscValidPointer(steps, 2);
-  ierr = DMGetDMTS(dm, &tsdm);CHKERRQ(ierr);
-  *steps = tsdm->steps;
-  PetscFunctionReturn(0);
-}
-
-#undef __FUNCT__
 #define __FUNCT__ "DMTSSetIFunction"
 /*@C
    DMTSSetIFunction - set TS implicit function evaluation function