If you are only using PETSc, the efficient way to do this is to get the raw petsc vector via the wrapper (wrappervec.vec()) and then use that with VecReciprocal function. If you are using Trilinos, I believe there is also a reciprocal function that takes an EPetraVector to do the same.
If need be, it might be worthwhile to add a pure virtual method on NumericVector so that the overridden class can call its corresponding specialized routines. On Fri, Jan 27, 2012 at 12:36 AM, Vetter Roman <[email protected]> wrote: > Hi folks > > how would I compute the element-wise reciprocal of a ghosted NumericVector in > parallel? While I can just iterate through all entries i and do v.set(i, > 1/v(i)) in serial mode, the solution in parallel with ghosts is not at all > obvious to me. > > In case you're wondering: I can't fill v with the desired reciprocal values > in the first place, because the entries to be inverted are sums of element > contributions. > > Cheers, > > Roman > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > Libmesh-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/libmesh-users ------------------------------------------------------------------------------ Keep Your Developer Skills Current with LearnDevNow! The most comprehensive online learning library for Microsoft developers is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, Metro Style Apps, more. Free future releases when you subscribe now! http://p.sf.net/sfu/learndevnow-d2d _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
