# computePrimitiveState(1d, 2d, 3d)¶

The computePrimitiveState updater computes a vector of primitive variables, $$\mathbf{w} = \mathbf{w}(\mathbf{q})$$, (e.g. density, velocity, pressure), given a vector of conserved variables $$\mathbf{q}$$ (e.g. density, momentum, total energy) according to relationship specified by a Hyperbolic Equations.

The computePrimitiveState updater accepts the parameters below, 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 equation. Defined by the choice of Hyperbolic Equations.
out (string vector, required)
Output is a nodalArray which will contain $$\mathbf{w} \left( \mathbf{q} \right)$$. The number of components is defined by the choice of Hyperbolic Equations.

## Sub-Blocks¶

Equation (block, required)
The Hyperbolic Equations that defines $$\mathbf{q}$$, $$\mathcal{F}\left(\mathbf{w} \right)$$, $$\mathbf{w} =\mathbf{w}(\mathbf{q})$$, along with the eigensystem associated with $$\mathcal{F}\left( \mathbf{w}\right)$$.

## Example¶

The following block demonstrates the twoTemperatureMhdDednerEqn used in combination with computePrimitiveState(1d, 2d, 3d) to compute $$\mathbf{w} \left( \mathbf{q} \right)$$

 <Updater computePrimitiveState>
kind = computePrimitiveState1d

onGrid = domain
# input data-structures
in = [q,electricField,current,chargeState,resistivity]

# ouput data-structures
out = [w]

<Equation mhd>
kind = twoTemperatureMhdDednerEqn
gasGamma = GAS_GAMMA
electronGamma = $ELECTRON_GAMMA$
basementDensity = $BASEMENT_DENSITY$
basementPressure = $BASEMENT_PRESSURE$
externalEfield = "electricField"
currentVector = "current"
</Equation>

</Updater>