CableLoad

class CableLoad(dll: SofDll)

Bases: object

This class provides methods and a data structure to:

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

  • TYPE load type

  • PA: load value at cable start point

  • PE: load value at cable end point

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

The load TYPE can be one of the following:

  • PG Load in gravity direction

  • PXX Load in global X-direction

  • PYY Load in global Y-direction

  • PZZ Load in global Z-direction

  • PXP Load in global x-direction measured in projection

  • PYP Load in global y-direction measured in projection

  • PZP Load in global z-direction measured in projection

  • EX Strain in axial direction

  • VX Prestress

  • WX Change of length

  • DT Temperature difference

Important

Wind and snow loads are not implemented and will raise a runtime error if they are present in the requested load case.

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, load_type: str, point: str = 'PA', default: float | None = None) float

Retrieve the requested cable load.

Parameters:
  • element_id (int) – Cable element number

  • load_case (int) – Load case number

  • load_type (str) –

    Load type to retrieve. Must be one of:

    • "PG"

    • "PXX"

    • "PYY"

    • "PZZ"

    • "EX"

    • "WX"

    • "DT"

    • "VX"

    • "PXP"

    • "PYP"

    • "PZP"

  • point (str, default "PA") – Location on the cable where the load is applied; either the start ("PA") or the end ("PE")

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

Returns:

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

Return type:

float

Notes

If there are multiple entries for the same node and load case, this method returns the sum of all corresponding values. To access the individual entries without aggregation, use the get_data method.

Raises:

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

get_data(deep: bool = True) DataFrame

Return the pandas.DataFrame containing the loaded keys 161/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 cable load data 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

Notes

Wind and snow loads are not implemented and will raise a runtime error if they are present in the requested load case.

set_echo_level(echo_level: int) None

Set the echo level.

Parameters:

echo_level (int) – the new echo level