CableResult¶
- class CableResult(dll: SofDll)¶
Bases:
objectThis class provides methods and a data structure to:
access keys
162/LCof 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.DataFramewith the following columns:LOAD_CASEload case numberGROUPelement groupELEM_IDelement numberAXIAL_FORCEaxial force [kN]AVG_AXIAL_FORCE: average axial force [kN]AXIAL_DISPLACEMENT: axial displacement [m]RELAXED_LENGTH: relaxed cable length [m]TOTAL_STRAIN: total strain [-]EFFECTIVE_STIFFNESS: effective stiffness [kN/m]
The
DataFrameuses a MultiIndex with levelsELEM_IDandLOAD_CASE(in this specific order) to enable fast lookups via thegetmethod. The index columns are not dropped from theDataFrame.Note
Not all available quantities are retrieved and stored. In particular:
the maximum suspension of cable across axis and its components along the global X, Y and Z axes
vertical suspension of cable in load direction
nonlinear effects
are currently not included. This is a deliberate design choice and may be changed in the future without breaking the existing API.
- 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:
"AXIAL_FORCE""AVG_AXIAL_FORCE""TOTAL_STRAIN""RELAXED_LENGTH""AXIAL_DISPLACEMENT""EFFECTIVE_STIFFNESS"
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
defaultwhen it is not None.- Return type:
- Raises:
LookupError – If the requested result is not found and
defaultis None.
- get_data(deep: bool = True) DataFrame¶
Return the
pandas.DataFramecontaining the loaded keys162/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 topandas.DataFrame.copy()documentation for details).