Bug with collapsing nodes at intersection of line elements

Moderator: GiD Team

Anwar8
Posts: 5
Joined: Wed Nov 18, 2020 3:58 am

Bug with collapsing nodes at intersection of line elements

Postby Anwar8 » Fri Mar 26, 2021 4:40 am

Many times I need to collapse nodes to ensure continuity between elements. This has often worked well until I discovered this particular issue. If I have a single pair of nodes, as the case would be for intersecting lines, then the collapse nodes option will crash GiD. If more than one pair are selected this does not seem to happen. This occurs even when using the collapse nodes command "GiD_Process Mescape Utilities Collapse Nodes"

Kindly see the 1 minute video I recorded below to see exactly what I mean:
https://youtu.be/dMS5gUJrCBQ
User avatar
escolano
Posts: 1701
Joined: Thu Sep 18, 2014 3:31 pm

Re: Bug with collapsing nodes at intersection of line elements

Postby escolano » Fri Mar 26, 2021 1:09 pm

We are able to repeat the bug, thaks for your repport,
it will be fixed in next GiD official and developer versions.

The problem happen only in the case of the nodes collapse if the bounding box of the selection of nodes has zero size (all nodes exactly in the same location).
If do you select more nodes, not only the two overlapped, it will works well (only the nodes closer that the import tolerance will be joined)

On the other hand, in general, I recommend you to modify the geometry, not directly the mesh, then you can re-mesh with other sizes, etc, without lost your change.
In this case simply intersect both lines to have a common point, then will be only a common node when meshing.
Anwar8
Posts: 5
Joined: Wed Nov 18, 2020 3:58 am

Re: Bug with collapsing nodes at intersection of line elements

Postby Anwar8 » Wed Mar 31, 2021 3:45 am

Glad to hear you guys will fix it. I follow your recommendation regarding doing the modifications on the geometry not on the mesh all the time. I discovered this issue because I added a condition that would automatically collapse certain nodes to ensure connectivity between shell and line elements. I do not always want this connectivity to be active and want to have some control over it hence I do not want to collapse the geometry.

As you said, once more than one set of nodes is selected the bug does not occur so what I'm doing now is accumulating all the nodes to collapse in a list and calling the command for all of them at the same time.

I also wanted to just check with you, escolano, if there is a better way to call the collapse function than the one I am using in the code segment below. I had tried using a list of nodes as the argument but that doesn't seem to work so I had to resort to appendding the command with each node individually.

Code: Select all

      WarnWinText "nodes_to_collapse: $nodes_to_collapse"
      set cmd "GiD_Process Mescape Utilities Collapse Nodes"
      foreach node $nodes_to_collapse {
         lappend cmd $node
      }
      lappend cmd escape escape
      eval $cmd
User avatar
escolano
Posts: 1701
Joined: Thu Sep 18, 2014 3:31 pm

Re: Bug with collapsing nodes at intersection of line elements

Postby escolano » Wed Mar 31, 2021 11:16 am

You can do this (more simple and efficient)

Code: Select all

GiD_Process Mescape Utilities Collapse Nodes {*}$nodes_to_collapse escape


The {*} is a special Tcl standard syntax, available since Tcl 8.5 that expand a single item list its multiple sub-items

[5] Argument expansion.
If a word starts with the string “{*}” followed by a non-whitespace character, then the leading “{*}” is removed and the rest of the word is parsed and substituted as any other word. After substitution, the word is parsed as a list (without command or variable substitutions; backslash substitutions are performed as is normal for a list and individual internal words may be surrounded by either braces or double-quote characters), and its words are added to the command being substituted. For instance, “cmd a {*}{b [c]} d {*}{$e f {g h}}” is equivalent to “cmd a b {[c]} d {$e} f {g h}”.


https://wiki.tcl-lang.org/page/%7B%2A%7D

In your case you are 'flattening' the list with the 'eval' command (your extra loop on nodes_to_collapse lappending to an extra variable was unneeded)
This can be done prior to the {*} command existence:

eval "GiD_Process Mescape Utilities Collapse Nodes $nodes_to_collapse escape escape"
Anwar8
Posts: 5
Joined: Wed Nov 18, 2020 3:58 am

Re: Bug with collapsing nodes at intersection of line elements

Postby Anwar8 » Fri Apr 23, 2021 3:50 am

Thank you for your reply. I will definitely try this approach!

Return to “Mesh”

Who is online

Users browsing this forum: No registered users and 2 guests