Adding boundaries to a gmsh .inp file

725 views
Skip to first unread message

Jaron Senecal

unread,
Apr 20, 2014, 8:23:56 PM4/20/14
to moose...@googlegroups.com
Hello,
I am using gmsh to create an (Abaqus) .inp file for use in my MOOSE application. When I load the mesh there are blocks but no sidesets/boundaries. It appears that both PhysicalSurfaces and PhysicalVolumes in gmsh are interpreted as bodies by MOOSE. How can I create boundaries in either gmsh or peacock?
Thanks,
Jaron

Permann, Cody J

unread,
Apr 20, 2014, 8:41:31 PM4/20/14
to Jaron Senecal, moose...@googlegroups.com
Take a look at our MeshModifiers: http://mooseframework.org/docs/doxygen/moose/classMeshModifier.html

You might try "AddAllSideSetsByNormals" or "SideSetsAroundSubdomain" to have MOOSE add them automatically based on your geometry, there are others that might work as well.  When you execute your application, try the "--mesh-only" option to execute the Mesh and MeshModifier blocks only without executing your entire simulation.  In this fashion, you can adjust your mesh programmatically to obtain the mesh you want before you run your simulation.  If you have any questions, let us know!

Cody


--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peterson, JW

unread,
Apr 21, 2014, 10:51:55 AM4/21/14
to Jaron Senecal, moose-users
On Sun, Apr 20, 2014 at 6:23 PM, Jaron Senecal <jaron....@gmail.com> wrote:
Hello,
I am using gmsh to create an (Abaqus) .inp file for use in my MOOSE application. When I load the mesh there are blocks but no sidesets/boundaries. It appears that both PhysicalSurfaces and PhysicalVolumes in gmsh are interpreted as bodies by MOOSE. How can I create boundaries in either gmsh or peacock?

