Elements

NuSA provides five finite-element formulations in nusa.element. Elements own connectivity and geometry-dependent formulation and reference reusable physical-property objects when required. Solved response is evaluated explicitly from the element displacement vector and stored in analysis results.

Common element contract

Every element has an element type, a label assigned by the model, and a tuple of connected nodes.

The numerical analysis asks an element for its stiffness matrix and evaluates its solved response from an explicit local displacement vector.

Conceptually:

Ke = element.get_element_stiffness()
values = element.compute_results(u_e)

Elements do not read solved displacement attributes from nodes and do not cache solved forces, stresses, or strains on themselves.

Spring

Spring is a two-node, one-dimensional elastic element.

Required property:

k

Positive spring stiffness.

Local displacement vector:

[ux_i, ux_j]

Canonical results:

force_i
force_j

Bar

Bar is a two-node axial element.

Requires material=Material(E=...) and section=Section(A=...). Both references are read-only. The convenience properties E and A are delegated to these objects.

Local displacement vector:

[ux_i, ux_j]

Canonical results:

force_i
force_j
axial_force
axial_stress

Positive axial force/stress denotes tension.

Truss

Truss is a two-dimensional, two-node axial element whose orientation maps its axial response into the global coordinate system.

Requires material=Material(E=...) and section=Section(A=...).

Local/global element displacement vector used by the current formulation:

[ux_i, uy_i, ux_j, uy_j]

Canonical results:

axial_force
axial_stress

Beam

Beam is the current two-node Euler-Bernoulli beam formulation.

Requires material=Material(E=...) and section=Section(I=...).

Element displacement vector:

[uy_i, ur_i, uy_j, ur_j]

Canonical end actions:

shear_force_i
shear_force_j
bending_moment_i
bending_moment_j

LinearTriangle

LinearTriangle is a three-node constant-strain triangle (CST) for plane stress.

Requires material=Material(E=..., nu=...) and a positive thickness parameter. thickness and its alias t are read-only.

Element displacement vector:

[ux_1, uy_1, ux_2, uy_2, ux_3, uy_3]

The element additionally exposes explicit strain/stress evaluation:

strain = element.compute_strain(u_e)
stress = element.compute_stress(u_e)
values = element.compute_results(u_e)

Canonical results:

stress_xx
stress_yy
stress_xy
strain_xx
strain_yy
strain_xy

Validation

NuSA validates material and section parameters when their domain objects are created and checks required properties at element construction. thickness and spring stiffness must be finite, positive, and non-boolean. Degenerate triangular geometry is also rejected.

For physical-property definitions see Materials and sections. For worked examples see Examples.

API reference

class nusa.element.Bar(nodes, *, material, section)[source]

Bases: Element

Bar element for finite element analysis.

Parameters:
nodestuple of Node

Element connectivity.

materialMaterial

Material providing Young’s modulus E.

sectionSection

Section providing cross-sectional area A.

property A

Cross-sectional area provided by the section.

property E

Young’s modulus provided by the material.

property L

Length of element.

compute_results(u_e)[source]

Return canonical bar results from local displacements.

get_element_stiffness()[source]

Return the bar element stiffness matrix.

property material

Material associated with the element (read-only).

property section

Section associated with the element (read-only).

class nusa.element.Beam(nodes, *, material, section)[source]

Bases: Element

Euler-Bernoulli beam element for finite element analysis.

Parameters:
nodestuple of Node

Element connectivity.

materialMaterial

Material providing Young’s modulus E.

sectionSection

Section providing second moment of area I.

property E

Young’s modulus provided by the material.

property I

Second moment of area provided by the section.

property L

Length of element.

compute_results(u_e)[source]

Return canonical beam end actions from local displacements.

get_element_stiffness()[source]

Return the beam element stiffness matrix.

property material

Material associated with the element (read-only).

property section

Section associated with the element (read-only).

class nusa.element.Element(etype)[source]

Bases: object

Base class for finite elements.

Elements own formulation and connectivity and reference the physical properties required by that formulation. Solved response belongs to analysis results, not to the element instance.

class nusa.element.LinearTriangle(nodes, *, material, thickness)[source]

Bases: Element

Three-node constant-strain triangle (plane stress).

Parameters:
nodestuple of Node

Triangle connectivity.

materialMaterial

Material defining E and nu (both required).

thicknessfloat

Finite, strictly positive thickness.

property A
property B
property D

Constitutive matrix

Currently only plane stress supported

property E
compute_results(u_e)[source]

Return canonical CST stress/strain results from local displacements.

compute_strain(u_e)[source]

Return the constant engineering strain vector for local displacements.

compute_stress(u_e)[source]

Return the constant stress vector for local displacements.

get_element_stiffness()[source]

Get stiffness matrix for this element

property material
property nu
property t
property thickness
class nusa.element.Spring(nodes, ke)[source]

Bases: Element

Spring element for finite element analysis

nodestuple

Connectivity for element given as tuple of Node objects

kefloat

Spring stiffness

Example

n1 = Node((0,0))
n2 = Node((0,0))
e1 = Spring((n1,n2), 1000)
compute_results(u_e)[source]

Return canonical spring results from local displacements.

get_element_stiffness()[source]

Get stiffness matrix for this element.

The stiffness matrix for a spring element is defined by:

\[\begin{split}[k]_e = \begin{bmatrix} k & -k \\ -k & k \\ \end{bmatrix}\end{split}\]

where k is the spring stiffness.

Return a numpy array.

class nusa.element.Truss(nodes, *, material, section)[source]

Bases: Element

Truss element for finite element analysis.

Parameters:
nodestuple of Node

Element connectivity.

materialMaterial

Material providing Young’s modulus E.

sectionSection

Section providing cross-sectional area A.

property A

Cross-sectional area provided by the section.

property E

Young’s modulus provided by the material.

property L

Length of element

compute_results(u_e)[source]

Return canonical truss results from global element displacements.

get_element_stiffness()[source]

Get stiffness matrix for this element

property material

Material associated with the element (read-only).

property section

Section associated with the element (read-only).

property theta

Element angle, measure from X-positive axis counter-clockwise.