PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
fargo.h
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
14 /* ///////////////////////////////////////////////////////////////////// */
15 
16 #define FARGO_ORDER 3
21 #define FARGO_NSTEP_AVERAGE 10
22 
26 #ifndef SHEARINGBOX
27  #define FARGO_AVERAGE_VELOCITY YES
28 #else
29  #define FARGO_AVERAGE_VELOCITY NO
30 #endif
31 
32 
33 /* ----------------------------------------------------------------
34  Note: when both FARGO and SHEARINGBOX modules are used, *ALL*
35  source terms are accounted for by the body_force function
36  ---------------------------------------------------------------- */
37 
38 /* -- SBEG and SEND are the initial and final
39  indices in the direction of the orbital velocity -- */
40 
41 #if GEOMETRY != SPHERICAL
42  #define SDIR JDIR /* Orbital direction. */
43  #define SBEG JBEG /* Starting index in the orbital dir. */
44  #define SEND JEND /* Final index in the orbital dir. */
45  #define NS NX2
46  #define NS_TOT NX2_TOT
47 #else
48  #define SDIR KDIR
49  #define SBEG KBEG
50  #define SEND KEND
51  #define NS NX3
52  #define NS_TOT NX3_TOT
53 #endif
54 
55 /* ------------------------------------------------------------------
56  Handy macros for dimensional loops
57  ------------------------------------------------------------------ */
58 
59 #define SDOM_LOOP(s) for ((s) = SBEG; (s) <= SEND; (s)++)
60 
61 #if GEOMETRY == SPHERICAL
62  #define FARGO_ARRAY_INDEX(A,s,k,j,i) A[s][j][i]
63 /* #define FARGO_SELECT(w,k,j,i) ((w)[j][i]) */
64 #else
65  #define FARGO_ARRAY_INDEX(A,s,k,j,i) A[k][s][i]
66 /* #define FARGO_SELECT(w,k,j,i) ((w)[k][i]) */
67 #endif
68 
69 /* -----------------------------------------------------------------
70  Prevent compilation when Fargo and AMR are given simultaneously
71  ----------------------------------------------------------------- */
72 
73 #ifdef CH_SPACEDIM
74  #error FARGO and AMR are not compatible
75 #endif
76 
77 void FARGO_AddVelocity(const Data *, Grid *);
78 void FARGO_CHECK (Data_Arr V, Data_Arr U);
79 void FARGO_ComputeVelocity(const Data *, Grid *);
80 double **FARGO_GetVelocity(void);
81 void FARGO_SubtractVelocity(const Data *, Grid *);
82 void FARGO_ShiftSolution(Data_Arr, Data_Arr, Grid *);
83 double FARGO_SetVelocity(double, double);
84 void FARGO_ADD_SOURCE(const State_1D *, int, int, double, Grid *);