You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not that confident with GMSH but I added a little something to your mesh command in order to create a group for phases in the fashion you introduced grains groups. This is useful for affecting mechanical behaviors afterwards.
groupPrefix='Gr';
phaseList = unique(obj.Grains.Phase);
for i=1:size(phaseList,1)
Ids = obj.Grains.GrainID(ismember(obj.Grains.Phase,phaseList(i)));
Ids_str = [sprintf('%d,', Ids(1:end-1)), sprintf('%d', Ids(end))];
fprintf(ffid,['Physical Volume("%s_%s")={' Ids_str '};\n'],groupPrefix,phaseList{i,1});
end
I added this piece of code right after you ended the "for" loop in "Physical Volumes" section.
The issue is that GMSH is creating a mesh for grains groups and phase groups resulting in duplicating the elements everywhere (because grain groups are all included in phase groups, lying on the same base geometry entities)
Is there a way to avoid this issue ?
Thanks in advance,
Maxime
The text was updated successfully, but these errors were encountered:
Max-EDFLMT
changed the title
Creating phase groups
[help wanted] Creating phase groups
Feb 24, 2021
Hi Maxime,
Thank you for your comment. Indeed, grouping grains by their phase could be an interesting feature. I am currently away from office, but I will have a look on your issue ASAP.
Hi Dorian,
I'm not that confident with GMSH but I added a little something to your mesh command in order to create a group for phases in the fashion you introduced grains groups. This is useful for affecting mechanical behaviors afterwards.
groupPrefix='Gr';
phaseList = unique(obj.Grains.Phase);
for i=1:size(phaseList,1)
Ids = obj.Grains.GrainID(ismember(obj.Grains.Phase,phaseList(i)));
Ids_str = [sprintf('%d,', Ids(1:end-1)), sprintf('%d', Ids(end))];
fprintf(ffid,['Physical Volume("%s_%s")={' Ids_str '};\n'],groupPrefix,phaseList{i,1});
end
I added this piece of code right after you ended the "for" loop in "Physical Volumes" section.
The issue is that GMSH is creating a mesh for grains groups and phase groups resulting in duplicating the elements everywhere (because grain groups are all included in phase groups, lying on the same base geometry entities)
Is there a way to avoid this issue ?
Thanks in advance,
Maxime
The text was updated successfully, but these errors were encountered: