anaStruct
anaStruct copied to clipboard
How to clear information from memory?
Hi, How to clear information from memory? I want to model one structure after another, I'm using anaStruct in a loop to check if a certain bar meets an established parameter. However, an error occurs due to an overlap of data from the second structure with the first.
Have you got some more information? If the anastruct SystemElements
has no references to any object, it should be removed from memory. Only if you run in Jupyter Notebooks they could live longer.
from anastruct import * ss = SystemElements()
def entrada(): global lb, h0, tr_barra, cp_barra, nb, aux tr_barra = 20.0 cp_barra = -20.0 lb = 10.0 h0 = 1.5 aux = 0 nb = 5
Verificação
x = False
while x == False:
nba = 3 * (nb - 1) + nb
print(nb, nba)
nos(nb)
i = 1
resultado = []
verif = []
while i <= nba:
resultado.append(ss.get_element_results(element_id=int(i))['N'])
print("BARRA ", i, resultado[i - 1])
if cp_barra <= resultado[i - 1] <= tr_barra:
print("ok")
verif.append(True)
else:
verif.append(False)
i += 1
print(verif)
if all(verif) == True:
x = True
pass
else:
aux += 1
nb = nb + aux
# print("nb final: ", nb)
def nos(nb): global nos_sup print("nb nos: ",nb)
sb = lb / (nb - 1)
nn = nb - 1
nos_sup = []
nos_inf = []
i = 0
while i <= nn:
nos_sup.append([i * sb, h0])
nos_inf.append([i * sb, 0])
i += 1
i = 1
while i <= nn:
ss.add_truss_element(location=[nos_inf[i - 1], nos_inf[i]])
i += 1
i = 1
while i <= nn:
ss.add_truss_element(location=[nos_sup[i - 1], nos_sup[i]])
i += 1
i = 0
while i <= nn:
ss.add_truss_element(location=[nos_inf[i], nos_sup[i]])
i += 1
i = 1
while i <= nn:
ss.add_truss_element(location=[nos_inf[i - 1], nos_sup[i]])
i += 1
ss.add_support_hinged(node_id=1)
ss.add_support_hinged(node_id=nb)
i = 1
while i <= len(nos_sup):
ss.point_load(node_id=(i + nb), Fy=-10, rotation=0)
i += 1
ss.show_structure()
ss.solve()
entrada()
Could you create a minimal working example and clearly define your problem in English?
No response to question. Closing as can't reproduce / wontfix