plask.flow

Data flow classes for standard properties.

This module contains providers, receivers, and filters for standard properties. These classes are present in binary solvers, but you may also use them in your custom Python solvers.

Providers and Receivers

Existing providers can be connected to receivers by using a simple assignment operator:

>>> first_solver.inTemperature = second_solver.outTemperature

You can manually retrieve data from any provider or a connected receiver by calling it like a function:

>>> second_solver.outTemperature(mymesh)
<plask.Data at 0x584c140>
>>> first_solver.inTemperature(mymesh, 'spline')
<plask.Data at 0x584c140>

Providers and receivers of most quantities give spatial distributions of the corresponding fields and, thus, require the target mesh as its argument. In addition you may specify the interpolation method as in the example above. If the interpolation method is omitted, its default value, depending is assumed by the solver automatically.

Some properties (e.g. the light intensity) require the result number given as the first argument (this is e.g. the consecutive mode number). Others take some optional arguments that are specified at the end (e.g. the gain requires to be given the wavelength at which the gain is computed.

In PLaSK you can create your custom Python solvers. They may contain the default providers and receivers defined here. Receivers are simple objects that can be attached to providers later and read as shown above. On the contrary, providers require you to create a callable that returns the data to be provided when requested.

Example

To create the solver that gets temperature from another source and increases it by 60 K, use the following class:

>>> class Hotter:
...     def __init__(self):
...         self.inTemperature = flow.TemperatureReceiver2D()
...         self.outTemperature = flow.TemperatureProvider2D(
...             lambda mesh, meth: self.get_data(mesh, meth))
...     def get_data(self, mesh, method):
...         temp = self.inTemperature(mesh, method)
...         return temp.array + 60.

Filters

Filters are solver-like classes that translate the fields computed in one geometry to another one. This geometry can have either the same or different dimension.

All filter classes are used the same way. They are constructed with a single argument, which is a target geometry. The type of this geometry must match the suffix of the filter (2D for two-dimensional Cartesian geometry, Cyl for axi-symmetric cylindrical geometry, and 3D for three-dimensional one. An example temperature filter for target 2D geometry can be constructed as follows:

>>> temp_filter = flow.TemperatureFilter2D(mygeometry2d)

Having an existing filter, you may attach a source provider to it, using bracket indexing. The index is a geometry object either existing in the target geometry or containing it (e.g. a geometry.Extrusion object that is the root of the my_geometry_2d geometry). The indexed element is a proper data receiver that can be used for connecting the source data.

>>> temp_filter[some_object_in_mygeometry2d]
<plask.ReceiverForTemperature2D at 0x43a5210>
>>> temp_filter[mygeometry2d.extrusion]
<plask.ReceiverForTemperature3D at 0x44751a0>
>>> temp_filter[mygeometry2d.extrusion] = thermal_solver_3d.outTemperature

After connecting the source, the translated data can be obtained using the filter member out, which is a provider that can be connected to other solvers.

>>> temp_filter.out
<plask.ProviderForTemperature2D at 0x43a5fa0>
>>> other_solver_in_2d.inTemperature = temp_filter.out

After the connection the filter does its job automatically.

See also

Data Filters.

Definition of filters in the XPL file: filter tag.

Example using filters: sec-tutorial-threshold-of-array.

Classes

BandEdgesFilter2D

Data filter for conduction and valence band edges into Cartesian2D geometry.

BandEdgesFilter3D

Data filter for conduction and valence band edges into Cartesian3D geometry.

BandEdgesFilterCyl

Data filter for conduction and valence band edges into Cylindrical geometry.

BandEdgesProvider2D

Provider of the conduction and valence band edges in Cartesian2D geometry (eV).

BandEdgesProvider3D

Provider of the conduction and valence band edges in Cartesian3D geometry (eV).

BandEdgesProviderCyl

Provider of the conduction and valence band edges in Cylindrical geometry (eV).

BandEdgesReceiver2D

Receiver of the conduction and valence band edges in Cartesian2D geometry (eV).

BandEdgesReceiver3D

Receiver of the conduction and valence band edges in Cartesian3D geometry (eV).

BandEdgesReceiverCyl

Receiver of the conduction and valence band edges in Cylindrical geometry (eV).

CarriersConcentrationFilter2D

Data filter for carriers concentration into Cartesian2D geometry.

CarriersConcentrationFilter3D

Data filter for carriers concentration into Cartesian3D geometry.

CarriersConcentrationFilterCyl

Data filter for carriers concentration into Cylindrical geometry.

CarriersConcentrationProvider2D

Provider of the carriers concentration in Cartesian2D geometry (1/cm³).

CarriersConcentrationProvider3D

Provider of the carriers concentration in Cartesian3D geometry (1/cm³).

CarriersConcentrationProviderCyl

Provider of the carriers concentration in Cylindrical geometry (1/cm³).

CarriersConcentrationReceiver2D

Receiver of the carriers concentration in Cartesian2D geometry (1/cm³).

CarriersConcentrationReceiver3D

Receiver of the carriers concentration in Cartesian3D geometry (1/cm³).

CarriersConcentrationReceiverCyl

Receiver of the carriers concentration in Cylindrical geometry (1/cm³).

ConductivityFilter2D

Data filter for electrical conductivity into Cartesian2D geometry.

ConductivityFilter3D

Data filter for electrical conductivity into Cartesian3D geometry.

ConductivityFilterCyl

Data filter for electrical conductivity into Cylindrical geometry.

ConductivityProvider2D

Provider of the electrical conductivity in Cartesian2D geometry (S/m).

ConductivityProvider3D

Provider of the electrical conductivity in Cartesian3D geometry (S/m).

ConductivityProviderCyl

Provider of the electrical conductivity in Cylindrical geometry (S/m).

ConductivityReceiver2D

Receiver of the electrical conductivity in Cartesian2D geometry (S/m).

ConductivityReceiver3D

Receiver of the electrical conductivity in Cartesian3D geometry (S/m).

ConductivityReceiverCyl

Receiver of the electrical conductivity in Cylindrical geometry (S/m).

CurrentDensityFilter2D

Data filter for current density into Cartesian2D geometry.

CurrentDensityFilter3D

Data filter for current density into Cartesian3D geometry.

CurrentDensityFilterCyl

Data filter for current density into Cylindrical geometry.

CurrentDensityProvider2D

Provider of the current density in Cartesian2D geometry (kA/cm²).

CurrentDensityProvider3D

Provider of the current density in Cartesian3D geometry (kA/cm²).

CurrentDensityProviderCyl

Provider of the current density in Cylindrical geometry (kA/cm²).

CurrentDensityReceiver2D

Receiver of the current density in Cartesian2D geometry (kA/cm²).

CurrentDensityReceiver3D

Receiver of the current density in Cartesian3D geometry (kA/cm²).

CurrentDensityReceiverCyl

Receiver of the current density in Cylindrical geometry (kA/cm²).

EnergyLevelsProvider2D

Provider of the energy levels for electrons and holes in Cartesian2D geometry (eV).

EnergyLevelsProvider3D

Provider of the energy levels for electrons and holes in Cartesian3D geometry (eV).

EnergyLevelsProviderCyl

Provider of the energy levels for electrons and holes in Cylindrical geometry (eV).

EnergyLevelsReceiver2D

Receiver of the energy levels for electrons and holes in Cartesian2D geometry (eV).

EnergyLevelsReceiver3D

Receiver of the energy levels for electrons and holes in Cartesian3D geometry (eV).

EnergyLevelsReceiverCyl

Receiver of the energy levels for electrons and holes in Cylindrical geometry (eV).

EpsilonFilter2D

Data filter for permittivity tensor into Cartesian2D geometry.

EpsilonFilter3D

Data filter for permittivity tensor into Cartesian3D geometry.

EpsilonFilterCyl

Data filter for permittivity tensor into Cylindrical geometry.

EpsilonProvider2D

Provider of the permittivity tensor in Cartesian2D geometry (-).

EpsilonProvider3D

Provider of the permittivity tensor in Cartesian3D geometry (-).

EpsilonProviderCyl

Provider of the permittivity tensor in Cylindrical geometry (-).

EpsilonReceiver2D

Receiver of the permittivity tensor in Cartesian2D geometry (-).

EpsilonReceiver3D

Receiver of the permittivity tensor in Cartesian3D geometry (-).

EpsilonReceiverCyl

Receiver of the permittivity tensor in Cylindrical geometry (-).

FermiLevelsFilter2D

Data filter for quasi-Fermi levels for electrons and holes into Cartesian2D geometry.

FermiLevelsFilter3D

Data filter for quasi-Fermi levels for electrons and holes into Cartesian3D geometry.

FermiLevelsFilterCyl

Data filter for quasi-Fermi levels for electrons and holes into Cylindrical geometry.

FermiLevelsProvider2D

Provider of the quasi-Fermi levels for electrons and holes in Cartesian2D geometry (eV).

FermiLevelsProvider3D

Provider of the quasi-Fermi levels for electrons and holes in Cartesian3D geometry (eV).

FermiLevelsProviderCyl

Provider of the quasi-Fermi levels for electrons and holes in Cylindrical geometry (eV).

FermiLevelsReceiver2D

Receiver of the quasi-Fermi levels for electrons and holes in Cartesian2D geometry (eV).

FermiLevelsReceiver3D

Receiver of the quasi-Fermi levels for electrons and holes in Cartesian3D geometry (eV).

FermiLevelsReceiverCyl

Receiver of the quasi-Fermi levels for electrons and holes in Cylindrical geometry (eV).

GainFilter2D

Data filter for material gain into Cartesian2D geometry.

GainFilter3D

Data filter for material gain into Cartesian3D geometry.

GainFilterCyl

Data filter for material gain into Cylindrical geometry.

GainProvider2D

Provider of the material gain in Cartesian2D geometry (1/cm).

GainProvider3D

Provider of the material gain in Cartesian3D geometry (1/cm).

GainProviderCyl

Provider of the material gain in Cylindrical geometry (1/cm).

GainReceiver2D

Receiver of the material gain in Cartesian2D geometry (1/cm).

GainReceiver3D

Receiver of the material gain in Cartesian3D geometry (1/cm).

GainReceiverCyl

Receiver of the material gain in Cylindrical geometry (1/cm).

HeatFilter2D

Data filter for heat sources density into Cartesian2D geometry.

HeatFilter3D

Data filter for heat sources density into Cartesian3D geometry.

HeatFilterCyl

Data filter for heat sources density into Cylindrical geometry.

HeatFluxFilter2D

Data filter for heat flux into Cartesian2D geometry.

HeatFluxFilter3D

Data filter for heat flux into Cartesian3D geometry.

HeatFluxFilterCyl

Data filter for heat flux into Cylindrical geometry.

HeatFluxProvider2D

Provider of the heat flux in Cartesian2D geometry (W/m²).

HeatFluxProvider3D

Provider of the heat flux in Cartesian3D geometry (W/m²).

HeatFluxProviderCyl

Provider of the heat flux in Cylindrical geometry (W/m²).

HeatFluxReceiver2D

Receiver of the heat flux in Cartesian2D geometry (W/m²).

HeatFluxReceiver3D

Receiver of the heat flux in Cartesian3D geometry (W/m²).

HeatFluxReceiverCyl

Receiver of the heat flux in Cylindrical geometry (W/m²).

HeatProvider2D

Provider of the heat sources density in Cartesian2D geometry (W/m³).

HeatProvider3D

Provider of the heat sources density in Cartesian3D geometry (W/m³).

HeatProviderCyl

Provider of the heat sources density in Cylindrical geometry (W/m³).

HeatReceiver2D

Receiver of the heat sources density in Cartesian2D geometry (W/m³).

HeatReceiver3D

Receiver of the heat sources density in Cartesian3D geometry (W/m³).

HeatReceiverCyl

Receiver of the heat sources density in Cylindrical geometry (W/m³).

HeatSumProvider2D

Combined provider for heat sources density.

HeatSumProviderCyl

Combined provider for heat sources density.

LightEFilter2D

Data filter for electric field into Cartesian2D geometry.

LightEFilter3D

Data filter for electric field into Cartesian3D geometry.

LightEFilterCyl

Data filter for electric field into Cylindrical geometry.

LightEProvider2D

Provider of the electric field in Cartesian2D geometry (V/m).

LightEProvider3D

Provider of the electric field in Cartesian3D geometry (V/m).

LightEProviderCyl

Provider of the electric field in Cylindrical geometry (V/m).

LightEReceiver2D

Receiver of the electric field in Cartesian2D geometry (V/m).

LightEReceiver3D

Receiver of the electric field in Cartesian3D geometry (V/m).

LightEReceiverCyl

Receiver of the electric field in Cylindrical geometry (V/m).

LightHFilter2D

Data filter for magnetic field into Cartesian2D geometry.

LightHFilter3D

Data filter for magnetic field into Cartesian3D geometry.

LightHFilterCyl

Data filter for magnetic field into Cylindrical geometry.

LightHProvider2D

Provider of the magnetic field in Cartesian2D geometry (A/m).

LightHProvider3D

Provider of the magnetic field in Cartesian3D geometry (A/m).

LightHProviderCyl

Provider of the magnetic field in Cylindrical geometry (A/m).

LightHReceiver2D

Receiver of the magnetic field in Cartesian2D geometry (A/m).

LightHReceiver3D

Receiver of the magnetic field in Cartesian3D geometry (A/m).

LightHReceiverCyl

Receiver of the magnetic field in Cylindrical geometry (A/m).

LightMagnitudeFilter2D

Data filter for optical field magnitude into Cartesian2D geometry.

LightMagnitudeFilter3D

Data filter for optical field magnitude into Cartesian3D geometry.

LightMagnitudeFilterCyl

Data filter for optical field magnitude into Cylindrical geometry.

LightMagnitudeProvider2D

Provider of the optical field magnitude in Cartesian2D geometry (W/m²).

LightMagnitudeProvider3D

Provider of the optical field magnitude in Cartesian3D geometry (W/m²).

LightMagnitudeProviderCyl

Provider of the optical field magnitude in Cylindrical geometry (W/m²).

LightMagnitudeReceiver2D

Receiver of the optical field magnitude in Cartesian2D geometry (W/m²).

LightMagnitudeReceiver3D

Receiver of the optical field magnitude in Cartesian3D geometry (W/m²).

LightMagnitudeReceiverCyl

Receiver of the optical field magnitude in Cylindrical geometry (W/m²).

LuminescenceFilter2D

Data filter for luminescence into Cartesian2D geometry.

LuminescenceFilter3D

Data filter for luminescence into Cartesian3D geometry.

LuminescenceFilterCyl

Data filter for luminescence into Cylindrical geometry.

LuminescenceProvider2D

Provider of the luminescence in Cartesian2D geometry (a.u.).

LuminescenceProvider3D

Provider of the luminescence in Cartesian3D geometry (a.u.).

LuminescenceProviderCyl

Provider of the luminescence in Cylindrical geometry (a.u.).

LuminescenceReceiver2D

Receiver of the luminescence in Cartesian2D geometry (a.u.).

LuminescenceReceiver3D

Receiver of the luminescence in Cartesian3D geometry (a.u.).

LuminescenceReceiverCyl

Receiver of the luminescence in Cylindrical geometry (a.u.).

ModeEffectiveIndexProvider

Provider of the effective index (-).

ModeEffectiveIndexReceiver

Receiver of the effective index (-).

ModeLightEFilter2D

Data filter for electric field into Cartesian2D geometry.

ModeLightEFilter3D

Data filter for electric field into Cartesian3D geometry.

ModeLightEFilterCyl

Data filter for electric field into Cylindrical geometry.

ModeLightEProvider2D

Provider of the electric field in Cartesian2D geometry (V/m).

ModeLightEProvider3D

Provider of the electric field in Cartesian3D geometry (V/m).

ModeLightEProviderCyl

Provider of the electric field in Cylindrical geometry (V/m).

ModeLightEReceiver2D

Receiver of the electric field in Cartesian2D geometry (V/m).

ModeLightEReceiver3D

Receiver of the electric field in Cartesian3D geometry (V/m).

ModeLightEReceiverCyl

Receiver of the electric field in Cylindrical geometry (V/m).

ModeLightHFilter2D

Data filter for magnetic field into Cartesian2D geometry.

ModeLightHFilter3D

Data filter for magnetic field into Cartesian3D geometry.

ModeLightHFilterCyl

Data filter for magnetic field into Cylindrical geometry.

ModeLightHProvider2D

Provider of the magnetic field in Cartesian2D geometry (A/m).

ModeLightHProvider3D

Provider of the magnetic field in Cartesian3D geometry (A/m).

ModeLightHProviderCyl

Provider of the magnetic field in Cylindrical geometry (A/m).

ModeLightHReceiver2D

Receiver of the magnetic field in Cartesian2D geometry (A/m).

ModeLightHReceiver3D

Receiver of the magnetic field in Cartesian3D geometry (A/m).

ModeLightHReceiverCyl

Receiver of the magnetic field in Cylindrical geometry (A/m).

ModeLightMagnitudeFilter2D

Data filter for optical field magnitude into Cartesian2D geometry.

ModeLightMagnitudeFilter3D

Data filter for optical field magnitude into Cartesian3D geometry.

ModeLightMagnitudeFilterCyl

Data filter for optical field magnitude into Cylindrical geometry.

ModeLightMagnitudeProvider2D

Provider of the optical field magnitude in Cartesian2D geometry (W/m²).

ModeLightMagnitudeProvider3D

Provider of the optical field magnitude in Cartesian3D geometry (W/m²).

ModeLightMagnitudeProviderCyl

Provider of the optical field magnitude in Cylindrical geometry (W/m²).

ModeLightMagnitudeReceiver2D

Receiver of the optical field magnitude in Cartesian2D geometry (W/m²).

ModeLightMagnitudeReceiver3D

Receiver of the optical field magnitude in Cartesian3D geometry (W/m²).

ModeLightMagnitudeReceiverCyl

Receiver of the optical field magnitude in Cylindrical geometry (W/m²).

ModeLossProvider

Provider of the modal extinction (1/cm).

ModeLossReceiver

Receiver of the modal extinction (1/cm).

ModePropagationConstantProvider

Provider of the propagation constant (1/µm).

ModePropagationConstantReceiver

Receiver of the propagation constant (1/µm).

ModeWavelengthProvider

Provider of the wavelength (nm).

ModeWavelengthReceiver

Receiver of the wavelength (nm).

PotentialFilter2D

Data filter for potential into Cartesian2D geometry.

PotentialFilter3D

Data filter for potential into Cartesian3D geometry.

PotentialFilterCyl

Data filter for potential into Cylindrical geometry.

PotentialProvider2D

Provider of the potential in Cartesian2D geometry (V).

PotentialProvider3D

Provider of the potential in Cartesian3D geometry (V).

PotentialProviderCyl

Provider of the potential in Cylindrical geometry (V).

PotentialReceiver2D

Receiver of the potential in Cartesian2D geometry (V).

PotentialReceiver3D

Receiver of the potential in Cartesian3D geometry (V).

PotentialReceiverCyl

Receiver of the potential in Cylindrical geometry (V).

RefractiveIndexFilter2D

Data filter for refractive index into Cartesian2D geometry.

RefractiveIndexFilter3D

Data filter for refractive index into Cartesian3D geometry.

RefractiveIndexFilterCyl

Data filter for refractive index into Cylindrical geometry.

RefractiveIndexProvider2D

Provider of the refractive index in Cartesian2D geometry (-).

RefractiveIndexProvider3D

Provider of the refractive index in Cartesian3D geometry (-).

RefractiveIndexProviderCyl

Provider of the refractive index in Cylindrical geometry (-).

RefractiveIndexReceiver2D

Receiver of the refractive index in Cartesian2D geometry (-).

RefractiveIndexReceiver3D

Receiver of the refractive index in Cartesian3D geometry (-).

RefractiveIndexReceiverCyl

Receiver of the refractive index in Cylindrical geometry (-).

TemperatureFilter2D

Data filter for temperature into Cartesian2D geometry.

TemperatureFilter3D

Data filter for temperature into Cartesian3D geometry.

TemperatureFilterCyl

Data filter for temperature into Cylindrical geometry.

TemperatureProvider2D

Provider of the temperature in Cartesian2D geometry (K).

TemperatureProvider3D

Provider of the temperature in Cartesian3D geometry (K).

TemperatureProviderCyl

Provider of the temperature in Cylindrical geometry (K).

TemperatureReceiver2D

Receiver of the temperature in Cartesian2D geometry (K).

TemperatureReceiver3D

Receiver of the temperature in Cartesian3D geometry (K).

TemperatureReceiverCyl

Receiver of the temperature in Cylindrical geometry (K).

ThermalConductivityFilter2D

Data filter for thermal conductivity into Cartesian2D geometry.

ThermalConductivityFilter3D

Data filter for thermal conductivity into Cartesian3D geometry.

ThermalConductivityFilterCyl

Data filter for thermal conductivity into Cylindrical geometry.

ThermalConductivityProvider2D

Provider of the thermal conductivity in Cartesian2D geometry (W/(m×K)).

ThermalConductivityProvider3D

Provider of the thermal conductivity in Cartesian3D geometry (W/(m×K)).

ThermalConductivityProviderCyl

Provider of the thermal conductivity in Cylindrical geometry (W/(m×K)).

ThermalConductivityReceiver2D

Receiver of the thermal conductivity in Cartesian2D geometry (W/(m×K)).

ThermalConductivityReceiver3D

Receiver of the thermal conductivity in Cartesian3D geometry (W/(m×K)).

ThermalConductivityReceiverCyl

Receiver of the thermal conductivity in Cylindrical geometry (W/(m×K)).

VoltageFilter2D

Data filter for voltage into Cartesian2D geometry.

VoltageFilter3D

Data filter for voltage into Cartesian3D geometry.

VoltageFilterCyl

Data filter for voltage into Cylindrical geometry.

VoltageProvider2D

Provider of the voltage in Cartesian2D geometry (V).

VoltageProvider3D

Provider of the voltage in Cartesian3D geometry (V).

VoltageProviderCyl

Provider of the voltage in Cylindrical geometry (V).

VoltageReceiver2D

Receiver of the voltage in Cartesian2D geometry (V).

VoltageReceiver3D

Receiver of the voltage in Cartesian3D geometry (V).

VoltageReceiverCyl

Receiver of the voltage in Cylindrical geometry (V).