PLUTO
|
Convert between primitive and conservative variables. More...
#include "pluto.h"
Go to the source code of this file.
Functions | |
void | PrimToCons (double **uprim, double **ucons, int beg, int end) |
int | ConsToPrim (double **ucons, double **uprim, int beg, int end, unsigned char *flag) |
Convert between primitive and conservative variables.
The PrimToCons() converts an array of primitive quantities to an array of conservative variables for the RMHD equations.
The ConsToPrim() converts an array of conservative quantities to an array of primitive quantities. During the conversion, pressure is normally recovered from total energy using the algorithm outlined in
However, if the zone has been tagged with FLAG_ENTROPY, primitive variables are recovered by using the conserved entropy rather than total energy.
In other words:
if (FLAG_ENTROPY is TRUE) --> p = p(S) else --> p = p(E)
If the inversion scheme fails and p cannot be obtained the PressureFix() function is used.
Definition in file mappers.c.
int ConsToPrim | ( | double ** | ucons, |
double ** | uprim, | ||
int | beg, | ||
int | end, | ||
unsigned char * | flag | ||
) |
Convert from conservative to primitive variables.
[in] | ucons | array of conservative variables |
[out] | uprim | array of primitive variables |
[in] | beg | starting index of computation |
[in] | end | final index of computation |
[in,out] | flag | array of flags tagging, in input, zones where entropy must be used to recover pressure and, on output, zones where conversion was not successful. |
Definition at line 115 of file mappers.c.
void PrimToCons | ( | double ** | uprim, |
double ** | ucons, | ||
int | beg, | ||
int | end | ||
) |
Convert primitive variables to conservative variables.
[in] | uprim | array of primitive variables |
[out] | ucons | array of conservative variables |
[in] | beg | starting index of computation |
[in] | end | final index of computation |
Definition at line 36 of file mappers.c.