<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Oct 6, 2013 at 7:29 AM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov" target="_blank">bsmith@mcs.anl.gov</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
  VecScatterCreate().<br></blockquote><div><br><br></div><div>What about <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGetSubVector.html">VecGetSubVector()</a> ?<br></div><div><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<br>
   If you wish the sub vector to live on a single process then create a sequential vector of the appropriate size on that one process and sequential vectors of size zero on all other processes and scatter into them.<br>
<span class=""><font color="#888888"><br>
   Barry<br>
</font></span><div class=""><div class="h5"><br>
On Oct 2, 2013, at 6:27 AM, Rui Emanuel Ferreira da Silva <<a href="mailto:rui.silva@uam.es">rui.silva@uam.es</a>> wrote:<br>
<br>
> I am writing to you to ask some technical problems that I am dealing<br>
> with the use of PETSc.<br>
><br>
> The problem that I am facing is the following: I have defined a vector in Petsc which was created with VecCreateMPI. After that, I read this vector from an external file with a PETSc viewer.<br>
><br>
> So if the initial vector is V with size N, I want to obtain a smaller vector U with size M, where M<N. I have an array of integers that are the indexes of V that I want to pass to U.<br>
><br>
> How can I do this?<br>
><br>
> Regards<br>
><br>
> -------------------<br>
> Rui Silva<br>
> EMTCCM (European Master in Theoretical Chemistry and Computational Modelling)<br>
> UAM, Departamento de Química, Módulo 13<br>
> CAMPUS <a href="http://www.uam.es/departamentos/ciencias/quimica/spline/index.html" target="_blank">http://www.uam.es/departamentos/ciencias/quimica/spline/index.html</a><br>
> -------------------<br>
><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><font face="tahoma, sans-serif">---</font><div><font face="tahoma, sans-serif"><b>Analabha Roy</b></font></div><div><font face="tahoma, sans-serif"><a href="http://www.csir.res.in" target="_blank">C.S.I.R</a>  <a href="http://csirhrdg.res.in/poolsra.htm" target="_blank">Senior Research Associate</a></font></div>

<div><font face="tahoma, sans-serif"><a href="http://www.saha.ac.in" target="_blank">Saha Institute of Nuclear Physics</a></font></div><div><font face="tahoma, sans-serif">Section 1, Block AF</font></div><div><font face="tahoma, sans-serif">Bidhannagar, Calcutta 700064</font></div>

<div><font face="tahoma, sans-serif">India</font></div><div><b style="font-family:tahoma,sans-serif">Emails</b><span style="font-family:tahoma,sans-serif">: </span><a href="mailto:daneel@physics.utexas.edu" style="font-family:tahoma,sans-serif" target="_blank">daneel@physics.utexas.edu</a><span style="font-family:tahoma,sans-serif">, </span><a href="mailto:hariseldon99@gmail.com" style="font-family:tahoma,sans-serif" target="_blank">hariseldon99@gmail.com</a></div>

<div><font face="tahoma, sans-serif"><b>Webpage</b>: <a href="http://www.ph.utexas.edu/~daneel/" target="_blank">http://www.ph.utexas.edu/~daneel/</a></font></div>
</div></div>