hookeai.data_generation.spdg.patch_generator.FiniteElementPatchGenerator

class FiniteElementPatchGenerator(n_dim, patch_dims)[source]

Bases: object

Finite element material patch generator.

_n_dim

Number of spatial dimensions.

Type:

int

_patch_dims

Patch size in each dimension.

Type:

tuple[float]

_n_corners

Number of corners of the patch.

Type:

int

_n_edges

Number of edges of the patch.

Type:

int

_corners_mapping

For each corner label (key, str[int]), store the corner internal index. Corners are labeled from 1 to number of corners.

Type:

dict

_corners_coords_ref

Patch corners coordinates in the reference configuration (numpy.ndarray(n_corners, n_dim)).

Type:

numpy.ndarray(2d)

_edges_per_dim

For each dimension (key, str[int]), store the edges (item, tuple[tuple]) oriented along that dimension in the reference configuration. Each edge is stored as tuple[int](2) containing the indexes of the two corresponding corners. Corners are stored such that edges nodes are sorted in asceding order of coordinate.

Type:

dict

_edges_diag_per_dim

For each dimension (key, str[int]), store the edges reference diagonal (item, tuple[tuple]) for edges oriented along that dimension in the reference configuration. Each reference diagonal is stored as a tuple[int](2) containing the indexes of the two corresponding corners.

Type:

dict

_edges_mapping

For each edge label (key, str[int]), store the edge orientation dimension and internal index consistent with _edges_per_dim (tuple(2)). Edges are labeled from 1 to number of edges.

Type:

dict

generate_deformed_patch(self, elem_type, n_elems_per_dim, corners_lab_bc=None, corners_lab_disp_range=None, edges_lab_def_order=None, edges_lab_disp_range=None, translation_range=None, rotation_angles_range=None, deformation_noise=0.0, max_iter=10, is_verbose=False)[source]

Generate finite element deformed patch.

_build_corners_bc(self, corners_lab_bc=None)[source]

Build boundary conditions on patch corners.

_build_corners_disp_range(self, corners_lab_disp_range=None, corners_bc=None)[source]

Build patch corners displacement range.

_build_edges_poly_orders(self, edges_lab_def_order=None)[source]

Build patch edges deformation polynomials orders.

_build_edges_disp_range(self, edges_lab_disp_range=None)[source]

Build patch edges displacements range.

_set_corners_attributes(self)[source]

Set patch corners attributes.

_set_corners_coords_ref(self)[source]

Set patch corners coordinates (reference configuration).

_set_edges_attributes(self)[source]

Set patch edges attributes.

_get_matching_edges_idxs(self)[source]

Get matching edges indexes along each dimension.

_get_n_edge_nodes_per_dim(self, elem_type, n_elems_per_dim)[source]

Get number of patch edge nodes along each dimension.

_get_elem_type_attributes(self, elem_type)

Get finite element type attributes.

_get_corners_random_displacements(self, corners_disp_range, edges_poly_orders=None)[source]

Compute patch corners random displacements.

_get_deformed_boundary_edge(self, nodes_coords_ref, left_node_def,                                 right_node_def, poly_order,

poly_bounds_range=None, is_plot=False)

_polynomial_sampler(order, left_point, right_point, lower_bound=None, upper_bound=None, is_plot=False)[source]

Generate random polynomial by sampling points within given bounds.

_get_patch_centroid(self, corners_coords, edges_coords)[source]

Compute patch centroid.

_build_boundary_coords_array(self, edges_coords, is_close_polygon)[source]

Build patch boundary nodes coordinates array.

_is_admissible_simulation(self, edges_coords)[source]

Check whether simulation of patch is physically admissible.

_get_orthogonal_dims(self, dim)[source]

Get orthogonal dimensions to given dimension.

_rotation_tensor_deformed_edge(self, edge_dim, edge_index, corners_coords_def)[source]

Set rotation tensor to deformed boundary edge local coordinates.

