PLUTO  4.4-patch2
fargo.h
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
14 /* ///////////////////////////////////////////////////////////////////// */
15 
18 #ifndef FARGO_ORDER
19  #define FARGO_ORDER 3
20 #endif
21 
24 #ifndef FARGO_NSTEP_AVERAGE
25  #ifdef SHEARINGBOX
26  #define FARGO_NSTEP_AVERAGE -1 /* Never average with ShearinBox model */
27  #else
28  #define FARGO_NSTEP_AVERAGE 10 /* Default is 10 */
29  #endif
30 #endif
31 
33 #ifndef FARGO_OUTPUT_VTOT
34  #define FARGO_OUTPUT_VTOT NO
35 #endif
36 
37 #define FARGO_W (NVAR+4) /* 1,2,3 already taken by vec. potential */
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 #else
70  #define FARGO_ARRAY_INDEX(A,s,k,j,i) A[k][s][i]
71 #endif
72 
73 #if (GEOMETRY == CARTESIAN) || (GEOMETRY == POLAR)
74  #define FARGO_VELOCITY3D(w, i,j,k) w[k][i]
75 #elif GEOMETRY == SPHERICAL
76  #define FARGO_VELOCITY3D(w, i,j,k) w[j][i]
77 #endif
78 
79 /* -----------------------------------------------------------------
80  Prevent compilation when Fargo and AMR are given simultaneously
81  ----------------------------------------------------------------- */
82 
83 #ifdef CH_SPACEDIM
84  #error FARGO and AMR are not compatible
85 #endif
86 
87 void FARGO_AverageVelocity(const Data *, Grid *);
88 void FARGO_ComputeResidualVelocity(const Data *, double ***, Grid *);
89 void FARGO_ComputeTotalVelocity (const Data *, double ***, Grid *);
90 void FARGO_Initialize(void);
91 void FARGO_RestartOld(const Data *, Grid *);
92 void FARGO_Restart(const Data *, char *, int, int, Grid *);
93 void FARGO_ShiftSolution(Data_Arr, Data_Arr, Grid *);
94 #if PARTICLES
95 void FARGO_ShiftParticles(Data *, Grid *, double);
96 #endif
97 void FARGO_Source(Data_Arr, Data_Arr, double, Grid *);
98 double **FARGO_Velocity(void);
99 void FARGO_Write(const Data *, char *, int, Grid *);
100 
101 
void FARGO_Initialize(void)
Definition: fargo_velocity.c:26
Definition: structs.h:124
void FARGO_Restart(const Data *, char *, int, int, Grid *)
Definition: fargo_io.c:213
double ** FARGO_Velocity(void)
Definition: fargo_velocity.c:396
void FARGO_Source(Data_Arr, Data_Arr, double, Grid *)
Definition: fargo_source.c:28
void FARGO_AverageVelocity(const Data *, Grid *)
Definition: fargo_velocity.c:40
void FARGO_ComputeTotalVelocity(const Data *, double ***, Grid *)
Definition: fargo_velocity.c:229
Definition: structs.h:514
void FARGO_ComputeResidualVelocity(const Data *, double ***, Grid *)
Definition: fargo_velocity.c:314
void FARGO_ShiftSolution(Data_Arr, Data_Arr, Grid *)
Definition: fargo.c:42