ANYstructure API
The public API is exposed from anystruct.api:
from anystruct.api import CylStru, FlatStru
The API covers flat plate buckling, cylinder/shell buckling, and project file
load/save helpers. External spreadsheet-driven DNV PULS execution is not part
of the public API in the current release. Use SemiAnalytical S3/U3 or
ML-Numeric (PULS based) for the built-in PULS-style flat plate workflows.
See API Examples for complete runnable examples covering flat plates, cylinders, buckling methods, and project file load/save helpers. See Compact API Report Example for a compact manual/report version.
Units and sign conventions
Geometry setter dimensions are in millimetres unless a method docstring says otherwise.
Material yield and elastic modulus are in MPa.
Flat plate pressure and stresses are in MPa, and compression is positive.
Cylinder pressure and stresses are in MPa, and compression is negative.
Cylinder force input uses
Nsd/Qsdin kN andMsd/Tsdin kNm.
Flat Plate API
Supported domains:
Flat plate, unstiffenedFlat plate, stiffenedFlat plate, stiffened with girder
Supported buckling methods:
DNV-RP-C201 - prescriptiveSemiAnalytical S3/U3ML-Numeric (PULS based)
DNV-RP-C201 - prescriptive returns the legacy nested result dictionary with
Plate, Stiffener, Girder, and Local buckling entries where
applicable. SemiAnalytical S3/U3 and ML-Numeric (PULS based) return a
method result dictionary with buckling UF, ultimate UF, raw UF values,
validity, and selected UF fields.
Current flat plate setters and result helpers:
Method |
Purpose |
|---|---|
|
Set yield, elastic modulus, material factor, and Poisson ratio. |
|
Set plate spacing, thickness, and span. |
|
Set pressure, longitudinal/transverse stresses, and shear stress. |
|
Set stiffener web, flange, type, and spacing for stiffened domains. |
|
Set girder web, flange, type, and spacing for girder domains. |
|
Set fixation and bending/shear factors used by special provisions. |
|
Set SP/UP panel type, PULS boundary, stiffener end support, and UP boundary code. |
|
Select buckling method and set buckling, pressure, support, load-factor, fabrication, and ML options. |
|
Attach the sklearn-like model/scaler bundle used by |
|
Return the supported flat plate buckling method names. |
|
Run the selected flat plate buckling method. |
|
Return minimum/actual plate thickness, stiffener section modulus, and stiffener shear area. |
Cylinder API
Supported domains:
Unstiffened shellUnstiffened panelLongitudinal Stiffened shellLongitudinal Stiffened panelRing Stiffened shellRing Stiffened panelOrthogonally Stiffened shellOrthogonally Stiffened panelUnstiffened conical shell
Shell domains use force input mode internally; panel domains use stress input
mode internally. The API exposes both set_stresses and set_forces for
cylinders. Configure shell geometry and the relevant stiffener/ring objects
before using force input, because forces are converted to stress from the
current geometry. The conical shell domain uses set_conical_shell_geometry
and set_conical_forces.
Current cylinder setters and result helpers:
Method |
Purpose |
|---|---|
|
Set yield, elastic modulus, material factor, and Poisson ratio. |
|
Set radius, shell thickness, ring spacing, and total cylinder length. |
|
Set conical shell radii, axial length, and nominal thickness. |
|
Set the effective buckling length factor used by column buckling. |
|
Set axial, bending, torsional, shear, pressure, and hoop stresses. |
|
Set axial force, bending moment, torsional moment, shear force, and pressure. |
|
Set conical shell axial force, two bending moments, torsion, two shear forces, and pressure. |
|
Set initial out-of-roundness. |
|
Set stiffener and girder fabrication method. |
|
Control whether end-cap pressure is already included in stress input. |
|
Select |
|
Exclude ring stiffeners where the selected domain supports them. |
|
Exclude ring frames/girders where the selected domain supports them. |
|
Set longitudinal distance between girders. |
|
Set curved panel width. |
|
Set longitudinal stiffener web, flange, type, and spacing. |
|
Set ring stiffener web, flange, type, and spacing. |
|
Set ring girder/frame web, flange, type, and spacing. |
|
Return cylinder utilization factors and stiffener checks. |
Project File API
The project facade allows callers to load, save, and hydrate project files without constructing GUI objects.
Function or class |
Purpose |
|---|---|
|
Load a project file into a |
|
Save a |
|
Load and hydrate a project through the application service facade. |
|
Create and save project state from |
|
JSON-safe project snapshot. |
|
Plain save-boundary data used to create a project snapshot. |
|
Defaults used while hydrating legacy project data. |
Public API Reference
Functions
- anystruct.api.load_project_state(path)
Load an ANYstructure project file into canonical project state.
- anystruct.api.save_project_state(project_state, path)
Save canonical project state using the supported project-file codec.
- 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.
- class anystruct.api.FlatStru(calculation_domain: str = None)
API class for all flat plates.
Domains:
‘Flat plate, unstiffened’
‘Flat plate, stiffened’
Methods:
get_buckling_results([calculation_method, ...])Return buckling results for the active calculation method.
Special provisions for plating and stiffeners in steel structures.
set_buckling_parameters([...])Various buckling realted parameters are set here.
set_fixation_parameters([kpp, kps, km1, ...])Used for calculation of special provisions for plating and stiffeners in steel structures.
set_girder([hw, tw, bf, tf, stf_type, spacing])Sets the girder properties.
set_material([mat_yield, emodule, ...])Set the material properties for all structure.
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, thickness, span])Set the properties of plate.
set_puls_parameters([sp_or_up, ...])Set the PULS-style panel metadata used by SemiAnalytical and ML-Numeric buckling methods.
set_stiffener([hw, tw, bf, tf, stf_type, ...])Sets the stiffener properties.
set_stresses([pressure, sigma_x1, sigma_x2, ...])Set loads applied on the plate sides.
- 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:
- class anystruct.api.CylStru(calculation_domain: str = 'Unstiffened shell')
API 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’
‘Unstiffened conical shell’
Methods:
Return a dict including all buckling results :return: :rtype:
set_conical_forces([Nsd, M1sd, M2sd, Tsd, ...])Set DNV-RP-C202 Sec.
set_conical_shell_geometry([r1, r2, length, ...])Set unstiffened conical shell geometry.
set_conical_stresses([sasd, smsd, tTsd, ...])Set conical shell stress input and derive equivalent directional forces.
Cylinder may or may not have and end cap.
set_exclude_ring_frame([is_excluded])If for example orthogonally stiffened cylinder is selected and there are no ring girder, set this to True.
set_exclude_ring_stiffener([is_excluded])If for example orthogonally stiffened cylinder is selected and there are no ring stiffeners, set this to True.
set_fabrication_method([stiffener, girder])Fabrication method for stiffener and girder.
set_forces([Nsd, Msd, Tsd, Qsd, psd])Forces applied to cylinder.
set_imperfection([delta_0])Initial out of roundness of stiffener: delta_0 * r Typical value is set as default.
set_length_between_girder([val])Distance between the girders along the cylinder.
set_longitudinal_stiffener([hw, tw, bf, tf, ...])Sets the longitudinal stiffener dimensions.
set_material([mat_yield, emodule, ...])Set the material properties for all structure.
set_panel_spacing([val])In case a curved panel is selected, not a complete cylinder, this value sets the width of the panel.
set_ring_girder([hw, tw, bf, tf, stf_type, ...])Sets the ring girder dimensions.
set_ring_stiffener([hw, tw, bf, tf, ...])Sets the ring stiffener dimensions.
set_shell_buckling_parmeters([...])Sets the buckling length paramenter of the cylinder.
set_shell_geometry([radius, thickness, ...])Sets the baic parameters for the cylinder.
set_stresses([sasd, smsd, tTsd, tQsd, psd, shsd])Cylinder stresses.
set_uls_or_als([kind])This is used to calculate th resulting material factor.
- get_buckling_results()
Return a dict including all buckling results :return: :rtype:
- set_conical_forces(Nsd: float = 0, M1sd: float = 0, M2sd: float = 0, Tsd: float = 0, Q1sd: float = 0, Q2sd: float = 0, psd: float = 0)
Set DNV-RP-C202 Sec. 4.2 conical shell force input.
- Parameters:
Nsd – design axial force [kN]
M1sd – design bending moment about principal axis 1 [kNm]
M2sd – design bending moment about principal axis 2 [kNm]
Tsd – design torsional moment [kNm]
Q1sd – design shear force parallel to principal axis 1 [kN]
Q2sd – design shear force parallel to principal axis 2 [kN]
psd – design lateral pressure [N/mm2]
- set_conical_shell_geometry(r1: float = 0, r2: float = 0, length: float = 0, thickness: float = 0)
Set unstiffened conical shell geometry.
- Parameters:
r1 – radius at one end of cone [mm]
r2 – radius at the other end of cone [mm]
length – axial cone length, l [mm]
thickness – nominal shell thickness [mm]
- set_conical_stresses(sasd: float = 0, smsd: float = 0, tTsd: float = 0, tQsd: float = 0, psd: float = 0, shsd: float = 0)
Set conical shell stress input and derive equivalent directional forces.
Scalar bending and shear stresses are mapped to principal axis 1:
M2sd = 0andQ2sd = 0.
- 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.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)
JSON-safe project snapshot independent of Tkinter widget state.
- class anystruct.api.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])
Plain project data captured at the save boundary.
- class anystruct.api.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)
Legacy structure defaults that the UI used to inject while opening files.