sorting mesh data an from abaqus simulation
zasaconsulting at gmail.com
Mon Feb 2 13:10:15 CET 2009
Hello there :) ,
I am a python 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.
In Abaqus each mesh has the following structure (see "
- a list of NODES in form of a table ( nodelabel_n, coordinatex,
- 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
(elementlabel_n, node_n1, node_n2, node_n3)
Through following py script I can access all nodes (--> *N*) and elements
(--> *EL*) from the "mesh-1.odb" file (
http://www.tecnopolis.eu/upload/mesh-1.odb) where the simulation results are
*from odbAccess import *
from odbSection import *
nameodb = 'mesh-1'
path = '/onepath/' + nameodb + '.odb'
odb = openOdb(path)
**N = odb.rootAssembly.instances['PART-1-1'].nodes
*EL = odb.rootAssembly.instances['PART-1-1'].elements
to get a node label, for example the label of the node object n5 in the list
to get the x coordinates of that node: *Ntop.coordinates*
In particular I am interested in the node subset "TOP" (which represents all
the nodes at the top of my model)
*Ntop = odb.rootAssembly.instances['PART-1-1'].nodeSets['TOP'].nodes
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.
What I need is the same list *ordered by coordinate_x* 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
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)
Many thanks, Alex
> Alessandro Zivelonghi
> skype: alexzive
> "Energy and persistence conquer all things."
> Benjamin Franklin (1706 - 1790)
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list