BoundaryCondition#

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

Bases: object

Abstract base class for a boundary condition.

Variables:

mesh_tag – Tagged entity object.

Methods

apply_bc

Applies the boundary condition.

get_dofs_given_direction

Gets the degrees of freedom based on the BC direction.

__init__(direction: str, value: float, priority: int) None[source]#

Inits the BoundaryCondition class.

Parameters:
  • 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.

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.

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][source]#

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]