_BeamStress

class _BeamStress(dll: SofDll)

Bases: object

This class provides methods and a data structure to:

  • access keys 105/LC of the CDB file;

  • store the retrieved data in a convenient format;

  • provide access to the data after the CDB is closed.

The underlying data structure is a pandas.DataFrame with the following columns:

  • LOAD_CASE: the load case number

  • GROUP: the beam group number

  • ELEM_ID: the beam number

  • POS: position of the output station along the beam [m]

  • POS_REL: relative position of the output station along the beam (0 to 1)

  • POINT: identifier of the stress point

  • SIGC: minimum stress [kPa]

  • SIGT: maximum stress [kPa]

  • TAU: shear stress [kPa]

  • SIGV: reference stress [kPa]

  • SI: main tension stress [kPa]

  • SII: main compression stress [kPa]

The DataFrame uses a MultiIndex with levels ELEM_ID, LOAD_CASE, STATION and POINT (in this specific order) to enable fast lookups via the get method. The index columns are not dropped from the DataFrame.

Note

Not all available quantities are retrieved and stored. In particular:

  • admissible stresses for the cross-section’s material

  • maximum stresses in cross-section of beams

are currently not included. This is a deliberate design choice and may be changed in the future without breaking the existing API.

Important

The relative output station POS_REL is rounded to two decimal places to prevent floating-point errors for lookups at the beam end (POS_REL = 1.0) or at any other intermediate station.

clear(load_case: int) None

Clear the loaded data for the given load_case number.

clear_all() None

Clear the loaded data for all the load cases.

get(element_id: int, load_case: int, position: float, point: str, quantity: str, default: float | None = None) float

Retrieve the requested beam stress.

Parameters:
  • element_id (int) – Beam element number

  • load_case (int) – Load case number

  • position (float) – Relative position of the output station along the beam (0 to 1)

  • point (str) – identifier of the stress point

  • quantity (str) –

    Quantity to retrieve. Must be one of:

    • SIGC

    • SIGT

    • TAU

    • SIGV

    • SI

    • SII

  • default (float or None, default None) – Value to return if the requested quantity is not found

Returns:

value – The requested value if found. If not found, returns default when it is not None.

Return type:

float

Raises:

LookupError – If the requested result is not found and default is None.

get_data(deep: bool = True) DataFrame

Return the pandas.DataFrame containing the loaded keys 105/LC.

Parameters:

deep (bool, default True) – When deep=True, a new object will be created with a copy of the calling object’s data and indices. Modifications to the data or indices of the copy will not be reflected in the original object (refer to pandas.DataFrame.copy() documentation for details).

load(load_cases: int | list[int]) None

Retrieve beam stresses for the given load_cases. If a load case is not found, a warning is raised only if echo_level > 0.

Parameters:

load_cases (int | list[int]) – load case numbers