_transform_to_edge_local_coordinates(self, init_node_def, end_node_def, nodes_coords_ref, translation=None, rotation=None)[source]

Transform from patch coordinates to deformed edge local coordinates.

_transform_from_edge_local_coordinates(self, local_nodes_coords_def, translation=None, rotation=None)[source]

Transform from deformed edge local coordinates to patch coordinates.

_rotate_coords_array(coords_array, r)[source]

Rotate coordinates array.

_generate_finite_element_mesh(self, elem_type, n_elems_per_dim)[source]

Generate patch finite element mesh (reference configuration).

_get_elem_node_index(self, elem_type, n_elems_per_dim, global_index)[source]

Get element node local index from global mesh index.

_get_mesh_boundary_nodes_disps(self, edges_coords_ref, edges_coords_def,

mesh_nodes_matrix, mesh_nodes_coords_ref, is_interp_face_disps=False)

_get_node_label_from_coords(mesh_nodes_coords_ref, node_coords)[source]

Get finite element mesh node label from coordinates.

Constructor.

Parameters:
  • n_dim (int) – Number of spatial dimensions.

  • patch_dims (tuple[float]) – Patch size in each dimension.

List of Public Methods

generate_deformed_patch

Generate finite element deformed patch.

Methods

__init__(n_dim, patch_dims)[source]

Constructor.

Parameters:
  • n_dim (int) – Number of spatial dimensions.

  • patch_dims (tuple[float]) – Patch size in each dimension.

_build_boundary_coords_array(edges_coords, is_close_polygon=False)[source]

Build patch boundary nodes coordinates array.

In the two-dimensional case, boundary nodes are sorted in clockwise order. A closed polygon is obtained by setting is_close_polygon to True.

Parameters:
  • edges_coords (dict) – For each dimension (key, str[int]), store the corresponding edges coordinates (item, list[numpy.ndarray(2d)]). Each edge coordinates are stored as a numpy.ndarray(n_edge_nodes, n_dim). Corner nodes are assumed part of the edge.

  • is_close_polygon (bool, default=False) – If True, then close the polygon by adding a copy of the first node to the end of the boundary nodes coordinates array.

Returns:

boundary_coords_array – Boundary nodes coordinates array (numpy.ndarray(n_points, n_dim)).

Return type:

numpy.ndarray(2d)

_build_corners_bc(corners_lab_bc=None, is_random_min=False)[source]

Build boundary conditions on patch corners.

If boundary conditions are not provided, then a random set of minimal constraints is prescribed.

Parameters:
  • corners_lab_bc (dict, default=None) – Boundary conditions (item, tuple[int](n_dim)) for each patch corner label (key, str[int]). The tuple[int](n_dim)] prescribes 0 (free) or 1 (fixed) for each degree of freedom. Unspecified corners are assumed free by default.

  • is_random_min (bool, False) – Prescribe a random set of minimal constraints. This option overrides any prescribed boundary conditions.

Returns:

corners_bc – Boundary conditions applied to the corners of the patch. For each node, a tuple(n_dim) prescribes 0 (free) or 1 (fixed) for each degree of freedom.

Return type:

tuple[tuple]

_build_corners_disp_range(corners_lab_disp_range=None, corners_bc=None)[source]

Build patch corners displacement range.

Parameters:
  • corners_lab_disp_range (dict, default=None) – Displacement range along each dimension (item, tuple[tuple(2)]) for each corner label (key, str[int]). Corners are labeled from 1 to number of corners. Range is specified as tuple(min, max) for each dimension. If None, a null displacement range is set by default.

  • corners_bc (tuple[tuple], default=None) – Boundary conditions applied to the corners of the patch. For each node, a tuple(n_dim) prescribes 0 (free) or 1 (fixed) for each degree of freedom.

Returns:

corners_disp_range – Patch corners displacements range (numpy.ndarray(n_corners, n_dim, k), where k=0 (min) and k=1 (max)).

