[petsc-users] Get a smaller vector with PETSc
Barry Smith
bsmith at mcs.anl.gov
Sat Oct 5 20:59:41 CDT 2013
VecScatterCreate().
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.
Barry
On Oct 2, 2013, at 6:27 AM, Rui Emanuel Ferreira da Silva <rui.silva at uam.es> wrote:
> I am writing to you to ask some technical problems that I am dealing
> with the use of PETSc.
>
> 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.
>
> 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.
>
> How can I do this?
>
> Regards
>
> -------------------
> Rui Silva
> EMTCCM (European Master in Theoretical Chemistry and Computational Modelling)
> UAM, Departamento de Química, Módulo 13
> CAMPUS http://www.uam.es/departamentos/ciencias/quimica/spline/index.html
> -------------------
>
More information about the petsc-users
mailing list