PLUTO
fargo.h
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
2 /*!
3  \file
4  \brief FARGO-MHD module header file.
5 
6  Contains contains basic definitions and declarations used by the
7  FARGO-MHD module.
8 
9  \authors A. Mignone (mignone@ph.unito.it)\n
10  G. Muscianisi (g.muscianisi@cineca.it)
11  \date Oct 6, 2014
12  \todo
13 */
14 /* ///////////////////////////////////////////////////////////////////// */
15 
16 #ifndef FARGO_ORDER
17  #define FARGO_ORDER 3 /**< Set the order of interpolation during
18  the linear transport step. Either 2 or 3. Default is 3. */
19 #endif
20 
21 /*! Set how often (in number of steps) the total azimuthal
22  velocity should be averaged. */
23 #ifndef FARGO_NSTEP_AVERAGE
24  #define FARGO_NSTEP_AVERAGE 10 /* Default is 10 */
25 #endif
26 
27 /*! Average background velocity is computed by averaging the orbital
28  velocity (YES) or by prescribing the velocity analytically exactly in
29  the user-supplied function FARGO_SetVelocity */
30 #ifndef FARGO_AVERAGE_VELOCITY
31  #ifndef SHEARINGBOX
32  #define FARGO_AVERAGE_VELOCITY YES /* Default is YES */
33  #else
34  #define FARGO_AVERAGE_VELOCITY NO /* Default is NO */
35  #endif
36 #endif
37 
38 
39 /* ----------------------------------------------------------------
40  Note: when both FARGO and SHEARINGBOX modules are used, *ALL*
41  source terms are accounted for by the body_force function
42  ---------------------------------------------------------------- */
43 
44 /* -- SBEG and SEND are the initial and final
45  indices in the direction of the orbital velocity -- */
46 
47 #if GEOMETRY != SPHERICAL
48  #define SDIR JDIR /* Orbital direction. */
49  #define SBEG JBEG /* Starting index in the orbital dir. */
50  #define SEND JEND /* Final index in the orbital dir. */
51  #define NS NX2
52  #define NS_TOT NX2_TOT
53 #else
54  #define SDIR KDIR
55  #define SBEG KBEG
56  #define SEND KEND
57  #define NS NX3
58  #define NS_TOT NX3_TOT
59 #endif
60 
61 /* ------------------------------------------------------------------
62  Handy macros for dimensional loops
63  ------------------------------------------------------------------ */
64 
65 #define SDOM_LOOP(s) for ((s) = SBEG; (s) <= SEND; (s)++)
66 
67 #if GEOMETRY == SPHERICAL
68  #define FARGO_ARRAY_INDEX(A,s,k,j,i) A[s][j][i]
69 /* #define FARGO_SELECT(w,k,j,i) ((w)[j][i]) */
70 #else
71  #define FARGO_ARRAY_INDEX(A,s,k,j,i) A[k][s][i]
72 /* #define FARGO_SELECT(w,k,j,i) ((w)[k][i]) */
73 #endif
74 
75 /* -----------------------------------------------------------------
76  Prevent compilation when Fargo and AMR are given simultaneously
77  ----------------------------------------------------------------- */
78 
79 #ifdef CH_SPACEDIM
80  #error FARGO and AMR are not compatible
81 #endif
82 
83 void FARGO_AddVelocity(const Data *, Grid *);
84 void FARGO_CHECK (Data_Arr V, Data_Arr U);
85 void FARGO_ComputeVelocity(const Data *, Grid *);
86 double **FARGO_GetVelocity(void);
88 void FARGO_SubtractVelocity(const Data *, Grid *);
90 double FARGO_SetVelocity(double, double);
91 void FARGO_Source(Data_Arr, double, Grid *);
void FARGO_ComputeVelocity(const Data *, Grid *)
double **** Data_Arr
Definition: pluto.h:492
void FARGO_AddVelocity(const Data *, Grid *)
int FARGO_HasTotalVelocity()
void FARGO_Source(Data_Arr, double, Grid *)
Definition: fargo_source.c:28
void FARGO_SubtractVelocity(const Data *, Grid *)
Definition: structs.h:78
Definition: structs.h:30
double ** FARGO_GetVelocity(void)
void FARGO_ShiftSolution(Data_Arr, Data_Arr, Grid *)
Definition: fargo.c:42
void FARGO_CHECK(Data_Arr V, Data_Arr U)
double FARGO_SetVelocity(double, double)
Definition: init.c:502