hookeai.simulators.fetorch.element.type.tetra10.ElementType¶
- class ElementType(n_gauss=None, device_type='cpu')[source]¶
Bases:
ABCFETorch finite element interface.
- _node_local_coord¶
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, torch.Tensor(0d)). 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’}, default=’cpu’
- _device¶
Device on which torch.Tensor is allocated.
- Type:
torch.device
- eval_shapefun(self, local_coords)[source]¶
abstract: Evaluate shape functions at given local coordinates.
- eval_shapefun_local_deriv(self, local_coords)[source]¶
abstract: Evaluate shape functions local derivates at given local coordinates.
- get_gauss_integration_points(self)[source]¶
Get Gaussian quadrature points local coordinates and weights.
- check_shape_functions_properties(self)[source]¶
Check if element shape functions satisfy known properties.
Constructor.
- Parameters:
n_gauss (int, default=None) – 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
- abstract __init__(n_gauss=None, device_type='cpu')[source]¶
Constructor.
- Parameters:
n_gauss (int, default=None) – Number of Gauss quadrature integration points.
device_type ({'cpu', 'cuda'}, default='cpu') – Type of device on which torch.Tensor is allocated.
- abstract static _admissible_gauss_quadratures()[source]¶
Get admissible Gauss integration quadratures.
- check_shape_functions_properties()[source]¶
Check if element shape functions satisfy known properties.
- abstract 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)
- abstract 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)[source]¶
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()[source]¶
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()[source]¶
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()[source]¶
Get number of degrees of freedom per node.
- Returns:
n_dof_node – Number of degrees of freedom per node.
- Return type: