On Tue, 31 Aug 2010 15:24:55 -0500 (CDT), Roy Stogner <royst...@ices.utexas.edu> wrote: > > On Tue, 31 Aug 2010, Jed Brown wrote: > > >> But it would be sufficient for your case to just create ghosted > >> instead of parallel vectors. We can't do that in general in > >> NumericVector::build() because that doesn't have access to DofMap's > >> send_list. But we could do that as an option (run-time, even - make > >> it a flag in the System class) in System::add_vector() and > >> *System::init(). > > > > I don't remember how this is done in libmesh, but it would be typical to > > create a solution/residual vector from the function space (mesh), and > > the overlap (distribution and ghost indices) is available in that > > context. > > Yes; that's the context available in the System class. > > However when we're just building a parallel vector, we only call > NumericVector::build() with the global and local sizes, not with the > entire context that exists in the caller.
Okay, I just peeked at system.C. I think the way I would implement is to add the ghosted interface to your NumericVector class (when a send-list is provided). When running with the PETSc backend, there is only one slot (for the ghosted parallel vector), and getting the local form calls VecGhostGetLocalForm. With other backends, or if the user explicitly doesn't want to use ghosted, then NumericVector would perform the scatter and give the user access to the local vector. Then you could get rid of all ghost-related special cases in system.C. 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