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

Go to the source code of this file.

Functions

void SAVE_SOL (Data *d, Grid *grid)
 
void GET_SOL (Data *d, Grid *grid)
 

Variables

static int nstep0
 
static Data_Arr V0
 
static Data_Arr Vs0
 
static double t0
 
static double dt0
 

Function Documentation

void GET_SOL ( Data d,
Grid grid 
)

Definition at line 47 of file failsafe.c.

54 {
55  for (nv = NVAR; nv--; ){
56  DOM_LOOP(k,j,i){
57  d->Vc[nv][k][j][i] = V0[nv][k][j][i];
58  }}
59 
60  #ifdef STAGGERED_MHD
61  for (k = KBEG-1; k <= KEND; k++){
62  for (j = JBEG-1; j <= JEND; j++){
63  for (i = IBEG-1; i <= IEND; i++){
64  D_EXPAND(
65  d->Vs[BX1s][k][j][i] = Vs0[BX1s][k][j][i]; ,
66  d->Vs[BX2s][k][j][i] = Vs0[BX2s][k][j][i]; ,
67  d->Vs[BX3s][k][j][i] = Vs0[BX3s][k][j][i];)
68  }}}
69  #endif
71  g_dt = dt0;
72  t0 = g_time;
73 
74 }
static Data_Arr V0
Definition: failsafe.c:4
double **** Vs
The main four-index data array used for face-centered staggered magnetic fields.
Definition: structs.h:43
DOM_LOOP(k, j, i)
Definition: analysis.c:22
static Data_Arr Vs0
Definition: failsafe.c:4
double **** Vc
The main four-index data array used for cell-centered primitive variables.
Definition: structs.h:31
double g_dt
The current integration time step.
Definition: globals.h:118
#define BX3s
Definition: ct.h:29
long int g_stepNumber
Gives the current integration step number.
Definition: globals.h:97
int j
Definition: analysis.c:2
long int IEND
Upper grid index of the computational domain in the the X1 direction for the local processor...
Definition: globals.h:37
int k
Definition: analysis.c:2
#define BX1s
Definition: ct.h:27
static double dt0
Definition: failsafe.c:5
D_EXPAND(tot/[n]=(double) grid[IDIR].np_int_glob;, tot/[n]=(double) grid[JDIR].np_int_glob;, tot/[n]=(double) grid[KDIR].np_int_glob;)
Definition: analysis.c:27
int i
Definition: analysis.c:2
double g_time
The current integration time.
Definition: globals.h:117
long int KBEG
Lower grid index of the computational domain in the the X3 direction for the local processor...
Definition: globals.h:43
#define BX2s
Definition: ct.h:28
long int KEND
Upper grid index of the computational domain in the the X3 direction for the local processor...
Definition: globals.h:45
long int JBEG
Lower grid index of the computational domain in the the X2 direction for the local processor...
Definition: globals.h:39
#define NVAR
Definition: pluto.h:609
long int JEND
Upper grid index of the computational domain in the the X2 direction for the local processor...
Definition: globals.h:41
static double t0
Definition: failsafe.c:5
long int IBEG
Lower grid index of the computational domain in the the X1 direction for the local processor...
Definition: globals.h:35
static int nstep0
Definition: failsafe.c:3

Here is the call graph for this function:

void SAVE_SOL ( Data d,
Grid grid 
)

Definition at line 8 of file failsafe.c.

15 {
16  int i, j, k;
17 
18  if (V0 == NULL){
19  V0 = ARRAY_4D(NVAR, NX3_TOT, NX2_TOT, NX1_TOT, double);
20  #ifdef STAGGERED_MHD
21  Vs0 = ARRAY_4D(NVAR, NX3_TOT, NX2_TOT, NX1_TOT, double);
22  #endif
23  }
24 
25  for (nv = NVAR; nv--; ){
26  DOM_LOOP(k,j,i){
27  V0[nv][k][j][i] = d->Vc[nv][k][j][i];
28  }}
29 
30  #ifdef STAGGERED_MHD
31  for (k = KBEG-1; k <= KEND; k++){
32  for (j = JBEG-1; j <= JEND; j++){
33  for (i = IBEG-1; i <= IEND; i++){
34  D_EXPAND(
35  Vs0[BX1s][k][j][i] = d->Vs[BX1s][k][j][i]; ,
36  Vs0[BX2s][k][j][i] = d->Vs[BX2s][k][j][i]; ,
37  Vs0[BX3s][k][j][i] = d->Vs[BX3s][k][j][i];)
38  }}}
39  #endif
40 
42  dt0 = g_dt;
43  t0 = g_time;
44 }
static Data_Arr V0
Definition: failsafe.c:4
double **** Vs
The main four-index data array used for face-centered staggered magnetic fields.
Definition: structs.h:43
DOM_LOOP(k, j, i)
Definition: analysis.c:22
static Data_Arr Vs0
Definition: failsafe.c:4
long int NX2_TOT
Total number of zones in the X2 direction (boundaries included) for the local processor.
Definition: globals.h:57
double **** Vc
The main four-index data array used for cell-centered primitive variables.
Definition: structs.h:31
double g_dt
The current integration time step.
Definition: globals.h:118
#define BX3s
Definition: ct.h:29
long int g_stepNumber
Gives the current integration step number.
Definition: globals.h:97
long int NX3_TOT
Total number of zones in the X3 direction (boundaries included) for the local processor.
Definition: globals.h:59
int j
Definition: analysis.c:2
#define ARRAY_4D(nx, ny, nz, nv, type)
Definition: prototypes.h:173
long int IEND
Upper grid index of the computational domain in the the X1 direction for the local processor...
Definition: globals.h:37
int k
Definition: analysis.c:2
#define BX1s
Definition: ct.h:27
static double dt0
Definition: failsafe.c:5
D_EXPAND(tot/[n]=(double) grid[IDIR].np_int_glob;, tot/[n]=(double) grid[JDIR].np_int_glob;, tot/[n]=(double) grid[KDIR].np_int_glob;)
Definition: analysis.c:27
int i
Definition: analysis.c:2
double g_time
The current integration time.
Definition: globals.h:117
long int KBEG
Lower grid index of the computational domain in the the X3 direction for the local processor...
Definition: globals.h:43
#define BX2s
Definition: ct.h:28
long int KEND
Upper grid index of the computational domain in the the X3 direction for the local processor...
Definition: globals.h:45
long int JBEG
Lower grid index of the computational domain in the the X2 direction for the local processor...
Definition: globals.h:39
#define NVAR
Definition: pluto.h:609
long int JEND
Upper grid index of the computational domain in the the X2 direction for the local processor...
Definition: globals.h:41
long int NX1_TOT
Total number of zones in the X1 direction (boundaries included) for the local processor.
Definition: globals.h:55
static double t0
Definition: failsafe.c:5
long int IBEG
Lower grid index of the computational domain in the the X1 direction for the local processor...
Definition: globals.h:35
static int nstep0
Definition: failsafe.c:3

Here is the call graph for this function:

Variable Documentation

double dt0
static

Definition at line 5 of file failsafe.c.

int nstep0
static

Definition at line 3 of file failsafe.c.

double t0
static

Definition at line 5 of file failsafe.c.

Data_Arr V0
static

Definition at line 4 of file failsafe.c.

Data_Arr Vs0
static

Definition at line 4 of file failsafe.c.