Domain#

class domain.Domain2D(dimensions: tuple[float, float], element_shape: tuple[int, int], E: float = 1.0, ν: float = 0.3, t: float = 1.0)[source]#

Bases: object

Represents the 2D domain for the problem. The domain is a rectangle with dimensions [x, y]. Quadrilateral bi-linear elements are used to discretise the domain.

dimensions#

tuple[float, float] - The dimensions of the domain [x, y]

element_shape#

tuple[int, int] - The number of elements in each direction [x, y]

node_shape#

tuple[int, int] - The number of nodes in each direction [x, y]

ν#

float - Poisson’s ratio - used to calculate the stiffness matrix

num_dofs#

int - The number of degrees of freedom

element_size#

NDArray - The size of each element [x, y]

average_node_values_to_element(node_property: ndarray[Any, dtype[_ScalarType_co]]) ndarray[Any, dtype[_ScalarType_co]][source]#

Converts an array of values sampled at each node to an array of values within each element The value of each element is the average of the values at each node

Parameters:

node_property – NDArray - The property at each node

Returns:

NDArray - The property averaged to the element

coord_to_nearest_node(point: tuple[float, float]) ndarray[Any, dtype[_ScalarType_co]][source]#

Selects the node corresponding to the point in the domain

Parameters:

point – tuple[float, float] - The point in the domain in dimension units [x, y]

Returns:

NDArray - The node corresponding to the point

coords_to_nearest_dof_ids(point: tuple[float, float]) ndarray[Any, dtype[_ScalarType_co]][source]#

Selects the degrees of freedom corresponding to the point in the domain

Parameters:

point – tuple[float, float] - The point in the domain in dimension units [x, y]

Returns:

NDArray - The degrees of freedom corresponding to the point

dof_ids_to_coords(dof_ids: ndarray[Any, dtype[_ScalarType_co]]) ndarray[Any, dtype[_ScalarType_co]][source]#
element_value_to_nodes(element_value: ndarray[Any, dtype[_ScalarType_co]]) ndarray[Any, dtype[_ScalarType_co]][source]#

Converts an array of values sampled at each element to an array of values within each node The value of each node is 1/4 of the value of each element it is part of

Parameters:

element_value – NDArray - The property at each element

Returns:

NDArray - The property at each node

left_boundary_dof_ids()[source]#
node_xys_to_ids(point: tuple[int, int]) int[source]#