On Wed, Jun 8, 2011 at 8:49 AM, Cody Permann <[email protected]> wrote:
> I've just about finished up the patch to allow us to configure 
> subdomain_id_type with ./configure.  The current syntax I'm using is 
> "--with-subdomain-id-bytes=<1|2|4>" defaulting to "2".

> I'm running into an issue now with our regression test suite where I'm 
> getting diffs on tests that use the mesh generation facilities when I 
> reconfigure with a different size subdomain_id_types.  The issue is that in 
> exodusII_io_helper we take any element in subdomain 0 and remap it to 
> numeric_limits<subdomain_id_type>::max() because we can't write subdomain 0 
> to an exodusII file - *sigh*.


I think we should change the ExodusII code to map 0 to

numeric_limits<int>::max()

when writing, regardless of the subdomain_id_type, since that value
will always be valid for Exodus.

When reading, we initially read the subdomain ID into an int, then
check to see if that int value is >=
numeric_limits<subdomain_id_type>::max().  If it is, then that
subdomain ID gets mapped to 0 within libmesh.

If we encounter more than one subdomain ID when reading which is >=
numeric_limits<subdomain_id_type>::max(), then that's an error: you
can't read the current exodus file with the currently configured
libmesh; we could print an error message to that effect.


> Also, does anyone have a good way to assure that we get the right size type 
> for *any* system?  Configure tests the sizes of the various types and records 
> them but I couldn't come up with a clean way to get those sizes into the 
> actual typedef without a lot of seemingly hackish CPreprocessor commands.  
> Right now I'm just making assumptions (see id_types.h)

The most portable way (aside from additional autoconf code) is to let
the user choose a C type, e.g. "char/short/int" instead of a number of
bytes.  Presumably he knows which is the appropriate one on his
system.

-- 
John

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to