You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am testing the library. In my codes, there are just two standard elements. When I use insert_node() method to insert a new to the second element, the original element will split into two new elements. I can add a point load to the new node. However, the model will can not pass validation. You cannot solve the numerical problem.
I do not know how to fix this error. If I directly define three standard elements with the same properties, the same error will not occur.
from anastruct import SystemElements
structure = SystemElements(EA=15000, EI=5000, mesh=101)
# define elements
structure.add_element(location=[[0,0],[10,4]])
# structure.add_element(location=[[10,4],[10,3]])
structure.add_element(location=[[10,4],[10,0]])
# define support
structure.add_support_hinged(node_id=1)
structure.add_support_hinged(node_id=3)
# define loads
structure.q_load(q=5, element_id=1,direction='element')
structure.point_load(node_id=2, Fx=4, Fy=0)
structure.insert_node(element_id=2,factor=0.25) # insert a node
structure.point_load(node_id=4, Fx=8, Fy=0) # define a point load at the new node
# solve the numerical problem
structure.solve()
Below is the error message:
{
"name": "KeyError",
"message": "2",
"stack": "---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In[5], line 2
1 # solve the numerical problem
----> 2 structure.solve()
The text was updated successfully, but these errors were encountered:
I think the solution is to revalidate the whole structure object after inserting a node. I don't see any current API to do it elegantly.
thisisapple
changed the title
Inserting a node to existing element causes validation error
Inserting a node to existing element causes a key error because that element is deleted.
Sep 2, 2024
I am testing the library. In my codes, there are just two standard elements. When I use
insert_node()
method to insert a new to the second element, the original element will split into two new elements. I can add a point load to the new node. However, the model will can not pass validation. You cannot solve the numerical problem.I do not know how to fix this error. If I directly define three standard elements with the same properties, the same error will not occur.
Below is the error message:
{
"name": "KeyError",
"message": "2",
"stack": "---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In[5], line 2
1 # solve the numerical problem
----> 2 structure.solve()
The text was updated successfully, but these errors were encountered: