Utils

utils.azimuthalAverage()

Obtains radial distribution of field

Parameters:
  • u (A field variable to be averaged) –
  • r (Radial vector of same shape) –
  • bins (how many bins to do) –
Returns:

  • r (value of the radial component)
  • ur (the averaged field along radial direction)

utils.azimuthalAverage2()

Obtains radial distribution of field u

Parameters:u (A field defined on a grid of two-dimension) –
Returns:ur
Return type:the averaged field along radial direction
utils.bubble()
utils.droplet()
utils.ellipseDroplet()
utils.structureFactor()
  • Computes S(k) = <u(k)u(-k)> given the u(r)
  • This is computed using FFT of u to obtain u(k)
  • For a real field u, the multiplication of u(k)u(-k)

is same as (abs(u(k)))^2

Parameters:
  • u (A field on a grid in dim dimensions) –
  • dim (dimensionality) –
Returns:

Return type:

structureFactor defined (abs(u(k)))^2/N^2

utils.structureFactor()
  • Computes S(k) = <u(k)u(-k)> given the u(r)
  • This is computed using FFT of u to obtain u(k)
  • For a real field u, the multiplication of u(k)u(-k)

is same as (abs(u(k)))^2

Parameters:
  • u (A field on a grid in dim dimensions) –
  • dim (dimensionality) –
Returns:

Return type:

structureFactor defined (abs(u(k)))^2/N^2

Differentiation using loops (unlike pygl.dms)

class pygl.utils.FiniteDifference

Finite Difference using loops

diffx

computes d/dx u

diffx1

computes d/dx u

diffx2

computes d/dx u

diffy

computes d/dy u

diffy1

computes d/dy u

diffy2

computes d/dx u

lap2

computes d/dx u

laplacian

computes D^2 u