PLaSK library
Loading...
Searching...
No Matches
meta.shockley.threshold.ThresholdSearch Class Reference
Inheritance diagram for meta.shockley.threshold.ThresholdSearch:
[legend]
Collaboration diagram for meta.shockley.threshold.ThresholdSearch:
[legend]

Public Member Functions

 __init__ (self, name)
 
 reconnect (self)
 
 on_initialize (self)
 
 on_invalidate (self)
 
 get_lam (self)
 
 compute_thermoelectric (self)
 
 step (self, volt, save=False)
 
 get_optical_determinant (self, lam)
 
 get_junction_concentrations (self, interpolation='linear')
 
 get_junction_gains (self, axis=None, interpolation='linear')
 
 get_gain_spectrum (self, lams, pos=0., junction=0)
 
 plot_junction_concentration (self, bounds=True, interpolation='linear', label=None, **kwargs)
 
 plot_junction_gain (self, axis=None, bounds=True, interpolation='linear', label=None, **kwargs)
 
 plot_gain_spectrum (self, lams, pos=0., junction=0, comp=None, **kwargs)
 
 plot_optical_determinant (self, lams, **kwargs)
 
 compute (self, save=True, invalidate=False, group='ThresholdSearch', stepsave=False)
 
 save (self, filename=None, group='ThresholdSearch', optical_resolution=None)
 
 get_optical_field (self, resolution=None)
 
 get_optical_field_horizontal (self, resolution=None, interpolation='linear')
 
 get_optical_field_vertical (self, pos=0.01, offset=0.5, resolution=None, interpolation='linear')
 
 plot_optical_field (self, resolution=None, geometry_color='0.75', geometry_alpha=0.35, geometry_lw=1.0, **kwargs)
 
 plot_optical_field_horizontal (self, resolution=None, bounds=True, interpolation='linear', **kwargs)
 
 plot_optical_field_vertical (self, pos=0.01, offset=0.5, resolution=None, interpolation='linear', **kwargs)
 
- Public Member Functions inherited from meta.shockley.thermoelectric.ThermoElectric
 load_xpl (self, xpl, manager)
 
 get_total_current (self, nact=0)
 
 get_temperature (self)
 
 get_voltage (self)
 
 get_vertical_voltage (self, at=0)
 
 get_junction_currents (self, refine=16, interpolation='linear')
 
 plot_temperature (self, geometry_color='0.75', mesh_color=None, geometry_alpha=0.35, mesh_alpha=0.15, geometry_lw=1.0, mesh_lw=1.0, **kwargs)
 
 plot_voltage (self, geometry_color='0.75', mesh_color=None, geometry_alpha=0.35, mesh_alpha=0.15, geometry_lw=1.0, mesh_lw=1.0, **kwargs)
 
 plot_vertical_voltage (self, at=0., **kwargs)
 
 plot_junction_current (self, refine=16, bounds=True, interpolation='linear', label=None, **kwargs)
 
- Public Member Functions inherited from plask::Solver
bool initCalculation ()
 This should be called on beginning of each calculation method to ensure that solver will be initialized.
 
 Solver (const std::string &name="")
 Construct uninitialized solver.
 
virtual ~Solver ()
 Virtual destructor (for subclassing). Do nothing.
 
virtual void loadConfiguration (XMLReader &source, Manager &manager)
 Load configuration from given source.
 
void parseStandardConfiguration (XMLReader &source, Manager &manager, const std::string &expected_msg="solver configuration element")
 Load standard configuration (geometry, mesh) tags from source.
 
bool isInitialized ()
 Check if solver is already initialized.
 
void invalidate ()
 This method should be and is called if something important was changed: calculation space, mesh, etc.
 
virtual std::string getClassName () const =0
 Get name of solver.
 
std::string getId () const
 Get solver id.
 
std::string getName () const
 
virtual std::string getClassDescription () const
 Get a description of this solver.
 
