On Tue, 10 Feb 2009, Vijay S. Mahadevan wrote: > I am in a pickle here. I originally had my custom implementation of > associating tags with elements and nodes to maintain the material > numbers and other physics relevant information. But then, I modified > my code to actually attach the material number information to the > sbd_id in Elem. I remember reading that most of you follow this to > identify the material corresponding to a finite element. > > I have a complication due to this: I have more than 255 materials and > since _sbd_id is unsigned char, this leads to garbage. On the other > hand, I do not want to go back to mesh_data usage either since it is > messy and I need to propagate information based on refinement and > coarsening. > > As a solution, I was wondering whether it would make sense to add a > std::vector<objects> for every element and node. Of course, by default > these will be empty to save resources. This way, the user controls > what tags to associate with every element and thereby helps the > physics calculations in a better way. > > If you think this is not the way to go and then do pass on your > comments. If you have better ideas that you are using already or want > to try out, I would love to hear that too.
Two more natural ways to go here: Change the subdomain_id type. Frankly, there's a lot of hard coded types in libMesh that we ought to be turning into typedefs; we might as well start by fixing this one. Find everywhere a subdomain id is being used, change it from unsigned char to subdomain_id_t, add a "typedef unsigned char subdomain_id_t;" to an appropriate header, and we'll happily commit the patch. Then add an autoconf option for specifying a non-default type (e.g. short, int, long int) if you want to go whole hog, or just change it by hand for your own installation. Add something like deal.II's user_pointer to every element and node. More powerful, but also a little harder to deal with (e.g. how do you serialize to mesh files?) Thoughts? --- Roy ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
