anystruct package
The installable package is named anystructure on PyPI. The import package
used by Python code is anystruct.
Primary public modules
anystruct.api module
- class anystruct.api.CylStru(calculation_domain: str = 'Unstiffened shell')
Bases:
objectAPI class for all cylinder options.
Calculation domains are:
‘Unstiffened shell’
‘Unstiffened panel’
‘Longitudinal Stiffened shell’
‘Longitudinal Stiffened panel’
‘Ring Stiffened shell’
‘Ring Stiffened panel’
‘Orthogonally Stiffened shell’
‘Orthogonally Stiffened panel’
- geotypes = ('Unstiffened shell', 'Unstiffened panel', 'Longitudinal Stiffened shell', 'Longitudinal Stiffened panel', 'Ring Stiffened shell', 'Ring Stiffened panel', 'Orthogonally Stiffened shell', 'Orthogonally Stiffened panel')
- get_buckling_results()
Return a dict including all buckling results :return: :rtype:
- set_end_cap_pressure_included_in_stress(is_included: bool = True)
Cylinder may or may not have and end cap. If there is an end cap, and the stresses from pressure on this is not included, ste this values to True.
- Parameters:
is_included (bool) – if this is not set, stresses due to end cap pressure for clyinder is set
- Returns:
- Return type:
- set_exclude_ring_frame(is_excluded: bool = True)
If for example orthogonally stiffened cylinder is selected and there are no ring girder, set this to True. The resulting structure will then be only longitudinal and ring stiffeners.
- Parameters:
is_excluded (bool) – set no ring girders
- Returns:
- Return type:
- set_exclude_ring_stiffener(is_excluded: bool = True)
If for example orthogonally stiffened cylinder is selected and there are no ring stiffeners, set this to True. In this case only ring girders are included.
- Parameters:
is_excluded (bool) – set no ring stiffeners
- Returns:
- Return type:
- set_fabrication_method(stiffener: str = 'Fabricated', girder: str = 'Fabricated')
Fabrication method for stiffener and girder. Either ‘Fabricated’ or ‘Cold formed’
- Parameters:
stiffener (str) – set fabrication method of stiffeners, either ‘Fabricated’ or ‘Cold formed’
girder (str) – set fabrication method of girder, either ‘Fabricated’ or ‘Cold formed’
- Returns:
- Return type:
- set_forces(Nsd: float = 0, Msd: float = 0, Tsd: float = 0, Qsd: float = 0, psd: float = 0)
Forces applied to cylinder. Use negative numbers for compression pressure, stresses and forces.
- Parameters:
Nsd – Design Axial force, Nsd [kN]
Msd – Design bending mom., Msd [kNm]
Tsd – Design torsional mom., Tsd [kNm]
Qsd – Design shear force, Qsd [kN]
psd – Design lateral pressure, psd [N/mm2]
- Returns:
- set_imperfection(delta_0=0.005)
Initial out of roundness of stiffener: delta_0 * r Typical value is set as default.
- Parameters:
delta_0 (float) – Initial out of roundness of stiffener
- Returns:
- Return type:
- set_length_between_girder(val: float = 0)
Distance between the girders along the cylinder.
- Parameters:
val (float) – length/span between girders
- Returns:
- Return type:
- set_longitudinal_stiffener(hw: float = 260, tw: float = 12, bf: float = 49, tf: float = 28, stf_type: str = 'bulb', spacing: float = 680)
Sets the longitudinal stiffener dimensions. May be excluded.
- Parameters:
hw (float) – web height
tw (float) – web thickness
bf (float) – flange width
tf (float) – flange thickness
stf_type (str) – stiffener type, either T, FB, L or L-bulb
spacing (float) – distance between stiffeners
- set_material(mat_yield=355, emodule=210000, material_factor=1.15, poisson=0.3)
Set the material properties for all structure.
- Parameters:
mat_yield (float) – material yield, fy, given in MPa
emodule (float) – elastic module, E, given in MPa
material_factor (float) – material factor, typically 1.15 or 1.1
poisson (float) – poisson number of matieral
- Returns:
- Return type:
- set_panel_spacing(val: float = 0)
In case a curved panel is selected, not a complete cylinder, this value sets the width of the panel.
- Parameters:
val (float) – spacing between stiffeners
- Returns:
- Return type:
- set_ring_girder(hw: float = 500, tw: float = 15, bf: float = 200, tf: float = 25, stf_type: str = 'T', spacing: float = 700)
Sets the ring girder dimensions. May be excluded.
- Parameters:
hw (float) – web height
tw (float) – web thickness
bf (float) – flange width
tf (float) – flange thickness
stf_type (str) – stiffener type, either T, FB, L or L-bulb
spacing (float) – distance between stiffeners
- Returns:
- Return type:
- set_ring_stiffener(hw: float = 260, tw: float = 12, bf: float = 49, tf: float = 28, stf_type: str = 'bulb', spacing: float = 680)
Sets the ring stiffener dimensions. May be excluded.
- Parameters:
hw (float) – web height
tw (float) – web thickness
bf (float) – flange width
tf (float) – flange thickness
stf_type (str) – stiffener type, either T, FB, L or L-bulb
spacing (float) – distance between stiffeners
- Returns:
- Return type:
- set_shell_buckling_parmeters(eff_buckling_length_factor: float = 1.0)
Sets the buckling length paramenter of the cylinder. Used for global column buckling calculations.
- Parameters:
eff_buckling_length_factor (float) – effective length factor, column buckling
- Returns:
- Return type:
- set_shell_geometry(radius: float = 0, thickness: float = 0, distance_between_rings: float = 0, tot_length_of_shell: float = 0)
Sets the baic parameters for the cylinder.
- Parameters:
radius (float) – radius of cylinder
thickness (float) – thickness of cylinder
distance_between_rings (float) – distance between girders
tot_length_of_shell (float) – total length of the cylinder
- Returns:
- Return type:
- set_stresses(sasd=0, smsd=0, tTsd=0, tQsd=0, psd=0, shsd=0)
Cylinder stresses. Use negative numbers for compression pressure, stresses and forces.
- Parameters:
sasd (float) – Design axial stress, sa,sd [MPa]
smsd (float) – Design bending stress, sm,sd [MPa]
tTsd (float) – Design torsional stress, tT,sd [MPa]
tQsd (float) – Design shear stress, tQ,sd [MPa]
psd (float) – Design lateral pressure, psd [MPa]
shsd (float) – Additional hoop stress, sh,sd [MPa]
- Returns:
- Return type:
- set_uls_or_als(kind='ULS')
This is used to calculate th resulting material factor. ALS is Accidental Limit State ULS is Ultimate Limit State
- Parameters:
kind (str) – set load condition, either ‘ULS’ or ‘ALS’
- Returns:
- Return type:
- class anystruct.api.FlatStru(calculation_domain: str = None)
Bases:
objectAPI class for all flat plates.
Domains:
‘Flat plate, unstiffened’
‘Flat plate, stiffened’
- property Girder
- property Plate
- property Stiffeners
- property calculation_domain
- get_available_buckling_methods()
- get_buckling_results(calculation_method: str = None, ml_algo=None)
Return buckling results for the active calculation method. UF - Utilization Factor.
DNV-RP-C201 returns the legacy result dictionary:
Plate : {‘Plate buckling’: UF}
Stiffener: {‘Overpressure plate side’: UF, ‘Overpressure stiffener side’: UF,
‘Resistance between stiffeners’: UF, ‘Shear capacity’: UF}
Girder: {‘Overpressure plate side’: UF, ‘Overpressure girder side’: UF, ‘Shear capacity’: UF}
Local buckling {‘Stiffener’: [UF web, UF flange], ‘Girder’: [UF web, UF flange]}
SemiAnalytical and ML-Numeric return a method result dictionary with buckling/ultimate UF,
raw UF, validity, and selected UF fields.
- Returns:
Buckling results for the selected method
- Return type:
dict
- get_special_provisions_results()
Special provisions for plating and stiffeners in steel structures.
Return a dictionary:
‘Plate thickness’ : The thickness of plates shall not be less than this check.
‘Stiffener section modulus’ : The section modulus for longitudinals, beams, frames and other stiffeners
subjected to lateral pressure shall not be less than this check.
‘Stiffener shear area’ : The shear area of the plate/stiffener shall not be less than this ckeck.
- Returns:
minium dimensions and actual dimensions for the current structure in mm/mm^2/mm^3
- Return type:
dict
- set_buckling_parameters(calculation_method: str = None, buckling_acceptance: str = None, stiffened_plate_effective_aginst_sigy=True, min_lat_press_adj_span: float = None, buckling_length_factor_stf: float = None, buckling_length_factor_girder: float = None, stf_dist_between_lateral_supp: float = None, girder_dist_between_lateral_supp: float = None, panel_length_Lp: float = None, stiffener_support: str = 'Continuous', girder_support: str = 'Continuous', pressure_side: str = 'both sides', load_factor_stresses: float = 1.0, load_factor_pressure: float = 1.0, fabrication_method_stiffener: str = 'welded', fabrication_method_girder: str = 'welded', ml_algo=None)
Various buckling realted parameters are set here. For details, see
DNV-RP-C201 Buckling strength of plated structures.
- Parameters:
calculation_method (str) – ‘DNV-RP-C201 - prescriptive’, ‘SemiAnalytical S3/U3’, or ‘ML-Numeric (PULS based)’
buckling_acceptance (str) – selected UF family, either ‘buckling’ or ‘ultimate’
stiffened_plate_effective_aginst_sigy
min_lat_press_adj_span (float) – relative pressure applied on adjacent spans
buckling_length_factor_stf (float) – Buckling length factor: , kstiff
buckling_length_factor_girder (float) – Buckling length factor: kstiff
stf_dist_between_lateral_supp (float) – Distance between tripping brackets: lT
girder_dist_between_lateral_supp (float) – Dist.betw.lateral supp.: Ltg
panel_length_Lp (float) – Panel length (max.no stiff spans*l): Lp
stiffener_support (str) – continuous or sniped at ends
girder_support (str) – continuous or sniped at ends
pressure_side (str) – side receiving overpressure, ‘plate side’, ‘stiffener side’ or ‘both sides’
load_factor_stresses (float) – load factor applied to in-plane stresses
load_factor_pressure (float) – load factor applied to lateral pressure
fabrication_method_stiffener (str) – flat stiffener fabrication method, ‘welded’ or ‘cold formed’
fabrication_method_girder (str) – flat girder fabrication method, ‘welded’ or ‘cold formed’
ml_algo (dict) – optional numeric ML model/scaler bundle for ‘ML-Numeric (PULS based)’
- Returns:
- Return type:
- set_fixation_parameters(kpp: float = 1, kps: float = 1, km1: float = 12, km2: float = 24, km3: float = 12)
Used for calculation of special provisions for plating and stiffeners in steel structures.
- Parameters:
kpp (float) – fixation parameter for plate, 1.0 for clamped edges, 0.5 for simply supported edges
kps – fixation parameter for stiffeners, 1.0 if at least one end is clamped, 0.9 if both ends are simply supported
km1 (float) – Bending moment and shear force factors, see DNV standards or ANYstructure GUI
km2 (float) – Bending moment and shear force factors, see DNV standards or ANYstructure GUI
km3 (float) – Bending moment and shear force factors, see DNV standards or ANYstructure GUI
- Returns:
- Return type:
- set_girder(hw: float = 500, tw: float = 15, bf: float = 200, tf: float = 25, stf_type: str = 'T', spacing: float = 700)
Sets the girder properties.
- Parameters:
hw (float) – stiffer web height, mm
tw (float) – girder web thickness, mm
bf (float) – girder flange width, mm
tf (float) – girder flange thickness, mm
stf_type (str) – girder type, either T, FB, L or L-bulb
spacing (float) – spacing between girders
- Returns:
- Return type:
- set_material(mat_yield=355, emodule=210000, material_factor=1.15, poisson=0.3)
Set the material properties for all structure.
- Parameters:
mat_yield (float) – material yield, fy, given in MPa
emodule (float) – elastic module, E, given in MPa
material_factor (float) – material factor, typically 1.15 or 1.1
poisson (float) – poisson number of matieral
- Returns:
- Return type:
- set_ml_buckling_model(ml_algo)
Set the numeric ML model/scaler bundle used by the
ML-Numeric (PULS based)method.
- set_plate_geometry(spacing: float = 700, thickness: float = 20, span: float = 4000)
Set the properties of plate. If the plate is stiffened, spacing is between the stiffeners. If the plate is not unstiffened, the spacing is the width of the considered plate.
- Parameters:
spacing (float) – stiffener spacing
thickness (float) – plate thickness
span (float) – span of plate field
- Returns:
- Return type:
- set_puls_parameters(sp_or_up: str = None, puls_boundary: str = 'Int', stiffener_end: str = 'Continuous', up_boundary: str = 'SSSS')
Set the PULS-style panel metadata used by SemiAnalytical and ML-Numeric buckling methods.
- set_stiffener(hw: float = 260, tw: float = 12, bf: float = 49, tf: float = 27.3, stf_type: str = 'bulb', spacing: float = 608)
Sets the stiffener properties.
- Parameters:
hw (float) – stiffer web height, mm
tw (float) – stiffener web thickness, mm
bf (float) – stiffener flange width, mm
tf (float) – stiffener flange thickness, mm
stf_type (str) – stiffener type, either T, FB, L or L-bulb
spacing (float) – spacing between stiffeners
- Returns:
- Return type:
- set_stresses(pressure: float = 0, sigma_x1: float = 0, sigma_x2: float = 0, sigma_y1: float = 0, sigma_y2: float = 0, tau_xy: float = 0)
Set loads applied on the plate sides.
x1 and y1 is on one side of the plate
x2 and y2 is the other side
tau_xy act uniformly on the plate field
Stresses are in MPA.
Use POSITIVE numbers for compression pressure, stresses and forces
- Parameters:
pressure (float) – Lateral load / pressure: Psd [MPa]
sigma_x1 (float) – Longitudinal compr.: sx,sd [MPa]
sigma_x2 (float) – Longitudinal compr.: sx2,sd [MPa]
sigma_y1 (float) – Transverse compress.: sy,sd [MPa]
sigma_y2 (float) – Transverse compress.: sy2,sd [MPa]
tau_xy (float) – Shear Stress: txy [MPa]
- Returns:
- Return type:
- anystruct.api.load_project_state(path)
Load an ANYstructure project file into canonical project state.
- anystruct.api.open_project(path, hydration_defaults=None)
Load and hydrate an ANYstructure project through the application service facade.
- anystruct.api.save_project(path, save_input)
Create and save project state from a public project save input.
- anystruct.api.save_project_state(project_state, path)
Save canonical project state using the supported project-file codec.
anystruct.api_helpers module
- anystruct.api_helpers.assert_choice(value, choices, label)
- anystruct.api_helpers.cylinder_domain_with_input_mode(calculation_domain)
- anystruct.api_helpers.cylinder_input_mode(calculation_domain)
- anystruct.api_helpers.domain_for_geometry_id(geometry_id)
- anystruct.api_helpers.geometry_id_for_domain(calculation_domain)
- anystruct.api_helpers.mm_to_m(value)
- anystruct.api_helpers.mpa_to_pa(value)
- anystruct.api_helpers.normalize_bulb_stiffener_type(stiffener_type)
- anystruct.api_helpers.normalize_domain_string(calculation_domain)
- anystruct.api_helpers.normalize_flat_fabrication_method(method)
- anystruct.api_helpers.normalize_puls_boundary(boundary)
- anystruct.api_helpers.normalize_puls_stiffener_end(support)
Core calculation modules
anystruct.calc_structure module
- class anystruct.calc_structure.AllStructure(Plate: CalcScantlings = None, Stiffener: CalcScantlings = None, Girder: CalcScantlings = None, main_dict=None, calculation_domain: str = None)
Bases:
objectCalculation of structure
- property E
- property Girder
- property Plate
- property Stiffener
- property calculation_domain
- property fab_method_girder
- property fab_method_stiffener
- get_extended_string_mixed()
Some more information returned.
- get_main_properties()
- get_method()
- get_one_line_string_mixed()
Returning a one line string.
- girder(unstf_pl_data=None, stf_pl_data=None, optmizing=False)
Buckling of girder.
- property girder_end_support
- property km2
- property km3
- property lat_press
- local_buckling(optimizing=False)
Checks for girders and stiffeners
- property mat_yield
- property method
- property need_recalc
- property overpressure_side
- plate_buckling(optimizing=False)
Summary
- set_main_properties(prop_dict)
- property stf_end_support
- stiffened_panel(unstf_pl_data=None, optimizing=False)
- property stiffened_plate_effective_aginst_sigy
- property tension_field_action
- unstiffened_plate_buckling(optimizing=False)
- property v
- class anystruct.calc_structure.CalcFatigue(main_dict: dict, fatigue_dict: dict = None)
Bases:
StructureThis Class does the calculations for the plate fields. Input is a structure object (getters from the Structure Class)
- get_accelerations()
Returning tuple of accelerattions.
- get_damage_slope1(idx, curve, int_press=0, ext_press=0)
- get_damage_slope2(idx, curve, int_press, ext_press)
- get_design_life()
- get_dff()
- get_fatigue_properties()
Returning properties as a dictionary
- get_sn_curve()
- get_total_damage(int_press=(0, 0, 0), ext_press=(0, 0, 0))
- set_commmon_properties(fatigue_dict: dict)
Setting the fatiuge properties.
- set_fatigue_properties(fatigue_dict: dict)
Setting the fatiuge properties.
- class anystruct.calc_structure.CalcScantlings(main_dict: dict = None, lat_press=True, category='secondary')
Bases:
StructureThis Class does the calculations for the plate fields. Input is a structure object, same as for the structure class. The class inherits from Structure class.
- buckling_local_stiffener()
Local requirements for stiffeners. Chapter 9.11. :return:
- calculate_slamming_plate(slamming_pressure, red_fac=1)
Slamming pressure input is Pa
- calculate_slamming_stiffener(slamming_pressure, angle=90, red_fac=1)
- check_all_slamming(slamming_pressure, stf_red_fact=1, pl_red_fact=1)
A summary check of slamming
- get_dnv_min_section_modulus(design_pressure_kpa, printit=False)
Section modulus according to DNV rules
- get_dnv_min_thickness(design_pressure_kpa)
Return minimum thickness in mm :param design_pressure_kpa: :return:
- get_minimum_shear_area(pressure)
Calculating minimum section area according to ch 6.4.4.
Return [m^2] :return:
- get_net_effective_plastic_section_modulus(angle=90)
Calculated according to Rules for classification: Ships — DNVGL-RU-SHIP Pt.3 Ch.3. Edition July 2017, page 83
- get_plate_efficent_b(design_lat_press=0, axial_stress=50, trans_stress_small=100, trans_stress_large=100)
Simple buckling calculations according to DNV-RP-C201 :return:
- get_results_for_report(lat_press=0)
Returns a string for the report. :return:
- is_acceptable_pl_thk(design_pressure)
Checking if the thickness is acceptable. :return:
- is_acceptable_sec_mod(section_module, pressure)
Checking if the result is accepable. :param section_module: :param pressure: :return:
- is_acceptable_shear_area(shear_area, pressure)
Returning if the shear area is ok. :param shear_area: :param pressure: :return:
- property need_recalc
- class anystruct.calc_structure.CylinderAndCurvedPlate(main_dict=None, shell: Shell = None, long_stf: Structure = None, ring_stf: Structure = None, ring_frame: Structure = None)
Bases:
objectBuckling of cylinders and curved plates. Geomeries
Selections for: Type of Structure Geometry:
- geomeries = {1:’Unstiffened shell (Force input)’, 2:’Unstiffened panel (Stress input)’,
3:’Longitudinal Stiffened shell (Force input)’, 4:’Longitudinal Stiffened panel (Stress input)’, 5:’Ring Stiffened shell (Force input)’, 6:’Ring Stiffened panel (Stress input)’, 7:’Orthogonally Stiffened shell (Force input)’, 8:’Orthogonally Stiffened panel (Stress input)’}
- property E
- property LongStfObj
- property RingFrameObj
- property RingStfObj
- property ShellObj
- column_buckling(shell_bukcling_data=None, unstf_shell_data=None)
- property delta0
- property end_cap_pressure_included
- property fab_method_ring_girder
- property fab_method_ring_stf
- geomeries = {1: 'Unstiffened shell (Force input)', 2: 'Unstiffened panel (Stress input)', 3: 'Longitudinal Stiffened shell (Force input)', 4: 'Longitudinal Stiffened panel (Stress input)', 5: 'Ring Stiffened shell (Force input)', 6: 'Ring Stiffened panel (Stress input)', 7: 'Orthogonally Stiffened shell (Force input)', 8: 'Orthogonally Stiffened panel (Stress input)', 10: 'Flat plate, unstiffened', 11: 'Flat plate, stiffened', 12: 'Flat plate, stiffened with girder'}
- geomeries_map = {'Flat plate, stiffened': 11, 'Flat plate, stiffened with girder': 12, 'Flat plate, unstiffened': 10, 'Longitudinal Stiffened panel (Stress input)': 4, 'Longitudinal Stiffened shell (Force input)': 3, 'Orthogonally Stiffened panel (Stress input)': 8, 'Orthogonally Stiffened shell (Force input)': 7, 'Ring Stiffened panel (Stress input)': 6, 'Ring Stiffened shell (Force input)': 5, 'Unstiffened panel (Stress input)': 2, 'Unstiffened shell (Force input)': 1}
- geomeries_map_no_input_spec = {'Flat plate, stiffened': 11, 'Flat plate, stiffened with girder': 12, 'Flat plate, unstiffened': 10, 'Longitudinal Stiffened panel': 4, 'Longitudinal Stiffened shell ': 3, 'Orthogonally Stiffened panel': 8, 'Orthogonally Stiffened shell': 7, 'Ring Stiffened panel': 6, 'Ring Stiffened shell': 5, 'Unstiffened panel': 2, 'Unstiffened shell': 1}
- property geometry
- static get_Itot(hw, tw, b, tf, r, s, t)
- get_all_properties()
- get_main_properties()
- get_utilization_factors(optimizing=False, empty_result_dict=False)
If optimizing running time must be reduced.
- get_x_opt()
shell (0.02, 2.5, 5, 5, 10, nan, nan, nan), long (0.875, nan, 0.3, 0.01, 0.1, 0.01, nan, stiffener_type)), ring (nan, nan, 0.3, 0.01, 0.1, 0.01, nan, stiffener_type)), ring (nan, nan, 0.7, 0.02, 0.2, 0.02, nan, stiffener_type))]
- (self._spacing, self._plate_th, self._web_height, self._web_th, self._flange_width,
self._flange_th, self._span, self._girder_lg, self._stiffener_type)
- key = 8
- property length_between_girders
- longitudinally_stiffened_shell(column_buckling_data=None, unstiffened_shell=None)
- property mat_factor
- property mat_yield
- property panel_spacing
- property psd
- ring_stiffened_shell(data_shell_buckling=None, column_buckling_data=None)
- property sasd
- set_all_properties(all_prop_dict)
- set_main_properties(main_dict)
- set_stresses_and_pressure(val)
- shell_buckling()
Main sheet to calculate cylinder buckling.
- property shsd
- property smsd
- property tQsd
- property tTsd
- this_str = 'Orthogonally Stiffened panel'
- property uls_or_als
- unstiffened_shell(conical=False, shell_data=None)
- property v
- value = 'Orthogonally Stiffened panel (Stress input)'
- class anystruct.calc_structure.PULSpanel(run_dict: dict = {}, puls_acceptance: float = 0.87, puls_sheet_location: str = None)
Bases:
objectTakes care of puls runs
- property all_uf
- generate_random_results(batch_size: int = 1000, stf_type: str = None)
Genrate random results based on user input. :return:
- get_all_to_run()
- get_puls_line_results(line)
- get_run_results()
- get_string(line, uf=0.87)
- Parameters:
line
- Returns:
- get_utilization(line, method, acceptance=0.87)
- property puls_acceptance
- property puls_sheet_location
- result_changed(id)
- run_all(store_results=False)
Returning following results.:
Identification: name of line/run Plate geometry: dict_keys([‘Length of panel’, ‘Stiffener spacing’, ‘Plate thick.’]) Primary stiffeners: dict_keys([‘Number of stiffeners’, ‘Stiffener type’, ‘Stiffener boundary’, ‘Stiff. Height’,
‘Web thick.’, ‘Flange width’, ‘Flange thick.’, ‘Flange ecc.’, ‘Tilt angle’])
- Secondary stiffeners. dict_keys([‘Number of sec. stiffeners’, ‘Secondary stiffener type’, ‘Stiffener boundary’,
‘Stiff. Height’, ‘Web thick.’, ‘Flange width’, ‘Flange thick.’])
Model imperfections. dict_keys([‘Imp. level’, ‘Plate’, ‘Stiffener’, ‘Stiffener tilt’]) Material: dict_keys([‘Modulus of elasticity’, “Poisson’s ratio”, ‘Yield stress plate’, ‘Yield stress stiffener’]) Aluminium prop: dict_keys([‘HAZ pattern’, ‘HAZ red. factor’]) Applied loads: dict_keys([‘Axial stress’, ‘Trans. stress’, ‘Shear stress’, ‘Pressure (fixed)’]) Bound cond.: dict_keys([‘In-plane support’]) Global elastic buckling: dict_keys([‘Axial stress’, ‘Trans. Stress’, ‘Trans. stress’, ‘Shear stress’]) Local elastic buckling: dict_keys([‘Axial stress’, ‘Trans. Stress’, ‘Trans. stress’, ‘Shear stress’]) Ultimate capacity: dict_keys([‘Actual usage Factor’, ‘Allowable usage factor’, ‘Status’]) Failure modes: dict_keys([‘Plate buckling’, ‘Global stiffener buckling’, ‘Torsional stiffener buckling’,
‘Web stiffener buckling’])
Buckling strength: dict_keys([‘Actual usage Factor’, ‘Allowable usage factor’, ‘Status’]) Local geom req (PULS validity limits): dict_keys([‘Plate slenderness’, ‘Web slend’, ‘Web flange ratio’,
‘Flange slend ‘, ‘Aspect ratio’])
CSR-Tank requirements (primary stiffeners): dict_keys([‘Plating’, ‘Web’, ‘Web-flange’, ‘Flange’, ‘stiffness’])
- Returns:
- set_all_to_run(val)
- set_run_results(val)
- class anystruct.calc_structure.Shell(main_dict: dict = None)
Bases:
objectSmall class to contain shell properties.
- property Lc
- property dist_between_rings
- get_Zl()
- get_effective_width_shell_plate()
- get_main_properties()
- property k_factor
- property length_of_shell
- property radius
- set_main_properties(main_dict)
- property thk
- property tot_cyl_length
- class anystruct.calc_structure.Structure(main_dict: dict = None, *args, **kwargs)
Bases:
objectSetting the properties for the plate and the stiffener. Takes a dictionary as argument.
- property E
- property b
- get_Iz_moment_of_inertia(reduced_tw=None)
- get_beam_string(short=False)
Returning a string.
- get_buckling_ml_input(design_lat_press: float = 0, sp_or_up: str = 'SP', alone=True, csr=False)
Classes in data from ML
{‘negative utilisation’: 1, ‘non-zero’: 2, ‘Division by zero’: 3, ‘Overflow’: 4, ‘aspect ratio’: 5, ‘global slenderness’: 6, ‘pressure’: 7, ‘web-flange-ratio’: 8, ‘below 0.87’: 9,
‘between 0.87 and 1’: 10, ‘above 1’: 11}
- get_cross_section_area(efficient_se=None, include_plate=True)
Returns the cross section area. :return:
- get_cross_section_centroid_with_effective_plate(se=None, tf1=None, include_plate=True, reduced_tw=None)
Returns cross section centroid :return:
- get_ef_iacs()
- get_extended_string()
Some more information returned.
- get_fl_thk()
Return the flange thickness :return:
- get_fl_w()
Return the flange width :return:
- get_flange_eccentricity()
- get_fy()
Return material yield :return:
- get_km1()
Return var :return:
- get_km2()
Return var :return:
- get_km3()
Return var :return:
- get_kpp()
Return var :return:
- get_kps()
Return var :return:
- get_moment_of_interia_iacs(efficent_se=None, only_stf=False, tf1=None)
- get_moment_of_intertia(efficent_se=None, only_stf=False, tf1=None, reduced_tw=None, plate_thk=None, plate_spacing=None)
Returning moment of intertia. :return:
- get_moment_of_intertia_hp()
- get_one_line_string()
Returning a one line string.
- get_pl_thk()
Return the plate thickness :return:
- get_plasic_section_modulus()
Returns the plastic section modulus :return:
- get_polar_moment(reduced_tw=None)
- get_puls_boundary()
- get_puls_input(run_type: str = 'SP')
- get_puls_method()
- get_puls_sp_or_up()
- get_puls_stf_end()
- get_puls_up_boundary()
- get_report_stresses()
Return the stresses to the report
- get_s()
Return the spacing :return:
- get_section_modulus(efficient_se=None, dnv_table=False)
Returns the section modulus. :param efficient_se: :return:
- get_shear_area()
Returning the shear area in [m^2] :return:
- get_shear_center()
Returning the shear center :return:
- get_side()
Return the checked pressure side. :return:
- get_span()
Return the span :return:
- get_stf_cog_eccentricity()
- get_stiffener_type()
- get_structure_prop()
- get_structure_type()
- get_structure_types()
- get_torsional_moment_venant(reduced_tw=None, efficient_flange=True)
- get_tuple()
Return a tuple of the plate stiffener
- get_web_h()
Return the web heigh :return:
- get_web_thk()
Return the spacing :return:
- get_weight()
Return the weight. :return:
- get_weight_width_lg()
Return the weight including Lg :return:
- get_z_opt()
- property girder_lg
- property hw
- property mat_factor
- property mat_yield
- property panel_or_shell
- set_main_properties(main_dict)
Resettting all properties :param input_dictionary: :return:
- set_span(span)
Setting the span. Used when moving a point. :return:
- set_stresses(sigy1, sigy2, sigx1, sigx2, tauxy)
Setting the global stresses. :param sigy1: :param sigy2: :param sigx: :param tauxy: :return:
- property sigma_x1
- property sigma_x2
- property sigma_y1
- property sigma_y2
- property spacing
- property span
- property stiffener_type
- property t
- property tau_xy
- property tf
- property tw
- property v
- anystruct.calc_structure.main()
anystruct.calc_loads module
- class anystruct.calc_loads.Combination(object_line, comb_dict=None, tank_dict=None, load_dict=None)
Bases:
objectTHIS CLASS IS CURRENTLY NOT USED. MAY NOT BE USED AT ALL. IT IS STUPID. This class cointaines the load combinations. combination,self.active_line,compartment
- get_load_factor_dynamic()
Setting the the dynamic load factor. :return:
- get_load_factor_static()
Setting the the dynamic load factor. :return:
- get_load_factors()
Get the tk.DoubleVar, tk.DoubleVar, tk.IntVar that is used in the load factor input and on/off. :return:
- get_on_off(value)
Setting the the dynamic load factor. :return:
- set_combination_dictionary(value)
Setting the combination dictionary. :return:
- set_load_dictionary(value)
Setting the load dictionary. :return:
- set_load_factor_dynamic(value)
Setting the the dynamic load factor. :return:
- set_load_factor_static(value)
Setting the the dynamic load factor. :return:
- set_on_off(value)
Setting the the dynamic load factor. :return:
- set_tank_dictionary(value)
Setting the tank dictionary. :return:
- class anystruct.calc_loads.Loads(main_load_dict)
Bases:
objectThis Class calculates the load to be applied on the structure
- get_calculated_pressure(varibale_value, acceleration, structure_type)
Input variable is a tuple of (x,y). This method need one variable and the right one must be chosen. :param varibale_value: :return:
- get_limit_state()
Return ULS, FLS….
- get_load_condition()
Getting loaded, ballast or part
- get_load_parmeters()
- get_name()
- get_report_string()
- get_slamming_reduction_plate()
- get_slamming_reduction_stf()
- get_static_draft()
Return static draft if is_static :return:
- is_static()
Checking if the load is static type. :return:
- is_tank_test()
- class anystruct.calc_loads.Tanks(tank_dict)
Bases:
object- This class incorporates all tank definitions
- temp_tank_dict = {0 ‘comp_no’comp_no,
1 ‘cells’ : properties[0], 2 ‘min_el’ : properties[1], 3 ‘max_el’ : properties[2], 4 ‘content’ : ‘’, 5 ‘added_press’ : 0, 6 ‘acc’ : {static:g,dyn_loaded:az,dyn_ballast:az} 7 ‘density’ : 1025}
- get_accelerations()
Returns the defined accelerations :return:
- get_bottom_pressure()
Get pressure at bottom of tank. :return:
- get_calculated_pressure(coordinates, acceleration)
Get the pressure with specified variable. :param elevaiton: :return:
- get_condition()
Returning the condition. self.load_conditions = [‘loaded’, ‘ballast’,’tanktest’] :return:
- get_content()
Returnt the tank content type :return:
- get_density()
Get the tank density. :return:
- get_highest_elevation()
Find the top of the tank. :return:
- get_line_pressure_from_max_pressure(pressure, coordinates)
Used when you have a maximum pressure and request the pressure at a specific coordinate. :param coordinates: :return:
- get_lowest_elevation()
Find the bottom of the tank. :return:
- get_name()
Returns the name of the compartmnet :return:
- get_overpressure()
Get the overpressure at tank top. :return:
- get_parameters()
Returns properties :return:
- get_tank_dnv_minimum_pressure(lf_static, lf_enviromental)
Calculating 4.3.7 and 4.3.8 and returning the highest of these pressures. :return:
- get_top_pressure()
Get the pressure at the top of the tank. :return:
- is_ballast_condition()
Check to see if the tank shall be in cluded in loaded condition. :return:
- is_loaded_condition()
Check to see if the tank shall be in cluded in loaded condition. self.tank_options = [‘crude_oil’, ‘diesel’, ‘slop’, ‘ballast’] :return:
- is_tank_test_condition()
Check to see if the tank shall be in cluded in loaded condition. :return:
- set_acceleration(acc)
Setter :param overpressure: :return:
- set_content(content)
Setter :param overpressure: :return:
- set_density(density)
Setter :param overpressure: :return:
- set_overpressure(overpressure)
Setter :param overpressure: :return:
Project file modules
anystruct.project_state module
Canonical project data used at persistence and application boundaries.
- class anystruct.project_state.ProjectState(project_information: str = '', theme: str = 'default', points: dict[str, ~typing.Any]=<factory>, lines: dict[str, ~typing.Any]=<factory>, structures: dict[str, ~typing.Any]=<factory>, shell_structures: dict[str, ~typing.Any]=<factory>, loads: dict[str, ~typing.Any]=<factory>, accelerations: dict[str, ~typing.Any]=<factory>, load_combinations: dict[str, ~typing.Any]=<factory>, tanks: dict[str, ~typing.Any]=<factory>, fatigue: dict[str, ~typing.Any]=<factory>, buckling_method: str = 'DNV-RP-C201 - prescriptive', shifting: dict[str, ~typing.Any]=<factory>, weight_and_cog: dict[str, ~typing.Any]=<factory>, extras: dict[str, ~typing.Any]=<factory>, format_version: int = 1)
Bases:
objectJSON-safe project snapshot independent of Tkinter widget state.
- accelerations: dict[str, Any]
- buckling_method: str = 'DNV-RP-C201 - prescriptive'
- extras: dict[str, Any]
- fatigue: dict[str, Any]
- format_version: int = 1
- classmethod from_legacy_mapping(data: dict[str, Any]) ProjectState
- lines: dict[str, Any]
- load_combinations: dict[str, Any]
- loads: dict[str, Any]
- points: dict[str, Any]
- project_information: str = ''
- shell_structures: dict[str, Any]
- shifting: dict[str, Any]
- structures: dict[str, Any]
- tanks: dict[str, Any]
- theme: str = 'default'
- to_legacy_mapping() dict[str, Any]
- weight_and_cog: dict[str, Any]
anystruct.project_application module
Project snapshot, hydration, open-transfer, and persistence services.
- class anystruct.project_application.LoadCombinationRecord(name: Any, static_factor: Any, dynamic_factor: Any, include: Any)
Bases:
objectPlain load-combination value captured at the UI boundary.
- dynamic_factor: Any
- include: Any
- name: Any
- static_factor: Any
- to_legacy() list[Any]
- class anystruct.project_application.OpenLoadCombinationRecord(name: tuple[Any, ...], static_factor: Any, dynamic_factor: Any, include: Any = None)
Bases:
objectSaved load-combination values ready for Tk variable creation.
- dynamic_factor: Any
- classmethod from_legacy(data: list[Any]) OpenLoadCombinationRecord
- property has_include: bool
- include: Any = None
- name: tuple[Any, ...]
- static_factor: Any
- class anystruct.project_application.ProjectFileDialogService
Bases:
objectResolve project file targets without depending on Tk dialogs.
- static backup_save_target(root_dir: str | Path) ProjectFileTarget
- static example_open_target(file_name: str | Path, root_dir: str | Path) ProjectFileTarget
- static remembered_save_target(last_save_file: str | Path | None) ProjectFileTarget | None
- static restore_target(root_dir: str | Path) ProjectFileTarget | None
- static selected_open_target(filename: str | Path | None) ProjectFileTarget | None
- static selected_output_target(filename: str | Path | None) ProjectFileTarget | None
- static selected_save_target(filename: str | Path, *, backup: bool = False) ProjectFileTarget
- class anystruct.project_application.ProjectFileTarget(path: Path, remember_as_last_save: bool = False)
Bases:
objectResolved project file path plus whether it should become the remembered save path.
- path: Path
- remember_as_last_save: bool = False
- class anystruct.project_application.ProjectHydrationDefaults(structure_types: dict[str, Any], zstar_optimization: Any = True, puls_buckling_method: Any = 'ultimate', puls_boundary: Any = 'Int', puls_stiffener_end: Any = 'Continuous', puls_sp_or_up: Any = 'SP', puls_up_boundary: Any = 'SSSS', material_factor: Any = 1.15)
Bases:
objectLegacy structure defaults that the UI used to inject while opening files.
- material_factor: Any = 1.15
- puls_boundary: Any = 'Int'
- puls_buckling_method: Any = 'ultimate'
- puls_sp_or_up: Any = 'SP'
- puls_stiffener_end: Any = 'Continuous'
- puls_up_boundary: Any = 'SSSS'
- structure_types: dict[str, Any]
- zstar_optimization: Any = True
- class anystruct.project_application.ProjectHydrationResult(line_bundles: dict[str, list[Any]], load_assignments: dict[str, list[Any]], section_properties: tuple[dict[str, Any], ...])
Bases:
objectDomain objects rebuilt from a saved project before Tk widgets are touched.
- line_bundles: dict[str, list[Any]]
- load_assignments: dict[str, list[Any]]
- section_properties: tuple[dict[str, Any], ...]
- class anystruct.project_application.ProjectHydrationService
Bases:
objectRebuild supported domain objects from saved project state.
- LOAD_VARIABLES = ('poly_third', 'poly_second', 'poly_first', 'poly_const', 'load_condition', 'structure_type', 'man_press', 'static_draft', 'name_of_load', 'limit_state', 'slamming mult pl', 'slamming mult stf')
- classmethod hydrate_objects(state: ProjectState, defaults: ProjectHydrationDefaults)
- class anystruct.project_application.ProjectOpenResult(state: ProjectState, transfer: ProjectOpenTransfer, hydration: ProjectHydrationResult)
Bases:
objectAssembled project payload ready for the UI open boundary.
- hydration: ProjectHydrationResult
- state: ProjectState
- transfer: ProjectOpenTransfer
- class anystruct.project_application.ProjectOpenService
Bases:
objectLoad and assemble project data before the UI applies it.
- static assemble(state: ProjectState, defaults: ProjectHydrationDefaults) ProjectOpenResult
- classmethod open_path(path: str | Path, defaults: ProjectHydrationDefaults) ProjectOpenResult
- class anystruct.project_application.ProjectOpenTransfer(project_information: str, theme: str, points: dict[str, Any], lines: dict[str, Any], shifting: dict[str, Any], accelerations: dict[str, Any], load_combinations: tuple[OpenLoadCombinationRecord, ...], tank_grid: Any, tank_search_data: dict[int, Any] | None, tank_properties: dict[str, Any], buckling_method: str, weight_and_cog: dict[str, Any])
Bases:
objectPlain project values that openfile can apply at the Tk boundary.
- accelerations: dict[str, Any]
- buckling_method: str
- lines: dict[str, Any]
- load_combinations: tuple[OpenLoadCombinationRecord, ...]
- points: dict[str, Any]
- project_information: str
- shifting: dict[str, Any]
- tank_grid: Any
- tank_properties: dict[str, Any]
- tank_search_data: dict[int, Any] | None
- theme: str
- weight_and_cog: dict[str, Any]
- class anystruct.project_application.ProjectOpenTransferService
Bases:
objectNormalize saved project values before Tk view state is populated.
- DEFAULT_ACCELERATIONS = {'dyn_ballast': 0, 'dyn_loaded': 0, 'static': 9.81}
- classmethod create_transfer(state: ProjectState) ProjectOpenTransfer
- exception anystruct.project_application.ProjectPersistenceError(action: str, location: Any, error: Exception)
Bases:
RuntimeErrorFailure raised while a project file is loaded or saved.
- class anystruct.project_application.ProjectPersistenceService
Bases:
objectLoad and save project state without depending on Tk file objects.
- BACKUP_FILE_NAME = 'backup.txt'
- classmethod backup_exists(root_dir: str | Path) bool
- classmethod backup_path(root_dir: str | Path) Path
- codec
alias of
ProjectFileCodec
- classmethod load_state_from_path(path: str | Path) ProjectState
- classmethod save_state_to_path(state: ProjectState, path: str | Path) Path
- class anystruct.project_application.ProjectSaveInput(project_information: str, theme: str, points: MutableMapping[str, Any], lines: MutableMapping[str, Any], line_bundles: MutableMapping[str, list[Any]], load_assignments: MutableMapping[str, list[Any]], accelerations: MutableMapping[str, Any], load_combinations: tuple[LoadCombinationRecord, ...], tanks: MutableMapping[str, Any], tank_grid: Any, tank_search_data: Any, buckling_method: str, shifting: MutableMapping[str, Any], weight_and_cog: MutableMapping[str, Any])
Bases:
objectPlain project data captured at the save boundary.
- accelerations: MutableMapping[str, Any]
- buckling_method: str
- line_bundles: MutableMapping[str, list[Any]]
- lines: MutableMapping[str, Any]
- load_assignments: MutableMapping[str, list[Any]]
- load_combinations: tuple[LoadCombinationRecord, ...]
- points: MutableMapping[str, Any]
- project_information: str
- shifting: MutableMapping[str, Any]
- tank_grid: Any
- tank_search_data: Any
- tanks: MutableMapping[str, Any]
- theme: str
- weight_and_cog: MutableMapping[str, Any]
- class anystruct.project_application.ProjectSaveResult(path: Path, state: ProjectState)
Bases:
objectPersisted save state and its resolved project path.
- path: Path
- state: ProjectState
- class anystruct.project_application.ProjectSaveService
Bases:
objectCreate and persist project snapshots from plain save input.
- static create_state(save_input: ProjectSaveInput) ProjectState
- classmethod save_path(path: str | Path, save_input: ProjectSaveInput) ProjectSaveResult
- class anystruct.project_application.ProjectSnapshotService
Bases:
objectCreate persistence snapshots from domain objects and plain UI values.
- classmethod create_state(*, project_information: str, theme: str, points: MutableMapping[str, Any], lines: MutableMapping[str, Any], line_bundles: MutableMapping[str, list[Any]], load_assignments: MutableMapping[str, list[Any]], accelerations: MutableMapping[str, Any], load_combinations: list[LoadCombinationRecord], tanks: MutableMapping[str, Any], tank_grid: Any, tank_search_data: Any, buckling_method: str, shifting: MutableMapping[str, Any], weight_and_cog: MutableMapping[str, Any]) ProjectState
Optimization modules
anystruct.optimize module
- anystruct.optimize.any_constraints_all(x, obj, lat_press, init_weight, side='p', chk=(True, True, True, True, True, True, True, False, False, False), fat_dict=None, fat_press=None, slamming_press=0, PULSrun: PULSpanel = None, print_result=False, fdwn=1, fup=0.5, ml_results=None, random_result_return=False, weld_bias=0.0, builtup_stiffener=False, weld_metric='weld_consumables', cost_factors=None)
Checking all constraints defined.
- ml_results is used for both ML pipelines:
- chk[7] SemiAnalytical replacement:
ml_results[0] = buckling UF ml_results[1] = ultimate UF ml_results[2] = valid prediction flag, 1 = valid, 0 = invalid/unsupported ml_results[3] = SemiAnalytical acceptance limit accepted if selected UF / acceptance < 1.0
- chk[8] ML-CL:
deactivated; ML-Numeric has replaced this classifier path
- chk[9] ML-Numeric:
ml_results[0] = material-factored buckling UF ml_results[1] = material-factored ultimate UF ml_results[2] = valid numeric prediction flag, 1 = valid, 0 = invalid/NaN accepted if selected UF <= 1.0
- anystruct.optimize.any_constraints_cylinder(x, obj: CylinderAndCurvedPlate, init_weight, lat_press=None, side='p', chk=(True, True, True, True, True, True, True, False, False, False), fat_dict=None, fat_press=None, slamming_press=0, fdwn=1, fup=0.5, ml_results=None, weld_bias=0.0, builtup_stiffener=False, weld_metric='weld_consumables', cost_factors=None)
Checking all constraints defined.
- iter_var = ((item,init_stuc_obj,lat_press,init_filter_weight,side,chk,fat_dict,fat_press,slamming_press, PULSrun)
for item in iterable_all)
- Parameters:
x
- Returns:
- anystruct.optimize.any_find_min_weight_var(var)
Find the minimum weight of the inpu :param min: :param max: :return:
- anystruct.optimize.any_get_all_combs(min_var, max_var, deltas, init_weight=inf, predef_stiffeners=None, stf_type=None)
Calulating initial values. :param min: :param max: :return:
- anystruct.optimize.any_optimize_loop(min_var, max_var, deltas, initial_structure_obj, lateral_pressure, init_filter=inf, side='p', const_chk=(True, True, True, True, True, False), fat_dict=None, fat_press=None, slamming_press=0, weld_bias=0.0, builtup_stiffener=False, weld_metric='weld_consumables', cost_factors=None)
Calulating initial values. :param min: :param max: :return:
- anystruct.optimize.any_smart_loop(min_var, max_var, deltas, initial_structure_obj, lateral_pressure, init_filter=inf, side='p', const_chk=(True, True, True, True, True, True, True, False, False, False), fat_dict=None, fat_press=None, slamming_press=0, predefiened_stiffener_iter=None, processes=None, puls_sheet=None, puls_acceptance=0.87, fdwn=1, fup=0.5, ml_algo=None, weld_bias=0.0, builtup_stiffener=False, weld_metric='weld_consumables', cost_factors=None)
Trying to be smart.
- weld_bias:
- 0.0 = pure weight optimization.
IMPORTANT: no weld consumable calculations are performed.
1.0 = pure weld consumable optimization. Between 0 and 1 = normalized mixed objective.
- builtup_stiffener:
If True, include web-to-flange weld consumables in addition to plate-to-stiffener weld consumables.
- anystruct.optimize.any_smart_loop_cylinder(min_var, max_var, deltas, initial_structure_obj, lateral_pressure=None, init_filter=inf, side='p', const_chk=(True, True, True, True, True, True, True, False, False, False), fat_dict=None, fat_press=None, slamming_press=0, predefiened_stiffener_iter=None, processes=None, fdwn=1, fup=0.5, ml_algo=None, use_weight_filter=True, weld_bias=0.0, builtup_stiffener=False, weld_metric='weld_consumables', cost_factors=None)
Cylinder optimization.
- weld_bias:
- 0.0 = pure weight optimization. Existing behaviour is preserved and no
weld consumable calculations are performed.
1.0 = pure estimated weld consumable optimization. Between 0 and 1 = mixed normalized objective.
- builtup_stiffener:
If True, include web-to-flange welds for built-up stiffeners.
- anystruct.optimize.any_smart_loop_geometric(min_var, max_var, deltas, initial_structure_obj, lateral_pressure, init_filter=inf, side='p', const_chk=(True, True, True, True, True, True), fat_obj=None, fat_press=None, slamming_press=None, predefiened_stiffener_iter=None, processes=None, ml_algo=None, weld_bias=0.0, builtup_stiffener=False, weld_metric='weld_consumables', cost_factors=None)
Searching multiple sections using the smart loop.
- anystruct.optimize.calc_cylinder_objective_value(x, weld_bias=0.0, include_web_to_flange=False, weld_metric='weld_consumables', cost_factors=None)
Return the scalar cylinder objective used for filtering and winner selection.
- anystruct.optimize.calc_flat_objective_value(x, stiffener_type='T', weld_bias=0.0, include_web_to_flange=False, weld_metric='weld_consumables', cost_factors=None)
Return the scalar flat-panel objective used for filtering and winner selection.
- anystruct.optimize.calc_weight(x, prt=False)
Calculating the current weight :param current_dict: :return:
- anystruct.optimize.calc_weight_cylinder(x)
Calculation of total weigth.
shell (0.02, 2.5, 5, 5, 10, nan, nan, nan), long (0.875, nan, 0.3, 0.01, 0.1, 0.01, nan, nan), ring (nan, nan, 0.3, 0.01, 0.1, 0.01, nan, nan), ring (nan, nan, 0.7, 0.02, 0.2, 0.02, nan, nan)]
- anystruct.optimize.calc_weight_pso(x, *args)
Calculating the current weight :param current_dict: :return:
- anystruct.optimize.calc_weight_pso_section(x, *args)
Calculating the weight of a complete section. :param x: :param args: :return:
- anystruct.optimize.calc_weld_consumable(x, stiffener_type='T', density=7850.0, weld_area_factor=0.5, include_plate_to_stiffener=True, include_web_to_flange=False)
Estimate weld consumable mass [kg] for one stiffened plate field.
- anystruct.optimize.calc_weld_consumable_cylinder(x, density=7850.0, weld_area_factor=0.5, include_web_to_flange=False)
Estimate weld consumable mass [kg] for a stiffened cylinder candidate.
- anystruct.optimize.calc_weld_length(x, stiffener_type='T', include_plate_to_stiffener=True, include_web_to_flange=False)
Estimate total weld length [m] for one stiffened plate field.
- anystruct.optimize.calc_weld_length_cylinder(x, include_web_to_flange=False)
Estimate total weld length [m] for a stiffened cylinder candidate.
- anystruct.optimize.calc_weld_objective(x, stiffener_type='T', include_web_to_flange=False, weld_metric='weld_consumables')
Return selected flat-panel weld metric.
- anystruct.optimize.calc_weld_objective_cylinder(x, include_web_to_flange=False, weld_metric='weld_consumables')
Return selected cylinder weld metric.
- anystruct.optimize.constraint_geometric(fractions, *args)
- anystruct.optimize.create_new_calc_obj(init_obj, x, fat_dict=None, fdwn=1, fup=0.5)
Returns a new calculation object to be used in optimization :param init_obj: :return:
- anystruct.optimize.create_new_cylinder_obj(init_obj, x_new)
Create a new cylinder object for a candidate geometry.
Optimizer tuple values are in meters. Structure stiffener properties are exposed as mm properties: spacing, hw, tw, b, tf. Older objects may use .s.
- anystruct.optimize.create_new_structure_obj(init_obj, x, fat_dict=None, fdwn=1, fup=0.5)
Returns a new calculation object to be used in optimization :param init_obj: :return:
- anystruct.optimize.estimate_fillet_weld_leg(thickness_1, thickness_2, min_leg=0.003, max_leg=0.012, thickness_factor=0.7)
Estimate fillet weld leg length [m] from connected material thickness.
- anystruct.optimize.estimate_number_of_stiffeners(width, spacing)
Estimate number of stiffeners across Lg/field width.
Uses round(width / spacing) rather than floor division to avoid systematic under-counting when Lg is not an exact multiple of stiffener spacing.
- anystruct.optimize.geometric_summary_search(min_var=None, max_var=None, deltas=None, initial_structure_obj=None, lateral_pressure=None, init_filter=inf, side='p', const_chk=(True, True, True, True, True, True), pso_options=(100, 0.5, 0.5, 0.5, 100, 1e-08, 1e-08), fat_obj=None, fat_press=None, min_max_span=(2, 6), tot_len=None, frame_distance=None, algorithm='anysmart', predefiened_stiffener_iter=None, reiterate=True, processes=None, slamming_press=None, load_pre=False, opt_girder_prop=None, ml_algo=None, weld_bias=0.0, builtup_stiffener=False, weld_metric='weld_consumables', cost_factors=None)
Geometric optimization of all relevant sections.
- anystruct.optimize.get_field_tot_area(x)
Total area of a plate field.
- anystruct.optimize.get_filtered_results(iterable_all, init_stuc_obj, lat_press, init_filter_weight, side='p', chk=(True, True, True, True, True, True, True, False), fat_dict=None, fat_press=None, slamming_press=None, processes=None, puls_sheet=None, puls_acceptance=0.87, fdwn=1, fup=0.5, ml_algo=None, weld_bias=0.0, builtup_stiffener=False, weld_metric='weld_consumables', cost_factors=None, use_semianalytical_speed_staging=True)
Using multiprocessing to return list of applicable results.
- Supports:
chk[7] = built-in SemiAnalytical replacement chk[8] = ML-CL classification pipeline, deactivated chk[9] = ML-Numeric UF pipeline
- anystruct.optimize.get_initial_weight(obj, lat_press, min_var, max_var, deltas, trials, fat_dict, fat_press, predefined_stiffener_iter, slamming_press, fdwn=1, fup=0.5, ml_algo=None, weld_bias=0.0, builtup_stiffener=False, weld_metric='weld_consumables', cost_factors=None)
Return a guess of the initial objective used to filter constraints. Only aim is to reduce running time of the algorithm.
- anystruct.optimize.get_random_result(obj, lat_press, min_var, max_var, deltas, trials=10000, side='p', const_chk=(True, True, True, True, True), fat_dict=None, fat_press=None, weld_bias=0.0, builtup_stiffener=False, weld_metric='weld_consumables', cost_factors=None)
Return random results
- anystruct.optimize.get_random_result_no_bounds(obj, lat_press, min_var, max_var, trials=10000, side='p', const_chk=(True, True, True, True, True), fat_dict=None, fat_press=None, weld_bias=0.0, builtup_stiffener=False, weld_metric='weld_consumables', cost_factors=None)
Return random results, ignoring the deltas
- anystruct.optimize.normalize_cost_factors(cost_factors)
Return optimizer cost factors or None when cost optimization is inactive.
- anystruct.optimize.normalize_weld_metric(weld_metric)
Return supported weld objective metric key.
- anystruct.optimize.plot_optimization_results(results, multiple=False)
- anystruct.optimize.product_any(*args, repeat=1, weight=inf)
- anystruct.optimize.pso_constraint_geometric(x, *args)
The sum of the fractions must be 1.
- anystruct.optimize.random_product(*args, repeat=1)
- anystruct.optimize.run_optmizataion(initial_structure_obj=None, min_var=None, max_var=None, lateral_pressure=None, deltas=None, algorithm='anysmart', trials=30000, side='p', const_chk=(True, True, True, True, True, True, True, False, False, False), pso_options=(100, 0.5, 0.5, 0.5, 100, 1e-08, 1e-08), is_geometric=False, fatigue_obj=None, fat_press_ext_int=None, min_max_span=(2, 6), tot_len=None, frame_height=2.5, frame_distance=None, slamming_press=0, predefined_stiffener_iter=None, processes=None, use_weight_filter=True, load_pre=False, opt_girder_prop=None, puls_sheet=None, puls_acceptance=0.87, fdwn=1, fup=0.5, ml_algo=None, cylinder=False, material_factor=None, weld_bias=0.0, builtup_stiffener=False, weld_metric='weld_consumables', cost_factors=None)
The optimization is initiated here. It is called from optimize_window / optimize_cylinder.
- weld_bias:
- 0.0 = pure weight optimization. Existing behaviour is preserved and no weld
consumable objective is used downstream.
1.0 = pure estimated weld consumable optimization. Between 0 and 1 = mixed normalized objective.
- builtup_stiffener:
If True, include web-to-flange weld consumables for built-up stiffeners.
- anystruct.optimize.stress_scaling(sigma_old, t_old, t_new, fdwn=1, fup=0.5)
- anystruct.optimize.stress_scaling_area(sigma_old, a_old, a_new, fdwn=1, fup=0.5)
Scale stresses using input area
- anystruct.optimize.stress_scaling_cylinder(x1, x2, stress1)
Scale stresses of a stiffened cylinder.
To scale:
Design axial stress, sa,sd = Design bending stress, sm,sd = Design torsional stress, tT,sd= Design shear stress, tQ,sd= Additional hoop stress, sh,sd =
- anystruct.optimize.x_to_string(x)
anystruct.optimize_cylinder module
- class anystruct.optimize_cylinder.CreateOptimizeCylinderWindow(master, app=None)
Bases:
objectThis class initiates the single optimization window.
- algorithm_info()
When button is clicked, info is displayed.
- checkered(line_distance)
- draw_properties()
Drawing properties in the canvas. :return:
- get_deltas()
Return a numpy array of the deltas. :return:
- get_lower_bounds()
Return an numpy array of lower bounds. :return:
- get_running_time()
Estimate running time without generating all combinations.
This is intentionally lightweight because it is triggered from GUI variable changes.
- get_sigmas()
Returns the stressess. :return:
- get_upper_bounds()
Return an numpy array of upper bounds. :return:
- modify_structure_object()
Chaning parameters in the structure object before running.
- open_cost_study_window()
- open_example_file()
- plot_results()
- run_cost_study(cost_factors)
- run_optimizaion()
function for button :return:
- run_weight_weld_study()
- save_and_close()
Save and close :return:
- schedule_running_time_update(*args)
Debounce running-time updates.
Tkinter variable traces fire on every keystroke. Without debouncing, the GUI may repeatedly recompute estimates while the user is still typing, which makes the window feel frozen.
- selected_algorithm(event)
Action when selecting an algorithm.
- show_calculated()
- show_previous_weight_weld_study()
- toggle()
- update_running_time(*args)
Estimate the running time of the algorithm.
- write_result_csv()
- anystruct.optimize_cylinder.receive_progress_info()
Get progress info from optimization algorithm. :return:
anystruct.optimize_geometry module
- class anystruct.optimize_geometry.CreateOptGeoWindow(master, app=None)
Bases:
objectThis class initiates the MultiOpt window.
- algorithm_info()
When button is clicked, info is displayed.
- button_1_click(event)
When clicking the right button, this method is called. method is referenced in
- button_2_click(event)
Event when right click. :param evnet: :return:
- button_2_click_and_drag(event)
- button_3_click(event)
Event when right click. :param evnet: :return:
- checkered(line_distance)
Creates a grid in the properties canvas. :param line_distance: :return:
- controls()
Specifying the controls to be used. :return:
- ctrl_pressed(event=None)
Event when control is pressed. :param event: :return:
- draw_properties(init_obj=None, opt_obj=None, line=None)
Drawing properties in the canvas. :return:
- draw_result_text(geo_opt_obj, save_to_file=None)
Textual version of the results.
- draw_select_canvas(opt_results=None, save_file=None)
Making the lines canvas. :return:
- get_canvas_coord(coord)
Returning the canvas coordinates of the point. This value will change with slider. :param point_no: :return:
- get_deltas()
Return a numpy array of the deltas. :return:
- get_lower_bounds()
Return an numpy array of lower bounds. :return:
- get_plate_field_options(event)
- get_point_canvas_coord(point_no)
Returning the canvas coordinates of the point. This value will change with slider. :param point_no: :return:
- get_running_time()
Estimate the running time of the algorithm. :return:
- get_upper_bounds()
Return an numpy array of upper bounds. :return:
- mouse_scroll(event)
- on_closing()
Action when closing the window without saving. :return:
- open_example_file()
- opt_create_frames(fractions)
Creating frames between the the two lines to be optimized.
- opt_create_main_structure(frames, start1, stop1, start2, stop2)
This creates line definition for the new structure objects. The scipt searches the line to find frames.
- opt_create_struc_obj(opt_line)
Creating preliminary stucture object from selected optimized line. The properties of the new line oto be optimized is taken from the closest original line.
- opt_find_closest_orig_line(coord)
Find the closest original line to the optimized line. Used to create initial structure objects.
- opt_get_distance()
Getting the largest disctance between the two lines to be optimized.
- opt_get_fraction_bounds(max_len=6, min_len=2)
Return the fraction bounds(basis upper/lower) to be considered.
- opt_get_fractions()
Finding initial number of fractions
- opt_get_length()
Getting the length of the lines to be optimized.
- plot_results()
Plot optimization details for a selected panel.
Handles the default OptionMenu value ‘None’ safely and verifies that the selected panel result has the detailed iteration payload expected by op.plot_optimization_results().
- reshow_weight_figure()
Re-open the last geometric optimization summary figure.
- run_optimizaion(load_pre=False, save_results=False, harmonize=False)
Function when pressing the optimization botton inside this window. :return:
- save_and_close()
Save and close :return:
- schedule_running_time_update(*args)
Debounce GUI updates from variable traces.
This avoids slow or repeated work while the user is typing.
- selected_algorithm(event)
Action when selecting an algorithm in the optionm menu. :return:
- shift_pressed(event=None)
Event is executed when shift key pressed. :return:
- show_previous_results()
- slider_used(event)
Action when slider is activated. :return:
- toggle(found_files=None, obj=None, iterating=False, given_path: str = None)
On off button. :param found_files: :param obj: :return:
- update_running_time(*args)
Estimate the running time of the algorithm. :return:
anystruct.optimize_multiple_window module
- class anystruct.optimize_multiple_window.CreateOptimizeMultipleWindow(master, app=None)
Bases:
objectThis class initiates the MultiOpt window.
- algorithm_info()
When button is clicked, info is displayed.
- button_2_click_and_drag(event)
- checkered(line_distance)
Creates a grid in the properties canvas. :param line_distance: :return:
- controls()
Specifying the controls to be used. :return:
- ctrl_pressed(event=None)
Event when control is pressed. :param event: :return:
- draw_properties(init_obj=None, opt_obj=None, line=None)
Drawing properties in the canvas. :return:
- draw_select_canvas(load_selected=False)
Making the lines canvas. :return:
- get_deltas()
Return a numpy array of the deltas. :return:
- get_lower_bounds(obj)
Return an numpy array of lower bounds. :return:
- get_point_canvas_coord(point_no)
Returning the canvas coordinates of the point. This value will change with slider. :param point_no: :return:
- get_pressure_input(line)
- get_running_time()
Estimate running time without creating combinations.
Returns seconds for all currently selected lines.
- get_upper_bounds(obj)
Return an numpy array of upper bounds. :return:
- left_click(event)
When clicking the right button, this method is called. method is referenced in
- mid_click(event)
Event when right click. :param evnet: :return:
- mouse_scroll(event)
- on_closing()
Action when closing the window without saving. :return:
- open_example_file()
- opt_harmonizer()
Harmonizes the results of you run. :return:
- opt_harmonizer_historic()
- plot_results()
- right_click(event)
Event when right click. :param evnet: :return:
- run_optimizaion()
Function when pressing the optimization botton inside this window. :return:
- save_and_close()
Save and close :return:
- schedule_running_time_update(*args)
Debounce running-time estimate updates. Tkinter variable callbacks fire on every keystroke, so the estimate should only run after typing pauses.
- selected_algorithm(event)
Action when selecting an algorithm in the optionm menu. :return:
- shift_pressed(event=None)
Event is executed when shift key pressed. :return:
- slider_used(event)
Action when slider is activated. :return:
- toggle(found_files=None, obj=None, iterating=False)
On off button. :param found_files: :param obj: :return:
- toggle_harmonizer()
- trace_keep_spacing_check(*args)
- update_running_time(*args)
Estimate the running time of the algorithm and keep buckling checks mutually exclusive.
- anystruct.optimize_multiple_window.helper_harmonizer_multi(iterator)
Multiprocessing helper for harmonized optimization.
- The ML result payload is selected from the active constraint:
chk[8] -> ML-CL, deactivated chk[9] -> ML-Numeric result, expected [buckling_uf, ultimate_uf, valid_prediction]