- STFuncUpdater
STFuncUpdater¶
Works with VSimBase, VSimEM, VSimPD, VSimPA, and VSimVE licenses.
MultiField updater that performs one of the following operations on a field \(\mathbf{F}\) and an STFunc \(f\):
For updating a single component of \({\bf F}\), the updater is straightforward; the operation is specified by the operation parameter.
However, for updating multiple components of \({\bf F}\), if different components of \({\bf F}\) are located at different places (e.g., for a Yee electric field, \(E_x\) and \(E_y\) are located at different places within a mesh cell), STFunc is evaluated only once for all components; STFunc is evaluated at the position of the component given by the component parameter of the updater and the field offset of field \({\bf F}\). In this case, the components of \({\bf F}\) that are updated are those given by the parameter
writeComponents
.If you want to have \(f\) evaluated at the location of each component then you must use a separate STFuncUpdater definition for each component (or otherwise update all components using FieldMultiUpdater).
STFuncUpdater Parameters¶
The STFuncUpdater
takes the lowerBounds
and
upperBounds
parameters of FieldUpdater, as well as
the following parameters:
- minDim (optional integer, default = 1)
If the dimension of the simulation is less than
minDim
, this updater will not be applied.
- writeFields (required string vector)
A single element, the name of the field to update.
- component (optional integer, default = 0)
Component \(j\) of \({\bf F}\) to be updated. However, if
writeComponents
is not[0]
, the component, along with the field offset of \({\bf F}\), determines the location in each cell where the function \({\bf f}\) will be evaluated.
- writeComponents (optional integer vector, default = [0])
List of components of \({\bf F}\) that will be updated.
Note
The STFunc \(f\) will be evaluated only once per
cell for all components, and the location within each cell at which
\(f\) is evaluated is determined by the component
parameter.
- dtCoefficients (optional float vector, default = [1.0 0.0])
Two components [\(c_0\) \(c_1\)]: the function will be multiplied by \(\left(c_0 + c_1 \Delta t\right)\), where \(\Delta t\) is the current time step. If \(c_1\) is not specified it is assumed to be zero.
- STFunc (required parameter block)
A parameter block of type STFunc (with any name) must be specified. This describes \(f\).
Example STFuncUpdater block¶
<FieldUpdater initialPulse>
kind = STFuncUpdater
lowerBounds = [NX_BEGIN NY_BEGIN NZ_BEGIN]
upperBounds = [NX_END NY_END NZ_END]
operation = set
writeFields = [elecField]
component = 2
<STFunc unimportantName> # a gaussian
kind = expression
expression = E_AMP * exp(-0.5 * ( (x-X_INIT)^2 + (y-Y_INIT)^2 \
+ (z-Z_INIT)^2 ) / WIDTH_INIT^2)
</STFunc>
</FieldUpdater>