# PLaSK User Manual

#### Page Contents

- ShockleyCyl Class
  - `ShockleyCyl`
  - Methods
  - Attributes
    - Receivers
    - Providers
    - Other
  - Descriptions
    - Method Details
      - `ShockleyCyl.compute()`
      - `ShockleyCyl.get_capacitance()`
      - `ShockleyCyl.get_electrostatic_energy()`
      - `ShockleyCyl.get_total_current()`
      - `ShockleyCyl.get_total_heat()`
      - `ShockleyCyl.initialize()`
      - `ShockleyCyl.invalidate()`
    - Receiver Details
      - `ShockleyCyl.inTemperature`
    - Provider Details
      - `ShockleyCyl.outConductivity`
      - `ShockleyCyl.outCurrentDensity`
      - `ShockleyCyl.outHeat`
      - `ShockleyCyl.outPotential`
      - `ShockleyCyl.outVoltage`
    - Attribute Details
      - `ShockleyCyl.algorithm`
      - `ShockleyCyl.beta`
      - `ShockleyCyl.convergence`
      - `ShockleyCyl.empty_elements`
      - `ShockleyCyl.err`
      - `ShockleyCyl.geometry`
      - `ShockleyCyl.id`
      - `ShockleyCyl.initialized`
      - `ShockleyCyl.iterative`
      - `ShockleyCyl.js`
      - `ShockleyCyl.maxerr`
      - `ShockleyCyl.mesh`
      - `ShockleyCyl.ncond`
      - `ShockleyCyl.pcond`
      - `ShockleyCyl.pnjcond`
      - `ShockleyCyl.start_cond`
      - `ShockleyCyl.voltage_boundary`

# ShockleyCyl Class

class electrical.shockley.ShockleyCyl(name='')

  Finite element thermal solver for 2D cylindrical geometry.

## Methods

`compute`([loops]) | Run electrical calculations
`get_capacitance`() | Get the structure capacitance.
`get_electrostatic_energy`() | Get the energy stored in the electrostatic field in the analyzed structure.
`get_total_current`([nact]) | Get total current flowing through active region (mA)
`get_total_heat`() | Get the total heat produced by the current flowing in the structure.
`initialize`() | Initialize solver.
`invalidate`() | Set the solver back to uninitialized state.

## Attributes

### Receivers

`inTemperature` | Receiver of the temperature required for computations [K].

### Providers

`outConductivity` | Provider of the computed electrical conductivity [S/m].
`outCurrentDensity` | Provider of the computed current density [kA/cm²].
`outHeat` | Provider of the computed heat sources density [W/m³].
`outPotential` | Not available in this solver.
`outVoltage` | Provider of the computed voltage [V].

### Other

`algorithm` | Chosen matrix factorization algorithm
`beta` | Junction coefficient (1/V).
`convergence` | Convergence method.
`empty_elements` | Should empty regions (e.g. air) be included into computation domain?.
`err` | Maximum estimated error
`geometry` | Geometry provided to the solver
`id` | Id of the solver object.
`initialized` | True if the solver has been initialized.
`iterative` | Iterative matrix parameters (see `IterativeParams`)
`js` | Reverse bias current density (A/m2).
`maxerr` | Limit for the potential updates
`mesh` | Mesh provided to the solver
`ncond` | Conductivity of the n-contact
`pcond` | Conductivity of the p-contact
`pnjcond` | Default effective conductivity of the active region.
`start_cond` | Default effective conductivity of the active region.
`voltage_boundary` | Boundary conditions of the first kind (constant potential)

## Descriptions

### Method Details

ShockleyCyl.compute(loops=0)

  Run electrical calculations

ShockleyCyl.get_capacitance()

  Get the structure capacitance.

  Returns:

    Total capacitance [pF].

  Note

  This method can only be used it there are exactly two boundary conditions specifying the voltage. Otherwise use `get_electrostatic_energy()` to obtain the stored energy $W$ and compute the capacitance as: $C = 2 , W / U^2$, where $U$ is the applied voltage.

ShockleyCyl.get_electrostatic_energy()

  Get the energy stored in the electrostatic field in the analyzed structure.

  Returns:

    Total electrostatic energy [J].

ShockleyCyl.get_total_current(nact=0)

  Get total current flowing through active region (mA)

ShockleyCyl.get_total_heat()

  Get the total heat produced by the current flowing in the structure.

  Returns:

    Total produced heat (mW).

ShockleyCyl.initialize()

  Initialize solver.

  This method manually initialized the solver and sets `initialized` to True. Normally calling it is not necessary, as each solver automatically initializes itself when needed.

  Returns:

    solver `initialized` state prior to this method call.

  Return type:

    bool

ShockleyCyl.invalidate()

  Set the solver back to uninitialized state.

  This method frees the memory allocated by the solver and sets `initialized` to False.

### Receiver Details

ShockleyCyl.inTemperature = <property object>

  Receiver of the temperature required for computations [K].

  You will find usage details in the documentation of the receiver class `TemperatureReceiverCyl`.

  Example

  Connect the receiver to a provider from some other solver:

      >>> solver.inTemperature = other_solver.outTemperature

  See also

  Receciver class: `plask.flow.TemperatureReceiverCyl`

  Provider class: `plask.flow.TemperatureProviderCyl`

  Data filter: `plask.filter.TemperatureFilterCyl`

### Provider Details

