Skip to content

Commit

Permalink
fix fiber definition for OpenSeesPy
Browse files Browse the repository at this point in the history
  • Loading branch information
ioannis-vm committed Jan 14, 2024
1 parent 600813b commit d7719f9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/osmg/solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,9 @@ def define_material(mat, defined_materials):
sec = elm.section
parts = sec.section_parts.values()
if sec.uid not in defined_sections:
if ops.__name__ == 'openseespy.opensees':
ops.section(*sec.ops_args())
defined_sections[sec.uid] = sec
fibers = []
for part in parts:
mat = part.ops_material
Expand All @@ -459,9 +462,7 @@ def define_material(mat, defined_materials):
[y_loc, z_loc, area, part.ops_material.uid]
)

if ops.__name__ == 'openseespy.opensees':
ops.section(*sec.ops_args())
else: # ops.__name__ == 'opensees.openseespy'
if ops.__name__ == 'opensees.openseespy':
fiber_commands = ';\n '.join(
"fiber " + " ".join(map(str, fiber))
for fiber in fibers
Expand All @@ -474,8 +475,7 @@ def define_material(mat, defined_materials):
"""
)
ops.eval(cmd)

defined_sections[sec.uid] = sec
defined_sections[sec.uid] = sec

ops.beamIntegration(*elm.integration.ops_args())
ops.geomTransf(*elm.geomtransf.ops_args())
Expand Down

0 comments on commit d7719f9

Please sign in to comment.