combiner (1d, 2d, 3d)

Performs arithmetic operations on a set of input nodalArrays and stores the ouput in a single user-specifed nodalArray using an expression evaluator. The expression evaluator recognizes positions x, y, z and time t, along with the current dt and the cell volume, dVolume. The expression evaluator checks the user supplied expression for validity and errors on finding undefined expressions.

The combiner accepts the following parameters, in addition to those required by Updater:

Data

in (string vector, required)
Input 1 to N are input nodalArrays which will be supplied to the expression evaluator.
dynVectors (string vector)
Input 1 to N are input dynVectors which will be supplied to the expression evaluator.
out (string vector, required)
Output is a nodalArray which will contain the output of the evaluation.

Parameters

indVars_inName (string vector, required)
For each input variable an “indVars” string vector must be defined. So if in = [magneticField, electricField] where magneticField and electricField are each 3-component nodalArrays then the combiner block must define indVars_magneticField = [“bx”, “by”, “bz”] and indVars_electricField = [“ex”, “ey”, “ez”]. Note that the labels “bx”, “by”, “bz” and “ex”, “ey”, “ez” are arbitrary; the requirement is that there is a unique name for each component of each input data structure.
dynVars_ (string vector)
For each dynVector variable a “dynVars” string vector must be defined. So if dynVectors = [a, b] where a and b are each 3-component dynVectors then the combine block must define dynVectorVars_a = [“a1”,”a2”,”a3”] and dynVectorVars_b = [“b1”,”b2”,”b3”]. Note that the labels “a1”,”a2”,”a3” and “b1”,”b2”,”b3” are arbitrary; the requirement is that there is a unique name for each component of each input data structure.
exprs (string vector, required)
Strings must be put in quotes. The strings are evaluated and placed in the output array. The number of strings must be identical to the number of components in the output array. Available command are defined by the muParser (http://muparser.sourceforge.net/)
preExprs (string vector, optional)
Strings must be put in quotes. The preExprs is used to compute quantities based on indVars that can later be used in the exprs to evaluate the output. Available commands are defined by the muParser (http://muparser.sourceforge.net)
other (strings, optional)
In addition, an arbitrary number of constants can be defined that can then be used in evaluating expression in both preExprs and exprs.

Example

The following code block demonstrates the use of a combiner to compute the cross product of two 3-component nodalArrays (magneticField and electricField) using preExprs, and store the output multiplied by a user-specifed constant (factor) in a 3-component nodalArray (eCrossB)

<Updater computeECrossB>
  kind = combiner2d
  onGrid = domain

  in = [magneticField, electricField]
  out = [eCrossB]

  indVars_magneticField = ["bx", "by", "bz"]
  indVars_electricField = ["ex", "ey", "ez"]

  factor = 10.0

  preExprs = ["Sx = (ey*bz-ez*by)", "Sy = (ez*bx-ex*bz)", "Sz =
  (ex*by-ey*bx)"]

  exprs = ["factor*Sx", "factor*Sy", "factor*Sz"]
</Updater>