Skip to content

embedded_info

embedded_info

Classes

EmbeddedInfo dataclass

EmbeddedInfo(beams: Union[List[int], Set[int]], core_number: int, beams_solids: List[Tuple[List[int], List[int]]])

Optimized EmbeddedInfo data structure for fast interface comparisons.

This structure tracks connection mapping between embedded beam elements and surrounding solid elements, deduplicating equivalent layouts and detecting core partition conflicts.

Create an EmbeddedInfo instance.

Parameters:

Name Type Description Default
beams Union[List[int], Set[int]]

A set or list of integers representing beam element identifiers.

required
core_number int

An integer core partition ID.

required
beams_solids List[Tuple[List[int], List[int]]]

List of (list1, list2) mapping tuples, where list1 is the beam connectivity list and list2 is the solid element ID list.

required
Attributes
solids_set property
solids_set: FrozenSet[int]

Get the set of solid elements associated with this interface.

beams_solids property
beams_solids: List[Tuple[List[int], List[int]]]

Get beams_solids in list format for compatibility.

Methods:
__eq__
__eq__(other: object) -> bool

Check if two EmbeddedInfo objects are logically equal in O(1) time.

is_conflict
is_conflict(other: EmbeddedInfo) -> bool

Check if two objects conflict (have the same beams and overlap on list1 connectivities).

Parameters:

Name Type Description Default
other EmbeddedInfo

The other EmbeddedInfo instance to compare.

required

Returns:

Type Description
bool

True if there is a mapping conflict, False otherwise.

is_similar
is_similar(other: EmbeddedInfo) -> bool

Check if two objects are similar (share identical beams or solids without conflict).

Parameters:

Name Type Description Default
other EmbeddedInfo

The other EmbeddedInfo instance to compare.

required

Returns:

Type Description
bool

True if similar, False otherwise.

__hash__
__hash__() -> int

Compute the hash using pre-computed canonical values.

compare
compare(other: EmbeddedInfo) -> str

Compare with another EmbeddedInfo and return the relationship type.

Parameters:

Name Type Description Default
other EmbeddedInfo

The other EmbeddedInfo to compare.

required

Returns:

Type Description
str

A string indicating the relationship: "equal", "conflict",

str

"similar", or "unrelated".

Raises:

Type Description
TypeError

If other is not an instance of EmbeddedInfo.

with_core_number
with_core_number(new_core_number: int) -> EmbeddedInfo

Return a copy of this EmbeddedInfo with a different core_number.

Parameters:

Name Type Description Default
new_core_number int

The core partition number for the copy.

required

Returns:

Type Description
EmbeddedInfo

A new EmbeddedInfo instance with the updated core partition.