unaryScalarOpUpdater

unaryScalarOpUpdater

Works with VSimBase, VSimEM, VSimPD, VSimPA, and VSimMD licenses.

Scalar updater that performs one of the following operations on a scalar \({\bf A}\), another scalar \({\bf B}\), and an STFunc \(f\):

(17)\[B = f(0,0,0, A)\]
(18)\[B = f(0,0,0,t)*A\]
(19)\[B = B + f(0,0,0,t)*A\]
(20)\[B = B*f(0,0,0,t)*A\]
(21)\[B = \frac{B}{f(0,0,0,t)*A}\]

The above scalar A is the readScalars, and scalar B is the writeScalars.

unaryScalarOpUpdater Parameters

The unaryScalarOpUpdater takes the following parameters:

readScalars (optional string vector)

A single element, the name of the scalar to use in the operation (\(\mathbf{A}\), above). There can be either zero or one read scalar. If there is no read scalar specified, a scalar with default value 1 will be used.

writeScalars (required string vector)

A single element, the name of the scalar to update (\(\mathbf{B}\), above). There must be exactly one write scalar.

STFunc (required parameter block)

A parameter block of type STFunc (with any name) must be specified. This describes \(f\). This function is always evaluated at spatial origin (0,0,0) for this updater. So it is perfered a function that only depends on time t.

operation (required string)

One of:

dtCoefficients (optional float vector, default = [1.0 0.0])

Two components [\(c_0\) \(c_1\)]: the function \(f\) will be multiplied by \((c_0 + c_1 \Delta t)\), where \(\Delta t\) is the current time step. If \(c_1\) is not specified it is assumed to be zero.

Example unaryScalarOpUpdater Block

<Updater scalarSet>
  kind = unaryScalarOpUpdater
  operation = set
  writeScalars = [A3]
  dtCoefficients = [1.0 0.0]
  <STFunc phiFunc>
     kind = historySTFunc
     feedback = phiHist
     expression = 1.0
  </STFunc>
</Updater>

<Updater scalarApply>
  kind = unaryScalarOpUpdater
  operation = apply
  readScalars = [A5]
  writeScalars = [A5]
  dtCoefficients = [1.0 0.0]
  <STFunc phiFunc>
     kind = expression
     expression = sin(TWOPI*t/30)
  </STFunc>
 </Updater>