core icon indicating copy to clipboard operation
core copied to clipboard

Creating two numberings on the same field is flawed.

Open wrtobin opened this issue 7 years ago • 2 comments

If we create two numberings on a field:

apf::numbering * a = apf::createNumbering(fld);
apf::numbering * b = apf::createNumbering(fld);

and run different numbering algorithms on them:

apf::naiveOrder(a);
apf::adjReorder(b);

when retrieving numbers from a later on in a program, the values retrieved appear to be those set by the numbering algorithm applied to b.

I'm not certain what the cause for this is, though the underlying FieldBase<int> for each numbering has the same identifying string, which may be relevant, but so far I haven't exactly identified at what level the bug is occuring.

wrtobin avatar Nov 07 '18 19:11 wrtobin

This issue might not occur when using the apf::createNumbering(Mesh*,const char*,FieldShape*,int) function instead, I'm looking into that.

wrtobin avatar Nov 07 '18 20:11 wrtobin

Okay using the alternate apf::createNumbering() function avoids this issue, but using this workaround means that apf::getField(num) will return NULL.

The bug in the simpler apf::createNumbering() function still needs to be addressed.

wrtobin avatar Nov 07 '18 20:11 wrtobin