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)
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)
def get_flatbar(match, sect_names, fem) -> Section: d = match.groupdict() sec_id = str_to_int(d["geono"]) return Section( name=sect_names[sec_id], sec_id=sec_id, sec_type=Section.TYPES.FLATBAR, h=roundoff(d["hz"]), w_top=roundoff(d["bt"]), w_btn=roundoff(d["bb"]), genprops=GeneralProperties(Sfy=float(d["sfy"]), Sfz=float(d["sfz"])), parent=fem.parent, )
def get_BoxBeams(match): d = match.groupdict() sec_id = str_to_int(d["geono"]) return Section( name=sect_names[sec_id], sec_id=sec_id, sec_type="BG", h=roundoff(d["hz"]), w_top=roundoff(d["by"]), w_btn=roundoff(d["by"]), t_w=roundoff(d["ty"]), t_ftop=roundoff(d["tt"]), t_fbtn=roundoff(d["tb"]), genprops=GeneralProperties(sfy=float(d["sfy"]), sfz=float(d["sfz"])), parent=fem.parent, )
def get_isection(match, sect_names, fem) -> Section: d = match.groupdict() sec_id = str_to_int(d["geono"]) name = sect_names[sec_id] return Section( name=name, sec_id=sec_id, sec_type=Section.TYPES.IPROFILE, h=roundoff(d["hz"]), t_w=roundoff(d["ty"]), w_top=roundoff(d["bt"]), w_btn=roundoff(d["bb"]), t_ftop=roundoff(d["tt"]), t_fbtn=roundoff(d["tb"]), genprops=GeneralProperties(Sfy=float(d["sfy"]), Sfz=float(d["sfz"])), parent=fem.parent, )
def get_tubular_section(match, sect_names, fem) -> Section: d = match.groupdict() sec_id = str_to_int(d["geono"]) if sec_id not in sect_names: sec_name = f"TUB{sec_id}" else: sec_name = sect_names[sec_id] t = d["t"] if d["t"] is not None else (d["dy"] - d["di"]) / 2 return Section( name=sec_name, sec_id=sec_id, sec_type=Section.TYPES.TUBULAR, r=roundoff(float(d["dy"]) / 2), wt=roundoff(t), genprops=GeneralProperties(Sfy=float(d["sfy"]), Sfz=float(d["sfz"])), parent=fem.parent, )
def get_gpipe(match): d = match.groupdict() sec_id = str_to_int(d["geono"]) if sec_id not in sect_names: sec_name = f"TUB{sec_id}" else: sec_name = sect_names[sec_id] t = d["t"] if d["t"] is not None else (d["dy"] - d["di"]) / 2 return Section( name=sec_name, sec_id=sec_id, sec_type="TUB", r=roundoff(float(d["dy"]) / 2), wt=roundoff(t), genprops=GeneralProperties(sfy=float(d["sfy"]), sfz=float(d["sfz"])), parent=fem.parent, )
def interpret_section(profile_name, sec_type, props): props_clean = [ roundoff(x) for x in filter(lambda x: x.strip() != "", props.split(",")) ] if sec_type.upper() == "BOX": b, h, t1, t2, t3, t4 = props_clean return Section( profile_name, "BG", h=h, w_btn=b, w_top=b, t_w=t1, t_fbtn=t4, t_ftop=t2, parent=fem, ) elif sec_type.upper() == "CIRC": return Section(profile_name, "CIRC", r=props_clean[0], parent=fem) elif sec_type.upper() == "I": ( l, h, b1, b2, t1, t2, t3, ) = props_clean return Section( profile_name, "IG", h=h, w_btn=b1, w_top=b2, t_w=t3, t_fbtn=t1, t_ftop=t2, parent=fem, ) elif sec_type.upper() == "L": b, h, t1, t2 = props_clean return Section(profile_name, "HP", h=h, w_btn=b, t_w=t2, t_fbtn=t1, parent=fem) elif sec_type.upper() == "PIPE": r, t = props_clean return Section(profile_name, "TUB", r=r, wt=t, parent=fem) elif sec_type.upper() == "TRAPEZOID": # Currently converts Trapezoid to general beam b, h, a, d = props_clean # Assuming the Abaqus trapezoid element is symmetrical c = (b - a) / 2 # The properties were quickly copied from a resource online. Most likely it contains error # https: // www.efunda.com / math / areas / trapezoidJz.cfm genprops = GeneralProperties( ax=h * (a + b) / 2, ix=h * (b * h**2 + 3 * a * h**2 + a**3 + 3 * a * c**2 + 3 * c * a**2 + b**3 + c * b**2 + a * b**2 + b * c**2 + 2 * a * b * c + b * a**2), iy=(h**3) * (3 * a + b) / 12, iz=h * (a**3 + 3 * a * c**2 + 3 * c * a**2 + b**3 + c * b**2 + a * b**2 + 2 * a * b * c + b * a**2) / 12, ) return Section(profile_name, "GENBEAM", genprops=genprops, parent=fem) else: raise ValueError( f'Currently unsupported section type "{sec_type}"')