Shared Voronoi functionality between baseplate and powder init #372
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An edge case was previously possible in ExaCA where, due to the fact that the powder layer initialization left some cells with a "zero" GrainID, simulations of FromFile and FromFinch problems could get locked in a loop where no valid grain could claim the liquid cells in some melt pools for many time steps, often leading to simulation timeout. It also lead to unnatural grain shapes as grains stretch across multiple melt pools.
This changeset uses Voronoi helper functions to initialize both the baseplate (which previously used a Voronoi tessellation to assigned GrainIDs to cells) and each powder layer, so that no cells have a GrainID of 0 following initialization. The PowderDensity input is replaced with a MeanPowderGrainSize input, and for consistency, the MeanSize input is renamed MeanBaseplateGrainSize. Minor changes to the std::cout statements are also made to log which GrainID values are being used for which parts of the simulation (baseplate, powder layers, nucleated grains)