Dear all,

For a dof of a vector the corresponds to a System, I need to know the 
maximal subdomain_id of all elements which contain this dof.  While it 
is principally possible to determine this on the fly (via 
Elem::find_point_neighbor() and then a loop over the resulting 
elements and a loop over their respective dofs), this seems to be very 
slow (I guess too slow).  Therefore, I would like to store this 
complete information in some type of vector so that I can access it 
easily when I need it.  Since I actually need quite a lot of such 
vectors (because I have quite a lot of systems, and also I need a 
similar thing for the *minimal* subdomain_id), I would like to use 
some data structure that does not occupy more memory than required. 
However, I can't imagine what that might be.

std::vector<unsigned char> (where the index is the elem.id()): No, 
because this will be a serial vector, while I only need something like 
a "ghosted" vector.

NumericVector<unsigned char>: Would be great, but I don't think this 
exists (in particular since it seems to me that PETSc cannot work with 
more than one PetscScalar type at a time).

NumericVector<Number>: Will work but implies that I always have to 
cast from a floating point type to an integer type, which I don't find 
a clean thing to do.

std::map<unsigned int, unsigned char>: Seems to be the best solution 
that I can currently think of.  Can also be extended to 
std::map<unsigned int,std::pair<unsigned char,unsigned char> > so that 
minimal and maximal subdomain_id are stored in one structure.

Any suggestions?

Best Regards,

Tim

-- 
Dr. Tim Kroeger
CeVis -- Center of Complex Systems and Visualization
University of Bremen              [email protected]
Universitaetsallee 29             [email protected]
D-28359 Bremen                             Phone +49-421-218-7710
Germany                                    Fax   +49-421-218-4236

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to