hookeai.data_generation.spdg.patch_generator.FiniteElementPatch¶
- class FiniteElementPatch(n_dim, patch_dims, elem_type, n_elems_per_dim, mesh_nodes_matrix, mesh_nodes_coords_ref, mesh_boundary_nodes_disps)[source]¶
Bases:
objectFinite element material patch.
Material patch is assumed quadrilateral (2d) or parallelepipedic (3D) and discretized in a regular finite element mesh of quadrilateral (2d) / hexahedral (3d) finite elements.
- _mesh_nodes_matrix¶
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.
- Type:
numpy.ndarray(2d or 3d)
- _mesh_nodes_coords_ref¶
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.
- Type:
- _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.
- Type:
- get_mesh_nodes_coords_ref(self)[source]¶
Get reference coordinates of each finite element mesh node.
- get_mesh_boundary_nodes_disps(self)[source]¶
Get displacements prescribed on finite element mesh boundary nodes.
- plot_deformed_patch(self, is_hide_axes=False, is_show_fixed_dof=False,
is_hide_deformed_faces=True, is_show_plot=False, is_save_plot=False, save_directory=None, plot_name=None, is_overwrite_file=False)
Generate plot of material patch.
Constructor.
- Parameters:
n_dim (int) – Number of spatial dimensions.
elem_type (str) – Finite element type.
n_elems_per_dim (tuple[int]) – Number of finite elements per dimension.
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.
mesh_boundary_nodes_disps (dict) – 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.
List of Public Methods
Get finite element mesh boundary edges nodes labels.
Get finite element mesh boundary nodes labels.
Get finite element size along each dimension.
Get finite element type.
Get displacements prescribed on finite element mesh boundary nodes.
Get finite element mesh connected nodes pairs.
Get reference coordinates of each finite element mesh node.
Get finite element mesh nodes matrix.
Get number of spatial dimensions.
Get number of patch edge nodes along each dimension.
Get number of finite elements per dimension.
Get finite element material patch attributes.
Generate plot of finite element material patch.
Methods
- __init__(n_dim, patch_dims, elem_type, n_elems_per_dim, mesh_nodes_matrix, mesh_nodes_coords_ref, mesh_boundary_nodes_disps)[source]¶
Constructor.
- Parameters:
n_dim (int) – Number of spatial dimensions.
elem_type (str) – Finite element type.
n_elems_per_dim (tuple[int]) – Number of finite elements per dimension.
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.
mesh_boundary_nodes_disps (dict) – 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.
- get_elem_size_dims()[source]¶
Get finite element size along each dimension.
- Returns:
elem_size_dims – Finite element size along each dimension.
- Return type:
- get_elem_type()[source]¶
Get finite element type.
- Returns:
elem_type – Finite element type.
- Return type:
- get_mesh_boundary_nodes_disps()[source]¶
Get displacements prescribed on finite element mesh boundary nodes.
- 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:
- get_mesh_nodes_coords_ref()[source]¶
Get reference coordinates of each finite element mesh node.
- Returns:
mesh_nodes_coords_ref – 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.
- Return type:
- get_mesh_nodes_matrix()[source]¶
Get finite element mesh nodes matrix.
- Returns:
mesh_nodes_matrix – 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.
- Return type:
numpy.ndarray(2d or 3d)
- get_n_dim()[source]¶
Get number of spatial dimensions.
- Returns:
n_dim – Number of spatial dimensions.
- Return type:
- get_patch_attributes()[source]¶
Get finite element material patch attributes.
- Returns:
patch_attributes – Material patch attributes.
- Return type:
- plot_deformed_patch(is_hide_axes=False, is_show_fixed_dof=False, is_hide_deformed_faces=True, is_show_plot=False, is_save_plot=False, save_directory=None, plot_name=None, is_overwrite_file=False)[source]¶
Generate plot of finite element material patch.
Deformed configuration is only plotted if all boundary degrees of freedom displacements are prescribed.
- Parameters:
is_hide_axes (bool, default=False) – If True, then hide all visual components of axes.
is_show_fixed_dof (bool, default=False) – If True, then signal fixed boundary degrees of freedom.
is_hide_deformed_faces (bool, default=True) – If True, then hide boundary faces nodes deformed configuration when available. Only effective for three-dimensional patch.
is_show_plot (bool, default=False) – Display plot of finite element material patch if True.
is_save_plot (bool, default=False) – Save plot of finite element material patch. Plot is only saved if save_directory is provided and exists.
save_directory (str, default=None) – Directory where plot of finite element material patch is stored.
plot_name (str, default=None) – Filename of finite element material patch plot.
is_overwrite_file (bool, default=False) – Overwrite plot of finite element material patch if True, otherwise generate non-existent file path by extending the original file path with an integer.