[petsc-users] Get a smaller vector with PETSc

Matthew Knepley knepley at gmail.com
Tue Oct 8 13:35:05 CDT 2013


On Tue, Oct 8, 2013 at 1:27 PM, Analabha Roy <hariseldon99 at gmail.com> wrote:

>
>
>
> On Sun, Oct 6, 2013 at 7:29 AM, Barry Smith <bsmith at mcs.anl.gov> wrote:
>
>>
>>   VecScatterCreate().
>>
>
>
> What about VecGetSubVector()<http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Vec/VecGetSubVector.html>?
>

Only works for local subsets.

  Matt


>
>
>>
>>    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
>> > -------------------
>> >
>>
>>
>
>
> --
> ---
> *Analabha Roy*
> C.S.I.R <http://www.csir.res.in>  Senior Research Associate<http://csirhrdg.res.in/poolsra.htm>
> Saha Institute of Nuclear Physics <http://www.saha.ac.in>
> Section 1, Block AF
> Bidhannagar, Calcutta 700064
> India
> *Emails*: daneel at physics.utexas.edu, hariseldon99 at gmail.com
> *Webpage*: http://www.ph.utexas.edu/~daneel/
>



-- 
What most experimenters take for granted before they begin their
experiments is infinitely more interesting than any results to which their
experiments lead.
-- Norbert Wiener
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20131008/6c35da6f/attachment.html>


More information about the petsc-users mailing list