template<typename ArgT = double, typename ValT = double>
DataLog< ArgT, ValTdataLog (const std::string &chart_name, const std::string &axis_arg_name, const std::string &axis_val_name)
 
template<typename ArgT = double, typename ValT = double>
DataLog< ArgT, ValTdataLog (const std::string &axis_arg_name, const std::string &axis_val_name)
 
template<typename ... Args>
void writelog (LogLevel level, std::string msg, Args &&... params) const
 Log a message for this solver.
 

Public Attributes

 diffusion
 
 gain
 
 optical
 
 threshold_voltage
 
 threshold_current
 
 modeno
 
 ivb
 
 vtol
 
 maxiter
 
 quick
 
 optical_resolution
 
 skip_thermal
 
 get_lam
 
- Public Attributes inherited from meta.shockley.thermoelectric.ThermoElectric
 thermal
 
 electrical
 
 tfreq
 

Static Public Attributes

float tfreq = 6.0
 
 vmin = None
 
 vmax = None
 
tuple optical_resolution = (800, 600)
 
int vtol = 1e-5
 
bool quick = False
 
int maxiter = 50
 
bool skip_thermal = False
 

Protected Member Functions

 _parse_xpl (self, tag, manager)
 
 _optargs (self)
 
 _get_lam (self)
 
 _quickstep (self, arg)
 
 _get_in_junction (self, func, axis=None)
 
 _plot_in_junction (self, func, axis, bounds, kwargs, label)
 
 _get_info (self)
 
- Protected Member Functions inherited from meta.shockley.thermoelectric.ThermoElectric
 _read_attr (self, tag, attr, solver, type=None, pyattr=None)
 
 _parse_fem_tag (self, tag, manager, solver)
 
 _save_thermoelectric (self, h5file, group)
 
 _plot_hbounds (self, solver)
 
 _get_defines_info (self)
 
- Protected Member Functions inherited from plask::Solver
virtual void onInitialize ()
 Initialize the solver.
 
virtual void onInvalidate ()
 This method is called by invalidate() to reset stored values.
 

Protected Attributes

 _invalidate
 
 _sn
 
 _max_concentration
 
 _max_gain
 
 _quickscale
 
- Protected Attributes inherited from plask::Solver
bool initialized
 true only if solver is initialized
 

Static Protected Attributes

dict _OPTICAL_ROOTS = {}
 
 _Diffusion = None
 
 _Gain = None
 
 _Optical = None
 
str _optarg = 'lam'
 
str _lam0 = 'lam0'
 
- Static Protected Attributes inherited from meta.shockley.thermoelectric.ThermoElectric
 _Thermal = None
 
 _Electrical = None
 

Additional Inherited Members

- Static Protected Member Functions inherited from meta.shockley.thermoelectric.ThermoElectric
 _iter_levels (geometry, mesh, *required)
 

Detailed Description

Definition at line 37 of file threshold.py.

Constructor & Destructor Documentation

◆ __init__()

Member Function Documentation

◆ _get_in_junction()

meta.shockley.threshold.ThresholdSearch._get_in_junction (   self,
  func,
  axis = None 
)
protected

Definition at line 255 of file threshold.py.

◆ _get_info()

◆ _get_lam()

meta.shockley.threshold.ThresholdSearch._get_lam (   self)
protected

Definition at line 149 of file threshold.py.

◆ _optargs()

meta.shockley.threshold.ThresholdSearch._optargs (   self)
protected

◆ _parse_xpl()

meta.shockley.threshold.ThresholdSearch._parse_xpl (   self,
  tag,
  manager 
)
protected

◆ _plot_in_junction()

meta.shockley.threshold.ThresholdSearch._plot_in_junction (   self,
  func,
  axis,
  bounds,
  kwargs,
  label 
)
protected

Definition at line 316 of file threshold.py.

◆ _quickstep()

meta.shockley.threshold.ThresholdSearch._quickstep (   self,
  arg 
)
protected
Function performing one step of the quick threshold search.

