Re: [petsc-users] Is it still worth switching to PETSc if I can't write a Jacobian for my problem?

2015-12-10 Thread Barry Smith
Brian, I see two distinct issues here 1) being apply to apply your right hand side efficiently and 2) what type of ODE integrators, if any, can work well for your problem with its funky, possibly discontinuous right hand side? 1) Looking at the simplicity of your data structure

Re: [petsc-users] Is it still worth switching to PETSc if I can't write a Jacobian for my problem?

2015-12-10 Thread Brian Merchant
Hi Barry, Here's some non-trivial example code: https://gist.github.com/bmer/2af429f88b0b696648a8 I have still made some simplifications by removing some phase variables, expanding on variable names in general, and so on. The rhs function itself is defined on line 578. The functions referred to

Re: [petsc-users] Is it still worth switching to PETSc if I can't write a Jacobian for my problem?

2015-12-10 Thread Matthew Knepley
On Thu, Dec 10, 2015 at 2:56 PM, Brian Merchant wrote: > Hi Barry, > > Points 1) and 2) are bang on -- you understand the situation very well. > > 1) with regards to being able to apply the RHS efficiently in C -- I would > be happy to do this, but I worry about how to

Re: [petsc-users] Is it still worth switching to PETSc if I can't write a Jacobian for my problem?

2015-12-10 Thread Hong Zhang
Hi Brian, If you can’t provide Jacobian and do not need to run the code in parallel, I do not think using PETSc would make too much difference compared to using scipy.integrate.odeint. With both of them, you can either use explicit time integration methods with small time steps, or use

Re: [petsc-users] Is it still worth switching to PETSc if I can't write a Jacobian for my problem?

2015-12-10 Thread Emil Constantinescu
Brian, Can you take a look at what odeint returns? Specifically, at: ‘mused’ a vector of method indicators for each successful time step: 1: adams (nonstiff), 2: bdf (stiff) I suspect it's using Adams all the way, which means it's doesn't need a Jacobian. Emil On 12/10/15 1:51 PM,

Re: [petsc-users] Is it still worth switching to PETSc if I can't write a Jacobian for my problem?

2015-12-10 Thread Brian Merchant
Hi Barry, Points 1) and 2) are bang on -- you understand the situation very well. 1) with regards to being able to apply the RHS efficiently in C -- I would be happy to do this, but I worry about how to cleanly get C arrays back into NumPy arrays -- NumPy arrays are easy to manipulate for

Re: [petsc-users] Is it still worth switching to PETSc if I can't write a Jacobian for my problem?

2015-12-10 Thread Matthew Knepley
On Thu, Dec 10, 2015 at 3:47 PM, Brian Merchant wrote: > Hi Emil: > > I had a look at odeint's output -- it seems that while Adams is used > initially, bdf is used most often overall (especially in later timesteps), > some 80% of the timesteps in total. > > This is likely

Re: [petsc-users] Is it still worth switching to PETSc if I can't write a Jacobian for my problem?

2015-12-10 Thread Brian Merchant
Hi Emil: I had a look at odeint's output -- it seems that while Adams is used initially, bdf is used most often overall (especially in later timesteps), some 80% of the timesteps in total. This is likely because I ran the test on the full problem, which includes interactions between multiple

Re: [petsc-users] Is it still worth switching to PETSc if I can't write a Jacobian for my problem?

2015-12-10 Thread Emil Constantinescu
On 12/10/15 3:47 PM, Brian Merchant wrote: Hi Emil: I had a look at odeint's output -- it seems that while Adams is used initially, bdf is used most often overall (especially in later timesteps), some 80% of the timesteps in total. This is likely because I ran the test on the full problem,

[petsc-users] Build a PETSc matrix with "ghost lines" ?

2015-12-10 Thread 'PEYROUNETTE Myriam'
Hi all, I am partitioning an unstructured network in order to parallelize my code. To communicate some node data between processors, I have to deal with ghost values. I know PETSc allows its vectors to carry ghost values thanks to VecCreateGhost() or VecMPISetGhost() functions. In the same

Re: [petsc-users] Build a PETSc matrix with "ghost lines" ?

2015-12-10 Thread Barry Smith
> On Dec 10, 2015, at 11:06 AM, PEYROUNETTE Myriam > wrote: > > Hi all, > > I am partitioning an unstructured network in order to parallelize my code. To > communicate some node data between processors, I have to deal with ghost > values. I know PETSc allows its