suspicious code for operator+ in bboxset2

Create issue
Issue #1589 closed
Roland Haas created an issue

Operator+ in bboxset2 seems to actually implement operator^ but I don't quite understand what they are all doing so, please review.

When running with CARPET_DEBUG and CARPET_USE_BBOXSET2 the code dies with an assert due to a non-empty box intersection from inside CARPET_DEBUG code which seems to be due to the (invalid) assumption that multiple box.exterior would not overlap.

Finally the last patch fixes an possible obscure issue where CarpetIOHDF5 will ignore the checkpoint=no tag of a grid variable if the checkpoint file does indeed contain such a variable (since eg it was written with a code version that still had checkpoint=yes).

Keyword: Carpet

Comments (9)

  1. Erik Schnetter
    • changed status to open
    • removed comment

    Where is the + operator that combines different box.exteriors? Is this the one changed in patch 0003?

    Operator ^ calculates the symmetric set difference. Due to the internal representation used by bboxset2, which is based on symmetric set differences, this operator is especially efficient. I believe the current code is correct, and the patch only makes things less efficient. Please do not apply it.

    Patch 0003 looks correct. I do not know why the fine grid boundaries should be disjoint. Please apply it.

  2. Roland Haas reporter
    • removed comment

    Replying to [comment:3 eschnett]:

    Where is the + operator that combines different box.exteriors? Is this the one changed in patch 0003? yes, it is in patch 0003.

  3. Log in to comment