So I am looking into the size of Nodes and Elems, with an eye to adding some
state information while hopefully not increasing the size of the objects by
much (or at all).

I used the attached code, which produces the following:

// ariel(15)$ ./nodebits
//  ---------------
// |32-bit machine |
//  ---------------
// 24=sizeof(DofObject)
// 28=sizeof(Point)

// 48=sizeof(Elem)
// 52=sizeof(ElemWith<char>)
// 52=sizeof(ElemWith<short int>)
// 52=sizeof(ElemWith<int>)
// 52=sizeof(ElemWith<std::bitset<8> >)
// 52=sizeof(ElemWith<std::bitset<16> >)
// 52=sizeof(ElemWith<std::bitset<32> >)
// 56=sizeof(ElemWith<std::bitset<64> >)

// 56=sizeof(Node)
// 60=sizeof(NodeWith<char>)
// 60=sizeof(NodeWith<short int>)
// 60=sizeof(NodeWith<int>)
// 60=sizeof(NodeWith<std::bitset<8> >)
// 60=sizeof(NodeWith<std::bitset<16> >)
// 60=sizeof(NodeWith<std::bitset<32> >)
// 64=sizeof(NodeWith<std::bitset<64> >)


//  benkirk(115)$ ./nodebits
//  ---------------
// |64-bit machine |
//  ---------------
// 40=sizeof(DofObject)
// 32=sizeof(Point)

// 88=sizeof(Elem)
// 88=sizeof(ElemWith<char>)
// 88=sizeof(ElemWith<short int>)
// 88=sizeof(ElemWith<int>)
// 96=sizeof(ElemWith<std::bitset<8> >)
// 96=sizeof(ElemWith<std::bitset<16> >)
// 96=sizeof(ElemWith<std::bitset<32> >)
// 96=sizeof(ElemWith<std::bitset<64> >)

// 80=sizeof(Node)
// 88=sizeof(NodeWith<char>)
// 88=sizeof(NodeWith<short int>)
// 88=sizeof(NodeWith<int>)
// 88=sizeof(NodeWith<std::bitset<8> >)
// 88=sizeof(NodeWith<std::bitset<16> >)
// 88=sizeof(NodeWith<std::bitset<32> >)
// 88=sizeof(NodeWith<std::bitset<64> >)

What has motivated this is that I would like an 'is_shared()' method in a
Node to efficiently identify nodes which are shared between processors.
(Note that testing the processor id of the node is insufficient when you own
the node.) 'on_boundary()' and 'has_dirichlet_bcs()' also come to mind as
something which could be useful, and I am sure others might have other
thoughts...

In looking at the Elem, for example, we have two unsigned chars in there
right now for h&p refinement flags...  These are used to hold one of 7
possible values for RefinementState. I think this could be replaced with 6
bit states (the 'DO_NOTHING' inferred from no bits set) in the case of the
h-refinement flag, and maybe 4 for the p-refinement flag.  (does INACTIVE or
COARSEN_INACTIVE mean anything for the p-refinement flag?)

I think if both those chars are removed from the element there might
actually be room for a bitset<32> without increasing the current size.  We
might actually also be able to do away with the _p_level as well if we are
willing to impose some maximum p-level, say 16 or whatever...

Thoughts anyone?

-Ben


Attachment: nodebits.C
Description: Binary data

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Libmesh-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to