PLUTO  4.4-patch2
ct.h
Go to the documentation of this file.
1 /* ///////////////////////////////////////////////////////////////////// */
13 /* ///////////////////////////////////////////////////////////////////// */
14 #define STAGGERED_MHD
15 
16 /* ---- set labels for CT_EMF_AVERAGE ---- */
17 
18 #define ARITHMETIC 1
19 #define UCT0 2
20 #define UCT_CONTACT 3
21 #define CT_CONTACT 3
22 #define UCT_HLL 4
23 #define CT_FLUX 5
24 #define UCT_GFORCE 6
25 #define UCT_HLLD 7
26 #define CT_MAXWELL 8
27 
28 /* ---- staggered component labels ---- */
29 
30 #define BX1s 0
31 #if INCLUDE_JDIR
32  #define BX2s 1
33 #endif
34 #if INCLUDE_KDIR
35  #define BX3s 2
36 #endif
37 
38 #if (PHYSICS == ResRMHD)
39  #define EX1s (DIMENSIONS)
40  #if INCLUDE_JDIR
41  #define EX2s (EX1s + 1)
42  #endif
43  #if INCLUDE_KDIR
44  #define EX3s (EX2s + 1)
45  #endif
46 #endif
47 
48 /* ---- backward compatibility ---- */
49 
50 #define BXs BX1s
51 #define BYs BX2s
52 #define BZs BX3s
53 
54 #define FACE_EMF 11
55 #define EDGE_EMF 12
56 
57 /* *********************************************************************
58  Default values
59  ********************************************************************* */
60 
61 #ifndef CT_EMF_AVERAGE
62  #if PHYSICS == ResRMHD
63  #define CT_EMF_AVERAGE CT_MAXWELL
64  #else
65  #define CT_EMF_AVERAGE UCT_HLL
66  #endif
67 #endif
68 
69 #ifndef CT_EN_CORRECTION
70  #define CT_EN_CORRECTION NO
71 #endif
72 
73 /* Now define more convenient and user-friendly
74  pointer labels for geometry setting */
75 
76 #if GEOMETRY == CYLINDRICAL
77  #define iBRs BX1s
78  #define iBZs BX2s
79  #define iBPHIs BX3s
80 #endif
81 
82 #if GEOMETRY == POLAR
83  #define iBRs BX1s
84  #define iBPHIs BX2s
85  #define iBZs BX3s
86 #endif
87 
88 #if GEOMETRY == SPHERICAL
89  #define iBRs BX1s
90  #define iBTHs BX2s
91  #define iBPHIs BX3s
92 #endif
93 
94 /* ***********************************************************
95  \cond REPEAT_FUNCTION_DOCUMENTATION_IN_HEADER_FILES
96  Function prototyping
97  *********************************************************** */
98 
99 void CT_Allocate (EMF *);
100 void CT_AverageStaggeredFields (double ****Vs, double ****UU, RBox *, Grid *);
101 void CT_CheckDivB (double ***b[], Grid *);
102 void CT_ComputeEMF (const Data *, Grid *);
103 void CT_ComputeCenterEMF(const Data *);
104 void CT_EMF_ArithmeticAverage (const EMF *, const double);
105 void CT_EMF_IntegrateToCorner (const Data *, const EMF *, Grid *);
106 void CT_EMF_Riemann2D (const Data *, const EMF *, Grid *);
107 void CT_EMF_Flux(const Data *d, const EMF *emf, Grid *grid);
108 void CT_Flux(const Sweep *, int, int, Grid *);
109 void CT_GetEMF (const Data *, Grid *);
110 #if PHYSICS == ResRMHD
111 void CT_ComputeCharge(const Data *, RBox *, Grid *);
112 void CT_InterfaceCurrent(Data *, Grid *);
113 void FillElectricField (const Data *, int, Grid *);
114 void CT_IMEXImplicitUpdate(Data *, Data_Arr, double, Grid *);
115 void CT_MaxwellSolver(const Data *, const EMF *, Grid *);
116 void CT_ResistiveUpdate(const Data *, double, Grid *);
117 #endif
118 void CT_ResistiveEMF (const Data *, int, Grid *);
119 void CT_StoreUpwindEMF (const Sweep *, EMF *, int, int, Grid *);
120 void CT_Update(const Data *, Data_Arr, double, Grid *);
121 
122 void FillMagneticField (const Data *, int, Grid *);
123 
124 /* \endcond */
125 
void FillMagneticField(const Data *d, int side, Grid *grid)
Definition: ct_fill_mag_field.c:38
void CT_ComputeCenterEMF(const Data *data)
Definition: ct_emf.c:612
Definition: structs.h:31
void CT_EMF_IntegrateToCorner(const Data *d, const EMF *emf, Grid *grid)
Definition: ct_emf_average.c:70
Definition: structs.h:124
void CT_EMF_ArithmeticAverage(const EMF *Z1, const double w)
Definition: ct_emf_average.c:13
void CT_CheckDivB(double ***bf[], Grid *grid)
Definition: ct_update.c:344
void CT_EMF_Riemann2D(const Data *d, const EMF *emf, Grid *grid)
Definition: ct_emf_average.c:213
void CT_StoreUpwindEMF(const Sweep *sweep, EMF *emf, int beg, int end, Grid *grid)
Definition: ct_emf.c:166
void CT_IMEXImplicitUpdate(Data *d, Data_Arr J, double dt1, Grid *grid)
Definition: ct_imex_update_ELR.c:16
void CT_InterfaceCurrent(Data *d, Grid *grid)
Definition: ct_update.c:416
Definition: structs.h:514
void FillElectricField(const Data *d, int side, Grid *grid)
Definition: ct_fill_mag_field.c:155
void CT_AverageStaggeredFields(double ****Vs, double ****UU, RBox *box, Grid *grid)
Definition: ct_field_average.c:13
void CT_ComputeEMF(const Data *data, Grid *grid)
Definition: ct_emf.c:415
void CT_Update(const Data *d, Data_Arr Rs, double dt, Grid *grid)
Definition: ct_update.c:29
void CT_EMF_Flux(const Data *d, const EMF *emf, Grid *grid)
Definition: ct_emf_average.c:584
void CT_Allocate(EMF *emf0)
Definition: ct_emf.c:29
Definition: structs.h:201
void CT_ResistiveUpdate(const Data *d, double dt, Grid *grid)
Definition: ct_update.c:547
void CT_Flux(const Sweep *sweep, int beg, int end, Grid *grid)
Definition: ct_flux.c:25
Definition: structs.h:289