<div dir="ltr"><div><div>I tried the equivalent version with petsc in C++:<br><br> Mat subA[4];<br> Mat A;<br> ...<br> MatCreateNest(comm,2,NULL,2,NULL,subA,&A);<br><br></div>I did not face any issues. I am trying to map it to petsc4py.<br>
<br></div>Amit<br><div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 4, 2014 at 12:29 PM, Matthew Knepley <span dir="ltr"><<a href="mailto:knepley@gmail.com" target="_blank">knepley@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 class="gmail_extra"><div class="gmail_quote"><div class="">On Fri, Apr 4, 2014 at 12:27 PM, Amit Itagi <span dir="ltr"><<a href="mailto:gcfrai@gmail.com" target="_blank">gcfrai@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><div><div><div><div><div>I need to use the createNest for some application. I am trying it out on a toy program. I created four 6x6 AIJ matrices on two processes. I am trying to create a nest using<br>
<br>
</div>A=PETSc.Mat()<br>A.createNest([mA11,mA12,mA21,mA22])<br></div></div></div></div></div></div></blockquote><div><br></div></div><div>I have never run this using petsc4py, but if it were me I would make it take a 2D array.</div>
<div><br></div><div> Matt</div><div class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div></div>I get the following error:<br>
<br> A.createNest([mA11,mA12,mA21,mA22])<br> File "Mat.pyx", line 409, in petsc4py.PETSc.Mat.createNest (src/petsc4py.PETSc.c:85554)<br>
A.createNest([mA11,mA12,mA21,mA22])<br> File "Mat.pyx", line 409, in petsc4py.PETSc.Mat.createNest (src/petsc4py.PETSc.c:85554)<br> File "Mat.pyx", line 197, in petsc4py.PETSc.Mat.__getitem__ (src/petsc4py.PETSc.c:81516)<br>
File "Mat.pyx", line 197, in petsc4py.PETSc.Mat.__getitem__ (src/petsc4py.PETSc.c:81516)<br> File "petscmat.pxi", line 870, in petsc4py.PETSc.mat_getitem (src/petsc4py.PETSc.c:24830)<br> File "petscmat.pxi", line 870, in petsc4py.PETSc.mat_getitem (src/petsc4py.PETSc.c:24830)<br>
TypeError: 'int' object is not iterable<br>TypeError: 'int' object is not iterable<br><br></div>Any ideas ?<br><br>Also, is the following the correct way of setting the nest to a 2x2 block ?<br><br></div>
ix=PETSc.IS()<br>
</div>ix.CreateGeneral([0,1])<br></div>A.createNest([mA11,mA12,mA21,mA22],isrows=ix,iscols=ix)<br><div><div><div><br></div><div>Thanks<span><font color="#888888"><br></font></span></div><span><font color="#888888"><div>
<br></div><div>Amit<br></div><div><div><div><div><br><br></div></div></div>
</div></font></span></div></div></div>
</blockquote></div></div><span class="HOEnZb"><font color="#888888"><br><br clear="all"><div><br></div>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>
-- Norbert Wiener
</font></span></div></div>
</blockquote></div><br></div>