cf_c

This module is a C-extension and provides a fast implementation for the computation of:
  • the deformation gradient

  • the first Piola-Kirchhoff stress tensor

  • the configurational stresses

  • the configurational forces

Examples

>>> import numpy
>>> element_type = "CPE4R"
>>> method = "mbf"
>>> X_at_nodes = numpy.array([
...     [0., 0.],
...     [2., 0.],
...     [2., 2.],
...     [0., 2.],
... ])
>>> F_expected = numpy.array([
...     [1.1, 0.0],
...     [0.0, 0.9],
... ])
>>> U_at_nodes = X_at_nodes @ (F_expected - np.eye(2))
>>> S_at_int_points = numpy.array([[
...     [200., 0.],
...     [0., 0.]
... ]])
>>> e_at_int_points = numpy.array([20.])

The deformation gradient for the first (and only) element is evaluated at the first integration point in the element.

>>> element_id = 0
>>> int_point_id = 0
>>> compute_F(
...     [X_at_nodes],
...     [U_at_nodes],
...     element_type
... )[element_id, int_point_id]
array([[1.1, 0. ],
       [0. , 0.9]])

The first Piola-Kirchhoff stress tensor is computed at the same position as the deformation gradient.

>>> compute_P(
...     [X_at_nodes],
...     [U_at_nodes],
...     [S_at_int_points],
...     element_type
... )[element_id, int_point_id]
array([[180.,   0.],
       [  0.,   0.]])

The configuration stresses are computed using the motion based formulation “mbf” method (see conforce_gen.expressions.eval_CS_mbf()).

>>> compute_CS(
...     [e_at_int_points],
...     [X_at_nodes],
...     [U_at_nodes],
...     [S_at_int_points],
...     element_type,
...     method
... )[element_id, int_point_id]
array([[-178.,   -0.],
       [  -0.,   20.]])

The configuration forces are evaluated at the nodes of each element.

>>> compute_CF(
...     [e_at_int_points],
...     [X_at_nodes],
...     [U_at_nodes],
...     [S_at_int_points],
...     element_type,
...     method
... )[element_id]
array([[ 178.,  -20.],
       [-178.,  -20.],
       [-178.,   20.],
       [ 178.,   20.]])

Functions

compute_CF(e_at_int_points, X_at_nodes, ...)

Compute the configurational forces for num_elem elements of the given element type.

compute_CF_for_C3D10_using_dbf(...)

Compute the configurational forces for num_elem elements of typ C3D10.

compute_CF_for_C3D10_using_mbf(...)

Compute the configurational forces for num_elem elements of typ C3D10.

compute_CF_for_C3D15_using_dbf(...)

Compute the configurational forces for num_elem elements of typ C3D15.

compute_CF_for_C3D15_using_mbf(...)

Compute the configurational forces for num_elem elements of typ C3D15.

compute_CF_for_C3D20R_using_dbf(...)

Compute the configurational forces for num_elem elements of typ C3D20R.

compute_CF_for_C3D20R_using_mbf(...)

Compute the configurational forces for num_elem elements of typ C3D20R.

compute_CF_for_C3D20_using_dbf(...)

Compute the configurational forces for num_elem elements of typ C3D20.

compute_CF_for_C3D20_using_mbf(...)

Compute the configurational forces for num_elem elements of typ C3D20.

compute_CF_for_C3D4_using_dbf(...)

Compute the configurational forces for num_elem elements of typ C3D4.

compute_CF_for_C3D4_using_mbf(...)

Compute the configurational forces for num_elem elements of typ C3D4.

compute_CF_for_C3D6_using_dbf(...)

Compute the configurational forces for num_elem elements of typ C3D6.

compute_CF_for_C3D6_using_mbf(...)

Compute the configurational forces for num_elem elements of typ C3D6.

compute_CF_for_C3D8R_using_dbf(...)

Compute the configurational forces for num_elem elements of typ C3D8R.

compute_CF_for_C3D8R_using_mbf(...)

Compute the configurational forces for num_elem elements of typ C3D8R.

compute_CF_for_C3D8_using_dbf(...)

Compute the configurational forces for num_elem elements of typ C3D8.

compute_CF_for_C3D8_using_mbf(...)

Compute the configurational forces for num_elem elements of typ C3D8.

compute_CF_for_CPE3_using_dbf(...)

Compute the configurational forces for num_elem elements of typ CPE3.

compute_CF_for_CPE3_using_mbf(...)

Compute the configurational forces for num_elem elements of typ CPE3.

compute_CF_for_CPE4R_using_dbf(...)

Compute the configurational forces for num_elem elements of typ CPE4R.

compute_CF_for_CPE4R_using_mbf(...)

Compute the configurational forces for num_elem elements of typ CPE4R.

compute_CF_for_CPE4_using_dbf(...)

Compute the configurational forces for num_elem elements of typ CPE4.

compute_CF_for_CPE4_using_mbf(...)