Args:
    arg (array): Array containing voltage on a specified boundary condition (V) and wavelength.

Returns:
    array: Imaginary and real part of a specified mode

Definition at line 213 of file threshold.py.

◆ compute()

meta.shockley.threshold.ThresholdSearch.compute (   self,
  save = True,
  invalidate = False,
  group = 'ThresholdSearch',
  stepsave = False 
)
Execute the algorithm.

In the beginning the solvers are invalidated and next, the self-
consistent loop of thermal, electrical, gain, and optical calculations
are run within the root-finding algorithm until the mode is found
with zero optical losses.

Args:
    save (bool or str): If `True` the computed fields are saved to the
        HDF5 file named after the script name with the suffix denoting
        either the batch job id or the current time if no batch system
        is used. The filename can be overridden by setting this parameter
        as a string.

    invalidate (bool): If this flag is set, solvers are invalidated
                       in the beginning of the computations.

    group (str): HDF5 group to save the data under.

    stepsave (bool): If `True` the computed fields are saved to the
        HDF5 file after each computations step.

Returns:
    The voltage set to ``ivolt`` boundary condition for the threshold.
    The threshold current can be then obtained by calling:

    >>> solver.get_total_current()
    123.0

Reimplemented from meta.shockley.thermoelectric.ThermoElectric.

Definition at line 432 of file threshold.py.

◆ compute_thermoelectric()

meta.shockley.threshold.ThresholdSearch.compute_thermoelectric (   self)
Perform thermo-electric calculations.

This method may be called manually to perform thermo-electric calculations.
Afterwards, one may investigate gain spectrum or verify settings of the optical
solver.

Definition at line 158 of file threshold.py.

◆ get_gain_spectrum()

meta.shockley.threshold.ThresholdSearch.get_gain_spectrum (   self,
  lams,
  pos = 0.,
  junction = 0 
)
Get gain spectrum for specified junction.

Args:
    lams (array of floats): Wavelengths for which the spectrum should be plotted.

    pos (float): Lateral position fo the point in which the spectrum is plotted.

    junction (int): Junction number to take gain from.

Return:
    Data: Gain spectrum.

Definition at line 299 of file threshold.py.

◆ get_junction_concentrations()

meta.shockley.threshold.ThresholdSearch.get_junction_concentrations (   self,
  interpolation = 'linear' 
)
Get carriers concentration at the active regions.

Args:
    interpolation (str): Interpolation used when retrieving current density.

Return:
    dict: Dictionary of junction current density data.
          Keys are the junction number.

Definition at line 267 of file threshold.py.

◆ get_junction_gains()

meta.shockley.threshold.ThresholdSearch.get_junction_gains (   self,
  axis = None,
  interpolation = 'linear' 
)
Get gain at the active regions.

Args:
    axis (mesh or sequence): Points along horizontal axis to plot gain at.
                             Defaults to the optical mesh.

   interpolation (str): Interpolation used when retrieving current density.

Return:
    dict: Dictionary of junction current density data.
          Keys are the junction number.

Definition at line 281 of file threshold.py.

◆ get_lam()

meta.shockley.threshold.ThresholdSearch.get_lam (   self)

◆ get_optical_determinant()

meta.shockley.threshold.ThresholdSearch.get_optical_determinant (   self,
  lam 
)
Function computing determinant of the optical solver.

Args:
     lam (float or array): Wavelength to compute the determinant for (nm).

Returns:
    float or array: Optical determinant.

Reimplemented in meta.shockley.threshold.ThresholdSearch2D, and meta.shockley.threshold.ThresholdSearchFourier2D.

Definition at line 237 of file threshold.py.

◆ get_optical_field()

meta.shockley.threshold.ThresholdSearch.get_optical_field (   self,
  resolution = None 
)
Get computed optical mode field at threshold.

Args:
    resolution (tuple of ints): Number of points in horizontal and vertical directions.

Definition at line 599 of file threshold.py.

