initialize (1d, 2d, 3d)

Initializes a nodalArray according to a user specified function block.

Data

out (string vector, required)
Outputs 1 to N are nodalArrays which are initialized according to the function of this updater. If multiple outs are specified, then each nodalArray must have the same number components.

Parameters

There are no additional parameters for this kind of Updater

Sub-Blocks

Function (block, required)
exprFunc for specifying the initial condition.

Example

The following code block specificies the initial condition for a magnetized shock tube for a two temperature plasma:

<Updater init>
  kind = initialize1d
  onGrid = domain
  out = [q]

  <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>
</Updater>