CrossSectionalData

class CrossSectionalData(dll: SofDll)

Bases: object

This class provides abstractions to load and access information about the cross-sectional values, contained in keys 9/PROP:0 (total section) of the CDB file. Refer to SOFiHELP - CDBase for further information on this key.

Data are stored in a pandas.DataFrame having the following columns:

  • ID: property number

  • MNO: material ID of the section

  • A: cross-sectional gross area [m2]

  • AY: shear area Y [m2]

  • AZ: shear area Z [m2]

  • IT: torsional moment of inertia [m2]

  • IY: moment of inertia YY [m4]

  • IZ: moment of inertia ZZ [m4]

  • EM: elastic modulus [kNm-2]

  • GM: shear modulus [kNm-2]

  • SW: nominal weight of the material [kNm-3]

The DataFrame uses a MultiIndex with level ID to enable fast lookups via the get method. The index column is not dropped from the DataFrame.

Note

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

  • MRF: material ID of the reinforcement

  • IYZ: moment of inertia Y-Z

  • YS: coordinate of elastic centroid

  • ZS: coordinate of elastic centroid

  • YSC: coordinate of shear centre

  • ZSC: coordinate of shear centre

are currently not included.

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

clear(section_id: int) None

Clear the loaded data for the given section_id.

clear_all() None

Clear the loaded data for all the properties.

get(section_id: int, quantity: str, default: float | int | None = None) float | int

Retrieve the requested nodal load.

Parameters:
  • section_id (int) – The id of the cross-section

  • quantity (str) –

    Quantity to retrieve. Must be one of:

    • MNO

    • A

    • AY

    • AZ

    • IT

    • IY

    • IZ

    • EM

    • GM

    • SW

  • 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 data is not found and default is None.

get_data(deep: bool = True) DataFrame

Return the pandas.DataFrame containing all the loaded properties.

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).

is_loaded(section_id: int) bool

Return True if the section_id has been loaded.

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

Load cross-sectional values for the given section_id.