BuildFaceToCell Calling EntityRep::setValue() With Index of "-1"
I was debugging another issue when an assert triggered in EntityRep<>::setValue(). The direct cause of this assertion failure was function cpgrid::buildFaceToCell() calling setValue() with
other_cell = -1
There are a number of possibilities here
- The assertion is wrong and it's okay to call the function with a negative index (unlikely)
- The calling code in
buildFaceToCell()needs a check for negative cell indices - The pinch processing code is wrong since it generates a negative cell index
At the top of my head I don't know which is which here so I'd like to discuss the matter. For the record, this issue presented when running the VOLVE_2020 model.
1 and 2 should not be needed. 3 seems not to be the case as actnum is checked for both above and below, when inserting. There are issues with some of the logic expressions, though.
Maybe the active cells are changed somewhere in between such that global_to_local[it->second]<0 despite actnum[it->second]>0?