[petsc-users] Vector form of TS solvers

Chris Bradley c.bradley at auckland.ac.nz
Thu Jul 9 21:32:08 CDT 2015


Dear Barry,
thank you for your reply.

On 09/07/15 11:47, Barry Smith wrote:
> 
>> On Jul 8, 2015, at 6:25 PM, Chris Bradley <c.bradley at auckland.ac.nz> wrote:
>>
>> Dear PETSc,
>> I was wondering if you had any advice for using PETSc TS solvers to
>> solve a vector of ODEs. PETSc TS solvers solve DAEs of the form
>>
>> f(t,u,u^dot,a) = g(u,t) = 0 (for my case)
>>
>> where f is a user provided function, u is a vector of state variables,
>> u^dot a vector of the derivatives of state variables and a is a vector
>> of parameters (passed through the context).
>>
>> I need to solve a large number of these DAEs (one for every node in a
>> bigger finite element problem). Is there a vector form of the TS solvers
>> that can solve
>>
>> F(t,U,U^dot) = G(U,t) = 0
>>
>> where F is now a vector, U is a matrix of state variables and U^dot is a
>> matrix of the derivatives of U. Each row of the system corresponds to
>> the standard PETSc TS problem above and is independent of every other row.
> 
>   No, there is not.
> 
>>
>> If I understand the TS manual correctly then if I wanted to do this in
>> PETSc I would have to create a TS object and state and derivative
>> vectors objects for each row?
> 
>    That is one way to do (if the size of the individual DAE is tiny (say 3) then yes it would use a great deal of "extra" memory). You could also have a single TS on each process that you "reused" for each "small problem" but how difficult this would be depends on how often you need to solve each of these (for example do you run it for many time steps and then move on to the next one or do you need to get out the result after each time step and use it in some other computation?).
> 

The size of the DAE (size of u etc.) is anywhere from 2-3 to 80-90 with
an average of ~30-40. The DAE is integrated from t1 to t2 and then the
solution is used in a larger finite element solve which marches through
time. Thus each ODE is evaluated a large number of times. It could be
possible to reuse the TS object but I think I would still have to use
individual vector objects that point at the state variables and their
derivatives for each ODE??

>> All these PETSc objects for each row would
>> seem like a big overhead if there was a very large number of rows
>> (potentially tens of millions for my problem).
> 
>   How many unknowns are there in each individual (uncoupled) DAE?

anywhere from 2-3 to 80-90 with an average of ~30-40

> 
>   Is each individual DAE essentially the same DAE (with different parameter values etc?)

Yes, It can be organised that way. There may be a few different DAEs but
these can be consolidated into a number of blocks each with the same DAE.

> 
>   Is the Jacobian for each individual (uncoupled) DAE dense or sparse, if sparse is it the same for each one?

The Jacobian would be sparse and constant.

Best wishes
Chris

> 
>   Barry
> 
>>
>> Thanks for your help
>> Chris
>> -- 
>> Chris Bradley
>> Auckland Bioengineering Institute,
>> University of Auckland,
>> Private Bag 92019,
>> New Zealand.
>>
>> Tel: +64 9 373 7599 xtn 89924
>> Fax: +64 9 367 7157
>>
> 

-- 
Chris Bradley
Auckland Bioengineering Institute,
University of Auckland,
Private Bag 92019,
New Zealand.

Tel: +64 9 373 7599 xtn 89924
Fax: +64 9 367 7157



More information about the petsc-users mailing list