how to find nodes connected to a specific node
how to find nodes connected to a specific node
(OP)
hi everybody
does anyone have a suggestion on how to find the connected nodes (i mean the labels of those nodes) to a given node in a nodeset through a python script? it is important that this be carried out through a python script.
thanks a lot!
does anyone have a suggestion on how to find the connected nodes (i mean the labels of those nodes) to a given node in a nodeset through a python script? it is important that this be carried out through a python script.
thanks a lot!





RE: how to find nodes connected to a specific node
I need what I explained above to calculate a mean normal direction to a node in order to move that node along that direction during a postprocessing of the abaqus results.
All that could be avoided if somebody has an idea on how to obtain such normal direction to a node.
Thanks again to all of you
RE: how to find nodes connected to a specific node
I guess you could loop though all of the elements that are associated with the nodeset to work out if the target node resides in the connectivity list for a particular element. If so, you could then work out what other nodes are connected to that target node based upon its position in each associative elements connectivity list (you will need to refer to the documentation to ascertain what the connectivity is for the specific element you are using i.e. if using C3D8 and target node is first in element connectivity list then connected nodes are 2nd, 3rd, 4th & 5th of that element). If these connected nodes belong to the nodeset then you can store its label in an array etc and output as required
bfillery
RE: how to find nodes connected to a specific node
that could be a good idea. i'm just wondering where i could find the info on the connectivity (i mean, on the fact that the first node in the element connectivity list is connected to the 2nd,3rd,4th,and 5th).
thanks a lot for your help!
RE: how to find nodes connected to a specific node
thanks a lot!!!
RE: how to find nodes connected to a specific node
Lets say that you have an element set defined in the assembly that contains all the elements that are associated with the node set you mentioned above. To access the connectivity for each of the elements in this element set you would loop over the elements as follows
for i in mdb.models[modelName].rootAssembly.instances[instanceName].sets[elementSetName].elements:
element=i
connectivityList=element.connectivity
This tells you what nodes are connected to each other node from an element perspective. You can then build your required connected nodes list accordingly.
RE: how to find nodes connected to a specific node
thanks a lot. you're cool bfillery.
i appreciated your help very much
RE: how to find nodes connected to a specific node
i ended up not needing to access mdb because i chose another way to do what i needed to do when i asked that question. but now i'd actually like to open my mdb and access some stuff in there.
could you kindly explain to me how to make what you suggested work?
you wrote
mdb.models[modelName].rootAssembly.instances[instanceName].sets[elementSetName].elements:
element=i
but i can't get it to work
don't i have to define mdb first? i'm very confused on how to access a model database.....
RE: how to find nodes connected to a specific node
Sorry, I think I wrote the wrong thing. If accessing the odb from within CAE one way is to use,
myOdb=session.openOdb(name='myOdb', path='C:/......')
then
myOdb.rootAssembly.instances[instanceName].sets[elementSetName].elements etc as discussed above.
RE: how to find nodes connected to a specific node
though i'd like to access the model database, not the odb, because the node connectivity is in the model database, and i'd like to access it through a python script and not from within the CAE. could you help me with that?
RE: how to find nodes connected to a specific node
I am guessing by the database you mean a file.cae.
If this is the case then you still need to use a cae license but not run cae with a GUI
To do this you can call the script in the working directory as follows
abaqus cae noGUI=script_name.py
You will also need some stuff at the top of your script to help with the import of cae tools: i.e.
from abaqus import *
from abaqusConstants import *
from caeModules import *
from driverUtils import executeOnCaeStartup
executeOnCaeStartup()
Mdb()
From here you should be able to use:
mdb.models[modelName].rootAssembly.instances[instanceName].sets[elementSetName].elements etc as given above.