Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

How to get elements that are connected to a node?

Status
Not open for further replies.

VzHache

Structural
Feb 1, 2007
16
0
0
FR
Hi gents,

I'm trying to write a python script that gives the list of all elements that are connected to a specified node. I did not find the answer on eng tips or with google.
One possbility is to make a loop testing for all elements if the specifiec node belongs to element.connectivity, but it appears costly if the model has hundred thousand nodes.
Furthermore, the viewer gives the information if we ask it. I suppose it is possible to get this information with an internal abaqus command, isn't it?

Can anyone help me?

thanks in advance.

V.
 
Replies continue below

Recommended for you

Dear VzHache,

I've had the same problem and haven't been able to resolve it myself. I also noticed that the viewer can do it. That gave me the idea to check the .rpy-file to get the command behind it. Unfortunately, that didn't work as no line was added to that file once I performed the action in the Viewer.
 
Helle deyentl,

finally, I did this:

M3D6_list=[] # list of all available M3D6 elements in the current part
M3D6_connectivity_dict = {} # dictionnary with all M3D6 elements
node_num_M3D6_tri_dict={} # Dictionnary containing the connectivities of the nodes of M3D6 of the model ("connectivity" means : elements connected to a same node) ; the keys correspond to the node numbers
m=0
for i in odb_instance.element :
if (i.type=='M3D6') :
M3D6_list.append(i.label)
M3D6_connectivity_dict[i.label]=i.connectivity
m=m+1
for j in M3D6_connectivity_dict.keys() :
for k in M3D6_connectivity_dict[j] :
node_num_M3D6_tri_dict[k]=[]
for i in M3D6_connectivity_dict.keys() :
for k in M3D6_connectivity_dict[0:3] :
node_num_M3D6_tri_dict[k].append(i)

It doesn't take too long as I feared.
 
Status
Not open for further replies.
Back
Top