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
Get the set of solid elements associated with this interface.
beams_solids
property
Get beams_solids in list format for compatibility.
Methods:
__eq__
Check if two EmbeddedInfo objects are logically equal in O(1) time.
is_conflict
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
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. |
compare
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
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. |