Can you send us (perhaps as a google doc if it's large) the Abaqus file that Gmsh is creating for you?

I wrote the libmesh Abaqus writer based on a limited set of input file examples, it's possible that gmsh is doing something for sidesets that is outside the scope of what we are capable of reading...

--
John

Ziyu ZHANG

unread,
Apr 21, 2014, 11:14:32 PM4/21/14
to Peterson, JW, Jaron Senecal, moose-users
Hi, I am also having the same problem... My *.inp file is attached in this email. I'd appreciate if you could provide some instructions on how to define boundary conditions on the four straight boundary lines for this INP file. The model is pretty simple and its snapshot is also attached.


--
You received this message because you are subscribed to the Google Groups "moose-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to moose-users...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Ziyu ZHANG 張子瑜
PhD Student
Duke Computational Mechanics Laboratory
Department of Civil & Environmental Engineering
Duke University
Office: 919-660-5031
plate_hole.inp
plate_hole.png

Peterson, JW

unread,
Apr 22, 2014, 10:57:37 AM4/22/14
to Ziyu ZHANG, Jaron Senecal, moose-users
On Mon, Apr 21, 2014 at 9:14 PM, Ziyu ZHANG <buaazh...@gmail.com> wrote:
Hi, I am also having the same problem... My *.inp file is attached in this email. I'd appreciate if you could provide some instructions on how to define boundary conditions on the four straight boundary lines for this INP file. The model is pretty simple and its snapshot is also attached.

Thanks Ziyu.  Just to confirm, you used Gmsh to generate this Abaqus file?

--
John

Ziyu ZHANG

unread,
Apr 22, 2014, 11:27:15 AM4/22/14
to Peterson, JW, Jaron Senecal, moose-users
Yes, I used Gmsh to generate it. The ELSET Line1 - Line4 are the four straight boundary lines which I intend to impose BCs to. And the ELSET surface7 is the 2D body.

Peterson, JW

unread,
Apr 22, 2014, 11:38:41 AM4/22/14
to Ziyu ZHANG, Jaron Senecal, moose-users
Ziyu,

When I try to read your Mesh file, I actually get an error:

Unrecognized element type: *ELEMENT, TYPE=T3D2, ELSET=LINE1

Google tells me T3D2 is a 3D Truss element with 2 nodes, so that would map to libmesh's EDGE2 type.  I can fix this, but the bigger issue here seems to be that Gmsh is specifying (what we call) sidesets as ELSETs on lower-dimensional elements (T3D2s) rather than as *SURFACE or *NSET sections, which is what Libmesh's Abaqus reader currently supports.  See, for example, the "PhysicalLine9" section of your input file.

We can probably support this type of file, but it will require some updates to the Abaqus reader in order to map these sidesets defined on lower-dimensional elements to actual sides of higher-dimensional elements...  

--
John

Gaston, Derek R

unread,
Apr 22, 2014, 12:40:22 PM4/22/14
to Peterson, JW, Ziyu ZHANG, Jaron Senecal, moose-users
Doesn't libMesh support the actual GMSH format itself?  Do we support it in MOOSE?

It might be a better idea to just have GMSH write out it's "native" format instead and read it directly....

Derek


--

Ziyu ZHANG

unread,
Apr 22, 2014, 12:47:58 PM4/22/14
to Gaston, Derek R, Peterson, JW, Jaron Senecal, moose-users
MOOSE manual says .msh file is "write only", so I suppose MOOSE can only write it but not read it? Also, in Gmsh native files, the sidesets are also regarded as one dimension elements, which are put together with 2D body elements in the element section, so I guess MOOSE reader may still have the difficulty to read it (if it can somehow read .msh files).
plate_hole.msh

Peterson, JW

unread,
Apr 22, 2014, 12:51:31 PM4/22/14
to Ziyu ZHANG, Gaston, Derek R, Jaron Senecal, moose-users
On Tue, Apr 22, 2014 at 10:47 AM, Ziyu ZHANG <buaazh...@gmail.com> wrote:
MOOSE manual says .msh file is "write only", so I suppose MOOSE can only write it but not read it? Also, in Gmsh native files, the sidesets are also regarded as one dimension elements, which are put together with 2D body elements in the element section, so I guess MOOSE reader may still have the difficulty to read it (if it can somehow read .msh files).

There is a gmsh reader in libmesh, and it looks like it supports reading lower-dimensional elements for setting boundary condition information.  I think this reader should work automatically in MOOSE if you name your input file with a .msh extension.

Would you mind trying the gmsh format and letting us know if it works?  We will update the MOOSE manual if so.

--
John

Permann, Cody J

unread,
Apr 22, 2014, 12:53:20 PM4/22/14
to Peterson, JW, Ziyu ZHANG, Gaston, Derek R, Jaron Senecal, moose-users
We will need to add support to write the format in MOOSE, but that should be trivial.

Cody


--

Gaston, Derek R

unread,
Apr 22, 2014, 1:01:36 PM4/22/14
to Permann, Cody J, Peterson, JW, Ziyu ZHANG, Jaron Senecal, moose-users
I think John is right - if you output the native GMSH format and make sure the file name ends in .msh then MOOSE should just read it in with no problems.

Can one of you guys send us a simple GMSH format mesh for us to play with and we can incorporate this into our test suite?

Thanks!

Derek

Ziyu ZHANG

unread,
Apr 22, 2014, 1:04:53 PM4/22/14
to Gaston, Derek R, Permann, Cody J, Peterson, JW, Jaron Senecal, moose-users
Hi Derek, I just sent one - plate_hole.msh. I am also trying that now

Peterson, JW

unread,
Apr 22, 2014, 1:09:01 PM4/22/14
to Ziyu ZHANG, Gaston, Derek R, Permann, Cody J, Jaron Senecal, moose-users
On Tue, Apr 22, 2014 at 11:04 AM, Ziyu ZHANG <buaazh...@gmail.com> wrote:
Hi Derek, I just sent one - plate_hole.msh. I am also trying that now

Can you send me a copy of plate_hole.msh as well, I don't seem to have it in my email.

Thanks,
John

Peterson, JW

unread,
Apr 22, 2014, 2:42:13 PM4/22/14
to Ziyu ZHANG, moose-users
On Tue, Apr 22, 2014 at 11:35 AM, Ziyu ZHANG <buaazh...@gmail.com> wrote:
Hi John, here it is.

Thanks, but there does not seem to be any boundary information (sidesets, etc) in this file...

--
John

Ziyu ZHANG

unread,
Apr 22, 2014, 3:19:53 PM4/22/14
to Peterson, JW, moose-users
Yes, this is what Jaron and I were saying in previous emails... In Gmsh, the lower dimension facet elements and full dimension body elements are put together in the element section. If you look at the first line of the element section, element 1-32 are boudary elements, and element 33-282 are body elements. The marker to distinguish them is the second number right after the element ID. In my file, it is 1 or 2: 1 means facet element (line elements) in 2D and 2 means body element in 2D. The details for Gmsh .msh file format are here:


Maybe it will take you a lot of time to add full support for this weird MSH files :(

Peterson, JW

unread,
Apr 22, 2014, 3:42:57 PM4/22/14
to Ziyu ZHANG, moose-users


On Tue, Apr 22, 2014 at 1:19 PM, Ziyu ZHANG <buaazh...@gmail.com> wrote:
Yes, this is what Jaron and I were saying in previous emails... In Gmsh, the lower dimension facet elements and full dimension body elements are put together in the element section. If you look at the first line of the element section, element 1-32 are boudary elements, and element 33-282 are body elements. The marker to distinguish them is the second number right after the element ID. In my file, it is 1 or 2: 1 means facet element (line elements) in 2D and 2 means body element in 2D. The details for Gmsh .msh file format are here:


Maybe it will take you a lot of time to add full support for this weird MSH files :(

I see, sorry I didn't understand before.

It looks like the libmesh gmsh file reader has a little trouble reading this file as well, in debug mode I hit an assert:

Warning: can't load an element of dimension 1 into a mesh of dimension 3
Assertion `n_pieces > 0' failed.

To work around these issues, can you create your Abaqus or Gmsh file _without_ the lower-dimensional elements, and then try setting up the BCs with one of the MeshModifiers that are available in MOOSE?

--
John
Reply all
Reply to author
Forward
0 new messages