1.3.1. Beam

The main class that all 2D beam classes inherit from. Contains many methods that allow the user to create nodes, forces, and other points of interest.

class planesections.builder.Beam[source]

Bases: object

A representation of a beam object, that can be used to define information about basic beams. Units must form a consist unit basis for FEM analysis.

The base Beam class isn’t used by the user, the inherited classes Node2D and Node3D are used instead.

Fmax(index)[source]

get the maximum and minimum internal force for teh beam along the appropriate axis. 0:x, 1:y, 2:z (In 3D, 3:rx, 4:ry, 5:rz)

addDistLoad(x1: float, x2: float, distLoad: float, label: str = '')[source]

Adds a distributed load to the model. The load is defined between two locations, x1 and x2, in the model. If nodes exist at these locations, then the load is definied between those existing nodes. If there are no nodes at these locations, then nodes are added to the model. Old loads at this point are deleted.

Parameters:
  • x1 (float) – Start point of distributed load.

  • x2 (float) – Start point of distributed load.

  • distLoad (array) –

    The distributed load.

    In 2D has the form [Fx (axial force), Fy (shear force)]

    In 3D has the form [Fx (axial force), Fy (shear force), Fz (shear force)]

  • label (str) – A optional label for the force.

addDistLoadHorizontal(x1: float, x2: float, qx: float, label: str = '')[source]

Adds a distributed load to the model. The load is defined between two locations, x1 and x2, in the model. If nodes exist at these locations, then the load is definied between those existing nodes. If there are no nodes at these locations, then nodes are added to the model. Old loads at this point are deleted.

Parameters:
  • x1 (float) – Start point of distributed load.

  • x2 (float) – Start point of distributed load.

  • qx (float) – A constantly distributed axial force.

  • label (str) – A optional label for the force.

addDistLoadVertical(x1: float, x2: float, qy: float, label: str = '')[source]

Adds a distributed load to the model. The load is defined between two locations, x1 and x2, in the model. If nodes exist at these locations, then the load is definied between those existing nodes. If there are no nodes at these locations, then nodes are added to the model. Old loads at this point are deleted.

Parameters:
  • x1 (float) – Start point of distributed load.

  • x2 (float) – Start point of distributed load.

  • qy (float) – A constantly distributed vertical force.

  • label (str) – A optional label for the force.

addHorizontalLoad(x: float, Px: float, label: str = '', labelNode=False)[source]

Adds a horizontal point load at the model at location x. If no node exists at position x, a new node is added. Old loads are deleted. x : float

The x location to add force at.

Pxfloat

The magnitude of the vertical load to be added at x.

labelstr, optional

The label of the input node. labels are displayed in the plots. The default is ‘’.

addLabel(x: float, label: str, sort: bool = True)[source]

Adds a label to the beam at the coordinate in question. If a node exists at this location the label is added to it. If no node exists at location x, a new node is added. The new node will have default fixity.

Parameters:
  • x (float) – The x coordinate of the node.

  • label (str, optional) – A name for the node. This can be displayed in the plots. The default is ‘’.

  • sort (bool, optional) – A switch which turns on or off sorting of the nodes after a lable is added. The default value is True, which sorts the nodes.

Returns:

flag – returns 0 if a existing node has been updated, 1 if a new node is added, and -1 if the process failed.

Return type:

int

addLinLoad(x1: float, x2: float, linLoad: list[list], label: str = '')[source]

Adds a load that linearly varies between two input values. The load is defined between two locations, x1 and x2. If nodes exist at these locations, then the load is definied between those existing nodes. If there are no nodes at these locations, then nodes are added to the model. Old loads at this point are deleted.

Parameters:
  • x1 (float) – Start point of distributed load.

  • x2 (float) – Start point of distributed load.

  • linLoad (array) –

    The distributed load. The loads given are the maximum of the distributed load

    In 2D has the form [[qx_start, qx_end], [qy_start, qy_end]], where x is an axial force and y is a shear force.

    In 3D has the form [[qx_start, qx_end],

    [qy_start, qy_end], [qz_start, qz_end],]

    Where x is an axial force and y is shear force, and z is out of plane shear force..

labelstr

A optional label for the force.

addLinLoadHorizontal(x1: float, x2: float, qx: list[float], label: str = '')[source]

Adds a linear load to the model is defined between two locations, x1 and x2, in the model. If nodes exist at these locations, then the load is definied between those existing nodes. If there are no nodes at these locations, then nodes are added to the model. Old loads at this point are deleted.

Parameters:
  • x1 (float) – Start point of distributed load.

  • x2 (float) – Start point of distributed load.

  • qx (float) – A list of y values to linearly distribute between.

  • label (str) – A optional label for the force.

addLinLoadVertical(x1: float, x2: float, qy: list[float], label: str = '', **kwargs)[source]

Adds a linear load to the model. The load is defined between two locations in the model, x1 and x2. If nodes exist at these x1 or x2, then the load is definied between those existing nodes. If there are no nodes at these locations, then nodes are added to the model. Old loads at this point are deleted.

Parameters:
  • x1 (float) – Start point of distributed load.

  • x2 (float) – Start point of distributed load.

  • qy (float) – The peak load for a linearly disributed vertical load.

  • label (str) – A optional label for the force.

