The core module

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

Bases: object

Superclass for all Elements

Attributes:
fx
fy

Methods

get_element_forces()

Returns a tuple with element forces: (fx, fy)

set_element_forces([fx, fy])

Set element forces

set_label(label)

Set the label property

get_nodes

property fx
property fy
get_element_forces()[source]

Returns a tuple with element forces: (fx, fy)

get_nodes()[source]
set_element_forces(fx=0.0, fy=0.0)[source]

Set element forces

fxfloat

Force in x-dir

fyfloat

Force in y-dir

Normally this method is used by the solve method to update computed element-forces.

set_label(label)[source]

Set the label property

labelint

Label, must be an integer

class nusa.core.Model(name, mtype)[source]

Bases: object

Superclass for all Finite Element Analysis (FEA) models.

This class serves as a base container to manage nodes and elements, allowing derived models to build and manipulate FEA structures.

Methods

add_element(element)

Add an element to the model.

add_node(node)

Add a node to the model.

get_elements()

Return a list of element objects.

get_nodes()

Return a list of node objects.

get_number_of_elements()

Return the number of elements in the model.

get_number_of_nodes()

Return the number of nodes in the model.

simple_report([report_type, fname])

Placeholder for a future implementation of a simple report.

add_element(element)[source]

Add an element to the model.

Parameters:
elementElement

Instance of an Element to be added.

Raises:
ValueError

If the element type does not match the model type.

add_node(node)[source]

Add a node to the model.

Parameters:
nodeNode

Instance of a Node to be added.

Returns:
None
get_elements()[source]

Return a list of element objects.

Returns:
list

List of Element instances.

get_nodes()[source]

Return a list of node objects.

Returns:
list

List of Node instances.

get_number_of_elements()[source]

Return the number of elements in the model.

Returns:
int

Total number of elements.

get_number_of_nodes()[source]

Return the number of nodes in the model.

Returns:
int

Total number of nodes.

simple_report(report_type='print', fname='nusa_rpt.txt')[source]

Placeholder for a future implementation of a simple report.

Parameters:
report_typestr, optional

Type of report to generate (‘print’, ‘file’, etc.).

fnamestr, optional

Output filename for file-based reports.

class nusa.core.Node(coordinates)[source]

Bases: object

Class for node object.

coordinatestuple, list

Coordinates of node

labelint

Label of node

n1 = Node((0,0))
n2 = Node((0,0))
Attributes:
ex
exy
ey
fx
fy
label
m
seqv
sx
sxy
sy
ur
ux
uy

Methods

get_displacements

get_forces

get_label

set_displacements

set_forces

set_label

property ex
property exy
property ey
property fx
property fy
get_displacements()[source]
get_forces()[source]
get_label()[source]
property label
property m
property seqv
set_displacements(ux=nan, uy=nan, ur=nan)[source]
set_forces(fx=nan, fy=nan)[source]
set_label(label)[source]
property sx
property sxy
property sy
property ur
property ux
property uy