On Tue, 31 Aug 2010 11:18:17 -0500 (CDT), Roy Stogner 
<royst...@ices.utexas.edu> wrote:
> 
> 
> On Tue, 31 Aug 2010, Derek Gaston wrote:
> 
> > So... up until now I've only ever needed one "ghosted" vector... for
> > the solution vector.  And, just as we do in petsc_nonlinear_solver.C
> > I've just been bastardizing System::update() and
> > current_local_solution to "ghostize" a vector.
> >
> > But now that won't work because I need two such vectors
> > simultaneously.  What is the current state of the ghosted vector
> > situation?  What is the right way to take a Vec from a Petsc
> > callback and form a ghosted PetscVector out of it that I can pass to
> > my own (assembly like) routines?

If a VecGhost was passed in to SNES, then all the Krylov vectors will
also be VecGhost.  If not, create a new VecGhost (VecCreateGhost() or
VecDuplicate() an existing VecGhost) and VecCopy from the plain Vec to
the ghost Vec.

> But that's in theory.  In practice:
> 
> 1. We also call this->_vec = v; this works in current PETSc since a
> Vec is really just a pointer to the real structure, but I'm not sure
> if it's official standard behavior that won't break someday.

I'm not sure what you're after here, but

  typedef struct _p_Vec *Vec;

is pretty fundamental to the object model, it's not subject to change.
You might want to PetscObjectReference((PetscObject)v) depending on the
owneship semantics you are after.

Jed

------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to