◆ get_optical_field_horizontal()

meta.shockley.threshold.ThresholdSearch.get_optical_field_horizontal (   self,
  resolution = None,
  interpolation = 'linear' 
)
Get horizontal distribution of the computed optical mode field at threshold.

Args:
    resolution (int): Number of points in horizontal direction.

    interpolation (str): Interpolation used when retrieving current density.

Definition at line 613 of file threshold.py.

◆ get_optical_field_vertical()

meta.shockley.threshold.ThresholdSearch.get_optical_field_vertical (   self,
  pos = 0.01,
  offset = 0.5,
  resolution = None,
  interpolation = 'linear' 
)
Plot vertical distribution of the computed optical mode field at threshold and
refractive index profile.

Args:
    resolution (int): Number of points in horizontal direction.

    pos (float): Horizontal position to get the field at.

    offset (float): Distance above and below geometry boundary to include into
                    the plot.

    interpolation (str): Interpolation used when retrieving current density.

Definition at line 630 of file threshold.py.

◆ on_initialize()

meta.shockley.threshold.ThresholdSearch.on_initialize (   self)

◆ on_invalidate()

meta.shockley.threshold.ThresholdSearch.on_invalidate (   self)

Reimplemented from meta.shockley.thermoelectric.ThermoElectric.

Definition at line 139 of file threshold.py.

◆ plot_gain_spectrum()

meta.shockley.threshold.ThresholdSearch.plot_gain_spectrum (   self,
  lams,
  pos = 0.,
  junction = 0,
  comp = None,
**  kwargs 
)
Plot gain spectrum for specified junction.

Args:
    lams (array of floats): Wavelengths for which the spectrum should be plotted.

    pos (float): Lateral position fo the point in which the spectrum is plotted.

    junction (int): Junction number to take gain from.

    comp (int or str): Spectrum component to plot

    **kwargs: Keyword arguments passed to the plot function.

Definition at line 383 of file threshold.py.

◆ plot_junction_concentration()

meta.shockley.threshold.ThresholdSearch.plot_junction_concentration (   self,
  bounds = True,
  interpolation = 'linear',
  label = None,
**  kwargs 
)
Plot carriers concentration at the active region.

Args:
    bounds (bool): If *True* then the geometry objects boundaries are
                   plotted.

    interpolation (str): Interpolation used when retrieving current density.

    label (str or sequence): Label for each junction. It can be a sequence of
                             consecutive labels for each junction, or a string
                             in which case the same label is used for each
                             junction. If omitted automatic label is generated.

    **kwargs: Keyword arguments passed to the plot function.

Definition at line 334 of file threshold.py.

◆ plot_junction_gain()

meta.shockley.threshold.ThresholdSearch.plot_junction_gain (   self,
  axis = None,
  bounds = True,
  interpolation = 'linear',
  label = None,
**  kwargs 
)
Plot gain at the active region.

Args:
    axis (mesh or sequence): Points along horizontal axis to plot gain at.
                             Defaults to the optical mesh.

    bounds (bool): If *True* then the geometry objects boundaries are
                   plotted.

    interpolation (str): Interpolation used when retrieving current density.

    label (str or sequence): Label for each junction. It can be a sequence of
                             consecutive labels for each junction, or a string
                             in which case the same label is used for each
                             junction. If omitted automatic label is generated.

    **kwargs: Keyword arguments passed to the plot function.

Definition at line 356 of file threshold.py.

◆ plot_optical_determinant()

meta.shockley.threshold.ThresholdSearch.plot_optical_determinant (   self,
  lams,
**  kwargs 
)
Function plotting determinant of the optical solver.

Args:
    lams (array): Wavelengths to plot the determinant for (nm).

    **kwargs: Keyword arguments passed to the plot function.

Reimplemented in meta.shockley.threshold.ThresholdSearch2D, and meta.shockley.threshold.ThresholdSearchFourier2D.

Definition at line 417 of file threshold.py.

◆ plot_optical_field()

