[petsc-users] Array of SNES's

Patrick Sanan patrick.sanan at gmail.com
Tue Jan 5 22:30:30 CST 2016


Do all the SNES's need to be constructed at the same time? It will
obviously require a lot of memory to store N SNES objects (or perhaps
your N is small), and if they don't all need to exist simultaneously, then do you have the option to
create and destroy one at a time as you loop over your grid points?
On Tue, Jan 05, 2016 at 09:24:11PM -0700, Justin Chang wrote:
> Timothee,
> 
> No i haven't tried, mainly because I don't know how. Btw I am not doing
> this in C or FORTRAN, I want to do this in python (via petsc4py) since I am
> trying to make this compatible with Firedrake (which is also python-based).
> 
> Thanks,
> Justin
> 
> On Tue, Jan 5, 2016 at 8:57 PM, Timothée Nicolas <timothee.nicolas at gmail.com
> > wrote:
> 
> > Hello and happy new year,
> >
> > Have you actually tried ? I just declared an array of 10 snes and created
> > them, and there is no complaint whatsoever. Also, something I do usually is
> > that I declare a derived type which contains some Petsc Objects (like SNES,
> > KSP, matrices, vectors, whatever), and create arrays of this derived types.
> > This works perfectly fine in my case (I use FORTRAN btw).
> >
> > Best wishes
> >
> > Timothee
> >
> >
> > 2016-01-06 11:53 GMT+09:00 Justin Chang <jychang48 at gmail.com>:
> >
> >> Hi all,
> >>
> >> Is it possible to create an array of SNES's? If I have a problem size N
> >> degrees of freedom, I want each dof to have its own SNES solver (basically
> >> a pointer to N SNES's). Reason for this is because I am performing a
> >> "post-processing" step where after my global solve, each entry of my
> >> solution vector of size N will go through some algebraic manipulation.
> >>
> >> If I did a standard LU solve for these individual SNES's, I could use the
> >> same snes and this issue would be moot. But i am using the Variational
> >> Inequality, which basically requires a fresh SNES for each problem.
> >>
> >> Thanks,
> >> Justin
> >>
> >
> >


More information about the petsc-users mailing list