Physical Groups

Mesh generators, CAD programs, and other tools
Post Reply
Brummig
Posts: 15
Joined: 08 May 2012, 12:42
Antispam: Yes

Physical Groups

Post by Brummig »

I'm modelling various designs of capacitive sensor using Elmer. I've now reached the point where the electrodes are sufficiently complex that it's becoming very difficult in Elmer to apply the boundary conditions to all the necessary surfaces every time I change a dimension. The obvious solution would be to define physical groups in Gmsh since then I would only need to define once which surfaces comprise each electrode, but as soon as I do that I no longer get the entire mesh in the .msh file unless I save the mesh ignoring the physical groups, which gets me nowhere. Even if I select all the surfaces into groups (not just the electrodes) the mesh file only contains a fraction of the mesh. Can anyone tell me please what I should be doing?
raback
Site Admin
Posts: 4825
Joined: 22 Aug 2009, 11:57
Antispam: Yes
Location: Espoo, Finland
Contact:

Re: Physical Groups

Post by raback »

I guess you need to define a physical group for the bodies (3D entities) as well. -Peter
Brummig
Posts: 15
Joined: 08 May 2012, 12:42
Antispam: Yes

Re: Physical Groups

Post by Brummig »

I've just spent much of the day adding groups one by one and meshing. It seems the meshing goes very obviously awry unless I select all the faces into groups, and all the volumes into groups. But having done that I only get two groupings in the mesh. Needless to say they don't turn out to be useful groupings.
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Physical Groups

Post by mzenker »

Hi,

what I do in such a case is:

* make sure that the entities have the same numbers in the geo file for the different variants, e.g. using parametrization
* make a mesh for each variant, save without physical groups
* then the numbering in Elmer will be the same, so I have to figure out only once which boundaries I have to apply my BCs to (e.g. using ElmerFront)
* write those boundary numbers somewhere, e.g. into a comment in a free text field in ElmerGUI
* each time I reload a geometric variant, I juat have to check the boundaries again in the BC box.

If you find a better solution, I would be interested... ;)

HTH,

Matthias
Brummig
Posts: 15
Joined: 08 May 2012, 12:42
Antispam: Yes

Re: Physical Groups

Post by Brummig »

Thanks, but what do you mean by parameterisation? I've not been able to find anything about parameterisation in the .geo file.

I did try using ElmerFront to identify which boundary was which, but with dozens of boundaries that all look the same when viewed individually it was a nightmare task figuring out which boundaries belonged to each electrode. Will parameterisation allow me to say "I know Boundary 48 belongs to Electrode X because I made it so in the .geo file?"

If I come up with a better solution I'll be singing it from the rooftops :shock: .
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Physical Groups

Post by mzenker »

Hi,

here is a small example to illustrate what I mean by parametrization. Consider the following geo file:

Code: Select all

cl1 = 0.1;
cl2 = 0.5;
x0 = 0;
y0 = 0;
z0 = 0;
length = 1;
height = 2;
depth = 3;
Point(1) = {x0, y0, z0, cl1};
Point(2) = {x0+length, y0, z0, cl1};
Point(3) = {x0, y0+height, z0, cl1};
Point(4) = {x0+length, y0+height, z0, cl1};
Point(5) = {x0, y0, z0+depth, cl2};
Point(6) = {x0+length, y0, z0+depth, cl2};
Point(7) = {x0, y0+height, z0+depth, cl2};
Point(8) = {x0+length, y0+height, z0+depth, cl2};
Line(1) = {7, 8};
Line(2) = {7, 5};
Line(3) = {5, 6};
Line(4) = {6, 8};
Line(5) = {8, 4};
Line(6) = {7, 3};
Line(7) = {3, 4};
Line(8) = {4, 2};
Line(9) = {2, 1};
Line(10) = {1, 3};
Line(11) = {5, 1};
Line(12) = {6, 2};
Line Loop(13) = {1, -4, -3, -2};
Plane Surface(14) = {13};
Line Loop(15) = {12, 9, -11, 3};
Plane Surface(16) = {15};
Line Loop(17) = {10, 7, 8, 9};
Plane Surface(18) = {17};
Line Loop(19) = {6, 7, -5, -1};
Plane Surface(20) = {19};
Line Loop(21) = {6, -10, -11, -2};
Plane Surface(22) = {21};
Line Loop(23) = {5, 8, -12, 4};
Plane Surface(24) = {23};
Surface Loop(25) = {24, 20, 22, 18, 16, 14};
Volume(26) = {25};
This gives you a cube of length 1, height 2 and depth 3. If you change one of the parameters in the geo file, reload and remesh, you can create geometry variants which will get the same numbering for bodies and boundaries in Elmer.

Since the numbering is not kept in Elmer, parametrization in the geo file will not allow you to find out better which surface is which. But it will spare you from the effort to find it out anew each time you change a dimension in your geometry.
BTW, ElmerFront assigns a color to each body which may help to assign a boundary to a body.

As I said, I don't know of a better solution...

HTH,

Matthias
Brummig
Posts: 15
Joined: 08 May 2012, 12:42
Antispam: Yes

Re: Physical Groups

Post by Brummig »

Thank you for another useful tip.
One problem I was struggling with whilst grinding through a few dozen boundaries in ElmerFront was that everything was displayed in one of two shades of yellow (the two shades representing selected and not selected), and some boundaries were hidden behind another surface. By accident I discovered that double-clicking an entry in the boundaries list resulted in that boundary being displayed in black, even if it was hidden behind something else. I hope that's of help to anyone following this topic.
mzenker
Posts: 1999
Joined: 07 Dec 2009, 11:49
Location: Germany

Re: Physical Groups

Post by mzenker »

You did use the possibility to check and uncheck boundaries in the boundaries list to selectively display them?
This is what I find most useful - unfortunately ElmerGUI lacks this functionality.
The possibility to have a boundary turn black might indeed be useful at times...

Matthias
Brummig
Posts: 15
Joined: 08 May 2012, 12:42
Antispam: Yes

Re: Physical Groups

Post by Brummig »

Yes. The problem is that the two electrodes look similar. If I turn on only one face, then it is impossible to tell which electrode it belongs to. Worse still the electrodes are about 8mm in diameter but only 0.032mm thick, so some faces are only a few pixels high and even less in terms of "depth". Trying to spot something that thin appearing and disappearing against another surface (the uniquely identifiable reference surface) when both are shaded yellow is not too easy, especially if the face being selected is hidden behind the reference face :).
Post Reply