From: Benjamin Kirk <benjamin.kirk@na...>  20081118 17:40:54

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 //  // 32bit 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 //  // 64bit 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 hrefinement flag, and maybe 4 for the prefinement flag. (does INACTIVE or COARSEN_INACTIVE mean anything for the prefinement 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 plevel, say 16 or whatever... Thoughts anyone? Ben 