hookeai.material_model_finder.data.specimen_data.SpecimenNumericalData

class SpecimenNumericalData[source]

Bases: object

Specimen numerical data translated from experimental results.

After discretizing the specimen in a suitable finite element mesh, the experimental results are translated to numerical data, namely the nodes displacement history and reaction forces history.

specimen_mesh

Specimen finite element mesh.

Type:

StructureMesh

nodes_disps_mesh_hist

Displacements history of finite element mesh nodes stored as torch.Tensor(3d) of shape (n_node_mesh, n_dim, n_time).

Type:

torch.Tensor(3d)

reaction_forces_mesh_hist

Reaction forces (Dirichlet boundary conditions) history of finite element mesh nodes stored as torch.Tensor(3d) of shape (n_node_mesh, n_dim, n_time).

Type:

torch.Tensor(3d)

dirichlet_bc_mesh_hist

Dirichlet boundary constraints history of finite element mesh nodes stored as torch.Tensor(3d) of shape (n_node_mesh, n_dim, n_time). Encodes if each degree of freedom is free (assigned 0) or constrained (greater than 0) under Dirichlet boundary conditions. The encoding depends on the selected force equilibrium loss type.

Type:

torch.Tensor(3d)

time_hist

Discrete time history.

Type:

torch.Tensor(1d)

set_specimen_mesh(self, nodes_coords_mesh_init, elements_type, connectivities)[source]

Set the specimen finite element mesh.

set_specimen_data(self, nodes_disps_mesh_hist, reaction_forces_mesh_hist)[source]

Set specimen numerical data translated from experimental results.

update_specimen_mesh_configuration(self, time_idx, is_update_coords=True)[source]

Update the specimen mesh configuration for given discrete time.

get_batched_mesh_configuration_hist(self, is_update_coords=True)[source]

Get batched finite element mesh configuration history.

get_element_nodes_field_hist(self, element_nodes, nodes_field_mesh_hist)[source]

Get field history of finite element nodes.

get_n_dim(self)[source]

Get number of spatial dimensions.

check_dirichlet_bc_mesh_hist(self, force_equilibrium_loss_type)[source]

Check if Dirichlet boundary constraints history is admissible.

Constructor.

List of Public Methods

check_dirichlet_bc_mesh_hist

Check if Dirichlet boundary constraints history is admissible.

get_batched_mesh_configuration_hist

Get batched finite element mesh configuration history.

get_element_nodes_field_hist

Get field history of finite element nodes.

get_n_dim

Get number of spatial dimensions.

set_specimen_data

Set specimen numerical data translated from experimental results.

set_specimen_mesh

Set the specimen finite element mesh.

update_specimen_mesh_configuration

Update the specimen mesh configuration for given discrete time.

Methods

__init__()[source]

Constructor.

check_dirichlet_bc_mesh_hist(force_equilibrium_loss_type)[source]

Check if Dirichlet boundary constraints history is admissible.

Dirichlet boundary constraints history must be consistent with the selected force equilibrium loss type in the material model finder.

Parameters:

force_equilibrium_loss_type (str) – Type of force equilibrium loss.

get_batched_mesh_configuration_hist(is_update_coords=True, device=None)[source]

Get batched finite element mesh configuration history.

Batching operation over elements requires that all finite element mesh elements share the same element type (number of nodes).

Parameters:
  • is_update_coords (bool, default=True) – If False, then finite element mesh nodes coordinates are kept fixed throughout history. If True, then finite element mesh nodes coordinates are computed from nodes displacements history.

  • device (torch.device, default=None) – Device on which torch.Tensor is allocated.

Returns:

  • elements_coords_hist (torch.Tensor(4d)) – Coordinates history of finite element mesh elements nodes stored as torch.Tensor(4d) of shape (n_elem, n_node, n_dim, n_time).

  • elements_disps_hist (torch.Tensor(4d)) – Displacements history of finite element mesh elements nodes stored as torch.Tensor(4d) of shape (n_elem, n_node, n_dim, n_time).

get_element_nodes_field_hist(element_nodes, nodes_field_mesh_hist)[source]

Get field history of finite element nodes.

Parameters:
  • element_nodes (torch.Tensor(1d)) – Finite element mesh element connectitivities stored as torch.Tensor(1d) of shape (n_node,). Nodes are labeled from 1 to n_node_mesh.

  • nodes_field_mesh_hist (torch.Tensor(3d)) – Field history of finite element mesh nodes stored as torch.Tensor(3d) of shape (n_node_mesh, n_dim, n_time).

Returns:

element_nodes_hist – Field history of finite element nodes stored as torch.Tensor(3d) of shape (n_node, n_dim, n_time).

Return type:

torch.Tensor(3d)

get_n_dim()[source]

Get number of spatial dimensions.

Returns:

n_dim – Number of spatial dimensions.

Return type:

int

set_specimen_data(nodes_disps_mesh_hist, reaction_forces_mesh_hist, dirichlet_bc_mesh_hist, time_hist)[source]

Set specimen numerical data translated from experimental results.

Parameters:
  • nodes_disps_mesh_hist (torch.Tensor(3d)) – Displacements history of finite element mesh nodes stored as torch.Tensor(3d) of shape (n_node_mesh, n_dim, n_time).

  • reaction_forces_mesh_hist (torch.Tensor(3d)) – Reaction forces (Dirichlet boundary conditions) history of finite element mesh nodes stored as torch.Tensor(3d) of shape (n_node_mesh, n_dim, n_time).

  • dirichlet_bc_mesh_hist (torch.Tensor(3d)) – Dirichlet boundary constraints history of finite element mesh nodes stored as torch.Tensor(3d) of shape (n_node_mesh, n_dim, n_time). Encodes if each degree of freedom is free (assigned 0) or constrained (greater than 0) under Dirichlet boundary conditions. The encoding depends on the selected force equilibrium loss type.

  • time_hist (torch.Tensor(1d)) – Discrete time history.

set_specimen_mesh(nodes_coords_mesh_init, elements_type, connectivities, dirichlet_bool_mesh)[source]

Set the specimen finite element mesh.

Parameters:
  • nodes_coords_mesh_init (torch.Tensor(2d)) – Initial coordinates of finite element mesh nodes stored as torch.Tensor(2d) of shape (n_node_mesh, n_dim).

  • elements_type (dict) – FETorch element type (item, ElementType) of each finite element mesh element (str[int]). Elements labels must be within the range of 1 to n_elem (included).

  • connectivities (dict) – Nodes (item, tuple[int]) of each finite element mesh element (key, str[int]). Nodes must be within the range of 1 to n_node_mesh (included). Elements labels must be within the range of 1 to n_elem (included).

  • dirichlet_bool_mesh (torch.Tensor(2d)) – Degrees of freedom of finite element mesh subject to Dirichlet boundary conditions. Stored as torch.Tensor(2d) of shape (n_node_mesh, n_dim) where constrained degrees of freedom are labeled 1, otherwise 0.

update_specimen_mesh_configuration(time_idx, is_update_coords=True)[source]

Update the specimen mesh configuration for given discrete time.

For a given discrete time, the known nodes displacement history is used to update the specimen finite element mesh nodes coordinates and displacements. A similar update is performed for the last converged mesh configuration.

Parameters:
  • time_idx (int) – Discrete time index.

  • is_update_coords (bool, default=True) – If False, then only updates the displacements of the finite element mesh nodes, leaving the nodes coordinates unchanged. If True, then update both coordinates and displacements of finite element mesh nodes.