NodeBoundaryCondition#

class planestress.pre.boundary_condition.NodeBoundaryCondition(point: tuple[float, float], direction: str, value: float, priority: int)[source]#

Bases: BoundaryCondition

Abstract base class for a boundary condition at 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, priority: int) None[source]#

Inits the NodeBoundaryCondition class.

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

  • direction (str) – Direction of the boundary condition, "x", "y" or "xy".

  • value (float) – Value of the boundary condition.

  • priority (int) – Integer denoting the order in which the boundary condition gets applied.

get_node_dofs() list[int][source]#

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]

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

Applies the boundary condition.

Parameters:
  • k (lil_array) – Stiffness matrix.

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

Raises:

NotImplementedError – If this method has not been implemented.

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]