anastruct ========= .. py:module:: anastruct Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/anastruct/_types/index /autoapi/anastruct/_version/index /autoapi/anastruct/basic/index /autoapi/anastruct/cython/index /autoapi/anastruct/fem/index /autoapi/anastruct/material/index /autoapi/anastruct/preprocess/index /autoapi/anastruct/sectionbase/index /autoapi/anastruct/vertex/index Classes ------- .. autoapisummary:: anastruct.SystemElements anastruct.LoadCase anastruct.LoadCombination anastruct.Vertex Package Contents ---------------- .. py:class:: SystemElements(figsize: Optional[Tuple[float, float]] = (12, 8), EA: float = 15000.0, EI: float = 5000.0, load_factor: float = 1.0, mesh: int = 50, invert_y_loads: bool = True) Modelling any structure starts with an object of this class. Attributes: EA: Standard axial stiffness of elements, default=15,000 EI: Standard bending stiffness of elements, default=5,000 figsize: (tpl) Matplotlibs standard figure size element_map: (dict) Keys are the element ids, values are the element objects node_map: (dict) Keys are the node ids, values are the node objects. node_element_map: (dict) maps node ids to element objects. loads_point: (dict) Maps node ids to point loads. loads_q: (dict) Maps element ids to q-loads. loads_moment: (dict) Maps node ids to moment loads. loads_dead_load: (set) Element ids that have a dead load applied. Methods: add_element: Add a new element to the structure. add_element_grid: Add multiple elements based upon sequential x and y coordinates. add_sequential_elements: Add multiple elements based upon any number of sequential points. add_multiple_elements: Add multiple elements defined by the first and the last point. add_truss_element: Add a new truss element (an element that only has axial force) to the structure. add_support_hinged: Add a hinged support to a node. add_support_fixed: Add a fixed support to a node. add_support_roll: Add a roll support to a node. add_support_rotational: Add a rotational support to a node. add_support_spring: Add a spring support to a node. insert_node: Insert a node into an existing structure. solve: Compute the results of current model. validate: Validate the current model. .. py:attribute:: post_processor .. py:attribute:: plotter .. py:attribute:: plot_values .. py:attribute:: EA :value: 15000.0 .. py:attribute:: EI :value: 5000.0 .. py:attribute:: figsize :value: (12, 8) .. py:attribute:: orientation_cs :value: -1 .. py:attribute:: element_map :type: Dict[int, anastruct.fem.elements.Element] .. py:attribute:: node_map :type: Dict[int, anastruct.fem.node.Node] .. py:attribute:: node_element_map :type: Dict[int, List[anastruct.fem.elements.Element]] .. py:attribute:: system_spring_map :type: Dict[int, float] .. py:attribute:: _remainder_indexes :type: List[int] :value: [] .. py:attribute:: supports_fixed :type: List[anastruct.fem.node.Node] :value: [] .. py:attribute:: supports_hinged :type: List[anastruct.fem.node.Node] :value: [] .. py:attribute:: supports_rotational :type: List[anastruct.fem.node.Node] :value: [] .. py:attribute:: internal_hinges :type: List[anastruct.fem.node.Node] :value: [] .. py:attribute:: supports_roll :type: List[anastruct.fem.node.Node] :value: [] .. py:attribute:: supports_spring_x :type: List[Tuple[anastruct.fem.node.Node, bool]] :value: [] .. py:attribute:: supports_spring_y :type: List[Tuple[anastruct.fem.node.Node, bool]] :value: [] .. py:attribute:: supports_spring_z :type: List[Tuple[anastruct.fem.node.Node, bool]] :value: [] .. py:attribute:: supports_roll_direction :type: List[Literal[1, 2]] :value: [] .. py:attribute:: inclined_roll :type: Dict[int, float] .. py:attribute:: supports_roll_rotate :type: List[bool] :value: [] .. py:attribute:: supports_spring_args :type: List[tuple] :value: [] .. py:attribute:: loads_point :type: Dict[int, Tuple[float, float]] .. py:attribute:: loads_q :type: Dict[int, List[Tuple[float, float]]] .. py:attribute:: loads_moment :type: Dict[int, float] .. py:attribute:: loads_dead_load :type: Set[int] .. py:attribute:: reaction_forces :type: Dict[int, anastruct.fem.node.Node] .. py:attribute:: non_linear :value: False .. py:attribute:: non_linear_elements :type: Dict[int, Dict[Literal[1, 2], float]] .. py:attribute:: buckling_factor :type: Optional[float] :value: None .. py:attribute:: _previous_point .. py:attribute:: load_factor :value: 1.0 .. py:attribute:: count :value: 0 .. py:attribute:: system_matrix :type: Optional[numpy.ndarray] :value: None .. py:attribute:: system_force_vector :type: Optional[numpy.ndarray] :value: None .. py:attribute:: system_displacement_vector :type: Optional[numpy.ndarray] :value: None .. py:attribute:: shape_system_matrix :type: Optional[int] :value: None .. py:attribute:: reduced_force_vector :type: Optional[numpy.ndarray] :value: None .. py:attribute:: reduced_system_matrix :type: Optional[numpy.ndarray] :value: None .. py:attribute:: _vertices :type: Dict[anastruct.vertex.Vertex, int] .. py:property:: id_last_element :type: int ID of the last element added to the structure Returns: int: ID of the last element added to the structure .. py:property:: id_last_node :type: int ID of the last node added to the structure Returns: int: ID of the last node added to the structure .. py:method:: add_sequential_elements(location: Sequence[anastruct._types.VertexLike], EA: Optional[Union[List[float], numpy.ndarray, float]] = None, EI: Optional[Union[List[float], numpy.ndarray, float]] = None, g: Optional[Union[List[float], numpy.ndarray, float]] = None, mp: Optional[anastruct._types.MpType] = None, spring: Optional[anastruct._types.Spring] = None, **kwargs: dict) -> None Add multiple elements based upon any number of sequential points. Args: location (Sequence[VertexLike]): Sequence of points that define the elements. EA (Optional[Union[List[float], np.ndarray, float]], optional): Axial stiffnesses. Defaults to None. EI (Optional[Union[List[float], np.ndarray, float]], optional): Bending stiffnesses. Defaults to None. g (Optional[Union[List[float], np.ndarray, float]], optional): Self-weights. Defaults to None. mp (Optional[MpType], optional): Maximum plastic moment capacities for all elements. Defaults to None. spring (Optional[Spring], optional): Springs for all elements. Defaults to None. Raises: FEMException: The mp parameter should be a dictionary. .. py:method:: add_element_grid(x: Union[List[float], numpy.ndarray], y: Union[List[float], numpy.ndarray], EA: Optional[Union[List[float], numpy.ndarray, float]] = None, EI: Optional[Union[List[float], numpy.ndarray, float]] = None, g: Optional[Union[List[float], numpy.ndarray, float]] = None, mp: Optional[anastruct._types.MpType] = None, spring: Optional[anastruct._types.Spring] = None, **kwargs: dict) -> None Add multiple elements based upon sequential x and y coordinates. Args: x (Union[List[float], np.ndarray]): X coordinates of the grid y (Union[List[float], np.ndarray]): Y coordinates of the grid EA (Optional[Union[List[float], np.ndarray, float]], optional): Axial stiffnesses. Defaults to None. EI (Optional[Union[List[float], np.ndarray, float]], optional): Bending stiffnesses. Defaults to None. g (Optional[Union[List[float], np.ndarray, float]], optional): Self-weights. Defaults to None. mp (Optional[MpType], optional): Maximum plastic moment capacities for all elements. Defaults to None. spring (Optional[Spring], optional): Springs for all elements. Defaults to None. Raises: FEMException: x and y should have the same length. .. py:method:: add_truss_element(location: Union[Sequence[anastruct._types.VertexLike], anastruct._types.VertexLike], EA: Optional[float] = None, **kwargs: dict) -> int Add a new truss element (an element that only has axial force) to the structure Example: .. code-block:: python location=[[x, y], [x, y]] location=[Vertex, Vertex] location=[x, y] location=Vertex Args: location (Union[Sequence[VertexLike], VertexLike]): The two nodes of the element or the next node of the element. EA (Optional[float], optional): Axial stiffness of the new element. Defaults to None. Returns: int: ID of the new element .. py:method:: add_element(location: Union[Sequence[anastruct._types.VertexLike], anastruct._types.VertexLike], EA: Optional[float] = None, EI: Optional[float] = None, g: float = 0, mp: Optional[anastruct._types.MpType] = None, spring: Optional[anastruct._types.Spring] = None, **kwargs: Any) -> int Add a new general element (an element with axial and lateral force) to the structure Example: .. code-block:: python location=[[x, y], [x, y]] location=[Vertex, Vertex] location=[x, y] location=Vertex mp={1: 210e3, 2: 180e3} spring={1: k, 2: k} # Set a hinged node: spring={1: 0} Args: location (Union[Sequence[VertexLike], VertexLike]): The two nodes of the element or the next node of the element EA (Optional[float], optional): Axial stiffness of the new element. Defaults to None. EI (Optional[float], optional): Bending stiffness of the new element. Defaults to None. g (float, optional): Self-weight of the new element. Defaults to 0. mp (Optional[MpType], optional): Maximum plastic moment of each end node. Keys are integers representing the nodes. Values are the bending moment capacity. Defaults to None. spring (Optional[Spring], optional): Rotational spring or hinge (k=0) of each end node. Keys are integers representing the nodes. Values are the bending moment capacity. Defaults to None. Optional Keyword Args: element_type (ElementType): "general" (axial and lateral force) or "truss" (axial force only) steelsection (str): Steel section name like IPE 300 orient (OrientAxis): Steel section axis for moment of inertia - 'y' and 'z' possible b (float): Width of generic rectangle section h (float): Height of generic rectangle section d (float): Diameter of generic circle section sw (bool): If true self weight of section is considered as dead load E (float): Modulus of elasticity for section material gamma (float): Weight of section material per volume unit. [kN/m3] / [N/m3]s Returns: int: ID of the new element .. py:method:: remove_element(element_id: int) -> None Remove an element from the structure. Args: element_id (int): ID of the element to remove .. py:method:: add_multiple_elements(location: Union[Sequence[anastruct._types.VertexLike], anastruct._types.VertexLike], n: Optional[int] = None, dl: Optional[float] = None, EA: Optional[float] = None, EI: Optional[float] = None, g: float = 0, mp: Optional[anastruct._types.MpType] = None, spring: Optional[anastruct._types.Spring] = None, **kwargs: Any) -> List[int] Add multiple elements defined by the first and the last point. Example: .. code-block:: python last={'EA': 1e3, 'mp': 290} Args: location (Union[Sequence[VertexLike], VertexLike]): The two nodes of the element or the next node of the element. n (Optional[int], optional): Number of elements to add between the first and last nodes. Defaults to None. dl (Optional[float], optional): Length of sub-elements to add between the first and last nodes. Length will be rounded down if necessary such that all sub-elements will have the same length. Defaults to None. EA (Optional[float], optional): Axial stiffness. Defaults to None. EI (Optional[float], optional): Bending stiffness. Defaults to None. g (float, optional): Self-weight. Defaults to 0. mp (Optional[MpType], optional): Maximum plastic moment capacity at ends of element. Defaults to None. spring (Optional[Spring], optional): Rotational springs or hinges (k=0) at ends of element. Defaults to None. Optional Keyword Args: element_type (ElementType): "general" (axial and lateral force) or "truss" (axial force only) first (dict): Different arguments for the first element last (dict): Different arguments for the last element steelsection (str): Steel section name like IPE 300 orient (OrientAxis): Steel section axis for moment of inertia - 'y' and 'z' possible b (float): Width of generic rectangle section h (float): Height of generic rectangle section d (float): Diameter of generic circle section sw (bool): If true self weight of section is considered as dead load E (float): Modulus of elasticity for section material gamma (float): Weight of section material per volume unit. [kN/m3] / [N/m3]s Raises: FEMException: One, and only one, of n and dl should be passed as argument. Returns: List[int]: IDs of the new elements .. py:method:: insert_node(element_id: int, location: Optional[anastruct._types.VertexLike] = None, factor: Optional[float] = None) -> dict[str, int] Insert a node into an existing structure. This can be done by adding a new Vertex at any given location, or by setting a factor of the elements length. E.g. if you want a node at 40% of the elements length, you pass factor = 0.4. Args: element_id (int): Id number of the element in which you want to insert the node location (Optional[VertexLike], optional): Location in which to insert the node. Defaults to None. factor (Optional[float], optional): Fraction of distance from start to end of elmeent on which to divide the element. Must be between 0 and 1. Defaults to None. Returns: dict[str, int]: Dictionary with keys: 'new_node_id': ID of the newly created node 'new_element_id1': ID of the first new element created 'new_element_id2': ID of the second new element created 'old_element_id': ID of the old element that was split .. py:method:: insert_node_old(element_id: int, location: Optional[anastruct._types.VertexLike] = None, factor: Optional[float] = None) -> None Insert a node into an existing structure. This can be done by adding a new Vertex at any given location, or by setting a factor of the elements length. E.g. if you want a node at 40% of the elements length, you pass factor = 0.4. Note: this method completely rebuilds the SystemElements object and is therefore slower then building a model with `add_element` methods. Args: element_id (int): Id number of the element in which you want to insert the node location (Optional[VertexLike], optional): Location in which to insert the node. Defaults to None. factor (Optional[float], optional): Fraction of distance from start to end of elmeent on which to divide the element. Must be between 0 and 1. Defaults to None. .. py:method:: solve(force_linear: bool = False, verbosity: int = 0, max_iter: int = 200, geometrical_non_linear: int = False, **kwargs: Any) -> numpy.ndarray Compute the results of current model. Args: force_linear (bool, optional): Force a linear calculation, even when the system has non-linear nodes. Defaults to False. verbosity (int, optional): Log calculation outputs (0), or silence (1). Defaults to 0. max_iter (int, optional): Maximum allowed iterations. Defaults to 200. geometrical_non_linear (int, optional): Calculate second order effects and determine the buckling factor. Defaults to False. Optional Keyword Args: naked (bool): Whether or not to run the solve function without doing post processing. discretize_kwargs (dict): When doing a geometric non linear analysis you can reduce or increase the number of elements created that are used for determining the buckling_factor Raises: FEMException: The eigenvalues of the stiffness matrix are non zero, which indicates an unstable structure. Check your support conditions Returns: np.ndarray: Displacements vector. .. py:method:: validate(min_eigen: float = 1e-09) -> bool Validate the stability of the stiffness matrix. Args: min_eigen (float, optional): Minimum value of the eigenvalues of the stiffness matrix. This value should be close to zero. Defaults to 1e-9. Returns: bool: True if the structure is stable, False if not. .. py:method:: add_support_hinged(node_id: Union[int, Sequence[int]]) -> None Model a hinged support at a given node. Args: node_id (Union[int, Sequence[int]]): Represents the nodes ID .. py:method:: add_support_rotational(node_id: Union[int, Sequence[int]]) -> None Model a rotational support at a given node. Args: node_id (Union[int, Sequence[int]]): Represents the nodes ID .. py:method:: add_internal_hinge(node_id: Union[int, Sequence[int]]) -> None Model a internal hinge at a given node. This may alternatively be done by setting a spring restraint to zero (`{1: 0}` or `{2: 0}`). The effect is the same, though this function may be easier to use. Args: node_id (Union[int, Sequence[int]]): Represents the nodes ID .. py:method:: add_support_roll(node_id: Union[Sequence[int], int], direction: Union[Sequence[anastruct._types.SupportDirection], anastruct._types.SupportDirection] = 'x', angle: Union[Sequence[Optional[float]], Optional[float]] = None, rotate: Union[Sequence[bool], bool] = True) -> None Add a rolling support at a given node. Args: node_id (Union[Sequence[int], int]): Represents the nodes ID direction (Union[Sequence[SupportDirection], SupportDirection], optional): Represents the direction that is free ("x", "y", "1", or "2"). Defaults to "x". angle (Union[Sequence[Optional[float]], Optional[float]], optional): Angle in degrees relative to global x-axis. If angle is given, the support will be inclined. Defaults to None. rotate (Union[Sequence[bool], bool], optional): If set to False, rotation at the roller will also be restrianed. Defaults to True. Raises: FEMException: Invalid direction, if the direction parameter is invalid .. py:method:: add_support_fixed(node_id: Union[Sequence[int], int]) -> None Add a fixed support at a given node. Args: node_id (Union[Sequence[int], int]): Represents the nodes ID .. py:method:: add_support_spring(node_id: Union[Sequence[int], int], translation: Union[Sequence[anastruct._types.AxisNumber], anastruct._types.AxisNumber], k: Union[Sequence[float], float], roll: Union[Sequence[bool], bool] = False) -> None Add a spring support at a given node. Args: node_id (Union[Sequence[int], int]): Represents the nodes ID translation (Union[Sequence[AxisNumber], AxisNumber]): Represents the prevented translation or rotation. 1 = translation in x, 2 = translation in y, 3 = rotation about z k (Union[Sequence[float], float]): Stiffness of the spring roll (Union[Sequence[bool], bool], optional): If set to True, only the translation of the spring is controlled. Defaults to False. .. py:method:: q_load(q: Union[float, Sequence[float]], element_id: Union[int, Sequence[int]], direction: Union[anastruct._types.LoadDirection, Sequence[anastruct._types.LoadDirection]] = 'element', rotation: Optional[Union[float, Sequence[float]]] = None, q_perp: Optional[Union[float, Sequence[float]]] = None) -> None Apply a q-load (distributed load) to an element. Args: q (Union[float, Sequence[float]]): Value of the q-load element_id (Union[int, Sequence[int]]): The element ID to which to apply the load direction (Union["LoadDirection", Sequence["LoadDirection"]], optional): "element", "x", "y", "parallel", or "perpendicular". Defaults to "element". rotation (Optional[Union[float, Sequence[float]]], optional): Rotate the force clockwise. Rotation is in degrees. Defaults to None. q_perp (Optional[Union[float, Sequence[float]]], optional): Value of any q-load perpendicular to the indicated direction/rotatione. Defaults to None. Raises: FEMException: _description_ .. py:method:: point_load(node_id: Union[int, Sequence[int]], Fx: Union[float, Sequence[float]] = 0.0, Fy: Union[float, Sequence[float]] = 0.0, rotation: Union[float, Sequence[float]] = 0.0, Fz: Optional[Union[float, Sequence[float]]] = None) -> None Apply a point load to a node. Args: node_id (Union[int, Sequence[int]]): The node ID to which to apply the load Fx (Union[float, Sequence[float]], optional): Force in the global X direction. Defaults to 0.0. Fy (Union[float, Sequence[float]], optional): Force in the global Y direction. Defaults to 0.0. rotation (Union[float, Sequence[float]], optional): Rotate the force clockwise by the given angle in degrees. Defaults to 0.0. Raises: FEMException: Point loads may not be placed at the location of inclined roller supports .. py:method:: moment_load(node_id: Union[int, Sequence[int]], Tz: Union[float, Sequence[float]] = 0.0, Ty: Optional[Union[float, Sequence[float]]] = None) -> None Apply a moment load to a node. Args: node_id (Union[int, Sequence[int]]): The node ID to which to apply the load Tz (Union[float, Sequence[float]]): Moment load (about the global Y direction) to apply .. py:method:: show_structure(verbosity: int, scale: float, offset: Tuple[float, float], figsize: Optional[Tuple[float, float]], show: bool, supports: bool, values_only: Literal[True], annotations: bool) -> Tuple[numpy.ndarray, numpy.ndarray] show_structure(verbosity: int, scale: float, offset: Tuple[float, float], figsize: Optional[Tuple[float, float]], show: Literal[False], supports: bool, values_only: Literal[False], annotations: bool) -> matplotlib.figure.Figure show_structure(verbosity: int = 0, scale: float = 1.0, offset: Tuple[float, float] = (0, 0), figsize: Optional[Tuple[float, float]] = None, show: Literal[True] = True, supports: bool = True, values_only: Literal[False] = False, annotations: bool = False) -> None Plot the structure. Args: verbosity (int, optional): 0: All information, 1: Suppress information. Defaults to 0. scale (float, optional): Scale of the plot. Defaults to 1.0. offset (Tuple[float, float], optional): Offset the plots location on the figure. Defaults to (0, 0). figsize (Optional[Tuple[float, float]], optional): Change the figure size. Defaults to None. show (bool, optional): Plot the result or return a figure. Defaults to True. supports (bool, optional): Plot the supports. Defaults to True. values_only (bool, optional): Return the values that would be plotted as tuple containing two arrays: (x, y). Defaults to False. annotations (bool, optional): if True, structure annotations are plotted. It includes section name. Returns: Figure: If show is False, return a figure. .. py:method:: change_plot_colors(plot_colors: Dict) -> None Calls the change_plot_colors method of the plotter object Args: colors (Dict): A dictionary containing plot components and colors as key-value pairs. .. py:method:: show_bending_moment(factor: Optional[float], verbosity: int, scale: float, offset: Tuple[float, float], figsize: Optional[Tuple[float, float]], show: bool, values_only: Literal[True]) -> Tuple[numpy.ndarray, numpy.ndarray] show_bending_moment(factor: Optional[float], verbosity: int, scale: float, offset: Tuple[float, float], figsize: Optional[Tuple[float, float]], show: Literal[False], values_only: Literal[False]) -> matplotlib.figure.Figure show_bending_moment(factor: Optional[float] = None, verbosity: int = 0, scale: float = 1.0, offset: Tuple[float, float] = (0, 0), figsize: Optional[Tuple[float, float]] = None, show: Literal[True] = True, values_only: Literal[False] = False) -> None Plot the bending moment. Args: factor (Optional[float], optional): Influence the plotting scale. Defaults to None. verbosity (int, optional): 0: All information, 1: Suppress information. Defaults to 0. scale (float, optional): Scale of the plot. Defaults to 1. offset (Tuple[float, float], optional): Offset the plots location on the figure. Defaults to (0, 0). figsize (Optional[Tuple[float, float]], optional): Change the figure size. Defaults to None. show (bool, optional): Plot the result or return a figure. Defaults to True. values_only (bool, optional): Return the values that would be plotted as tuple containing two arrays: (x, y). Defaults to False. Returns: Figure: If show is False, return a figure. .. py:method:: show_axial_force(factor: Optional[float], verbosity: int, scale: float, offset: Tuple[float, float], figsize: Optional[Tuple[float, float]], show: bool, values_only: Literal[True]) -> Tuple[numpy.ndarray, numpy.ndarray] show_axial_force(factor: Optional[float], verbosity: int, scale: float, offset: Tuple[float, float], figsize: Optional[Tuple[float, float]], show: Literal[False], values_only: Literal[False]) -> matplotlib.figure.Figure show_axial_force(factor: Optional[float] = None, verbosity: int = 0, scale: float = 1.0, offset: Tuple[float, float] = (0, 0), figsize: Optional[Tuple[float, float]] = None, show: Literal[True] = True, values_only: Literal[False] = False) -> None Plot the axial force. Args: factor (Optional[float], optional): Influence the plotting scale. Defaults to None. verbosity (int, optional): 0: All information, 1: Suppress information. Defaults to 0. scale (float, optional): Scale of the plot. Defaults to 1. offset (Tuple[float, float], optional): Offset the plots location on the figure. Defaults to (0, 0). figsize (Optional[Tuple[float, float]], optional): Change the figure size. Defaults to None. show (bool, optional): Plot the result or return a figure. Defaults to True. values_only (bool, optional): Return the values that would be plotted as tuple containing two arrays: (x, y). Defaults to False. Returns: Figure: If show is False, return a figure. .. py:method:: show_shear_force(factor: Optional[float], verbosity: int, scale: float, offset: Tuple[float, float], figsize: Optional[Tuple[float, float]], show: bool, values_only: Literal[True]) -> Tuple[numpy.ndarray, numpy.ndarray] show_shear_force(factor: Optional[float], verbosity: int, scale: float, offset: Tuple[float, float], figsize: Optional[Tuple[float, float]], show: Literal[False], values_only: Literal[False]) -> matplotlib.figure.Figure show_shear_force(factor: Optional[float] = None, verbosity: int = 0, scale: float = 1.0, offset: Tuple[float, float] = (0, 0), figsize: Optional[Tuple[float, float]] = None, show: Literal[True] = True, values_only: Literal[False] = False) -> None Plot the shear force. Args: factor (Optional[float], optional): Influence the plotting scale. Defaults to None. verbosity (int, optional): 0: All information, 1: Suppress information. Defaults to 0. scale (float, optional): Scale of the plot. Defaults to 1. offset (Tuple[float, float], optional): Offset the plots location on the figure. Defaults to (0, 0). figsize (Optional[Tuple[float, float]], optional): Change the figure size. Defaults to None. show (bool, optional): Plot the result or return a figure. Defaults to True. values_only (bool, optional): Return the values that would be plotted as tuple containing two arrays: (x, y). Defaults to False. Returns: Figure: If show is False, return a figure. .. py:method:: show_reaction_force(verbosity: int, scale: float, offset: Tuple[float, float], figsize: Optional[Tuple[float, float]], show: Literal[False]) -> matplotlib.figure.Figure show_reaction_force(verbosity: int = 0, scale: float = 1.0, offset: Tuple[float, float] = (0, 0), figsize: Optional[Tuple[float, float]] = None, show: Literal[True] = True) -> None Plot the reaction force. Args: verbosity (int, optional): 0: All information, 1: Suppress information. Defaults to 0. scale (float, optional): Scale of the plot. Defaults to 1. offset (Tuple[float, float], optional): Offset the plots location on the figure. Defaults to (0, 0). figsize (Optional[Tuple[float, float]], optional): Change the figure size. Defaults to None. show (bool, optional): Plot the result or return a figure. Defaults to True. Returns: Figure: If show is False, return a figure. .. py:method:: show_displacement(factor: Optional[float], verbosity: int, scale: float, offset: Tuple[float, float], figsize: Optional[Tuple[float, float]], show: bool, linear: bool, values_only: Literal[True]) -> Tuple[numpy.ndarray, numpy.ndarray] show_displacement(factor: Optional[float], verbosity: int, scale: float, offset: Tuple[float, float], figsize: Optional[Tuple[float, float]], show: Literal[False], linear: bool, values_only: Literal[False]) -> matplotlib.figure.Figure show_displacement(factor: Optional[float] = None, verbosity: int = 0, scale: float = 1.0, offset: Tuple[float, float] = (0, 0), figsize: Optional[Tuple[float, float]] = None, show: Literal[True] = True, linear: bool = False, values_only: Literal[False] = False) -> None Plot the displacement. Args: factor (Optional[float], optional): Influence the plotting scale. Defaults to None. verbosity (int, optional): 0: All information, 1: Suppress information. Defaults to 0. scale (float, optional): Scale of the plot. Defaults to 1. offset (Tuple[float, float], optional): Offset the plots location on the figure. Defaults to (0, 0). figsize (Optional[Tuple[float, float]], optional): Change the figure size. Defaults to None. show (bool, optional): Plot the result or return a figure. Defaults to True. linear (bool, optional): Don't evaluate the displacement values in between the elements. Defaults to False. values_only (bool, optional): Return the values that would be plotted as tuple containing two arrays: (x, y). Defaults to False. Returns: Figure: If show is False, return a figure. .. py:method:: show_results(verbosity: int, scale: float, offset: Tuple[float, float], figsize: Optional[Tuple[float, float]], show: Literal[False]) -> matplotlib.figure.Figure show_results(verbosity: int = 0, scale: float = 1.0, offset: Tuple[float, float] = (0, 0), figsize: Optional[Tuple[float, float]] = None, show: Literal[True] = True) -> None Plot all the results in one window. Args: verbosity (int, optional): 0: All information, 1: Suppress information. Defaults to 0. scale (float, optional): Scale of the plot. Defaults to 1. offset (Tuple[float, float], optional): Offset the plots location on the figure. Defaults to (0, 0). figsize (Optional[Tuple[float, float]], optional): Change the figure size. Defaults to None. show (bool, optional): Plot the result or return a figure. Defaults to True. Returns: Figure: If show is False, return a figure. .. py:method:: get_node_results_system(node_id: None = None) -> List[Dict[str, Union[int, float]]] get_node_results_system(node_id: int) -> Dict[str, Union[int, float]] Get the node results. These are the opposite of the forces and displacements working on the elements and may seem counter intuitive. Args: node_id (int, optional): The node's ID. If node_id == None or 0, the results of all nodes are returned. Defaults to None. Returns: Union[ List[Dict[str, Union[int, float]]], Dict[str, Union[int, float]] ]: If node_id == 0, returns a list containing tuples with the results: [(id, Fx, Fy, Tz, ux, uy, phi_z), (id, Fx, Fy...), () .. ] If node_id > 0, returns a dict with the results: {"id": id, "Fx": Fx, "Fy": Fy, "Tz": Tz, "ux": ux, "uy": uy, "phi_z": phi_z} .. py:method:: get_node_displacements(node_id: None) -> List[Dict[str, Any]] get_node_displacements(node_id: int) -> Dict[str, Any] Get the node displacements. Args: node_id (int, optional): The node's ID. If node_id == None or 0, the results of all nodes are returned. Defaults to None. Returns: Union[List[Dict[str, Any]], Dict[str, Any]]: If node_id == 0, returns a list containing tuples with the results: [(id, ux, uy, phi_z), (id, ux, uy, phi_z), ... (id, ux, uy, phi_z) ] If node_id > 0, returns a dict with the results: {"id": id, "ux": ux, "uy": uy, "phi_z": phi_z} .. py:method:: get_element_results(element_id: None, verbose: bool) -> List[Dict[str, Any]] get_element_results(element_id: int, verbose: bool) -> Dict[str, Any] Get the element results. Args: element_id (int, optional): The element's ID. If element_id == None or 0, the results of all elements are returned. Defaults to None. verbose (bool, optional): If set to True, then numerical results for the deflection and the bending moment are also returned. Defaults to False. Returns: Union[List[Dict[str, Any]], Dict[str, Any]]: If element_id == 0, returns a list containing dicts with the results: [{"id": id, "length": length, "alpha": alpha, "umax": umax, "umin": umin, "u": u, "wmax": wmax, "wmin": wmin, "w": w, "Mmin": Mmin, "Mmax": Mmax, "M": M, "Qmin": Qmin, "Qmax": Qmax, "Q": Q, "Nmin": Nmin, "Nmax": Nmax, "N": N, "q": q}, ... ] If element_id > 0, returns a dict with the results: {"id": id, "length": length, "alpha": alpha, "umax": umax, "umin": umin, "u": u, "wmax": wmax, "wmin": wmin, "w": w, "Mmin": Mmin, "Mmax": Mmax, "M": M, "Qmin": Qmin, "Qmax": Qmax, "Q": Q, "Nmin": Nmin, "Nmax": Nmax, "N": N, "q": q} .. py:method:: get_element_result_range(unit: Literal['shear', 'moment', 'axial'], minmax: Literal['min', 'max', 'abs']) -> List[float] get_element_result_range(unit: Literal['shear', 'moment', 'axial'], minmax: Literal['both']) -> List[Tuple[float, float]] Get the element results. Returns a list with the min/max results of each element for a certain unit. Args: unit (str): "shear", "moment", or "axial" minmax (str), optional: "min", "max", "abs", or "both". Defaults to "abs". Note that "both" returns a tuple with two values: (min, max) Raises: NotImplementedError: If the unit is not implemented. Returns: List[Union[float, Tuple[float]]]: List with min and/or max results of each element for a certain unit. .. py:method:: get_node_result_range(unit: Literal['ux', 'uy', 'phi_z']) -> List[float] Get the node results. Returns a list with the node results for a certain unit. Args: unit (str): "uy", "ux", or "phi_z" Raises: NotImplementedError: If the unit is not implemented. Returns: List[float]: List with the node results for a certain unit. .. py:method:: find_node_id(vertex: Union[anastruct.vertex.Vertex, Sequence[float]], tolerance: float = 1e-09) -> Optional[int] Find the ID of a certain location. Args: vertex (Union[Vertex, Sequence[float]]): Vertex_xz, [x, y], (x, y) tolerance (float): Tolerance for matching existing node locations (length units). Defaults to 1e-9. Raises: TypeError: vertex must be a list, tuple or Vertex Returns: Optional[int]: id of the node at the location of the vertex .. py:method:: nodes_range(dimension: anastruct._types.Dimension) -> List[Union[float, Tuple[float, float], None]] Retrieve a list with coordinates x or y. Args: dimension (str): "both", 'x' or 'y' Returns: List[Union[float, Tuple[float, float], None]]: List with coordinates x or y .. py:method:: nearest_node(dimension: anastruct._types.Dimension, val: Union[float, Sequence[float]]) -> Union[int, None] Retrieve the nearest node ID. Args: dimension (str): "both", 'x', 'y' or 'z' val (Union[float, Sequence[float]]): Value of the dimension. Returns: Union[int, None]: ID of the node. .. py:method:: discretize(n: int = 10) -> None Discretize the elements. Takes an already defined :class:`.SystemElements` object and increases the number of elements. Args: n (int, optional): Divide the elements into n sub-elements.. Defaults to 10. .. py:method:: remove_loads(dead_load: bool = False) -> None Remove all the applied loads from the structure. Args: dead_load (bool, optional): Also remove the self-weights? Defaults to False. .. py:method:: apply_load_case(loadcase: anastruct.fem.util.load.LoadCase) -> None Apply a load case to the structure. Args: loadcase (LoadCase): Load case to apply. .. py:method:: get_stiffness_matrix(element_id: int) -> Optional[numpy.ndarray] Return the stiffness matrix for a specific element by its ID. Args: element_id (int): ID of the element. Returns: Optional[Union[list, None]]: The stiffness matrix of the element if it exists, otherwise None. .. py:method:: __deepcopy__(_: str) -> SystemElements Deepcopy the SystemElements object. Args: _ (str): Unnecessary argument. Returns: SystemElements: Copied SystemElements object. .. py:class:: LoadCase(name: str) Group different loads in a load case .. py:attribute:: name :type: str .. py:attribute:: spec :type: dict .. py:attribute:: c :type: int :value: 0 .. py:method:: q_load(q: Union[float, Sequence[float]], element_id: Union[int, Sequence[int]], direction: Union[str, Sequence[str]] = 'element', rotation: Optional[Union[float, Sequence[float]]] = None, q_perp: Optional[Union[float, Sequence[float]]] = None) -> None Apply a q-load to an element. :param element_id: (int/ list) representing the element ID :param q: (flt) value of the q-load :param direction: (str) "element", "x", "y", "parallel" .. py:method:: point_load(node_id: Union[int, Sequence[int]], Fx: Union[float, Sequence[float]] = 0, Fy: Union[float, Sequence[float]] = 0, rotation: Union[float, Sequence[float]] = 0) -> None Apply a point load to a node. :param node_id: (int/ list) Nodes ID. :param Fx: (flt/ list) Force in global x direction. :param Fy: (flt/ list) Force in global x direction. :param rotation: (flt/ list) Rotate the force clockwise. Rotation is in degrees. .. py:method:: moment_load(node_id: Union[int, Sequence[int]], Tz: Union[float, Sequence[float]]) -> None Apply a moment on a node. :param node_id: (int/ list) Nodes ID. :param Tz: (flt/ list) Moments acting on the node. .. py:method:: dead_load(element_id: Union[int, Sequence[int]], g: Union[float, Sequence[float]]) -> None Apply a dead load in kN/m on elements. :param element_id: (int/ list) representing the element ID :param g: (flt/ list) Weight per meter. [kN/m] / [N/m] .. py:method:: __str__() -> str .. py:class:: LoadCombination(name: str) .. py:attribute:: name :type: str .. py:attribute:: spec :type: dict .. py:method:: add_load_case(lc: Union[LoadCase, Sequence[LoadCase]], factor: Union[float, Sequence[float]]) -> None Add a load case to the load combination. :param lc: (:class:`anastruct.fem.util.LoadCase`) :param factor: (flt) Multiply all the loads in this LoadCase with this factor. .. py:method:: solve(system: anastruct.fem.system.SystemElements, force_linear: bool = False, verbosity: int = 0, max_iter: int = 200, geometrical_non_linear: bool = False, **kwargs: Any) -> Dict[str, anastruct.fem.system.SystemElements] Evaluate the Load Combination. :param system: (:class:`anastruct.fem.system.SystemElements`) Structure to apply loads on. :param force_linear: (bool) Force a linear calculation. Even when the system has non linear nodes. :param verbosity: (int) 0: Log calculation outputs. 1: silence. :param max_iter: (int) Maximum allowed iterations. :param geometrical_non_linear: (bool) Calculate second order effects and determine the buckling factor. :return: (ResultObject) Development **kwargs: :param naked: (bool) Whether or not to run the solve function without doing post processing. :param discretize_kwargs: When doing a geometric non linear analysis you can reduce or increase the number of elements created that are used for determining the buckling_factor .. py:class:: Vertex(x: Union[anastruct._types.VertexLike, anastruct._types.NumberLike], y: Union[anastruct._types.NumberLike, None] = None) Utility point in 2D. .. py:property:: x :type: float X coordinate Returns: float: X coordinate .. py:property:: y :type: float Y coordinate Returns: float: Y coordinate .. py:property:: y_neg :type: float Y negative coordinate (equals negative of Y coordinate) Returns: float: Y_neg coordinate .. py:method:: modulus() -> float Magnitude of the vector from the origin to the Vertex Returns: float: Magnitude of the vector from the origin to the Vertex .. py:method:: unit() -> Vertex Unit vector from the origin to the Vertex Returns: Vertex: Unit vector from the origin to the Vertex .. py:method:: displace_polar(alpha: float, radius: float, inverse_y_axis: bool = False) -> None Displace the Vertex by a polar coordinate Args: alpha (float): Angle in radians radius (float): Radius inverse_y_axis (bool, optional): Return a negative Y coordinate. Defaults to False. .. py:method:: __add__(other: Union[anastruct._types.VertexLike, anastruct._types.NumberLike]) -> Vertex Add two Vertex objects Args: other (Union[VertexLike, NumberLike]): Vertex to add Returns: Vertex: Sum of the two Vertex objects .. py:method:: __radd__(other: Union[anastruct._types.VertexLike, anastruct._types.NumberLike]) -> Vertex Add two Vertex objects Args: other (Union[VertexLike, NumberLike]): Vertex to add Returns: Vertex: Sum of the two Vertex objects .. py:method:: __sub__(other: Union[anastruct._types.VertexLike, anastruct._types.NumberLike]) -> Vertex Subtract two Vertex objects Args: other (Union[VertexLike, NumberLike]): Vertex to subtract Returns: Vertex: Difference of the two Vertex objects .. py:method:: __rsub__(other: Union[anastruct._types.VertexLike, anastruct._types.NumberLike]) -> Vertex Subtract two Vertex objects Args: other (Union[VertexLike, NumberLike]): Vertex to subtract Returns: Vertex: Difference of the two Vertex objects .. py:method:: __mul__(other: Union[anastruct._types.VertexLike, anastruct._types.NumberLike]) -> Vertex Multiply two Vertex objects Args: other (Union[VertexLike, NumberLike]): Vertex to multiply Returns: Vertex: Product of the two Vertex objects .. py:method:: __rmul__(other: Union[anastruct._types.VertexLike, anastruct._types.NumberLike]) -> Vertex Multiply two Vertex objects Args: other (Union[VertexLike, NumberLike]): Vertex to multiply Returns: Vertex: Product of the two Vertex objects .. py:method:: __truediv__(other: Union[anastruct._types.VertexLike, anastruct._types.NumberLike]) -> Vertex Divide two Vertex objects Args: other (Union[VertexLike, NumberLike]): Vertex to divide Returns: Vertex: Quotient of the two Vertex objects .. py:method:: __eq__(other: object) -> bool Check if two Vertex objects are equal Args: other (object): Object to compare Raises: NotImplementedError: If the object is not a Vertex object or a tuple or list of length 2 Returns: bool: True if the two Vertex objects are equal .. py:method:: __str__() -> str String representation of the Vertex object Returns: str: String representation of the Vertex object .. py:method:: __hash__() -> int Hash of the Vertex object Returns: int: Hash of the Vertex object