NodeSupport#

class planestress.pre.boundary_condition.NodeSupport(point: tuple[float, float], direction: str, value: float = 0.0)[source]#

Bases: NodeBoundaryCondition

Class for adding a support to a node.

Variables:

mesh_tag – Tagged node object.

Methods

apply_bc

Applies the boundary condition.

get_dofs_given_direction

Gets the degrees of freedom based on the BC direction.

get_node_dofs

Get the degrees of freedom of the node.

__init__(point: tuple[float, float], direction: str, value: float = 0.0) None[source]#

Inits the NodeSupport class.

Parameters:
  • point (tuple[float, float]) – Point location (x, y) of the node support.

  • direction (str) – Direction of the node support, either "x" or "y" (rollers), or "xy" (pin).

  • value (float) – Imposed displacement to apply to the node support. Defaults to 0.0, i.e. a node support with fixed zero displacement.

Example

TODO.

apply_bc(k: lil_array, f: npt.NDArray[np.float64]) tuple[lil_array, npt.NDArray[np.float64]][source]#

Applies the boundary condition.

Parameters:
  • k (lil_array) – Stiffness matrix.

  • f (npt.NDArray[np.float64]) – Load vector.

Returns:

Modified stiffness matrix and load vector (k, f).

Return type:

tuple[lil_array, npt.NDArray[np.float64]]

get_dofs_given_direction(dofs: list[int]) list[int]#

Gets the degrees of freedom based on the BC direction.

Parameters:

dofs (list[int]) – Degrees of freedom.

Returns:

Degrees of freeom in BC direction.

Return type:

list[int]

get_node_dofs() list[int]#

Get the degrees of freedom of the node.

Raises:

RuntimeError – If a mesh tag has not been assigned.

Returns:

List (length 2) of degrees of freedom.

Return type:

list[int]