Hello there :) ,<br>
<br>
I am a <span>python</span> newbie who needs help with
tables(lists?) and other data structures. My mechanical engineering
simulation program (Abaqus) use a Python env to access model data and
results from a simulation. For me a model means a "mesh" of that model,
i.e. a lists of nodes and elements which discretized the CAD model. <br>
In Abaqus each mesh has the following structure (see "<a href="http://www.tecnopolis.eu/upload/mesh.inp">http://www.tecnopolis.eu/upload/mesh.inp</a>"):<br><br>- a list of NODES in form of a table ( nodelabel_n, coordinatex, coordinatey) <br>
<br>-
and a list of ELEMENTS also in form of a table. Each element refers to
three nodes (which must be in the list of nodes) and the table looks
like this <br>
<br> (elementlabel_n, node_n1, node_n2, node_n3)<br><br>Through following py script I can access all nodes (--> <b>N</b>) and elements (--> <b>EL</b>) from the "mesh-1.odb" file (<a href="http://www.tecnopolis.eu/upload/mesh-1.odb">http://www.tecnopolis.eu/upload/mesh-1.odb</a>) where the simulation results are stored. <br>

<br><i>from odbAccess import *<br>from odbSection import *<br><br>nameodb = 'mesh-1'<br><br><br>path = '/onepath/' + nameodb + '.odb'<br>odb = openOdb(path)<br><b><br></b></i><i><b>N = odb.rootAssembly.instances['PART-1-1'].nodes</b><br>


</i><br><i><b>EL = odb.rootAssembly.instances['PART-1-1'].elements</b><br></i><br>Info:<br>
to get a node label, for example the label of the node object n5 in the list Ntop:  <b>Ntop[5].label</b><br>
to get the x coordinates of that node: <b>Ntop[5].coordinates[0]</b><br><br>In particular I am interested in the node subset "TOP" (which represents all the nodes at the top of my model)<br><br><i><b>Ntop = odb.rootAssembly.instances['PART-1-1'].nodeSets['TOP'].nodes</b><br>


</i><br>Problem:<br>1) the list of nodes Ntop contains all the node
labels [2673,   2675,   2676,   2677,   2678,   3655,   3656, 119939,
124154, 127919] already ordered in ascending order.<br>What I need is the same list <b>ordered by coordinate_x</b>
of each node, i.e. from left to right in the model (unfortunately, for
example node 124154 cames before node 3656 in the model, if you read
the model from left to right)<br>
<br><br>1b) I don't understand which kind of data are EL, N,
Ntop (list?) and how can I sort Ntop  with the criterium based on
coordinate_x (coordinate[0]) <br><br>Many thanks, Alex<br><br>-- <br><div class="gmail_quote"><div><br><br><br><br><br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Alessandro Zivelonghi <br><br><a href="http://www.tecnopolis.eu" target="_blank">http://www.tecnopolis.eu</a><br><br>skype: alexzive<br><br>"Energy and persistence conquer all things."<br> Benjamin Franklin (1706 - 1790)<br>


</blockquote><br clear="all"><br><br></div><br><br>