Package ComboCode :: Package cc :: Package modeling :: Package profilers :: Module Grainsize :: Class Distribution
[hide private]
[frames] | no frames]

Class Distribution

source code


An interface for a grain size distribution as a function of grain size and radius, and for given minimum and maximum grain sizes.

Instance Methods [hide private]
 
__init__(self, r, a, func, *args, **kwargs)
Create an instance of the Distribution() class.
source code
array/float
__call__(self, *args, **kwargs)
Evaluate the profile function at a coordinate point.
source code
array/float
eval(self, x=None, y=None, warn=1, w_sputter=0.0, w=array([], dtype=float64))
Evaluate the grain-size distribution function at a coordinate point.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, r, a, func, *args, **kwargs)
(Constructor)

source code 

Create an instance of the Distribution() class. Requires a radial and a grain size grid.

The function can also be given as an interpolation object.

The optional args and kwargs give the additional arguments for the temperature function, which are ignored in case func is an interpolation object.

Parameters:
  • r (array) - The radial points (cm)
  • a (array) - The grain size points (cm). Must include minimum and maximum grain sizes, unless manually declared in kwargs.
  • func (function/interpolation object) - The function that describes the grain size distribution. Can be given as an interpolation object.
  • args (tuple) - Additional parameters passed to the functions when eval or diff are called.

    (default: [])

  • kwargs (dict) - Additional keywords passed to the functions when eval or diff are called.

    (default: {})

Overrides: object.__init__

__call__(self, *args, **kwargs)
(Call operator)

source code 

Evaluate the profile function at a coordinate point.

Passes all args and kwargs on the call to self.eval().

Parameters:
  • x - The primary coordinate point(s). If None, the default coordinate grid is used.

    (default: None)

  • y - The secondary coordinate point(s). If None, the default coordinate grid is used.

    (default: None)

  • warn - Warn when extrapolation occurs.

    (default: 1)

Returns: array/float
The profile evaluated at x and y
Overrides: cc.modeling.profilers.Profiler.Profiler2D.__call__

eval(self, x=None, y=None, warn=1, w_sputter=0.0, w=array([], dtype=float64))

source code 

Evaluate the grain-size distribution function at a coordinate point.

x/y can be any value or array. If func is an interpolation object, it is in principle limited by the x/y-range of the interpolator. It is advised not to extend much beyond the given x/y-range.

If one of the two variables is None, it is replaced by the default grid.

Sputtering can be applied here by passing the drift array and the max drift velocity to the call. Any grain sizes with a drift above w_sputter will have their number density set to 0. This depends on both the grain size and the radius.

Parameters:
  • x (array/float) - The primary coordinate point(s). If None, the default coordinate grid is used.

    (default: None)

  • y (array/float) - The secondary coordinate point(s). If None, the default coordinate grid is used.

    (default: None)

  • warn (bool) - Warn when extrapolation occurs.

    (default: 1)

  • w_sputter (float) - The sputtering drift velocity above which the number density is set to zero. Default in case no sputtering is to be applied.

    (default: 0.)

  • w (array) - The Drift() object. Only relevant when w_sputter is nonzero.

    (default: np.empty(0))

Returns: array/float
The profile evaluated at x and y
Overrides: cc.modeling.profilers.Profiler.Profiler2D.eval