Return type:

numpy.ndarray(3d)

_build_edges_disp_range(edges_lab_disp_range=None)[source]

Build patch edges displacements range.

Parameters:

edges_lab_disp_range (dict, default=None) – Displacement range (item, tuple[float](2)) for each edge label (key, str[int]). Edges are labeled from 1 to number of edges. Range is specified as a tuple(min, max) where: (1) displacement range is orthogonal and relative to the edge (defined by limiting corner nodes in the deformed configuration), (2) positive/negative displacement corresponds to outward/inward direction with respect to the patch. Null displacement range is assumed for unspecified edges. If None, null displacement range is set by default.

Returns:

edge_disp_range – For each dimension (key, str[int]), store the corresponding edges displacement range (item, tuple[tuple(min, max)]).

Return type:

dict

_build_edges_poly_orders(edges_lab_def_order=None)[source]

Build patch edges deformation polynomials orders.

Parameters:

edges_lab_def_order ({int, dict}, default=None) – Deformation polynomial order (item, int) for each edge label (key, str[int]). Edges are labeled from 1 to number of edges. If a single order is provided, then it is assumed for all the edges. Zero order is assumed for unspecified edges. If None, zero order is assumed for all the edges.

Returns:

edges_poly_orders – For each dimension (key, str[int]), store the corresponding edges deformation polynomials orders (item, list[int]).

Return type:

dict

_generate_finite_element_mesh(elem_type, n_elems_per_dim)[source]

Generate patch finite element mesh (reference configuration).

The finite element mesh is regular and uniform, assuming a spatial discretization in quadrilateral (2D) / hexahedral (3D) elements.

Parameters:
  • elem_type (str) – Finite element type.

  • n_elems_per_dim (tuple[int]) – Number of finite elements per dimension.

