anastruct.fem.system_components.util

Functions

check_internal_hinges(→ None)

Identify internal hinges, set their hinge status

append_node_id(→ None)

Append the node id to the system if it is not already in the system

remove_node_id(→ None)

Remove the node id from the system

det_vertices(→ Tuple[anastruct.vertex.Vertex, ...)

Determine the vertices of a location list

det_node_ids(→ Tuple[int, int])

Determine the node ids of two points

add_node(→ int)

Add a node, optionally with a specific ID, without adding an element

support_check(→ None)

Check if the node is a hinge

force_elements_orientation(...)

Force the elements to be in the first and the last quadrant of the unity circle.

Module Contents

anastruct.fem.system_components.util.check_internal_hinges(system: anastruct.fem.system.SystemElements, node_id: int) None[source]

Identify internal hinges, set their hinge status

Args:

system (SystemElements): System in which the node is located node_id (int): Id of the node in the system

anastruct.fem.system_components.util.append_node_id(system: anastruct.fem.system.SystemElements, point_1: anastruct.vertex.Vertex, point_2: anastruct.vertex.Vertex, node_id1: int, node_id2: int) None[source]

Append the node id to the system if it is not already in the system

Args:

system (SystemElements): System in which the node is located point_1 (Vertex): Vertex of the first point point_2 (Vertex): Vertex of the second point node_id1 (int): Node id of the first point node_id2 (int): Node id of the second point

anastruct.fem.system_components.util.remove_node_id(system: anastruct.fem.system.SystemElements, node_id: int) None[source]

Remove the node id from the system

Note that this function does NOT check if the node is still used in the system. It is intended to be used as a helper function to remove_element() and others, not to be used directly by users.

Args:

system (SystemElements): System in which the node is located node_id (int): Node id of the node

anastruct.fem.system_components.util.det_vertices(system: anastruct.fem.system.SystemElements, location_list: anastruct._types.VertexLike | Sequence[anastruct._types.VertexLike]) Tuple[anastruct.vertex.Vertex, anastruct.vertex.Vertex][source]

Determine the vertices of a location list

Args:

system (SystemElements): System in which the nodes are located location_list (Union[ Vertex, Sequence[Vertex], Sequence[int], Sequence[float], Sequence[Sequence[float]], ]):

List of one or two locations

Raises:
FEMException: Raised when the location list is not a list of two points, a list of

two coordinates, or a list of two lists of two coordinates.

Returns:

Tuple[Vertex, Vertex]: Tuple of two vertices

anastruct.fem.system_components.util.det_node_ids(system: anastruct.fem.system.SystemElements, point_1: anastruct.vertex.Vertex, point_2: anastruct.vertex.Vertex) Tuple[int, int][source]

Determine the node ids of two points

Args:

system (SystemElements): System in which the nodes are located point_1 (Vertex): First point point_2 (Vertex): Second point

Returns:

Tuple[int, int]: Tuple of two node ids

anastruct.fem.system_components.util.add_node(system: anastruct.fem.system.SystemElements, point: anastruct.vertex.Vertex, node_id: int | None = None) int[source]

Add a node, optionally with a specific ID, without adding an element

Args:

system (SystemElements): System in which the nodes are located point (Vertex): Location of the node node_id (Optional[int], optional): node_id to assign to the node. Defaults to None,

which means to use the first available node_id automatically.

Raises:

FEMException: Raised when the location is already assigned to a different node id. FEMException: Raised when the node id is already assigned to a different location.

Returns:

int: The node id of the added (or existing) node

anastruct.fem.system_components.util.support_check(system: anastruct.fem.system.SystemElements, node_id: int) None[source]

Check if the node is a hinge

Args:

system (SystemElements): System in which the node is located node_id (int): Node id of the node

Raises:

FEMException: Raised when the node is a hinge

anastruct.fem.system_components.util.force_elements_orientation(point_1: anastruct.vertex.Vertex, point_2: anastruct.vertex.Vertex, node_id1: int, node_id2: int, spring: anastruct.fem.system.Spring | None, mp: anastruct.fem.system.MpType | None) Tuple[anastruct.vertex.Vertex, anastruct.vertex.Vertex, int, int, anastruct.fem.system.Spring | None, anastruct.fem.system.MpType | None, float][source]

Force the elements to be in the first and the last quadrant of the unity circle. Meaning the first node is always left and the last node is always right. Or they are both on one vertical line.

The angle of the element will thus always be between -90 till +90 degrees.

Args:

point_1 (Vertex): First point of the element point_2 (Vertex): Second point of the element node_id1 (int): Node id of the first point node_id2 (int): Node id of the second point spring (Optional[Spring]): Any spring releases of the element mp (Optional[MpType]): Any maximum plastic moments of the element

Returns:
Tuple[ Vertex, Vertex, int, int, Optional[Spring], Optional[MpType], float ]:

Tuple of the first point, second point, first node id, second node id, spring releases, maximum plastic moments, and the angle of the element