bluemira.structural.geometry
Finite element geometry
Classes
Abstract object for the collection of nodes and elements in the finite |
|
Abstract object for the collection of nodes and elements in the finite |
Module Contents
- class bluemira.structural.geometry.Geometry
Abstract object for the collection of nodes and elements in the finite element model
- nodes = []
- node_xyz = []
- elements = []
- property n_nodes: int
The number of Nodes in the Geometry. Used to index Nodes.
- Return type:
The number of Nodes in the Geometry.
- property n_elements: int
The number of Elements in the Geometry. Used to index Elements.
- Return type:
The number of Elements in the Geometry.
- 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.
- Parameters:
x (float) – The node global x coordinate
y (float) – The node global y coordinate
z (float) – The node global z coordinate
- Return type:
The ID number of the node that was added
- find_node(x: float, y: float, z: float) int
Return the node ID if the node coordinates are in the geometry.
- Parameters:
x (float) – The x coordinate of the node to find
y (float) – The y coordinate of the node to find
z (float) – The z coordinate of the node to find
- Return type:
The node ID
- Raises:
StructuralError – Node not found in model
- 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.
- Parameters:
node_id (int) – The id_number of the Node to move
dx (float) – The x distance to move the Node
dy (float) – The y distance to move the Node
dz (float) – The z distance to move the Node
- remove_node(node_id: int)
Remove a Node from the Geometry.
- Parameters:
node_id (int) – The id_number of the Node to remove
- 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
- Parameters:
node_id1 (int) – The ID number of the first node
node_id2 (int) – The ID number of the second node
cross_section (bluemira.structural.crosssection.CrossSection) – The CrossSection property object of the element
material (matproplib.material.Material | None) – The Material property object of the element
op_cond (matproblib.conditions.OperationalConditions | None)
- Return type:
The ID number of the element that was added
- remove_element(elem_id: int)
Remove an Element from the Geometry.
- Parameters:
elem_id (int) – The Element id_number to remove
- 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
- Parameters:
coordinates (bluemira.geometry.coordinates.Coordinates) – The coordinates to transform into connected Nodes and Elements
cross_section (bluemira.structural.crosssection.CrossSection) – The cross section of all the Elements in the Coordinates
material (matproplib.material.Material | None) – The material of all the Elements in the Coordinates
op_cond (matproblib.conditions.OperationalConditions | None)
- k_matrix() numpy.ndarray
Builds the global stiffness matrix K
- Return type:
The global stiffness matrix of the Geometry ((6*n_nodes, 6*n_nodes))
- k_matrix_sparse() scipy.sparse.lil_matrix
Builds the sparse global stiffness matrix K
- Return type:
The sparse global stiffness matrix of the Geometry ((6*n_nodes, 6*n_nodes))
- bounds() tuple[float, float, float, float, float, float]
Calculates the bounds of the geometry
- Return type:
tuple[float, float, float, float, float, float]
- bounding_box() bluemira.geometry.bound_box.BoundingBox
Calculates a bounding box for the Geometry object
- Return type:
BoundingBox rectangular cuboid of the geometry
- interpolate(scale: float = 100.0)
Interpolates the geometry model between Nodes
- Parameters:
scale (float)
- rotate(t_matrix: numpy.ndarray)
Rotates a geometry by updating the positions of all nodes and their global displacements
- Parameters:
t_matrix (numpy.ndarray) – The rotation matrix to use
- transfer_node(node: bluemira.structural.node.Node) int
Transfer a Node into the Geometry, copying all its state.
- Parameters:
node (bluemira.structural.node.Node) – The Node to transfer into the geometry
- Return type:
int
- merge(other: Geometry)
Combine geometry object with another
- Parameters:
other (Geometry) – The geometry to combine with
Notes
Will copy across Node and Element loads, BCs, displacements, and stress information
- plot(ax=None, **kwargs)
Plot the Geometry.
- Parameters:
ax (Union[Axes, None]) – The matplotlib Axes upon which to plot
- class bluemira.structural.geometry.DeformedGeometry(geometry: Geometry, scale: float)
Bases:
GeometryAbstract object for the collection of nodes and elements in the finite element model, with the ability to be deformed.
- Parameters:
geometry (Geometry)
scale (float)
- nodes
- node_xyz
- elements
- _scale
- deform()
Deform the Geometry by displacing the nodes by their deflections.
- plot(ax: matplotlib.pyplot.Axes | None = None, stress: numpy.ndarray | None = None, **kwargs) bluemira.structural.plotting.DeformedGeometryPlotter | bluemira.structural.plotting.StressDeformedGeometryPlotter
Plot the DeformedGeometry.
- Parameters:
ax (matplotlib.pyplot.Axes | None) – The matplotlib Axes upon which to plot
stress (numpy.ndarray | None) – The stress values to use (if any) when plotting
- Return type:
bluemira.structural.plotting.DeformedGeometryPlotter | bluemira.structural.plotting.StressDeformedGeometryPlotter