[Gmsh] physical surface in gmsh

王学敏 campusxuemin at gmail.com
Tue Mar 18 01:44:17 CET 2014


Dear Geordie,
Thank you so much for your help.
I have one more question, when I used gmsh to open solid1.mesh, I could see
mesh inside the graph. I just add a sentence "plot(Th) " in solid1.edp,
there was no mesh inside, it is so strange.
Best regards,
Xuemin



2014-03-17 19:09 GMT-05:00 Geordie McBain <gdmcbain at freeshell.org>:

> 2014-03-18 5:54 GMT+11:00 王学敏 <campusxuemin at gmail.com>:
> > Dear gmsh user,
> > I got geometry from solidwork and got mesh from gmsh. I should define
> > physical surface in .geo file and I did. But when I imported mesh to
> > freefem, it seemed that there was no physical surface. Especially
> physical
> > surface 27 in geo file. Attachments are geo file and msh file. Thank you
> so
> > much.
>
> For FreeFem++, you might have more luck exporting in "format -mesh",
> as in http://www.geuz.org/pipermail/gmsh/2010/005438.html
>
> On the command-line (after having renamed your "solid (1).geo" as
> "solid1.geo"):
>
> $ gmsh -3 -format mesh -string 'Mesh.SaveElementTagType=2;' solid1.geo
>
> For me this produced a solid1.mesh, as attached, which did have
> triangular elements with tag 27.  I verified this by calculating their
> collective area in FreeFem++ with a very small FreeFem++ script,
> solid1.edp, as attached:
>
> mesh3 Th = readmesh3("solid1.mesh");
> int[int] surfaces = [25, 26, 27];
> for (int i = 0; i < surfaces.n; i++) {
>     cout << "Area of Surface" << " " << surfaces[i] << ": " <<
> int2d(Th, surfaces[i]) (1.0)
>     << endl;
> }
>
> It produces the output:
>
> Area of Surface 25: 2
> Area of Surface 26: 2.1146
> Area of Surface 27: 105.613
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.geuz.org/pipermail/gmsh/attachments/20140317/b7f5c186/attachment.html>