ExpressionΒΆ

Type:string
Range:[]
Default:-/-
Appearance:simple
Excludes:Function, Module

This parameter is used to define the height profile of the texture by means of a Python expression within the layout.jcm input file. For example, the following declarations defines a Gaussian bump:

Texture {
  Python {
    Expression = "value=40*exp(-3e-3*X[0]*X[0]-3e-3*X[1]*X[1])"
  }

In general the syntax is as follows:

Python {
   Expression = " ... # your python scripting
                  ...
                  value = ... # set return value

                 "

   # define one or more parameters
   Parameter {
     Name = "Para1"
     ...
   }
   Parameter {
     Name = "Para2"
     ...

   }
}

The string value Expression has to be valid Python code and is interpreted in the following way:

  • The NumPy-package is automatically imported when evaluating the expression.
  • Any parameter as defined by a Parameter section is available within the Python expression as an NumPy object named accordingly to the value of the parameter Name.
  • The position \pvec{x} is available as a NumPy object with name x.
  • The expression must define a scalar value which contains z-elongation of the height profile.
  • Keep in mind the Python indentation rule.