RefractiveIndexProvider2D Class¶
- class plask.flow.RefractiveIndexProvider2D(data)¶
Provider of the refractive index in Cartesian2D geometry (-).
This class is used for refractive index provider in binary solvers. You can also create a custom provider for your Python solver.
- Parameters:
data –
Data
object to interpolate or callable returning it for given mesh. The callable must accept the same arguments as the provider__call__
method (see below). It must also be able to give its length (i.e. have the__len__
method defined) that gives the number of different provided values.
To obtain the value from the provider simply call it. The call signature is as follows:
- solver.outRefractiveIndex(comp, mesh, lam=DEFAULT, interpolation='default')¶
- Parameters:
comp (str) – Component of a diagonal refractive index derivative to return. Can be ‘ll’, ‘tt’, ‘vv’, or equivalent using current axes names. For scalar solvers this argument is ignored and can be skipped.
mesh (mesh) – Target mesh to get the field at.
interpolation (str) – Requested interpolation method.
lam (float) – Complex wavelength at which the refractive index is computed (nm).
- Returns:
Data with the refractive index on the specified mesh (-).
You may obtain the number of different values this provider can return by testing its length.
Example
Connect the provider to a receiver in some other solver:
>>> other_solver.inRefractiveIndex = solver.outRefractiveIndex
Obtain the provided field:
>>> solver.outRefractiveIndex(0, mesh, lam=DEFAULT) <plask.Data at 0x1234567>
Test the number of provided values:
>>> len(solver.outRefractiveIndex) 3
See also
Receiver of refractive index:
plask.flow.RefractiveIndexReceiver2D
Data filter for refractive index:plask.flow.RefractiveIndexFilter2D
Methods¶
|
Get value from the provider. |
Inform all connected receivers that the provided value has changed. |
Descriptions¶
Method Details¶
- RefractiveIndexProvider2D.__call__(comp, mesh, lam, interpolation='DEFAULT')¶
- RefractiveIndexProvider2D.__call__(mesh, lam, interpolation='DEFAULT')
- RefractiveIndexProvider2D.__call__(mesh, interpolation='DEFAULT')
- RefractiveIndexProvider2D.__call__(comp, mesh, interpolation='DEFAULT')
Get value from the provider.
- Parameters:
comp (str) – Component of a diagonal refractive index derivative to return. Can be ‘ll’, ‘tt’, ‘vv’, or equivalent using current axes names. For scalar solvers this argument is ignored and can be skipped.
mesh (mesh) – Target mesh to get the field at.
interpolation (str) – Requested interpolation method.
lam (float) – Complex wavelength at which the refractive index is computed (nm).
- RefractiveIndexProvider2D.set_changed()¶
Inform all connected receivers that the provided value has changed.
The receivers will have its changed attribute set to True and solvers will call the provider again if they need its value (otherwise they might take it from the cache.