Пример #1
0
 def get_GenBeams(match):
     d = match.groupdict()
     sec_id = str_to_int(d["geono"])
     gen_props = GeneralProperties(
         ax=roundoff(d["area"]),
         ix=roundoff(d["ix"]),
         iy=roundoff(d["iy"]),
         iz=roundoff(d["iz"]),
         iyz=roundoff(d["iyz"]),
         wxmin=roundoff(d["wxmin"]),
         wymin=roundoff(d["wymin"]),
         wzmin=roundoff(d["wzmin"]),
         shary=roundoff(d["shary"]),
         sharz=roundoff(d["sharz"]),
         scheny=roundoff(d["shceny"]),
         schenz=roundoff(d["shcenz"]),
         sy=float(d["sy"]),
         sz=float(d["sz"]),
     )
     if sec_id in fem.parent.sections.idmap.keys():
         sec = fem.parent.sections.get_by_id(sec_id)
         sec._genprops = gen_props
         gen_props.parent = sec
     else:
         sec = Section(name=f"GB{sec_id}",
                       sec_id=sec_id,
                       sec_type="GENBEAM",
                       genprops=gen_props,
                       parent=fem.parent)
         gen_props.parent = sec
         fem.parent.sections.add(sec)
Пример #2
0
def add_general_sections(match, fem) -> None:
    d = match.groupdict()
    sec_id = str_to_int(d["geono"])
    gen_props = GeneralProperties(
        Ax=roundoff(d["area"], 10),
        Ix=roundoff(d["ix"], 10),
        Iy=roundoff(d["iy"], 10),
        Iz=roundoff(d["iz"], 10),
        Iyz=roundoff(d["iyz"], 10),
        Wxmin=roundoff(d["wxmin"]),
        Wymin=roundoff(d["wymin"]),
        Wzmin=roundoff(d["wzmin"]),
        Shary=roundoff(d["shary"]),
        Sharz=roundoff(d["sharz"]),
        Shceny=roundoff(d["shceny"]),
        Shcenz=roundoff(d["shcenz"]),
        Sy=float(d["sy"]),
        Sz=float(d["sz"]),
    )

    if sec_id in fem.parent.sections.id_map.keys():
        sec = fem.parent.sections.get_by_id(sec_id)
        sec._genprops = gen_props
        gen_props.parent = sec
    else:
        stype = Section.TYPES.GENERAL
        sec = Section(name=f"GB{sec_id}",
                      sec_id=sec_id,
                      sec_type=stype,
                      genprops=gen_props,
                      parent=fem.parent)
        gen_props.parent = sec
        fem.parent.sections.add(sec)