Creating a new vector based on a already distributed set of Vecs

Matthew Knepley knepley at
Sun Mar 23 15:12:33 CDT 2008

2008/3/23 Vijay S. Mahadevan <vijay.m at>:
> Hi all,
>  I am sure the subject line wasn't too explanatory and so here goes.
>  I have a system which already has a Vec object created and distributed on
>  many processors based on domain decomposition. I could have several such
>  systems, each with a solution vector and a residual vector pertaining to its
>  physics.
>  Now, can I create a global vector which would just be pointers to the
>  already existing vectors but from PETSc's point of view, appears to be a
>  globally valid, (and possibly weirdly) distributed vector. Such an option
>  will save the memory needed for the global vector and eliminates errors as
>  to synchronization of the solution, residuals for the systems.

I do not understand what you want. If you want a vector with the same layout,
use VecDuplicate(). If you want the same data, just use the Vec itself.



>  I was reading the documentation and found the PetscMap data structure. But I
>  am not entirely sure if this is what I am looking for.
>  I hope that makes sense. I would appreciate any help you can provide to
>  point me in the right direction.
>  Cheers,
>  Vijay
>  No virus found in this outgoing message.
>  Checked by AVG.
>  Version: 7.5.519 / Virus Database: 269.21.8/1339 - Release Date: 3/22/2008
>  4:43 PM

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

More information about the petsc-users mailing list