hookeai.simulators.fetorch.element.type.tri3.FETri3¶
- class FETri3(n_gauss=1, device_type='cpu')[source]¶
Bases:
ElementTypeFETorch finite element: 3-Node Triangular.
- _nodes_local_coords¶
Nodes local coordinates stored as torch.Tensor(2d) of shape (n_node, n_dof_node).
- Type:
torch.Tensor(2d)
- _gp_coords¶
Gauss quadrature integration points (key, str[int]) local coordinates (item, torch.Tensor(1d)). Gauss integration points are labeled from 1 to n_gauss.
- Type:
- _gp_weights¶
Gauss quadrature integration points (key, str[int]) weights (item, float). Gauss integration points are labeled from 1 to n_gauss.
- Type:
- _device_type¶
Type of device on which torch.Tensor is allocated.
- Type:
{‘cpu’, ‘cuda’}
- _device¶
Device on which torch.Tensor is allocated.
- Type:
torch.device
- _set_node_local_coords(self)¶
Set nodes local coordinates.
- eval_shapefun_local_deriv(self, local_coords)[source]¶
Evaluate shape functions local derivates at given local coordinates.
Constructor.
- Parameters:
n_gauss (int, default=1) – Number of Gauss quadrature integration points.
device_type ({'cpu', 'cuda'}, default='cpu') – Type of device on which torch.Tensor is allocated.
List of Public Methods
Check if element shape functions satisfy known properties.
Evaluate shape functions at given local coordinates.
Evaluate shape functions local derivates at given local coordinates.
Get Gaussian quadrature points batched coordinates and weights.
Get device on which torch.Tensor is allocated.
Get Gaussian quadrature points local coordinates and weights.
Get number of degrees of freedom per node.
Get number of Gauss quadrature integration points.
Get number of nodes.
Set device on which torch.Tensor is allocated.
Methods
- __init__(n_gauss=1, device_type='cpu')[source]¶
Constructor.
- Parameters:
n_gauss (int, default=1) – Number of Gauss quadrature integration points.
device_type ({'cpu', 'cuda'}, default='cpu') – Type of device on which torch.Tensor is allocated.
- check_shape_functions_properties()¶
Check if element shape functions satisfy known properties.
- eval_shapefun(local_coords)[source]¶
Evaluate shape functions at given local coordinates.
- Parameters:
local_coords (torch.Tensor(1d)) – Local coordinates of point where shape functions are evaluated.
- Returns:
shape_fun – Shape functions evaluated at given local coordinates, sorted according with element nodes.
- Return type:
torch.Tensor(1d)
- eval_shapefun_local_deriv(local_coords)[source]¶
Evaluate shape functions local derivates at given local coordinates.
- Parameters:
local_coords (torch.Tensor(1d)) – Local coordinates of point where shape functions local derivatives are evaluated.
- Returns:
shape_fun_local_deriv – Shape functions local derivatives evaluated at given local coordinates, sorted according with element nodes. Derivative of the i-th shape function with respect to the j-th local coordinate is stored in shape_fun_local_deriv[i, j].
- Return type:
torch.Tensor(2d)
- get_batched_gauss_integration_points(device=None)¶
Get Gaussian quadrature points batched coordinates and weights.
- Parameters:
device (torch.device, default=None) – Device on which torch.Tensor is allocated.
- Returns:
gp_coords_tensor (torch.Tensor(2d)) – Gauss quadrature integration points local coordinates stored as torch.Tensor(2d) of shape (n_gauss, n_dim). Gauss integration points are sorted according with their label.
gp_weights_tensor (torch.Tensor(1d)) – Gauss quadrature integration points weights stored as torch.Tensor(1d) of shape (n_gauss,). Gauss integration points are sorted with their label.
- get_device()¶
Get device on which torch.Tensor is allocated.
- Returns:
device_type ({‘cpu’, ‘cuda’}) – Type of device on which torch.Tensor is allocated.
device (torch.device) – Device on which torch.Tensor is allocated.
- get_gauss_integration_points()¶
Get Gaussian quadrature points local coordinates and weights.
- Returns:
gp_coords (dict) – Gauss quadrature integration points (key, str[int]) local coordinates (item, torch.Tensor(1d)). Gauss integration points are labeled from 1 to n_gauss.
gp_weights (dict) – Gauss quadrature integration points (key, str[int]) weights (item, torch.Tensor(0d)). Gauss integration points are labeled from 1 to n_gauss.
- get_n_dof_node()¶
Get number of degrees of freedom per node.
- Returns:
n_dof_node – Number of degrees of freedom per node.
- Return type:
- get_n_gauss()¶
Get number of Gauss quadrature integration points.
- Returns:
n_gauss – Number of Gauss quadrature integration points.
- Return type:
- set_device(device_type)¶
Set device on which torch.Tensor is allocated.
- Parameters:
device_type ({'cpu', 'cuda'}) – Type of device on which torch.Tensor is allocated.
device (torch.device) – Device on which torch.Tensor is allocated.