Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"list index out of range" error when using big material tag numbers #26

Open
mnadhro opened this issue Jun 8, 2022 · 0 comments
Open

Comments

@mnadhro
Copy link

mnadhro commented Jun 8, 2022

This error happens when using big material tag numbers that are larger than the size of matcolor list.
Sometimes using this kind of tags (101, 102 …) is useful for recognizing materials, elements, sections …etc. However, the matcolor list could not be that long, obviously, which lead to this error.

This is a small example.

import matplotlib.pyplot as plt
import opsvis

matTag = 101
fiber_section_ = [
                 ['section', 'Fiber', 1, '-GJ', 1e9],
                 ["patch", 'rect', matTag, 2, 10, *[-200, -300]  , *[200, 300]],
]

matcolor = ['c',]
opsvis.plot_fiber_section(fiber_section_, matcolor=matcolor)
plt.axis('equal')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant