pysdic.GrayLevelGroups#

The pysdic.GrayLevelGroups stores the groups of integration points used to compute the statistics (mean and standard deviation) of the gray level corrections. It is created by pysdic.compute_gray_level_groups().

  • point_groups: the group of each point \((N_p,)\), whose statistics correct its gray level.

  • members: a sparse boolean matrix \((N_g, N_p)\), the row \(k\) giving the points used to compute the statistics of the group \(k\). The groups can overlap (neighborhoods of the elements).

class GrayLevelGroups(point_groups, point_elements, group_elements)[source]#

Bases: object

The groups of integration points used to compute the statistics of the gray level corrections (see compute_gray_level_groups()).

A group is a set of elements: the statistics of the group \(k\) are computed over the integration points located in the elements of the row \(k\) of group_elements. They are computed from the sums over each element (one pass over the points) and a single product with group_elements, whose size only depends on the mesh (not on the number of points per element).

The groups only depend on the connectivity of the mesh and on the elements of the points: compute them once and share them between the terms of the same points (see gray_level_groups of pysdic.SDICCorrelationTerm).

Parameters:
  • point_groups (numpy.ndarray) – An integer array of shape \((N_p,)\): the group of each point, whose statistics correct its gray level.

  • point_elements (numpy.ndarray) – An integer array of shape \((N_p,)\): the element of each point (all the points must be located, indices in \([0, N_e)\)).

  • group_elements (scipy.sparse.csr_matrix) – A matrix of shape \((N_g, N_e)\): the non-zero entries of the row \(k\) are the elements whose points are used to compute the statistics of the group \(k\). Converted once to a csr_matrix of ones in float64 (sorted indices).

Raises:

ValueError – If the shapes are not consistent or an index is out of range.

property members: csr_matrix#

[Get] The points of each group, a boolean csr_matrix of shape \((N_g, N_p)\) (sorted indices), computed at each call: group_elements @ location with \(\text{location}_{e,p} = 1\) if the point \(p\) is in the element \(e\).

Only needed by the exact derivatives of the corrections: its size is about the number of points per element times the size of group_elements.

property n_elements: int#

[Get] The number of elements \(N_e\) of the mesh.

property n_groups: int#

[Get] The number of groups \(N_g\).

property n_points: int#

[Get] The number of integration points \(N_p\).