PLUTO
flat_states.c File Reference
#include "pluto.h"
Include dependency graph for flat_states.c:

Go to the source code of this file.

Functions

void States (const State_1D *state, int beg, int end, Grid *grid)
 

Function Documentation

void States ( const State_1D state,
int  beg,
int  end,
Grid grid 
)

Compute 1D left and right interface states using piecewise linear reconstruction and the characteristic decomposition of the quasi-linear form of the equations.

This is done by first extrapolating the cell center value to the interface using piecewise limited linear reconstruction on the characteristic variables.

Left and right states are then evolved for the half time step using characteristic tracing if necessary.

Definition at line 4 of file flat_states.c.

20 {
21  int nv, i;
22 
23  #if TIME_STEPPING != EULER
24  #error FLAT Reconstruction must be used with EULER integration only
25  #endif
26 
27  for (i = beg; i <= end; i++) {
28  for (nv = 0; nv < NVAR; nv++) {
29  state->vm[i][nv] = state->vp[i][nv] = state->v[i][nv];
30  }}
31  PrimToCons(state->vm, state->um, beg, end);
32  PrimToCons(state->vp, state->up, beg, end);
33 
34 /* -------------------------------------------
35  Assign face-centered magnetic field
36  ------------------------------------------- */
37 
38  #ifdef STAGGERED_MHD
39  for (i = beg; i <= end-1; i++) {
40  state->vR[i][BXn] = state->vL[i][BXn] = state->bn[i];
41  }
42  #endif
43 
44 /* -------------------------------------------
45  compute states in conservative variables
46  ------------------------------------------- */
47 
48  PrimToCons (state->vp, state->up, beg, end);
49  PrimToCons (state->vm, state->um, beg, end);
50 }
double ** v
Cell-centered primitive varables at the base time level, v[i] = .
Definition: structs.h:134
int end
Global end index for the local array.
Definition: structs.h:116
double ** vR
Primitive variables to the right of the interface, .
Definition: structs.h:139
int BXn
Definition: globals.h:75
double ** vp
prim vars at i+1/2 edge, vp[i] = vL(i+1/2)
Definition: structs.h:142
int beg
Global start index for the local array.
Definition: structs.h:115
double ** vm
prim vars at i-1/2 edge, vm[i] = vR(i-1/2)
Definition: structs.h:141
void PrimToCons(double **uprim, double **ucons, int ibeg, int iend)
Definition: mappers.c:26
int i
Definition: analysis.c:2
double * bn
Face magentic field, bn = bx(i+1/2)
Definition: structs.h:165
double ** um
same as vm, in conservative vars
Definition: structs.h:146
double ** vL
Primitive variables to the left of the interface, .
Definition: structs.h:136
double ** up
same as vp, in conservative vars
Definition: structs.h:147
#define NVAR
Definition: pluto.h:609

Here is the call graph for this function: