No, it cannot be simply removed. If I remove it and run src/ts/examples/tutorials/ex1.c (after removing the TSSetSolution() and x argument to the TSSolve() I get the bad error
$ ./ex1 [0]PETSC ERROR: --------------------- Error Message -------------------------------------------------------------- [0]PETSC ERROR: Null argument, when expecting valid pointer [0]PETSC ERROR: Null Object: Parameter # 1 [0]PETSC ERROR: See http://www.mcs.anl.gov/petsc/documentation/faq.html for trouble shooting. [0]PETSC ERROR: Petsc Development GIT revision: v3.10.2-975-g84761bfe160 GIT Date: 2018-12-08 17:24:25 -0700 [0]PETSC ERROR: ./ex1 on a arch-master named anlextwls003-196.wl.anl-external.org by barrysmith Mon Dec 10 13:40:15 2018 [0]PETSC ERROR: Configure options [0]PETSC ERROR: #1 VecDuplicate() line 376 in /Users/barrysmith/Src/petsc/src/vec/vec/interface/vector.c [0]PETSC ERROR: #2 TSSetUp_Pseudo() line 300 in /Users/barrysmith/Src/petsc/src/ts/impls/pseudo/posindep.c which is not useful to users. But I think it can be moved to TSSolve() after the call to TSSetUp(). Barry > On Dec 10, 2018, at 6:35 AM, Stefano Zampini via petsc-dev > <petsc-dev@mcs.anl.gov> wrote: > > In TSSetUp, current master has > > if (!ts->vec_sol) SETERRQ(PETSC_COMM_SELF,PETSC_ERR_ARG_WRONGSTATE,"Must call > TSSetSolution() first"); > > but the function apparently does not make use of it. Would it be safe to > remove the check? > > -- > Stefano