Pick point and get Node id

Moderator: GiD Team

Post Reply
theokart
Posts: 11
Joined: Mon Mar 14, 2016 11:38 am

Pick point and get Node id

Post by theokart »

Dear GiD Team,

Is it possible through a condition window in a specific field to pick a point (e.g. with tkwidget GidUtils::TkwidgetPickPoint) and then get the corresponding NODE id number to use it on bas files? Or any other easy way to get a node number through a condition FIELD (Obviously, not necessary the node number of the corresponding point that the condition is applied on) ?

Thank you in advance!
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Pick point and get Node id

Post by escolano »

No, having a point is not possible to know 'its possible node', because of several reasons:
1-If the mesh has not been generated the node doesn't exists
2-Depending on meshing criteria maybe the point won't generate any node (e.g. allowing or setting 'to skip entities', or not to be meshed, or Cartesian mesh or others)
3-Maybe the mesh is imported is not created from a geometry
4-Once generated the mesh the nodes and elements GiD doesn't store any pointer to its geometrical source entities, if any.

About the last point, there is a trick, that is use a classical condition with special field 'self-calculated' #FUNC#(NumEntity) that when meshing will store the ID of the 'geometry parent' (e.g. the point id parent of a node, if any)

But if you apply a condition to a point and generate the mesh the node will inherit this condition. It is not enough for your use?

and if the mesh exists you can also pick in mesh mode a node to fill a field with TKWIDGET: GidUtils::TkwidgetPickNode (but in general handle directly mesh entities is unrecommended)

or pick a point in geometry mode and a node in mesh mode with TKWIDGET: GidUtils::TkwidgetPickPointOrNode
theokart
Posts: 11
Joined: Mon Mar 14, 2016 11:38 am

Re: Pick point and get Node id

Post by theokart »

I need to assign the condition on many points once (nodes after mesh) with a field value of a specific (user's option) node number, so to write on data file the solver command that these nodes (assigned with the condition) have the same displacement with the particular node. Solver can "understand" the node number (These numbers are used to define the nodes) so giving the point number will cause error.

I see two different ways.

1) pickNode through the special tkwidget and assign on the meshed model, which i agree it is unrecommended because then it is gone when you go back on geometry model.

2) Make a second condition to work in cooperation with the other so i can assign on the specific point and use the corresponding generated node after meshing. I was just wondering if i could avoid the second condition.

Thank you very much again for your response.
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Pick point and get Node id

Post by escolano »

some other possible approaches:

1- store in the condition field applied to the 'slave entities' the 'master point id' and then find the node id by distance (the nearest node to the point x y z coordinates). This could be a little expensive for big meshes and not robust if there are more than one node overlapped on the same location.

You can find the nearest node to the x,y,z coordinates of the 'master point' in your own solver code, or at Tcl scripting level (could be more expensive at runtime for very big meshes doing at Tcl level)

2- mark with a 'master' condition the point and with a 'slave' condition the other points and in both conditions have a 'contact id' field that virtually link both selections (the ones that have the same 'contact id')

once again you can do the tasks of finding paired master/slave conditions at problemtype level or at solver level
Post Reply