# userDefinedEqn¶

Define an arbitrary hyperbolic system. Built in hyperbolic equations should be used when they are available as they are faster.

## Parameters¶

indVars_inName
For each input variable an “indVars” array must be defined. So if in = [E, B] then indVars_E and indVars_B must be defined. If indVars_E = [“Ex”,”Ey”,”Ez”] then operations are performed on “Ex”,”Ey” and “Ez” in the expression evaluator.
transform_inName
For each variable there must be a vector that tells how the data is transformed upon rotation. For example, for an electric field E, the transform would be transform_E = [vector] so that USim knows the input data is a vector. If the input data is density, momentum, energy as in the euler equations then we would have transform_q = [scalar, vector, scalar] which assumes that momentum has 3 components. The previous example transforms the first variable as if it were a scalar, then the next 3 variables as if they were part of a tensor and then the last variable as if it were a scalar. Available options are scalar, vector and tensor. It is assumed that vector has 3 components even in 1D and 2D simulations. Also it’s assumed that tensor has 6 components in the order Txx, Txy, Tx, Tyy, Tyz, Tzz and that the remaining components are symmetric so are redundant.
preExprs (string vector)
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)
flux (string vector)
Strings must be put in quotes. The strings are used to evaluate the flux in the x-direction. The fluxes in other directions are obtained through rotation of the input vector. Available command are defined by the muParser (http://muparser.sourceforge.net/)
eigenvalues (string vector)
Strings must be put in quotes. The strings are evaluated and placed in the output array and are used to define the set of eigenvalues for the system. The eigenvalues are technically the eigenvalues in the x-direction and values in other directions are obtained through rotation. Available command are defined by the muParser (http://muparser.sourceforge.net/)
other (variable definition)
In addition, an arbitrary number of constants can be defined that can then be used in evaluating expression in both preExprs and flux and eigenvalues.

## Parent Updater Data¶

in (string vector)
Input 1 to N are input nodalArray on which operations will be performed. Example in = [E, B]
out (string vector)
output nodalArray where the result of the operation is stored

## Example¶

<Updater hyper>
kind = classicMuscl1d
onGrid = domain

in = [q]
out = [qnew]
timeIntegrationScheme = none
numericalFlux = $RIEMANN_SOLVER$
cfl = CFL
variableForm = $VARIABLE_FORM$
limiter = [$LIMITER$]

equations = [euler]

<Equation euler>
kind = userDefinedEqn

indVars_q = ["rho","mx","my","mz","en"]
transform_q = [scalar, vector, scalar]

gamma = GAS_GAMMA
preExprs = ["p=(gamma-1.0)*(en-0.5*((mx*mx+my*my+mz*mz)/rho))"]
flux = ["mx","(mx*mx/rho)+p","(mx*my/rho)","(mx*mz/rho)","(mx/rho)*(en+p)"]
eigenvalues = ["sqrt(p*gamma/rho)+(mx/rho)"]

</Equation>

</Updater>