Performs arithmetic operations specified by a set of user defined expressions. . The expression evaluator checks the user supplied expression for validity and errors on finding undefined expressions.
exprs
(string vector, required)preExprs
(string vector, optional)other
(strings, optional)The following code block specificies the initial condition for a magnetized shock tube for a two temperature plasma:
<Function func>
kind = exprFunc
pr = 1.0
pl = 0.1
rhor = 1.0
rhol = 0.125
mu0 = MU0
gas_gamma = GAMMA
preExprs = [ \
"rho = if (x > 0.0, rhol, rhor)", \
"P = if(x > 0.0, pl, pr)", \
"bx = 0.75*sqrt(mu0)", \
"by = if(x>0.0, -1.0*sqrt(mu0), 1.0*sqrt(mu0))", \
"bz = 0.0",\
"phi = 0.0",\
]
exprs = ["rho", "0.0", "0.0", "0.0", "P/(gas_gamma-1)+(0.5/mu0)*(bx*bx+by*by)","bx","by","bz","phi","0.5*P/(gas_gamma-1)"]
</Function>