# PLaSK User Manual

#### Page Contents

- StepProfile Class
  - `StepProfile`
  - Methods
  - Attributes
  - Descriptions
    - Method Details
      - `StepProfile.__call__()`
    - Attribute Details
      - `StepProfile.default`
      - `StepProfile.geometry`

# StepProfile Class

class plask.StepProfile(geometry, default=0.0, dtype=None)

  Step profile for use in custom providers.

  Create a step profile class that can set a constant value of any scalar field in an arbitrary geometry object. Typical use of this class is setting an arbitrary heat source or step-profile material gain located in a chosen geometry object.

  Parameters:

    - geometry – Geometry in which the step-profile is defined. It must be known in order to properly map the absolute mesh coordinates to the step-profile items.

    - default – Default value of the provided field, returned in all non-referenced geometry objects.

    - dtype – Type of the returned value. Defaults to None, in which case it is determined by the type of default.

  After creation, set the desired values at chosen geometry objects using item access [] notation:

      >>> profile[geometry_object] = value

  Then, you may retrieve the provider of a desired type using the normal outXXX name:

      >>> solver.inProperty = profile.outProperty

  This way you create a provider of the proper type and associate it with the profile, so each time, the profile is in any way changed, all the receivers connected to the provider get notified.

  Example

  To create a heat source profile that sets some heat at the object named hot:

      >>> hot = geometry.Rectangle(20,2, 'GaAs')
      >>> cold = geometry.Rectangle(20,10, 'GaAs')
      >>> stack = geometry.Stack2D()
      >>> stack.prepend(hot)
      <plask.geometry.PathHint at 0x47466b0>
      >>> stack.prepend(cold)
      <plask.geometry.PathHint at 0x47469e0>
      >>> geom = geometry.Cylindrical(stack)
      >>> profile = StepProfile(geom)
      >>> profile[hot] = 1e7
      >>> receiver = flow.HeatReceiverCyl()
      >>> receiver.connect(profile.outHeat)
      >>> list(receiver(mesh.Rectangular2D([10], [5, 11])))
      [0.0, 10000000.0]
      >>> receiver.changed
      False
      >>> profile[hot] = 2e7
      >>> receiver.changed
      True
      >>> list(receiver(mesh.Rectangular2D([10], [5, 11])))
      [0.0, 20000000.0]

## Methods

`__call__`(mesh, *args) | Call self as a function.

## Attributes

`default` | Default value of the profile.
`geometry` | Profile geometry.

## Descriptions

### Method Details

StepProfile.__call__(mesh, *args)

  Call self as a function.

### Attribute Details

StepProfile.default = <property object>

  Default value of the profile.

  This value is returned for all mesh points that are located outside any of the geometry objects with a specified value.

StepProfile.geometry = <property object>

  Profile geometry. (read only)