[petsc-users] VecSetType and ghosted vectors

Dominik Szczerba dominik at itis.ethz.ch
Wed Oct 19 17:09:09 CDT 2011


Many thanks! My rationale: I have abstracted a C++ class called
PetscLinearSolver that is supposed to wrap all the complex ksp & co
functionality in an easy to use C++ class. There, I do not know apriori if a
class user will want to have x and b ghosted or not - that depends on the
problem type. So even it it is known in runtime, it is not known in coding
or setup time. Therefore I would benefit from a function to declare a vector
as ghosted.

Dominik

On Wed, Oct 19, 2011 at 11:54 PM, Barry Smith <bsmith at mcs.anl.gov> wrote:

>
> On Oct 19, 2011, at 1:27 PM, Jed Brown wrote:
>
> > On Wed, Oct 19, 2011 at 13:26, Dominik Szczerba <dominik at itis.ethz.ch>
> wrote:
> > Is it possible to VecCreate() first and set its type to ghosted later,
> just as it is possible with VECMPI?
> >
> > Not currently, you have to use VecCreateGhost*().
>
>
>   Ghosting is basically a property of VECMPI not a different vector class.
>  I have added a VecMPISetGhost() to petsc-dev that you can call after
> VecCreate(), VecSetType() and VecSetSizes().
>
>   It is not clear to me that this is a particularly useful function because
> you generally decide before you write the code if you are going to use
> ghosted vectors or not; that is, it is unlikely it is a runtime decision so
> you might as well just use VecCreateGhost() instead of the sequence
> VecCreate(), VecSetType(), VecSetSizes(), VecMPISetGhost(). But for
> uniformity of PETSc style it is good to have it so here it is.
>
>
>  Barry
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20111020/0d006895/attachment.htm>


More information about the petsc-users mailing list