zhuminjie / OpenSeesPy

OpenSeesPy versions, doc, and pip
Other
173 stars 66 forks source link

The command 'section' doesn't work #147

Closed frdw closed 2 hours ago

frdw commented 3 hours ago

I am working on a complicated model but stuck at the command 'section()'. I created this short piece of python script to reproduce the issue:

import openseespy.opensees as op op.uniaxialMaterial('Elastic',1,1000) op.section('Fiber',1)

The error message as below:

Traceback (most recent call last): File "D:\task\2025\fiberbeam\opsexmp\opsexp03.py", line 5, in op.section('Fiber',1) opensees.OpenSeesError: See stderr output

It can be seen that the command 'uniaxialMaterial' works well, but the command 'section' doesn't.

mhscott commented 2 hours ago

The fiber section command checks the model dimensions and DOFs/node. You don't have a model command issued, so the fiber section command returns an error.

Add the following to your short script:

op.model('basic','-ndm',2,'-ndf',3)

Or 3 and 6 if you want to test in 3D.

frdw commented 2 hours ago

Thank you so much, Michael. It works now.