PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
fargo.h
1 /* **********************************************************************
2  * FARGO module header file.
3  *
4  * Last Modified: Jan 6th, 2012 by A. Mignone (mignone@ph.unito.it)
5  *
6  ************************************************************************ */
7 
8 #define FARGO_ORDER 3 /* order of interpolation:
9  either 2 or 3 */
10 #define FARGO_PRIM_SHIFT NO /* shift primitive (YES) or
11  conservative (NO) variables.
12  Default should be NO. */
13 #define FARGO_CONS_FORM YES /* Source terms are discretized in a
14  conservative fashion (YES) or
15  regularly (NO).
16  Default should be YES. */
17 #ifndef SHEARINGBOX
18  #define FARGO_AVERAGE_VELOCITY YES /* Background mean velocity is computed */
19 #else /* by averaging the orbital velocity (YES) */
20  #define FARGO_AVERAGE_VELOCITY NO /* or by prescribing the velocity exactly */
21 #endif /* in the user-supplied function */
22  /* FARGO_VELOCITY (NO). */
23 
24 #if GEOMETRY == SPHERICAL
25  #define FARGO_SELECT(w,k,j,i) ((w)[j][i])
26 #else
27  #define FARGO_SELECT(w,k,j,i) ((w)[k][i])
28 #endif
29 
30 /* ----------------------------------------------------------------
31  Note: when both FARGO and SHEARINGBOX modules are used, *ALL*
32  source terms are accounted for by the body_force function
33  ---------------------------------------------------------------- */
34 
35 /* -- SBEG and SEND are the initial and final
36  indices in the direction of the orbital velocity -- */
37 
38 #if GEOMETRY != SPHERICAL
39  #define SDIR JDIR
40  #define SBEG JBEG
41  #define SEND JEND
42  #define NS NX2
43  #define NS_TOT NX2_TOT
44 #else
45  #define SDIR KDIR
46  #define SBEG KBEG
47  #define SEND KEND
48  #define NS NX3
49  #define NS_TOT NX3_TOT
50 #endif
51 
52 #define SDOM_LOOP(s) for ((s) = SBEG; (s) <= SEND; (s)++)
53 
54 void FARGO_AddVelocity(const Data *, Grid *);
55 void FARGO_CHECK (Data_Arr V, Data_Arr U);
56 void FARGO_ComputeVelocity(const Data *, Grid *);
57 double **FARGO_GetVelocity(void);
58 void FARGO_SubtractVelocity(const Data *, Grid *);
59 void FARGO_ADD_SOURCE(const State_1D *, int, int, double, Grid *);
60 void FARGO_SHIFT(Data_Arr, Data_Arr, Grid *);
61 // int FARGO_MOD (int jc);
62 // void FARGO_FLUX (double *, double *, double w, double);
63 double FARGO_VELOCITY(double, double);