On Thu, 24 Jun 2010 15:59:22 +0200 (CEST), Tim Kroeger 
<tim.kroe...@cevis.uni-bremen.de> wrote:
> Dear all,
> 
> In my application, I am doing quite a lot of assignments between 
> NumericVector instances (which always are PetscVector instances in my 
> case), and since I am lazily most of the time working in opt mode, I 
> didn't realize that I was sometimes assigning vectors of different 
> type, that is in particular
> 
> v = w
> 
> where v is a parallel vector and w is a ghosted vector.

This is value-assignment, right?  There is no behavioral difference
between a "parallel vector" and a "ghosted vector" except that you can
only VecGhostGetLocalForm and VecGhostUpdate the latter.  You can
certainly VecCopy between them.

Whether your operator= should support these mismatched types is entirely
up to you.  I could imagine imposing an artificial restriction just to
maintain consistent types so that you don't accidentally end up calling
VecGhostGetLocalForm on an plain vector (with work to figure out why
it's a plain vector and not VecGhost).

It is fine to use VecGhost for all vectors, the cost of holding the
(unused) local part in all the Krylov vectors is pretty small unless you
have very small subdomains (e.g. 8^3), very bad partitions, or large
overlap.  The smallest possible storage requirements are with VecGhost
used only for vectors holding the state (and residual); Krylov vectors,
vectors held by the time integrator, checkpoints for adjoints, etc., can
be held in plain vectors and copied into a VecGhost if you later decide
you need the local form.  The general operator= seems to make sense in
this context.

Jed

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to