meta.shockley.threshold.ThresholdSearch.plot_optical_field (   self,
  resolution = None,
  geometry_color = '0.75',
  geometry_alpha = 0.35,
  geometry_lw = 1.0,
**  kwargs 
)
Plot computed optical mode field at threshold.

Args:
    resolution (tuple of ints): Number of points in horizontal and vertical directions.

    geometry_color (str or ``None``): Matplotlib color specification
        for the geometry. If ``None``, structure is not plotted.

    geometry_alpha (float): Geometry opacity (1 — fully opaque, 0 – invisible).

    geometry_lw (float): Line width for geometry.

    **kwargs: Keyword arguments passed to the plot function.

Definition at line 653 of file threshold.py.

◆ plot_optical_field_horizontal()

meta.shockley.threshold.ThresholdSearch.plot_optical_field_horizontal (   self,
  resolution = None,
  bounds = True,
  interpolation = 'linear',
**  kwargs 
)
Plot horizontal distribution of the computed optical mode field at threshold.

Args:
    resolution (int): Number of points in horizontal direction.

    bounds (bool): If *True* then the geometry objects boundaries are
                   plotted.

    interpolation (str): Interpolation used when retrieving current density.

    **kwargs: Keyword arguments passed to the plot function.

Definition at line 674 of file threshold.py.

◆ plot_optical_field_vertical()

meta.shockley.threshold.ThresholdSearch.plot_optical_field_vertical (   self,
  pos = 0.01,
  offset = 0.5,
  resolution = None,
  interpolation = 'linear',
**  kwargs 
)
Plot vertical distribution of the computed optical mode field at threshold and
refractive index profile.

Args:
    resolution (int): Number of points in horizontal direction.

    pos (float): Horizontal position to get the field at.

    offset (float): Distance above and below geometry boundary to include into
                    the plot.

    interpolation (str): Interpolation used when retrieving current density.

    **kwargs: Keyword arguments passed to the plot function.

Definition at line 703 of file threshold.py.

◆ reconnect()

meta.shockley.threshold.ThresholdSearch.reconnect (   self)
Reconnect all internal solvers.

This method should be called if some of the internal solvers were changed manually.

Reimplemented from meta.shockley.thermoelectric.ThermoElectric.

Definition at line 76 of file threshold.py.

◆ save()

meta.shockley.threshold.ThresholdSearch.save (   self,
  filename = None,
  group = 'ThresholdSearch',
  optical_resolution = None 
)
Save the computation results to the HDF5 file.

Args:
    filename (str): The file name to save to.
        If omitted, the file name is generated automatically based on
        the script name with suffix denoting either the batch job id or
        the current time if no batch system is used.

    group (str): HDF5 group to save the data under.

    optical_resolution (tuple of ints): Number of points in horizontal and vertical directions
        for optical field.

Reimplemented from meta.shockley.thermoelectric.ThermoElectric.

Definition at line 550 of file threshold.py.

◆ step()

meta.shockley.threshold.ThresholdSearch.step (   self,
  volt,
  save = False 
)
Function performing one step of the threshold search.

Args:
    volt (float): Voltage on a specified boundary condition (V).

    save (bool): If `True` the computed fields are saved to the
        HDF5 file after each computations step.

Returns:
    float: Loss of a specified mode

Definition at line 182 of file threshold.py.

Member Data Documentation

◆ _Diffusion

meta.shockley.threshold.ThresholdSearch._Diffusion = None
staticprotected

Definition at line 41 of file threshold.py.

◆ _Gain

meta.shockley.threshold.ThresholdSearch._Gain = None
staticprotected

Definition at line 42 of file threshold.py.

◆ _invalidate

meta.shockley.threshold.ThresholdSearch._invalidate
protected

Definition at line 64 of file threshold.py.

◆ _lam0

str meta.shockley.threshold.ThresholdSearch._lam0 = 'lam0'
staticprotected

Definition at line 45 of file threshold.py.

