MTEX2Gmsh icon indicating copy to clipboard operation
MTEX2Gmsh copied to clipboard

[help wanted] Creating phase groups

Open Max-EDFLMT opened this issue 3 years ago • 1 comments

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

Max-EDFLMT avatar Feb 24 '21 11:02 Max-EDFLMT

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.

Regards.

DorianDepriester avatar Feb 28 '21 17:02 DorianDepriester