_SpringResult

class _SpringResult(dll: SofDll)

Bases: object

This class provides methods and a data structure to:

  • access keys 170/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 load case number

  • GROUP element group

  • ELEM_ID element number

  • P axial force

  • PT: transversal force

  • PTX: transversal force in global X-direction

  • PTY: transversal force in global Y-direction

  • PTZ: transversal force in global Z-direction

  • M: axial moment

  • V: axial displacement

  • VT: transversal displacement

  • VTX: transversal displacement in global X-direction

  • VTY: transversal displacement in global Y-direction

  • VTZ: transversal displacement in global Z-direction

  • PHI: axial rotation

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

  • nonlinear effects

  • all quantities available if a workload has beed defined

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

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

Retrieve the requested cable result.

Parameters:
  • element_id (int) – Cable element number

  • load_case (int) – Load case number

  • quantity (str) –

    Quantity to retrieve. Must be one of:

    • P

    • PT

    • PTX

    • PTY

    • PTZ

    • M

    • V

    • VT

    • VTX

    • VTY

    • VTZ

    • PHI

  • 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 170/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 spring 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

set_echo_level(echo_level: int) None

Set the echo level.

Parameters:

echo_level (int) – the new echo level