<div dir="ltr"><div><div>(Sorry I forgot to answer all in the first message)<br><br></div>Well I have never used Petsc in python, but in FORTRAN, it seems to work like any array. So why not use a python list for instance ? You would start with SNESs = [], create a new snes and append it to the list with SNESs.append(snes). Then you can use your list. That would not do it ?<br><br></div>Timothee<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-06 13:24 GMT+09:00 Justin Chang <span dir="ltr"><<a href="mailto:jychang48@gmail.com" target="_blank">jychang48@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Timothee,<br><br></div>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).<br><br></div>Thanks,<br></div>Justin<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 5, 2016 at 8:57 PM, Timothée Nicolas <span dir="ltr"><<a href="mailto:timothee.nicolas@gmail.com" target="_blank">timothee.nicolas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Hello and happy new year,<br><br></div><div>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).<br><br></div><div>Best wishes<br><br></div><div>Timothee<br><br></div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">2016-01-06 11:53 GMT+09:00 Justin Chang <span dir="ltr"><<a href="mailto:jychang48@gmail.com" target="_blank">jychang48@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi all,<br><br></div>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. <br><br>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.<br></div><div><br></div>Thanks,<br></div>Justin<br></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>