scalarFieldBinOpUpdater

scalarFieldBinOpUpdater

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

MultiField updater that applies a mathematical operation on scalars and one field, and writes the result to a field.

scalarFieldBinOpUpdater Parameters

The scalarFieldBinOpUpdater takes the lowerBounds and upperBounds parameters of FieldUpdater, as well as the following parameters:

readScalars (required string vector)

A vector of the names of the scalars on which to operate. There should be at least one scalar. The number of components to updated (NUM) depends on the setting of readComponents and writeComponent. If the number of readScalars is less than NUM, the last scalar is paded to NUM. If the number of readScalars is more than NUM, any scalars above NUM are disregarded. The binary operation happens between one scalar and one component of the field

readField (required string)

A vector of the name of the single field on which to operate.

writeField (required string)

A vector containing a single element, the name of field to update.

binOp (required string)

Operation to apply to the field and scalars; one of add, subtract, multiply or divide. Those operations take place between one scalar and one component of the readField. Operations are:

add:       (aCoeff*A)+(bCoeff*Fj)
subtract:  (aCoeff*A)-(bCoeff*Fj)
multiply:  (aCoeff+A)*(bCoeff+Fj)
divide:    (aCoeff+A)/(bCoeff+Fj)
readComponents (optional integer vector)

The components to use in the operand fields.

writeComponent (optional integer)

The component to update.

Note

The readComponents and writeComponent parameters work together, and if one is specified, the other must be as well. If neither are specified, then all the components are updated. In that case, both of the readField and the writeField must all have the same number of components.

aCoeff (optional float)

Coefficient for the scalar (A, as described above). Default values:

add:      1.0
subtract: 1.0
multiply: 0.0
divide:   0.0
bCoeff (optional float)

Coefficient for the field (F, as described above). Default values:

add:      1.0
subtract: 1.0
multiply: 0.0
divide:   0.0

Example scalarFieldBinOpUpdater Block

<FieldUpdater scalarFieldAdd>
  kind = scalarFieldBinOpUpdater
  lowerBounds = [0 0 0]
  upperBounds = [NX1 NY1 NZ1]
  binOp = add
  readScalars = [A1 A2]
  readField = F1
  writeField = F2
  readComponents = [0 1 2]
  writeComponents = [0 1 2]
  aCoeff = 2.0
  bCoeff = 3.0
</FieldUpdater>