ShockleyCyl.outConductivity(mesh, interpolation='default') = <property object>

  Provider of the computed electrical conductivity [S/m].

  Parameters:

    - mesh (mesh) – Target mesh to get the field at.

    - interpolation (str) – Requested interpolation method.

  Returns:

    Data with the electrical conductivity on the specified mesh [S/m].

  Example

  Connect the provider to a receiver in some other solver:

      >>> other_solver.inConductivity = solver.outConductivity

  Obtain the provided field:

      >>> solver.outConductivity(mesh)
      <plask.Data at 0x1234567>

  See also

  Provider class: `plask.flow.ConductivityProviderCyl`

  Receciver class: `plask.flow.ConductivityReceiverCyl`

ShockleyCyl.outCurrentDensity(mesh, interpolation='default') = <property object>

  Provider of the computed current density [kA/cm²].

  Parameters:

    - mesh (mesh) – Target mesh to get the field at.

    - interpolation (str) – Requested interpolation method.

  Returns:

    Data with the current density on the specified mesh [kA/cm²].

  Example

  Connect the provider to a receiver in some other solver:

      >>> other_solver.inCurrentDensity = solver.outCurrentDensity

  Obtain the provided field:

      >>> solver.outCurrentDensity(mesh)
      <plask.Data at 0x1234567>

  See also

  Provider class: `plask.flow.CurrentDensityProviderCyl`

  Receciver class: `plask.flow.CurrentDensityReceiverCyl`

ShockleyCyl.outHeat(mesh, interpolation='default') = <property object>

  Provider of the computed heat sources density [W/m³].

  Parameters:

    - mesh (mesh) – Target mesh to get the field at.

    - interpolation (str) – Requested interpolation method.

  Returns:

    Data with the heat sources density on the specified mesh [W/m³].

  Example

  Connect the provider to a receiver in some other solver:

      >>> other_solver.inHeat = solver.outHeat

  Obtain the provided field:

      >>> solver.outHeat(mesh)
      <plask.Data at 0x1234567>

  See also

  Provider class: `plask.flow.HeatProviderCyl`

  Receciver class: `plask.flow.HeatReceiverCyl`

ShockleyCyl.outPotential = <property object>

  Not available in this solver. Use `outVoltage` instead.

ShockleyCyl.outVoltage(mesh, interpolation='default') = <property object>

  Provider of the computed voltage [V].

  Parameters:

    - mesh (mesh) – Target mesh to get the field at.

    - interpolation (str) – Requested interpolation method.

  Returns:

    Data with the voltage on the specified mesh [V].

  Example

  Connect the provider to a receiver in some other solver:

      >>> other_solver.inVoltage = solver.outVoltage

  Obtain the provided field:

      >>> solver.outVoltage(mesh)
      <plask.Data at 0x1234567>

  See also

  Provider class: `plask.flow.VoltageProviderCyl`

  Receciver class: `plask.flow.VoltageReceiverCyl`

### Attribute Details

ShockleyCyl.algorithm = <property object>

  Chosen matrix factorization algorithm

ShockleyCyl.beta = <property object>

  Junction coefficient (1/V).

  In case, there is more than one junction you may set $\beta$ parameter for any of them by using `beta#` property, where # is the junction number (specified by a role `junction#` or `active#`).

  `beta` is an alias for `beta0`.

ShockleyCyl.convergence = <property object>

  Convergence method.

  If stable, n is slowed down to ensure stability.

ShockleyCyl.empty_elements = <property object>

  Should empty regions (e.g. air) be included into computation domain?

ShockleyCyl.err = <property object>

  Maximum estimated error

ShockleyCyl.geometry = <property object>

  Geometry provided to the solver

ShockleyCyl.id = <property object>

  Id of the solver object. (read only)

  Example

      >>> mysolver.id
      mysolver:category.type

ShockleyCyl.initialized = <property object>

  True if the solver has been initialized. (read only)

  Solvers usually get initialized at the beginning of the computations. You can clean the initialization state and free the memory by calling the `invalidate()` method.

ShockleyCyl.iterative = <property object>

  Iterative matrix parameters (see `IterativeParams`)

ShockleyCyl.js = <property object>

  Reverse bias current density (A/m2).

  In case, there is more than one junction you may set $j_s$ parameter for any of them by using `js#` property, where # is the junction number (specified by a role `junction#` or `active#`).

  `js` is an alias for `js0`.

ShockleyCyl.maxerr = <property object>

  Limit for the potential updates

ShockleyCyl.mesh = <property object>

  Mesh provided to the solver

ShockleyCyl.ncond = <property object>

  Conductivity of the n-contact

ShockleyCyl.pcond = <property object>

  Conductivity of the p-contact

ShockleyCyl.pnjcond = <property object>

  Default effective conductivity of the active region.

  Effective junction conductivity will be computed starting from this value. Note that the actual junction conductivity after convergence can be obtained with `outConductivity`.

ShockleyCyl.start_cond = <property object>

  Default effective conductivity of the active region.

  Effective junction conductivity will be computed starting from this value. Note that the actual junction conductivity after convergence can be obtained with `outConductivity`.

ShockleyCyl.voltage_boundary = <property object>

  Boundary conditions of the first kind (constant potential)

  This field holds a list of boundary conditions for the solver. You may access and alter its elements a normal Python list. Each element is a special class that has two attributes:

  `place` | Boundary condition location (`plask.mesh.RectangularBase2D.Boundary`).
  `value` | Boundary condition value.

  When you add new boundary condition, you may use two-argument `append`, or `prepend` methods, or three-argument `insert` method, where you separately specify the place and the value. See the below example for clarification.

  Example

      >>> solver.voltage_boundary.clear()
      >>> solver.voltage_boundary.append(solver.mesh.Bottom(), some_value)
      >>> solver.voltage_boundary[0].value = different_value
      >>> solver.voltage_boundary.insert(0, solver.mesh.Top(), new_value)
      >>> solver.voltage_boundary[1].value == different_value
      True