bluemira.structural.geometry ============================ .. py:module:: bluemira.structural.geometry .. autoapi-nested-parse:: Finite element geometry Classes ------- .. autoapisummary:: bluemira.structural.geometry.Geometry bluemira.structural.geometry.DeformedGeometry Module Contents --------------- .. py:class:: Geometry Abstract object for the collection of nodes and elements in the finite element model .. py:attribute:: nodes :value: [] .. py:attribute:: node_xyz :value: [] .. py:attribute:: elements :value: [] .. py:property:: n_nodes :type: int The number of Nodes in the Geometry. Used to index Nodes. :rtype: The number of Nodes in the Geometry. .. py:property:: n_elements :type: int The number of Elements in the Geometry. Used to index Elements. :rtype: The number of Elements in the Geometry. .. py:method:: add_node(x: float, y: float, z: float) -> int Add a Node to the Geometry object. Will check if an identical Node is already present. :param x: The node global x coordinate :param y: The node global y coordinate :param z: The node global z coordinate :rtype: The ID number of the node that was added .. py:method:: find_node(x: float, y: float, z: float) -> int Return the node ID if the node coordinates are in the geometry. :param x: The x coordinate of the node to find :param y: The y coordinate of the node to find :param z: The z coordinate of the node to find :rtype: The node ID :raises StructuralError: Node not found in model .. py:method:: move_node(node_id: int, dx: float = 0.0, dy: float = 0.0, dz: float = 0.0) Move a Node in the Geometry. If the Node is moved to the position of another Node, its connections are transferred, and the Node is removed. :param node_id: The id_number of the Node to move :param dx: The x distance to move the Node :param dy: The y distance to move the Node :param dz: The z distance to move the Node .. py:method:: remove_node(node_id: int) Remove a Node from the Geometry. :param node_id: The id_number of the Node to remove .. py:method:: add_element(node_id1: int, node_id2: int, cross_section: bluemira.structural.crosssection.CrossSection, material: matproplib.material.Material | None = None, op_cond: matproblib.conditions.OperationalConditions | None = None) -> int Adds an Element to the Geometry object :param node_id1: The ID number of the first node :param node_id2: The ID number of the second node :param cross_section: The CrossSection property object of the element :param material: The Material property object of the element :rtype: The ID number of the element that was added .. py:method:: remove_element(elem_id: int) Remove an Element from the Geometry. :param elem_id: The Element id_number to remove .. py:method:: add_coordinates(coordinates: bluemira.geometry.coordinates.Coordinates, cross_section: bluemira.structural.crosssection.CrossSection, material: matproplib.material.Material | None = None, op_cond: matproblib.conditions.OperationalConditions | None = None) Adds a Coordinates object to the Geometry :param coordinates: The coordinates to transform into connected Nodes and Elements :param cross_section: The cross section of all the Elements in the Coordinates :param material: The material of all the Elements in the Coordinates .. py:method:: k_matrix() -> numpy.ndarray Builds the global stiffness matrix K :rtype: The global stiffness matrix of the Geometry ((6*n_nodes, 6*n_nodes)) .. py:method:: k_matrix_sparse() -> scipy.sparse.lil_matrix Builds the sparse global stiffness matrix K :rtype: The sparse global stiffness matrix of the Geometry ((6*n_nodes, 6*n_nodes)) .. py:method:: bounds() -> tuple[float, float, float, float, float, float] Calculates the bounds of the geometry .. py:method:: bounding_box() -> bluemira.geometry.bound_box.BoundingBox Calculates a bounding box for the Geometry object :rtype: BoundingBox rectangular cuboid of the geometry .. py:method:: interpolate(scale: float = 100.0) Interpolates the geometry model between Nodes .. py:method:: rotate(t_matrix: numpy.ndarray) Rotates a geometry by updating the positions of all nodes and their global displacements :param t_matrix: The rotation matrix to use .. py:method:: transfer_node(node: bluemira.structural.node.Node) -> int Transfer a Node into the Geometry, copying all its state. :param node: The Node to transfer into the geometry .. py:method:: merge(other: Geometry) Combine geometry object with another :param other: The geometry to combine with .. rubric:: Notes Will copy across Node and Element loads, BCs, displacements, and stress information .. py:method:: plot(ax=None, **kwargs) Plot the Geometry. :param ax: The matplotlib Axes upon which to plot :type ax: Union[Axes, None] .. py:class:: DeformedGeometry(geometry: Geometry, scale: float) Bases: :py:obj:`Geometry` .. autoapi-inheritance-diagram:: bluemira.structural.geometry.DeformedGeometry :parts: 1 :private-bases: Abstract object for the collection of nodes and elements in the finite element model, with the ability to be deformed. .. py:attribute:: nodes .. py:attribute:: node_xyz .. py:attribute:: elements .. py:attribute:: _scale .. py:method:: deform() Deform the Geometry by displacing the nodes by their deflections. .. py:method:: plot(ax: matplotlib.pyplot.Axes | None = None, stress: numpy.ndarray | None = None, **kwargs) -> bluemira.structural.plotting.DeformedGeometryPlotter | bluemira.structural.plotting.StressDeformedGeometryPlotter Plot the DeformedGeometry. :param ax: The matplotlib Axes upon which to plot :param stress: The stress values to use (if any) when plotting