pyNastran
pyNastran copied to clipboard
Example to read in an abaqus deck and write out a nastran file?
I have installed pyNastran on a CentOS 8 machine. When trying to use the abaqus converter I get this message. Will keep poking around the docs to see if I can figure it out..
>>> abq = pyNastran.converters.abaqus.abaqus()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'pyNastran' has no attribute 'converters'
>>> print(dir(pyNastran))
['__author__', '__builtins__', '__cached__', '__copyright__', '__desc__', '__discussion_forum__', '__doc__', '__docs__', '__docs_rtd__', '__email__', '__file__', '__issue__', '__license__', '__loader__', '__longdesc__', '__name__', '__package__', '__path__', '__pyqt_copyright__', '__pyside_copyright__', '__releaseDate2__', '__releaseDate__', '__spec__', '__version__', '__website__', 'is_pynastrangui_exe', 'is_release', 'os', 'sys']
>>>
Think I figured it out with this example, though it seems to not like "*node,nset=all". Also tried just "*node" with the same error.
>>> model = Abaqus()
>>> model.read_abaqus_inp('/home/feacluster/converted.inp')
DEBUG: abaqus.py:83 0, *node,nset=all
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/feacluster/.local/lib/python3.6/site-packages/pyNastran/converters/abaqus/abaqus.py", line 222, in read_abaqus_inp
raise NotImplementedError(word)
NotImplementedError: node,nset=all
Made some progress by enclosing the model data in *part, name=test and a *end part card. But now getting an error about reading the element ids:
eids_elements = np.array(elements, dtype='int32')
ValueError: setting an array element with a sequence.
Here's how the input deck data looks:
*ELEMENT,TYPE=C3D10H,ELSET=C3D10
82543,13582,49204,12456,13462,182815,182816,100651,100652,182817,100262
82544, 50978, 16525, 15771, 15591, 182819, 109464, 182818, 182820, 109463, 107203,
I deleted all the whitespaces in the first line to see if that was the issue.
I need a small example
Sure, here's a stripped down version of the deck:
*part, name=test
*NODE, NSET=NALL
1,1.000000e+00,1.000000e+01,0.000000e+00
2,1.000000e+00,1.000000e+01,1.000000e+02
3,1.000000e+00,0.000000e+00,0.000000e+00
*ELEMENT,TYPE=C3D10,ELSET=C3D10
82543, 13582, 49204, 12456, 13462, 182815, 182816, 100651, 100652, 182817, 100262,
82544, 50978, 16525, 15771, 15591, 182819, 109464, 182818, 182820, 109463, 107203,
*NSET,NSET=FIX
7,
3,
1,
5,
*NSET,NSET=LOAD
6,
2,
4,
8,
*end part
*BOUNDARY
FIX,1,3
*MATERIAL,NAME=EL
*ELASTIC
210000.,.3
*SOLID SECTION,ELSET=C3D10,MATERIAL=EL
*STEP
*STATIC
*CLOAD
LOAD,2,-25
*EL FILE
U,S
*NODE PRINT, NSET=LOAD
U
*END STEP
Closing because the example isn't valid due to missing nodes.