[petsc-dev] Unneeded check in TSSetUp?

Smith, Barry F. bsmith at mcs.anl.gov
Tue Dec 11 17:25:39 CST 2018



   I guess

> On Dec 11, 2018, at 4:45 AM, Stefano Zampini <stefano.zampini at gmail.com> wrote:
> 
> Yes, I have also noticed it.
> IMHO, we should enforce the  TSGetDM + DMCreateGlobalVector pattern instead of duplicating ts->vec_sol in all the implementations.
> I'll open a bitbucket issue if you agree
> 
> Il giorno lun 10 dic 2018 alle ore 22:49 Smith, Barry F. <bsmith at mcs.anl.gov> ha scritto:
> 
>   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 at 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
> 
> 
> 
> -- 
> Stefano



More information about the petsc-dev mailing list