[petsc-users] TSSetMatrices structure?

Barry Smith bsmith at mcs.anl.gov
Thu Mar 29 21:07:48 CDT 2012


On Mar 29, 2012, at 8:58 PM, Andrew Spott wrote:

> This: http://www.mcs.anl.gov/petsc/petsc-3.2/src/ts/examples/tutorials/ex4.c.html  Looks like what I'm interested in doing, though I would like to use the latest.

   With this simple a situation using the current version or switching to dev is both fine. The changes you would have to make are small 

>  When is Petsc 3.3 (or 3.4, I'm not sure how your versioning works) coming out?  Is the dev version stable enough (in API and in execution) to be used?

    The dev version is always stable enough to use :-). At this point yes because we are in the testing phase for the next release.

> 
> Until then, does the 3.2 version of the TS interface work?  (the link above, and the corresponding one for petsc-dev don't appear to have much changed between them).

   Yes.

   Barry

Note that in 3.2 if you have a mass matrix (for example    M U_t  = A U_xx)how to formulate the problem is different between 3.2 and dev so I would recommend working immediately with dev.  But for simple U_t  = something, 3.2 is fine and then you can change it slightly for the next release.

> 
> Thanks for the prompt reply,
> 
> -Andrew
> 
> On Mar 29, 2012, at 7:37 PM, Barry Smith wrote:
> 
>> 
>>  Andrew,
>> 
>>    These are outdated manual pages; you'll want to avoid this. 
>> 
>>    Jed and Emil have done a major update of the TS interface and solvers, much more powerful and less confusing. 
>> 
>>     Likely you'll want to use TSSetIFunction() and TSSetIJacobian() http://www.mcs.anl.gov/petsc/petsc-dev/docs/manualpages/TS/index.html and work with petsc-dev http://www.mcs.anl.gov/petsc/developers/index.html
>> 
>> 
>> 
>>    Barry
>> 
>> On Mar 29, 2012, at 8:09 PM, Andrew Spott wrote:
>> 
>>> In the Petsc manual, there is a TSSetMatrices function, however there is no further documentation for it.
>>> 
>>> It is referenced in the manual as:
>>> 
>>> TSSetMatrices(TS ts,
>>> Mat A,PetscErrorCode (*frhs)(TS,PetscReal,Mat*,Mat*,MatStructure*,void*), Mat B,PetscErrorCode (*flhs)(TS,PetscReal,Mat*,Mat*,MatStructure*,void*), MatStructure flag,void *ctx)
>>> 
>>> However, what is passed to the function pointers isn't mentioned anywhere, and it isn't in the online documentation.
>>> 
>>> Also, I assume that "MatStructure flag" tells if the structure of A and B are the same or different, if B is PETSC_NULL, is flag "SAME_NONZERO_PATERN" or is it different?  (B can be considered to not exist, or to exist as an identity matrix, hence the confusion).
>>> 
>>> How does the ctx work?  Is the same context passed to frhs each time?
>>> 
>>> Thanks for the help.
>>> 
>>> -Andrew
>> 
> 



More information about the petsc-users mailing list