コード例 #1
0
from anastruct.fem.system import SystemElements
import time
import os
import subprocess

save = True
min_ = 1e8
n = 25

for i in range(n):
    t0 = time.time()
    ss = SystemElements()
    el = ss.add_multiple_elements([[0, 0], [10, 10]], n=500)
    ss.point_load(ss.node_map.values(), Fy=1)
    ss.q_load(1, el)
    t = time.time() - t0
    print(t)
    min_ = min(min_, t)

print(f"Best of {n} = {min_} s.")

if save:
    with open("system-creation.csv", "a") as f:
        os.chdir("../../..")
        git_label = (str(subprocess.check_output(["git", "describe",
                                                  "--tags"])).replace(
                                                      "\\n",
                                                      "").replace("'", "")[1:])
        f.write(f"{git_label}, {min_}\n")
コード例 #2
0
from anastruct.fem.system import SystemElements

ss = SystemElements(EI=5e3, EA=1e5)

ss.add_multiple_elements([[0, 0], [0, 10]], 10)

top_node = ss.nearest_node('y', 10) + 1
ss.add_support_roll(top_node, 1)
ss.add_support_hinged(1)

ss.point_load(top_node, Fz=-1)

if __name__ == "__main__":
    print(ss.solve(geometrical_non_linear=True))
    ss.show_displacement()
コード例 #3
0
from anastruct.fem.system import SystemElements
import time
import os
import subprocess

save = True
min_ = 1e8
n = 25

for i in range(n):
    t0 = time.time()
    ss = SystemElements()
    el = ss.add_multiple_elements([[0, 0], [10, 10]], n=500)
    ss.point_load(ss.node_map.values(), Fy=1)
    ss.q_load(1, el)
    t = time.time() - t0
    print(t)
    min_ = min(min_, t)

print(f"Best of {n} = {min_} s.")

if save:
    with open("system-creation.csv", "a") as f:
        os.chdir("../../..")
        git_label = str(subprocess.check_output(["git", "describe", "--tags"])).replace('\\n', '').replace("'", "")[1:]
        f.write(f"{git_label}, {min_}\n")