On Thu, 28 Jun 2018, Renato Poli wrote:

Should I copy-paste code from NumericVector to build mine?
Any suggestion?

We're pretty far into XY Problem territory at this point.

http://xyproblem.info/

What you've said about your vector is that you'll need to be able to
do a maxloc() on it, that it's describable as a "solution vector",
that you seem to interested both in sorting it and in using it with
an arbitrary value type T.  That's not enough information to give
advice.

The "arbitrary value type T" criterion rules out pretty much all of
the libMesh NumericVector subclasses (except perhaps
DistributedVector, with some work), but the "solution vector"
description in the libMesh context *implies* a NumericVector subclass
(and not the DistributedVector subclass, if you're solving an implicit
system).

Another alternative is to sync the solution vector to all processors so
that everybody can do the same calculation.

Are you referring to the maxloc() calculation here?  That wouldn't be
hard to add to NumericVector (with specializations for speed in
subclasses), and the implementation would be a lot more efficient than
serialization.  But maxloc has nothing to do with the "you can't use
NumericVector with generic type T" problem, so maybe back up and
figure that out (starting with *why*, not *how*)first?
---
Roy

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to