pyoomph.expressions.utils module

class pyoomph.expressions.utils.DeterministicRandomField(min_x=[0], max_x=[1], amplitude=1.0, Nresolution=100, interpolation='linear')[source]

Bases: CustomMathExpression

Creates a random field in 1d, 2d or 3d. The field is created by a random cloud of points, which is interpolated using scipy’s RegularGridInterpolator. The field is then evaluated at the given point. Ranges must be set via min_x=[xmin,<ymin>,<zmin>] and same for max_x.

Parameters:
  • min_x (Union[float, List[float]]) – Minimum values of the field in each dimension. If a single value is given, it is assumed that the field is 1D.

  • max_x (Union[float, List[float]]) – Maximum values of the field in each dimension. If a single value is given, it is assumed that the field is 1D.

  • amplitude (float) – Amplitude of the random field.

  • Nresolution (int) – Number of points in each dimension of the random cloud.

  • interpolation (str) – Interpolation method. Default is “linear”.