u-anurag / vfo-docs

Documentation for vfo (Visualization for OpenSees)
https://vfo.readthedocs.io
1 stars 1 forks source link

possible error when using large element tag #6

Closed SiuKam closed 8 months ago

SiuKam commented 8 months ago

Hi, thank you for your wonderful package for visualizing opensees. I recently get into a strange problem when trying to plot my model. It's a 3D model, and the package works smoothly when I call vfo.plot_model() without creating a database with vfo.createODB(modelName, loadCase). Yet when I did call vfo.createODB(modelName, loadCase) and then call `vfo.plot_model(modelName), the following error was throw out:

Reading data from the nlt_ODB. Traceback (most recent call last): File "test.py", line 276, in
vfo.plot_model(model="nlt") File "C:\Users\test\anaconda3\envs\ops\lib\site-packages\vfo\vfo.py", line 483, in plot_model
mesh_original, mesh_lines_original, vertices, nodeTags = _get_modelDisplay(nodeArray, elementArray, eleClassTags) File "C:\Users\test\anaconda3\envs\ops\lib\site-packages\vfo\vfo.py", line 350, in _get_modelDisplay lines = _getPV_2NodeELements(elementArray) File "C:\Users\test\anaconda3\envs\ops\lib\site-packages\vfo\vfo.py", line 292, in _getPV_2NodeELements tempArray = np.array([2, _getNodeIndex(ii[1]), _getNodeIndex(ii[2])]) File "C:\Users\test\anaconda3\envs\ops\lib\site-packages\vfo\vfo.py", line 271, in _getNodeIndex
return int(nodeIndex) TypeError: only size-1 arrays can be converted to Python scalars

With a little digging into the odb files, I noticed that my large element tag might be an issue in the vfo package. I'm used to construct my tags in a style that can be as large as 1e8. While the .out files in vfo only have 5 digits. This might cause a bunch element having the same tag. I wonder if this be the problem? I've uploaded the ODB folder here: https://drive.google.com/file/d/1Dq5uuTeN1aI8aWmzQNgd1eKrwrx0n1Y7/view?usp=sharing Hoping to get your help!

SiuKam commented 8 months ago

just notice a similar issue in vfo repo issue 13