Returns:

  • mesh_nodes_matrix (numpy.ndarray(2d or 3d)) – Finite element mesh nodes matrix (numpy.ndarray[int](n_edge_nodes_per_dim) where each element corresponds to a given node position and whose value is set either as the global node label or zero (if the node does not exist). Nodes are labeled from 1 to n_nodes.

  • mesh_nodes_coords (dict) – Coordinates (item, numpy.ndarray(n_dim)) of each finite element mesh node (key, str[int]). Nodes are labeled from 1 to n_nodes.

_get_corners_random_displacements(corners_disp_range, edges_poly_orders=None)[source]

Compute patch corners random displacements.

Edges deformation polynomial order may be updated in-place to enforce a zero order deformation polynomial in all matching edges if at least one of them has been prescribed a zero order deformation polynomial.

Parameters:
  • corners_disp_range (numpy.ndarray(3d)) – Patch corners displacements range (numpy.ndarray(n_corners, n_dim, k), where k=0 (min) and k=1 (max)).

  • edges_poly_orders (dict, default=None) – For each dimension (key, str[int]), store the corresponding edges deformation polynomials orders (item, tuple[int]).

Returns:

  • corners_disp (numpy.ndarray(2d)) – Patch corners displacements (numpy.ndarray(n_corners, n_dim)).

  • corners_disp_range (numpy.ndarray(3d)) – Patch corners displacements range (numpy.ndarray(n_corners, n_dim, k), where k=0 (min) and k=1 (max)).

_get_deformed_boundary_edge(nodes_coords_ref, left_node_def, right_node_def, poly_order, poly_bounds_range=None, noise=0.0, is_plot=False)[source]

Get randomly deformed boundary edge node coordinates in 2D plane.

The boundary edge nodes (reference configuration) must be sorted along the first dimension (either ascending or descending order).

The deformed configuration of the boundary edge is computed by sampling a random polynomial along the second dimension of the deformed boundary edge local coordinates.

The boundary edge nodes are then projected to the deformed configuration and the corresponding displacements are computed based on the reference coordinates.

Parameters:
  • nodes_coords_ref (numpy.ndarray(2d)) – Boundary edge nodes coordinates in the reference configuration (numpy.ndarray(n_edge_nodes, 2)).

  • left_node_def (numpy.ndarray(1d)) – Boundary edge leftmost node coordinates in the deformed configuration (numpy.ndarray(2)).

  • right_node_def (numpy.ndarray(1d)) – Boundary edge rightmost node coordinates in the deformed configuration (numpy.ndarray(2)).

  • poly_order (int) – Order of random polynomial sampled to generate the deformed configuration of the boundary edge.

  • poly_bounds_range (tuple[float], default=None) – Polynomial range along second dimension. Range is relative to midplane defined by both boundary edge nodes along the second dimension.

  • noise (float, default=0.0) – Parameter that controls the normally distributed noise superimposed to the boundary edges interior nodes coordinates in the deformed configuration. Defines the noise standard deviation along given dimension after being multiplied by the corresponding patch size.

  • is_plot (bool, default=False) – If True, plot boundary edge reference and deformed configurations.

Returns:

  • nodes_coords_def (numpy.ndarray(2d)) – Boundary edge nodes coordinates in the deformed configuration (numpy.ndarray(n_edge_nodes, 2)).

  • nodes_disp (numpy.ndarray(2d)) – Boundary edge nodes displacements (numpy.ndarray(n_edge_nodes, 2)).

_get_elem_node_index(elem_type, n_elems_per_dim, global_index)[source]

Get element node local index from global mesh index.

Shared nodes between adjacent elements are assumed to belong to the element from the lower coordinate side.

Parameters:
  • elem_type (str) – Finite element type.

  • n_elems_per_dim (tuple[int]) – Number of finite elements per dimension.

  • global_index (tuple[int]) – Global mesh node index.

Returns:

local_index – Finite element node index.

Return type:

tuple[int]

_get_matching_edges_idxs()[source]

Get matching edges indexes along each dimension.

Returns:

matching_edges_idxs_per_dim – For each dimension (key, str[int]), store maching edges internal indexes (item, tuple[tuple]). Matching edges share the same connectivities with respect to corners.

Return type:

dict

_get_mesh_boundary_nodes_disps(edges_coords_ref, edges_coords_def, mesh_nodes_matrix, mesh_nodes_coords_ref, is_interp_face_disps=True)[source]

Compute finite element patch boundary displacements.

Parameters:
  • edges_coords_ref (dict[list[numpy.ndarray(2d)]]) – For each dimension (key, str[int]), store the corresponding edges coordinates in the reference configuration (item, list[numpy.ndarray(2d)]). Each edge coordinates are stored as a numpy.ndarray(n_edge_nodes, n_dim). Corner nodes are assumed part of the edge.

  • edges_coords_def (dict[list[numpy.ndarray(2d)]]) – For each dimension (key, str[int]), store the corresponding edges coordinates in the deformed configuration (item, list[numpy.ndarray(2d)]). Each edge coordinates are stored as a numpy.ndarray(n_edge_nodes, n_dim). Corner nodes are assumed part of the edge.

  • mesh_nodes_matrix (numpy.ndarray(2d or 3d)) – Finite element mesh nodes matrix (numpy.ndarray[int](n_edge_nodes_per_dim) where each element corresponds to a given node position and whose value is set either as the global node label or zero (if the node does not exist). Nodes are labeled from 1 to n_nodes.

  • mesh_nodes_coords_ref (dict) – Coordinates (item, numpy.ndarray(n_dim)) of each finite element mesh node (key, str[int]) in the reference configuration. Nodes are labeled from 1 to n_nodes.

  • is_interp_face_disps (bool, default=True) – If True, then faces nodes displacements are computed by interpolating the corresponding edges nodes displacements. If False, then faces nodes degrees of freedom are left free.

Returns:

mesh_boundary_nodes_disps – Displacements (item, numpy.ndarray(n_dim)) prescribed on each finite element mesh boundary node (key, str[int]). Free degrees of freedom must be set as None.

Return type:

dict

_get_n_edge_nodes_per_dim(elem_type, n_elems_per_dim)[source]

Get number of patch edge nodes along each dimension.

Parameters:
  • elem_type (str) – Finite element type.

  • n_elems_per_dim (tuple[int]) – Number of finite elements per dimension.

Returns:

n_edge_nodes_per_dim – Number of patch edge nodes along each dimension.

Return type:

tuple[int]

static _get_node_label_from_coords(mesh_nodes_coords_ref, node_coords)[source]

Get finite element mesh node label from coordinates.

Parameters:
  • mesh_nodes_coords_ref (dict) – Coordinates (item, numpy.ndarray(n_dim)) of each finite element mesh node (key, str[int]) in the reference configuration. Nodes are labeled from 1 to n_nodes.

  • node_coords (numpy.ndarray(1d)) – Target node coordinates (numpy.ndarray(n_dim)).

Returns:

nodel_label – Target node label.

Return type:

str[int]

_get_orthogonal_dims(dim)[source]

Get orthogonal dimensions to given dimension.

Parameters:

dim (int) – Dimension.

Returns:

orthogonal_dims – Orthogonal dimensions to given dimension.

Return type:

tuple[int]

_get_patch_centroid(corners_coords, edges_coords)[source]

Compute patch centroid.

In the three-dimensional case, the patch (geometrical) centroid is approximated by the average of the corners coordinates.

Parameters:
  • corners_coords (numpy.ndarray(2d)) – Patch corners coordinates (numpy.ndarray(n_corners, n_dim)).

  • edges_coords (dict[list[numpy.ndarray(2d)]]) – For each dimension (key, str[int]), store the corresponding edges coordinates (item, list[numpy.ndarray(2d)]). Each edge coordinates are stored as a numpy.ndarray(n_edge_nodes, n_dim). Corner nodes are assumed part of the edge.

Returns:

centroid – Patch centroid.

Return type:

numpy.ndarray(2d)

_get_random_rigid_motions(translation_range, rotation_angles_range)[source]

Get random rigid body motion tensors (translation and rotation).

Parameters:
  • translation_range (dict, default=None) – Translational displacement range (item, tuple[float](2)) along each dimension (key, str[int]). Range is specified as tuple(min, max) for each dimension. Null range is assumed for unspecified dimensions. If None, then there is no translational motion.

  • rotation_angles_range (dict, default=None) – Rotational angle (degrees) range (item, tuple[float](2)) for each Euler angle (key, str). Euler angles follow Bunge convention (Z1-X2-Z3) and are labeled (‘alpha’, ‘beta’, ‘gamma’), respectively. Null range is assumed for unspecified angles. If None, then there is no rotational motion.

Returns:

  • translation (numpy.ndarray(1d)) – Translation array (numpy.ndarray(n_dim)).

  • rotation (numpy.ndarray(2d)) – Rotation tensor (for given rotation angle theta, active transformation (+ theta) and passive transformation (- theta)).

_is_admissible_simulation(edges_coords_def)[source]

Check whether simulation of patch is physically admissible.

Parameters:

edges_coords_def (dict[list[numpy.ndarray(2d)]]) – For each dimension (key, str[int]), store the corresponding edges coordinates (item, list[numpy.ndarray(2d)]) (deformed configuration). Each edge coordinates are stored as a numpy.ndarray(n_edge_nodes, n_dim). Corner nodes are assumed part of the edge.

Returns:

is_admissible – If True, the patch simulation is physically admissible.

Return type:

bool

static _polynomial_sampler(order, left_point, right_point, lower_bound=None, upper_bound=None, is_plot=False)[source]

Generate random polynomial by sampling points within given bounds.

Parameters:
  • order (int) – Order of polynomial.

  • left_point (tuple[float]) – Leftmost control point of polynomial. Sets sampling lower bound along first dimension.

  • right_point (tuple[float]) – Rightmost control point of polynomial. Sets sampling upper bound along first dimension.

  • lower_bound (float, default=None) – Sampling lower bound along second dimension. If None, lower bound is set from limit control points.

  • upper_bound (float, default=None) – Sampling upper bound along second dimension. If None, upper bound is set from limit control points.

  • is_plot (bool, default=False) – If True, plot randomly generated polynomial.

Returns:

coefficients – Polynomial coefficients sorted by increasing order terms.

Return type:

tuple[float]

static _rotate_coords_array(coords_array, r)[source]

Rotate coordinates array.

Parameters:
  • coords_array (numpy.ndarray(2d)) – Coordinates array (numpy.ndarray(n_points, n_dim)).

  • r (numpy.ndarray (2d)) – Rotation tensor (for given rotation angle theta, active transformation (+ theta) and passive transformation (- theta)).

Returns:

rot_coords_array – Coordinates array (numpy.ndarray(n_points, n_dim)).

Return type:

numpy.ndarray(2d)

_rotation_tensor_deformed_edge(edge_dim, edge_index, corners_coords_def)[source]

Set rotation tensor to deformed boundary edge local coordinates.

Parameters:
  • edge_dim (int) – Dimension along which edge is oriented in the reference configuration.

  • edge_index (int) – Edge index with respect to edges oriented along the corresponding dimension.

  • corners_coords_def (numpy.ndarray(2d)) – Patch corners coordinates in the deformed configuration (numpy.ndarray(n_corners, n_dim)).

Returns:

rotation – Rotation tensor (for given rotation angle theta, active transformation (- theta) and passive transformation (+ theta)).

Return type:

numpy.ndarray(2d)

_set_corners_attributes()[source]

Set patch corners attributes.

_set_corners_coords_ref()[source]

Set patch corners coordinates (reference configuration).

_set_edges_attributes()[source]

Set patch edges attributes.

_transform_from_edge_local_coordinates(local_nodes_coords_def, translation=None, rotation=None)[source]

Transform from deformed edge local coordinates to patch coordinates.

Parameters:
  • local_nodes_coords_def (numpy.ndarray(2d)) – Boundary edge nodes coordinates (deformed configuration) in deformed boundary edge local coordinates and stored as numpy.ndarray(n_edge_nodes, n_dim).

  • translation (numpy.ndarray(1d), default=None) – Translation from deformed boundary edge local coordinates to patch coordinates stored as numpy.ndarray(n_dim).

  • rotation (numpy.ndarray(2d), default=None) – Rotation tensor from deformed boundary edge local coordinates to patch coordinates stored as numpy.ndarray(n_dim, n_dim).

Returns:

nodes_coords_def – Boundary edge nodes coordinates (deformed configuration) stored as numpy.ndarray(n_edge_nodes, n_dim).

Return type:

numpy.ndarray(2d)

_transform_to_edge_local_coordinates(init_node_def, end_node_def, nodes_coords_ref, translation=None, rotation=None)[source]

Transform from patch coordinates to deformed edge local coordinates.

Parameters:
  • init_node_def (numpy.ndarray(2d)) – Boundary edge initial corner node coordinates (deformed configuration) stored as numpy.ndarray(n_dim).

  • end_node_def (numpy.ndarray(2d)) – Boundary edge ending corner node coordinates (deformed configuration) stored as numpy.ndarray(n_dim).

  • nodes_coords_ref (numpy.ndarray(2d)) – Boundary edge nodes coordinates (reference configuration) stored as numpy.ndarray(n_edge_nodes, n_dim).

  • translation (numpy.ndarray(1d), default=None) – Translation from patch coordinates to deformed boundary edge local coordinates stored as numpy.ndarray(n_dim).

  • rotation (numpy.ndarray(2d), default=None) – Rotation tensor from patch coordinates to deformed boundary edge local coordinates stored as numpy.ndarray(n_dim, n_dim).

Returns:

  • local_init_node_def (numpy.ndarray(1d)) – Boundary edge initial corner node coordinates (deformed configuration) in deformed boundary edge local coordinates stored as numpy.ndarray(n_dim).

  • local_end_node_def (numpy.ndarray(1d)) – Boundary edge ending corner node coordinates (deformed configuration) in deformed boundary edge local coordinates stored as numpy.ndarray(n_dim).

  • local_nodes_coords_ref (numpy.ndarray(2d)) – Boundary edge nodes coordinates (reference configuration) in deformed boundary edge local coordinates stored as numpy.ndarray(n_edge_nodes, n_dim).

generate_deformed_patch(elem_type, n_elems_per_dim, corners_lab_bc=None, corners_lab_disp_range=None, edges_lab_def_order=None, edges_lab_disp_range=None, translation_range=None, rotation_angles_range=None, deformation_noise=0.0, max_iter=10, is_verbose=False)[source]

Generate finite element deformed patch.

Parameters:
  • elem_type (str) – Finite element type.

  • n_elems_per_dim (tuple[int]) – Number of finite elements per dimension.

  • corners_lab_bc (dict, default=None) – Boundary conditions (item, tuple[int](n_dim)) for each patch corner label (key, str[int]). Corners are labeled from 1 to number of corners. The tuple[int](n_dim) prescribes 0 (free) or 1 (fixed) for each degree of freedom. Corners are labeled from 1 to number of corners. Unspecified corners are assumed free by default.

  • corners_lab_disp_range (dict, default=None) – Displacement range along each dimension (item, tuple[tuple(2)]) for each corner label (key, str[int]). Corners are labeled from 1 to number of corners. Range is specified as tuple(min, max) for each dimension. If None, a null displacement range is set by default.

  • edges_lab_def_order ({int, dict}, default=None) – Deformation polynomial order (item, int) for each edge label (key, str[int]). Edges are labeled from 1 to number of edges. If a single order is provided, then it is assumed for all the edges. Zero order is assumed for unspecified edges. If None, zero order is assumed for all the edges.

  • edges_lab_disp_range (dict, default=None) – Displacement range (item, tuple[float](2)) for each edge label (key, str[int]). Edges are labeled from 1 to number of edges. Range is specified as a tuple(min, max) where: (1) displacement range is orthogonal and relative to the edge (defined by limiting corner nodes in the deformed configuration), (2) positive/negative displacement corresponds to outward/inward direction with respect to the patch. Null displacement range is assumed for unspecified edges. If None, null displacement range is set by default.

  • translation_range (dict, default=None) – Translational displacement range (item, tuple[float](2)) along each dimension (key, str[int]). Range is specified as tuple(min, max) for each dimension. Null range is assumed for unspecified dimensions. If None, then there is no translational motion.

  • rotation_angles_range (dict, default=None) – Rotational angle (degrees) range (item, tuple[float](2)) for each Euler angle (key, str). Euler angles follow Bunge convention (Z1-X2-Z3) and are labeled (‘alpha’, ‘beta’, ‘gamma’), respectively. Null range is assumed for unspecified angles. If None, then there is no rotational motion.

  • deformation_noise (float, default=0.0) – Parameter that controls the normally distributed noise superimposed to the boundary edges interior nodes coordinates in the deformed configuration. Defines the noise standard deviation along given dimension after being multiplied by the corresponding patch size.

  • max_iter (int, default=10) – Maximum number of iterations to get a geometrically admissible deformed patch configuration.

  • is_verbose (bool, default=False) – If True, enable verbose output.

Returns:

  • is_admissible (bool) – If True, the patch is geometrically admissible.

  • patch (FiniteElementPatch) – Finite element patch. If is_admissible is False, then returns None.