hookeai.simulators.fetorch.element.type.tetra10.FETetra10

class FETetra10(n_gauss=4, device_type='cpu')[source]

Bases: ElementType

FETorch finite element: 10-Node Tetrahedral.

_name

Name.

Type:

str

_n_node

Number of nodes.

Type:

int

_n_dof_node

Number of degrees of freedom per node.

Type:

int

_nodes_local_coords

Nodes local coordinates stored as torch.Tensor(2d) of shape (n_node, n_dof_node).

Type:

torch.Tensor(2d)

_n_gauss

Number of Gauss quadrature integration points.

Type:

int

_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:

dict

_gp_weights

Gauss quadrature integration points (key, str[int]) weights (item, float). Gauss integration points are labeled from 1 to n_gauss.

Type:

dict

_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(self, local_coords)[source]

Evaluate shape functions at given local coordinates.

eval_shapefun_local_deriv(self, local_coords)[source]

Evaluate shape functions local derivates at given local coordinates.

_admissible_gauss_quadratures()[source]

Get admissible Gauss integration quadratures.

Constructor.

Parameters:
  • n_gauss (int, default=4) – 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_shape_functions_properties

Check if element shape functions satisfy known properties.

eval_shapefun

Evaluate shape functions at given local coordinates.

eval_shapefun_local_deriv

Evaluate shape functions local derivates at given local coordinates.

get_batched_gauss_integration_points

Get Gaussian quadrature points batched coordinates and weights.

get_device

Get device on which torch.Tensor is allocated.

get_gauss_integration_points

Get Gaussian quadrature points local coordinates and weights.

get_n_dof_node

Get number of degrees of freedom per node.

get_n_gauss

Get number of Gauss quadrature integration points.

get_n_node

Get number of nodes.

set_device

Set device on which torch.Tensor is allocated.

Methods

__init__(n_gauss=4, device_type='cpu')[source]

Constructor.

Parameters:
  • n_gauss (int, default=4) – Number of Gauss quadrature integration points.

  • device_type ({'cpu', 'cuda'}, default='cpu') – Type of device on which torch.Tensor is allocated.

static _admissible_gauss_quadratures()[source]

Get admissible Gauss integration quadratures.

Returns:

admissible_n_gauss – Admissible Gauss integration quadratures (number of Gauss integration points).

Return type:

tuple[int]

_set_nodes_local_coords()[source]

Set nodes local coordinates.

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:

int

get_n_gauss()

Get number of Gauss quadrature integration points.

Returns:

n_gauss – Number of Gauss quadrature integration points.

Return type:

int

get_n_node()

Get number of nodes.

Returns:

n_node – Number of nodes.

Return type:

int

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.