Feature: Grain Boundaries#387
Merged
Merged
Conversation
new grainboundaries implementation
JonathanMaes
reviewed
Apr 8, 2026
add 3 bools (X,Y,Z) for treating simulation box edges as boundaries
Contributor
Author
|
Added the 3 bools as ext_grainboundary_edgeX/Y/Z. They respect PBC, so if PBC is on in say X, but ext_grainboundary_edgeX is false, you'll still get boundaries as expected, if there are two different regions on either side of the wrap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a new function that adds boundaries to existing regions, given user input of: (startregion, numgrains, offset, boundarythickness, zeroflag). Zeroflag: 1 = region0 is normal, 0 = region0 acts as edge but no boundary itself, -1 = ignore region0 entirely.
For instance, if one had called
ext_make3dgrains(200e-9, 1, 50, ellipsoid(5e-9512,5e-9256,5e-9*100), 12345678)
and you wanted 2 boundary layers each with thickness of 3 cells, you might do:
ext_grainboundaries(0,50,51,3,1)
ext_grainboundaries(0,50,102,3,1)