BeamResults

class BeamResults(dll: SofDll)

Bases: object

This class provides methods and a data structure to:

  • access keys 102/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)

  • N: axial force [kN]

  • VY: shear force Y [kN]

  • VZ: shear force Z [kN]

  • MT: torsional moment [kNm]

  • MY: bending moment around Y [kNm]

  • MZ: bending moment around Z [kNm]

  • MB: warping moment [kNm]

  • MT2: second torsional moment [kNm]

The DataFrame uses a MultiIndex with levels ELEM_ID, LOAD_CASE and STATION (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:

  • displacements and rotations in local coordinates

  • twist angle

  • 3rd torsional moment

  • axial and transverse beddings

  • local y and z components of the transverse beddings

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, quantity: str, default: float | None = None) float

Retrieve the requested beam result.

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)

  • quantity (str) –

    Quantity to retrieve. Must be one of:

    • N

    • VY

    • VZ

    • MT

    • MY

    • MZ

    • MB

    • MT2

  • 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 102/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 results 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