sgio.check_forbidden_ids#

sgio.check_forbidden_ids(ids: List[int] | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes], format: Literal['generic', 'vabs', 'swiftcomp', 'abaqus'] = 'generic', id_type: str = 'ID') List[int]#

Check for forbidden IDs according to format requirements.

Different formats have different restrictions on allowed ID values: - generic: No restrictions - vabs/swiftcomp: IDs must be positive (>= 1) - abaqus: IDs must be positive (>= 1), ID=0 is forbidden

Parameters:
  • ids (list of int or array-like) – List or array of IDs to check.

  • format ({'generic', 'vabs', 'swiftcomp', 'abaqus'}, default 'generic') – Format to check against.

  • id_type (str, default 'ID') – Type of ID being checked (e.g., ‘Node’, ‘Element’) for error messages.

Returns:

List of forbidden IDs found (empty if none found).

Return type:

list of int

Examples

>>> check_forbidden_ids([0, 1, 2, 3], format='abaqus')
[0]
>>> check_forbidden_ids([-1, 0, 1, 2], format='vabs')
[-1, 0]
>>> check_forbidden_ids([0, -5, 1, 2], format='generic')
[]