◆ _max_concentration

meta.shockley.threshold.ThresholdSearch._max_concentration
protected

Definition at line 474 of file threshold.py.

◆ _max_gain

meta.shockley.threshold.ThresholdSearch._max_gain
protected

Definition at line 475 of file threshold.py.

◆ _optarg

str meta.shockley.threshold.ThresholdSearch._optarg = 'lam'
staticprotected

Definition at line 44 of file threshold.py.

◆ _Optical

meta.shockley.threshold.ThresholdSearch._Optical = None
staticprotected

Definition at line 43 of file threshold.py.

◆ _OPTICAL_ROOTS

dict meta.shockley.threshold.ThresholdSearch._OPTICAL_ROOTS = {}
staticprotected

Definition at line 39 of file threshold.py.

◆ _quickscale

meta.shockley.threshold.ThresholdSearch._quickscale
protected

Definition at line 486 of file threshold.py.

◆ _sn

meta.shockley.threshold.ThresholdSearch._sn
protected

Definition at line 66 of file threshold.py.

◆ diffusion

meta.shockley.threshold.ThresholdSearch.diffusion

Definition at line 58 of file threshold.py.

◆ gain

meta.shockley.threshold.ThresholdSearch.gain

Definition at line 59 of file threshold.py.

◆ get_lam

meta.shockley.threshold.ThresholdSearch.get_lam

◆ ivb

meta.shockley.threshold.ThresholdSearch.ivb

Definition at line 89 of file threshold.py.

◆ maxiter [1/2]

int meta.shockley.threshold.ThresholdSearch.maxiter = 50
static

Definition at line 53 of file threshold.py.

◆ maxiter [2/2]

meta.shockley.threshold.ThresholdSearch.maxiter

Definition at line 91 of file threshold.py.

◆ modeno

meta.shockley.threshold.ThresholdSearch.modeno

Definition at line 65 of file threshold.py.

◆ optical

meta.shockley.threshold.ThresholdSearch.optical

Definition at line 60 of file threshold.py.

◆ optical_resolution [1/2]

tuple meta.shockley.threshold.ThresholdSearch.optical_resolution = (800, 600)
static

Definition at line 50 of file threshold.py.

◆ optical_resolution [2/2]

meta.shockley.threshold.ThresholdSearch.optical_resolution

Definition at line 116 of file threshold.py.

◆ quick [1/2]

bool meta.shockley.threshold.ThresholdSearch.quick = False
static

Definition at line 52 of file threshold.py.

◆ quick [2/2]

meta.shockley.threshold.ThresholdSearch.quick

Definition at line 92 of file threshold.py.

◆ skip_thermal [1/2]

bool meta.shockley.threshold.ThresholdSearch.skip_thermal = False
static

Definition at line 54 of file threshold.py.

◆ skip_thermal [2/2]

meta.shockley.threshold.ThresholdSearch.skip_thermal

Definition at line 127 of file threshold.py.

◆ tfreq

float meta.shockley.threshold.ThresholdSearch.tfreq = 6.0
static

Definition at line 47 of file threshold.py.

◆ threshold_current

meta.shockley.threshold.ThresholdSearch.threshold_current

Definition at line 63 of file threshold.py.

◆ threshold_voltage

meta.shockley.threshold.ThresholdSearch.threshold_voltage

Definition at line 62 of file threshold.py.

◆ vmax

meta.shockley.threshold.ThresholdSearch.vmax = None
static

Definition at line 49 of file threshold.py.

◆ vmin

meta.shockley.threshold.ThresholdSearch.vmin = None
static

Definition at line 48 of file threshold.py.

◆ vtol [1/2]

int meta.shockley.threshold.ThresholdSearch.vtol = 1e-5
static

Definition at line 51 of file threshold.py.

◆ vtol [2/2]

meta.shockley.threshold.ThresholdSearch.vtol

Definition at line 90 of file threshold.py.


The documentation for this class was generated from the following file: