Variable#
- class Variable#
Bases:
FieldQuantityRepresent a physical variable field, e.g. magnetization.
- __init__(impl)#
- set(value)#
Set the variable value.
- Parameters:
value (tuple of floats, ndarray, or callable) – The new value for the variable field can be set uniformly with a tuple of floats. The number of floats should match the number of components. Or the new value can be set cell by cell with an ndarray with the same shape as this variable, or with a function which returns the cell value as a function of the position.
See also
- set_in_region(region_idx, value)#
Set a static value in a specified region.
- Parameters:
region_idx (int) – The index of the region the variable must be set in.
value (float, tuple of floats, or callable) – Value to assign within the specified region. The value may be either a uniform scalar or vector matching the number of variable components, or a callable that takes grid coordinates and returns a compatible value.
See also
- get()#
Get the variable value.