Compute the configurational forces for num_elem elements of typ CPE4.

compute_CF_for_CPE6_using_dbf(...)

Compute the configurational forces for num_elem elements of typ CPE6.

compute_CF_for_CPE6_using_mbf(...)

Compute the configurational forces for num_elem elements of typ CPE6.

compute_CF_for_CPE8R_using_dbf(...)

Compute the configurational forces for num_elem elements of typ CPE8R.

compute_CF_for_CPE8R_using_mbf(...)

Compute the configurational forces for num_elem elements of typ CPE8R.

compute_CF_for_CPE8_using_dbf(...)

Compute the configurational forces for num_elem elements of typ CPE8.

compute_CF_for_CPE8_using_mbf(...)

Compute the configurational forces for num_elem elements of typ CPE8.

compute_CS(e_at_int_points, X_at_nodes, ...)

Compute the configurational stresses for num_elem elements of the given element type.

compute_CS_for_C3D10_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ C3D10.

compute_CS_for_C3D10_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ C3D10.

compute_CS_for_C3D15_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ C3D15.

compute_CS_for_C3D15_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ C3D15.

compute_CS_for_C3D20R_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ C3D20R.

compute_CS_for_C3D20R_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ C3D20R.

compute_CS_for_C3D20_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ C3D20.

compute_CS_for_C3D20_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ C3D20.

compute_CS_for_C3D4_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ C3D4.

compute_CS_for_C3D4_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ C3D4.

compute_CS_for_C3D6_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ C3D6.

compute_CS_for_C3D6_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ C3D6.

compute_CS_for_C3D8R_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ C3D8R.

compute_CS_for_C3D8R_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ C3D8R.

compute_CS_for_C3D8_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ C3D8.

compute_CS_for_C3D8_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ C3D8.

compute_CS_for_CPE3_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ CPE3.

compute_CS_for_CPE3_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ CPE3.

compute_CS_for_CPE4R_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ CPE4R.

compute_CS_for_CPE4R_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ CPE4R.

compute_CS_for_CPE4_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ CPE4.

compute_CS_for_CPE4_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ CPE4.

compute_CS_for_CPE6_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ CPE6.

compute_CS_for_CPE6_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ CPE6.

compute_CS_for_CPE8R_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ CPE8R.

compute_CS_for_CPE8R_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ CPE8R.

compute_CS_for_CPE8_using_dbf(...)

Compute the configurational stresses for num_elem elements of typ CPE8.

compute_CS_for_CPE8_using_mbf(...)

Compute the configurational stresses for num_elem elements of typ CPE8.

compute_F(X_at_nodes, U_at_nodes, element_type)

Compute the deformation gradients for num_elem elements of the given element type.

compute_F_for_C3D10(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ C3D10.

compute_F_for_C3D15(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ C3D15.

compute_F_for_C3D20(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ C3D20.

compute_F_for_C3D20R(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ C3D20R.

compute_F_for_C3D4(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ C3D4.

compute_F_for_C3D6(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ C3D6.

compute_F_for_C3D8(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ C3D8.

compute_F_for_C3D8R(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ C3D8R.

compute_F_for_CPE3(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ CPE3.

compute_F_for_CPE4(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ CPE4.

compute_F_for_CPE4R(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ CPE4R.

compute_F_for_CPE6(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ CPE6.

compute_F_for_CPE8(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ CPE8.

compute_F_for_CPE8R(X_at_nodes, U_at_nodes)

Compute the deformation gradients for num_elem elements of typ CPE8R.

compute_P(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of the given element type.

compute_P_for_C3D10(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ C3D10.

compute_P_for_C3D15(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ C3D15.

compute_P_for_C3D20(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ C3D20.

compute_P_for_C3D20R(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ C3D20R.

compute_P_for_C3D4(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ C3D4.

compute_P_for_C3D6(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ C3D6.

compute_P_for_C3D8(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ C3D8.

compute_P_for_C3D8R(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ C3D8R.

compute_P_for_CPE3(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ CPE3.

compute_P_for_CPE4(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ CPE4.

compute_P_for_CPE4R(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ CPE4R.

compute_P_for_CPE6(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ CPE6.

compute_P_for_CPE8(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ CPE8.

compute_P_for_CPE8R(X_at_nodes, U_at_nodes, ...)

Compute the first Piola-Kirchhoff stress tensors for num_elem elements of typ CPE8R.

Classes

ElementInfo(number_of_dimensions, ...)

Create new instance of ElementInfo(number_of_dimensions, number_of_nodes, number_of_integration_points)

Attributes

map_type_to_info

mapping of element type name to ElementInfo

map_type_to_F_function

mapping of element type name to the function that computes the deformation gradient

map_type_to_P_function

mapping of element type name to the function that computes the first Piola-Kirchhoff stresses

map_type_and_method_to_CS_function

mapping of element type name and method to the function that computes the configurational stresses

map_type_and_method_to_CF_function

mapping of element type name and method to the function that computes the configurational forces