addMoment(x: float, M: float, label: str = '', labelNode=False)[source]

Adds a moment ot the model at location x. If no node exists at position x, a new node is added. Old loads at this point are deleted. .. todo:: State which direction positive is.

Parameters:
  • x (float) – The x location to add a moment at.

  • M (float) – The magnitude of the moment to be added at x.

  • label (str, optional) – The label of the input node. labels are displayed in the plots. The default is ‘’.

addNode(x: float, fixity: list | str | Fixity | None = None, label: str = '', sort: bool = True)[source]

Adds a new node to the beam. Keyword arguments are passed to the node. See Node2D for more details

Parameters:
  • x (float) – The x coordinate of the node.

  • fixity (Fixity, list) –

    A fixity object, or a list of the input fixities for each possible degree of freedom. 2D nodes have three degree of freedoms; [x, y, \(\theta\)] 3D nodes have six degree of freedoms; [x, y, z, \(\theta_x\), \(\theta_y\), \(\theta_z\)] For each degree of freedom, 1 represents a fixed condition, 0 represents a free conditon. e.x.

    [1,1,0] - A 2D connection that’s fixed in x/y but free in rotation.

    [1,1,0,0,0,1] - A 3D connection that’s fixed in x/y and \(\theta_z\) .

  • label (str, optional) – A name for the node. This can be displayed in the plots. The default is ‘’.

  • sort (bool, optional) – A toggle that turns on or off node sorting as new nodes are added. Nodes are sorted after each new node as added, this can be toggled off to inprove performance. However, nodes must be sorted before the analysis is run.

Returns:

flag – returns 0 if a existing node has been updated, 1 if a new node is added, and -1 if the process failed.

Return type:

int

addNodes(xCoords: list[float], fixities: list[list | str | Fixity] | None = None, labels: list[str] | None = None)[source]

Adds several new nodes to the beam at the same time. The nodes in question are added at the x coordinates in the model. Nodes are sorted at the end of the process

Parameters:
  • xCoords (list of float) – A list of the x coordinates to be added to the model.

  • fixities (list of fixity or booliean, optional) –

    A fixity object, or a list of the input fixities for each possible degree of freedom. 2D nodes have three degree of freedoms; [x, y, \(\theta\)] 3D nodes have six degree of freedoms; [x, y, z, \(\theta_x\), \(\theta_y\), \(\theta_z\)] For each degree of freedom, 1 represents a fixed condition, 0 represents a free conditon. e.x.

    [1,1,0] - A 2D connection that’s fixed in x/y but free in rotation.

    [1,1,0,0,0,1] - A 3D connection that’s fixed in x/y and \(\theta_z\) .

  • label (list[str], optional) – A list of the labels for each node. labels are displayed in the plots. The default is ‘’.

addPointLoad(x: float, pointLoad: list, label: str = '', labelNode=False)[source]

Adds a load ot the model at location x. If a node exists at the current location, the old load value is overwritten. Old loads are deleted, and the node is relabled. Can represent objects in 2D or 3D.

Parameters:
  • x (float) – The location of the load.

  • pointLoad (list) –

    A list of the forces. For a 2D beam has form [Fx, Fy, M]. For a 3D beam has form [Fx, Fy, Fz, Mx, My, Mz].

    New Load 1:

    [0., 10., 0.] A vertical load of 10 is applied in beam units.

    New Load 2:

    [0., 0., 13] A moment of 13 is applied in beam units.

  • label (str, optional) – The label of the input node. labels are displayed in the plots. The default is ‘’.

addVerticalLoad(x: float, Py: float, label: str = '', labelNode=False)[source]

Adds a vertical load to the model at location x. If no node exists at position x, a new node is added. Old loads at this point are deleted.

Parameters:
  • x (float) – The x location to add force at.

  • Py (float) – The magnitude of the vertical load to be added at x.

  • label (str, optional) – The label of the input node. labels are displayed in the plots. The default is ‘’.

getDOF()[source]

Returns the number of degrees of Freedom at each point in the beam.

getLength()[source]

Returns the length of the beam.

Returns:

The beam length.

Return type:

float

getNodeIDs()[source]

Gets all of the node IDs.

Returns:

IDs – a list of all of the node IDs in the model.

Return type:

list[int]

getNodes()[source]
getxLims()[source]

Returns the of the beam.

Returns:

A list with the left most and right most point.

Return type:

list[float]

setFixity(x: float, fixity: list[list | Fixity], label=None)[source]

Sets the the model fixity at locaiton x. If the node exists, update it. If the node doesn’t exist, then a new node will be added

Parameters:
  • x (float) – The x coordinant of the noded to be modified/added.

  • fixity (list, Fixity) –

    A fixity object, or a list of the input fixities for each possible degree of freedom. 2D nodes have three degree of freedoms; [x, y, \(\theta\)] 3D nodes have six degree of freedoms; [x, y, z, \(\theta_x\), \(\theta_y\), \(\theta_z\)] For each degree of freedom, 1 represents a fixed condition, 0 represents a free conditon. e.x.

    [1,1,0] - A 2D connection that’s fixed in x/y but free in rotation.

    [1,1,0,0,0,1] - A 3D connection that’s fixed in x/y and \(\theta_z\) .

  • label (str, optional) – The label of the input node. labels are displayed in the plots. The default is ‘’.