[Gmsh] Gmsh user help

Geordie McBain gdmcbain at freeshell.org
Tue Aug 4 02:55:28 CEST 2015


2015-08-03 21:33 GMT+10:00 3.14 <972260358 at qq.com>:
> I have tried that  way.But,i  am still confused .Did you mean that the BCs
> should be applied in the "phsical Lines" in 2D problems?

Yes.

> By the way,my FEA software is applying BCs on the boundary elements whose
> are triangles  or quadrangles .

That's right, for a three-dimensional problem. So those parts of the
boundary where you want to apply the boundary conditions should be
defined as Physical Surfaces.

> Do  I make some mistakes?

No, I don't think so, that sounds fine.

> May  you give me more information?

Sure.  Will a two-dimensional example do?  Here's a listing of a .geo
file for a rectangle in which all four sides are put into a single
Physical Line.

phi = (1 + Sqrt(5)) / 2;
Point(1) = {-phi, phi^2, 0};
Point(2) = {-phi, -phi^2, 0};
Point(3) = {phi, -phi^2, 0};
Point(4) = {phi, phi^2, 0};

Line(1) = {1, 2};
Line(2) = {2, 3};
Line(3) = {3, 4};
Line(4) = {4, 1};

Physical Line(1) = {1, 2, 3, 4};

Line Loop(1) = {1, 2, 3, 4};
Plane Surface(1) = {1};
Physical Surface(2) = {1};

Processing this with Gmsh, you'll see a number of type 1 elements,
i.e. two-node lines, which are the one-dimensional boundary elements,
and some type 2 elements, i.e. three-node triangles, which are the
domain elements.  The procedure in three dimensions is analogous.