hookeai.simulators.fetorch.element.type.quad8.ElementType

class ElementType(n_gauss=None, device_type='cpu')[source]

Bases: ABC

FETorch finite element interface.

_name

Name.

Type:

str

_n_node

Number of nodes.

Type:

int

_n_dof_node

Number of degrees of freedom per node.

Type:

int

_node_local_coord

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, torch.Tensor(0d)). 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’}, default=’cpu’

_device

Device on which torch.Tensor is allocated.

Type:

torch.device

_set_nodes_local_coords(self)[source]

abstract: Set nodes local coordinates.

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.

_admissible_gauss_quadratures()[source]

abstract: Get admissible Gauss integration quadratures.

get_n_node(self)[source]

Get number of nodes.

get_n_dof_node(self)[source]

Get number of degrees of freedom per node.

get_n_gauss(self)[source]

Get number of Gauss quadrature integration points.

get_gauss_integration_points(self)[source]

Get Gaussian quadrature points local coordinates and weights.

set_device(self, device_type)[source]

Set device on which torch.Tensor is allocated.

get_device(self)[source]

Get device on which torch.Tensor is allocated.

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

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.

Returns:

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

Return type:

tuple[int]

abstract _set_nodes_local_coords()[source]

Set nodes local coordinates.

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:

int

get_n_gauss()[source]

Get number of Gauss quadrature integration points.

Returns:

n_gauss – Number of Gauss quadrature integration points.

Return type:

int

get_n_node()[source]

Get number of nodes.

Returns:

n_node – Number of nodes.

Return type:

int

set_device(device_type)[source]

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.