On Tue, 14 Sep 2010, Tim Kroeger wrote:

> 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).

It also might be incorrect, depending on your definition of "contain".
Are you looking at just all elements which have a shape function
associated with this DoF, or are you also including every element
which supports an associated basis function?  In the former case it's
enough to find elements which point to this DoF's node; in the latter
case in an adapted mesh you've also got to check for other DoFs which
are constrained by this one.

But when you want to cache it:

> 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?

If efficiency is important, put the local dofs in a vector and just
the ghost dofs in a map.

If efficiency is really important, try both map and hash_map.  Grep for
HASH_MAP and you'll find two places where we're using them for
multimap containers (in one of 7 incarnations depending on how up to
date your compiler is), and you can use the same #if defined() tests
to find a supported hash_map type or fallback.

If you want to be awesome, add this as a GHOSTED option to the
DistributedVector class.  PETSc may not want to play with multiple
scalar types but it'd be no problem for us to add additional
instantiations like DistributedVector<unsigned int>.
---
Roy

------------------------------------------------------------------------------
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