4
$\begingroup$

I acknowledge the following post where a similar question is posed and a very nice answer has been provided: Is there a mesh generator that will generate zero thickness elements for interfaces?

However, the interface created there consists of 2 noded line elements.

My question is as follows:

  • Is there a convenient method of inserting quad elements with (originally) overlapping nodes, i.e. with a zero thickness.

Quad interface element

Possibly within Gmsh or alternatively an example using a similar open source mesh generator. This would require duplicate nodes along the interface, the resulting mesh following the example has only one node on every coordinate. I require quad elements along the interface to include mixed-mode debonding using a cohesive zone approach.

$\endgroup$
1
  • 1
    $\begingroup$ I just edited my response. Let me know if this works for you. You just need python in order to run it. I wrote it on a *nix system, so if you're on Windows and something in the code breaks, I apologize. $\endgroup$ Commented Sep 22, 2015 at 23:38

1 Answer 1

4
$\begingroup$

One way to do it might be to create an internal Line Loop in the input file where the crack originates. To do this, you would create 2 points at each end of the crack in your .geo file (say, points 1,2,3,4), and connect them up with lines. Then, create a Plane Surface from the border of that zero-thickness line loop. When you mesh the geometry, elements will hopefully be placed in this zero-thickness surface.

If gmsh complains about that, you may have to write a script to post-process the .msh file that comes out of the procedure in my answer in your linked question. You can identify the nodes on the interface using a physical ID. Then, lay down a line of new nodes on top of the interface nodes. Next, loop through all of the elements: Any elements below the interface (physical surface 1, in the example) can keep using the old interface nodes. Any elements above the interface (physical surface 2 in the example) should swap any old interface nodes with the new nodes that you just placed. Lastly, loop through the 2-node interface elements. Replace these with an appropriate quad element using the old and new nodes.

Since you will have likely read the file into more convenient data structures and manipulated the elements/nodes within a script, you will now have to write all of this out to a valid .msh file, but that shouldn't be too hard to do if you've been able to do everything else up to this point. I'm not saying that this would be a particularly pleasant route, but if you really need the zero-thickness element, then this might be the way to do it.

This seems to be a popular request, so I'm going to write a matlab/python script to do it. I'll come back and edit this when I have a small working example.

===============UPDATE===================

I have written a script that implements the procedure that I outlined in the second paragraph. It is too long to paste into a code block here, so I have uploaded it to my github page: https://github.com/tjolsen/Mesh_Utilities/tree/master/gmsh_crack

I have included a small working example of a .geo file and some documentation on how to use the code. The script parses a .msh file, creates new nodes and elements, then writes the "cracked" mesh into a new file. Anyone is, of course, welcome to use the code (provided as is...). I would welcome any feedback/improvements to the code. It has some pretty low-hanging performance improvements, which might be necessary if you start using larger meshes than the toy one that I ran on my laptop.

Please let me know if this does/doesn't suit your needs. If it doesn't, it is probably only a small tweak away from being what you need.

$\endgroup$
4
  • $\begingroup$ Thank you so much Tyler, I've checked the procedure outlined in the first paragraph (had already tried extruding a line by 0 without success) and this isn't the solution; it all works fine until meshing. I'll check out the script you've written and come back on that, but many thanks in advance already for the effort you put in! $\endgroup$
    – Steyn W.
    Commented Sep 23, 2015 at 5:42
  • $\begingroup$ Works like a charm on my Windows system using Spyder. Does indeed seem to do just what I need, you've provided a very useful answer. The conversion of the line elements is a really good approach IMO, I was thinking about using a duplicate symmetry approach, but this clearly limits the applicability. One thing I'd think is important to note in the README for example is that the crack quads will be added at <crack physical id +1 >. If I encounter any problems or make modifications in the future I'll get back to you. $\endgroup$
    – Steyn W.
    Commented Sep 23, 2015 at 6:59
  • $\begingroup$ Yeah, that was just a quick hack to just get something working. The smarter thing to do here is to ensure that there is no physical_ID collision, and then to print out a report of everything done (summary of input info, number of elements added, name of output file, physical id of crack quads). I'm going to make a few changes to this over the next few days, so I'll let you know if there are any updates. Glad it's able to do what you need. $\endgroup$ Commented Sep 23, 2015 at 11:22
  • $\begingroup$ Got to love your dedication. I will be making some changes myself too, to allow for a distinction between the interface with zero thickness quad elements in between and an initial crack with duplicate nodes only. I intend to use two different physical line definitions for this, in order to keep it within the current form. $\endgroup$
    – Steyn W.
    Commented Sep 23, 2015 at 11:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.