grains.dic.DIC

class grains.dic.DIC(u, v)[source]

Performs operations on digital image correlation data.

Parameters

u, v (ndarray) – The two components of the displacement field, discretized on a rectangular grid.

Raises

ValueError – If the displacement components are not discretized on the same grid or if the grid size is not at least 3-by-3. This latter requirement is not a problem in practice (which camera is not capable of shooting photos in 9 pixels resolution?), while it allows the evaluation of the numerical derivatives with second order accuracy on the boundaries too.

Notes

Throughout the class methods, the following terms are used. When not precised, image refers to the DIC data plotted as an image. We can perceive the image as a pixel grid, in which the vertices are the centres of the pixels. An image coordinate system \((X,Y)\) can be defined on this grid such that the vertices have integer coordinates, the origin \(A\) is at the top left hand corner, and the \(Y\)-axis points towards the right, while the \(X\)-axis points to the bottom. When the experimental result is compared with a numerical solution (assumed to be available at the nodes of a mesh), one needs to map values defined on the DIC grid onto the nodes of the mesh, and vice versa. The mesh exists on the physical domain, for which a physical coordinate system \((x,y)\) is attached to. Hence, there is a need to express \((X,Y)\) in terms of \((x,y)\). Let \(A(a_x,a_y)\) be the origin of the \((X,Y)\) coordinate system given in terms of the \(x,y\) coordinates, and \(s[\mathrm{pixel/mm}]\) is the scale for the DIC image. The coordinate transformation is then given by

\[\begin{split}\begin{gather} x = a_x + \frac{Y}{s} \\ y = a_y - \frac{X}{s} \end{gather}\end{split}\]

The DIC grid in the physical coordinate system \((x,y)\) is called physical grid.

It should be noted that the special alignment of \((x,y)\) with respect to \((X,Y)\) is not a major constraint. In practical applications (when a Cartesian coordinate system is used), the orientation of \((x,y)\) in this way is a convention.

__init__(u, v)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(u, v)

Initialize self.

equivalent_strain(strain_tensor, strain_measure)

Computes a scalar quantity from the strain tensor.

plot_displacement(component[, ax])

Plots a component of the displacement field.

plot_physicalgrid([ax])

Plots the DIC grid in the physical coordinate system.

plot_pixelgrid([ax])

Plots the DIC grid in the image coordinate system.

plot_strain(component[, minval, maxval, …])

Plots a component of the infinitesimal strain tensor.

plot_superimposedmesh(mesh, *args, **kwargs)

Plots the DIC grid with a mesh superimposed on it.

project_onto_grid(nodes, nodal_values[, method])

Project a numerically computed field onto the DIC grid.

project_onto_mesh(nodes[, method])

Project the experimental displacement field onto a mesh.

set_transformation(origin, …)

Sets the transformation rule between the pixel and the physical coordinate systems.

strain(strain_measure)

Computes the strain tensor from the displacement vector.