Dear Roy,

On Wed, 17 Dec 2008, Roy Stogner wrote:

>> Why does NumericVector::localize_to_one() write its results into an
>> std::vector<T> rather than into another NumericVector<T>, like most of
>> the localize() methods do?

> We only really use that method for data output, for which it's pointless to
> create a PETSc or some such linear algebra vector.

>> Is there some easy workaround for that?

> Don't we have NumericVector constructors that take a std::vector?

Constructors not, but operator=.

> Not that that's efficient, but it's easy.

You're right.

> What do you need a NumericVector on one processor for?

I want to create a MeshFunction on this vector, and then output its 
values at certain points (which are most probably not grid points).

Currently, I just localize to all processors.  Directly after that, I 
have

   if(libMesh::processor_id()==0)
     {
       // Initialize MeshFunction and do a lot
     }
}

where the last } lets the vector that has been localized go out of 
scope.  Hence, it seems to be okay for me, but it would be more 
suggestive to localize to processor 0 only.

> Otherwise you may have to write an overloaded localize_to_one().

I've not yet decided whether I want to do that.  (-:

Best Regards,

Tim

-- 
Dr. Tim Kroeger                                        Phone +49-421-218-7710
[email protected], [email protected]  Fax   +49-421-218-4236

MeVis Research GmbH, Universitaetsallee 29, 28359 Bremen, Germany

Amtsgericht Bremen HRB 16222
Geschaeftsfuehrer: Prof. Dr. H.-O. Peitgen

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to