SecondaryGroupsLC

class SecondaryGroupsLC(dll: SofDll)

Bases: object

This class provides methods and a data structure to:

  • access secondary groups info in keys 11/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:

  • GROUP_NAME" group name

  • LOAD_CASE" the load case number

  • IS_ACTIVE" indicates whether the group is active in the load case

The DataFrame uses a MultiIndex with level GROUP and LOAD_CASE (in this specific order) to enable fast lookups via the is_active method. The index columns are not dropped from the DataFrame.

Note

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

  • MNR: material number of the group

  • MBW: material reinforcement number of the group

  • IBB and IBD: construction stage numbers

  • MIN_ID, MAX_ID and number of elements.

are currently not included.

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

active_groups(load_case: int) list[str]

For the given load_case, return the list of active secondary groups.

Parameters:

load_case (int) – The load_case number

Raises:

RuntimeError – If the given load_case is not loaded.

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_data(deep: bool = True) DataFrame

Return the pandas.DataFrame containing the loaded key 11/0.

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_active(group_name: str, load_case: int) bool

Return True if the group group_name is active in the load case load_case.

load(load_cases: int | list[bool | int]) None

Retrieve group data for the given load_cases.

Parameters:

load_cases (int | list[int]) – load case numbers