Closed zachcroft closed 2 months ago
The minimum grain id is hard-coded to zero, so it's fine as is.
I do think we should revisit the unit tests in the future to more thoroughly cover examples of grain reassignment (both different microstructures & something like 3-5 rectangular grains in a row)
Per our meeting, keep the part with the mergeSplitGrains()
and remove the part with the thresholding. Instead, change the unit test.
The minimum grain id is hard-coded to zero, so it's fine as is.
I do think we should revisit the unit tests in the future to more thoroughly cover examples of grain reassignment (both different microstructures & something like 3-5 rectangular grains in a row)
I want to make a comment that my most recent commit modified the ele_val threshold to be min_id instead of zero, but there is no technical justification for this change and it possibly introduced a bug.
I agree unit tests should be revisited. In my opinion, the queue flood fill algorithm needs to be implemented since it creates a large speed-up (I will submit a PR in the near future). We can create a new unit test for this algorithm.
Fixing the issue #219
1) Unit tests for FloodFiller and OrderParameterRemapper (which calls FloodFiller) were failing because of a modification that assigns the most common value of nodes to ele_val. The unit test has a grain with only one nodal value, so this wasn't being detected since the most common value would be null. I added a conditional that the most common value must be nonzero.
2) Because of the change to how ele_val was calculated, the threshold check for assigning vertices to grains also changed. Inconsistencies in grain vertex lists causes them to give rise to the "cracked" appearance described in the issue. The issue wasn't present in parallel because mergeSplitGrains() is called. To fix this issue for serial runs, I added a call to mergeSplitGrains() in the calcGrainSets function.