PLUTO  4.0
 All Data Structures Files Functions Variables Enumerations Macros Pages
prototypes.h
1 /* ---------------------------------------------------------------------
2  General function prototypes
3  --------------------------------------------------------------------- */
4 
5 void AdvectFlux (const State_1D *, int, int, Grid *);
6 void Analysis (const Data *, Grid *);
7 #if EOS == BAROTROPIC
8  double BAROTROPIC_PR(double);
9 #endif
10 double BodyForcePotential(double, double, double);
11 void BodyForceVector(double *, double *, double, double, double);
12 
13 void ChangeDumpVar ();
14 void CheckConsStates (double **, double **, double **, int, int);
15 void CheckPrimStates (double **, double **, double **, int, int);
16 int CheckNaN (double **, int, int, int);
17 unsigned char CheckZone (int z, int bit);
18 void ComputeUserVar (const Data *, Grid *);
19 float ***Convert_dbl2flt (double ***, int);
20 
21 void ConsToPrim3D(const Data *, int);
22 void PrimToCons3D(const Data *, int);
23 void CreateImage (char *);
24 
25 void EntropySwitch (const Data *, Grid *);
26 
27 #ifdef FINITE_DIFFERENCE
28  Riemann_Solver FD_Flux;
29  Reconstruct MP5_Reconstruct, PPM_Reconstruct, LIMO3_Reconstruct,
30  WENOZ_Reconstruct, WENO3_Reconstruct;
31  void FD_GetMaxEigenvalues (const Data *d, State_1D *state, Grid *grid);
32 #endif
33 
34 void FindShock (const Data *, Grid *);
35 void FlagReset (const Data *d);
36 void Flatten (const State_1D *, int, int, Grid *);
37 void FreeGrid (Grid *);
38 
39 Image *GetImage (char *);
40 double *GetInverse_dl (const Grid *);
41 int GetNghost (Input *);
42 double ***GetUserVar (char *);
43 
44 void Init (double *, double, double, double);
45 void Initialize(int argc, char *argv[], Data *, Input *, Grid *, Cmd_Line *);
46 
47 void InternalBoundaryReset (const State_1D *, Time_Step *, int, int, Grid *);
48 
49 void InputDataSet (char *, int *);
50 void InputDataRead (char *);
51 void InputDataFree (void);
52 
53 int IsLittleEndian (void);
54 
55 void MakeState (State_1D *);
56 void MakeGeometry (Grid *);
57 double Median (double a, double b, double c);
58 
59 void ParabolicFlux(Data_Arr, const State_1D *, double **, int, int, Grid *);
60 double ParabolicRHS (const Data *, Data_Arr, double, Grid *);
61 void ParseCmdLineArgs (int, char *argv[], char *, Cmd_Line *);
62 int ParOpen (char *);
63 char *ParGet (const char *, int );
64 int ParQuery (const char *);
65 void PrimToChar (double **, double *, double *);
66 
67 void ResetState (const Data *, State_1D *, Grid *);
68 void RightHandSide (const State_1D *, Time_Step *, int, int, double, Grid *);
69 void RKC (const Data *d, Time_Step *, Grid *);
70 
71 void SetColorMap (unsigned char *, unsigned char *, unsigned char *, char *);
72 void SetDefaultVarNames(Output *);
73 int SetDumpVar (char *, int, int);
74 Riemann_Solver *SetSolver (const char *);
75 void SetIndexes (Index *indx, Grid *grid);
76 void SetOutput (Data *d, Input *input);
77 void SetRBox(RBox *, RBox *, RBox *, RBox *);
78 int Setup (Input *, Cmd_Line *, char *);
79 void SetGrid (struct INPUT *INI, Grid *);
80 void SetJetDomain (const Data *, int, int, Grid *);
81 void SoundSpeed2 (double **, double *, double *, int, int, int, Grid *);
82 void SplitSource (const Data *, double, Time_Step *, Grid *);
83 void Startup (Data *, Grid *);
84 void States (const State_1D *, int, int, Grid *);
85 
86 void UnsetJetDomain (const Data *, int, Grid *);
87 
88 void VectorPotentialDiff (double *b, int, int, int, Grid *);
89 void VISC_FLUX (const State_1D *, int beg, int end, Grid *);
90 
91 /* ---------------------------------------------------------------------
92  Prototyping for memory allocation functions
93  --------------------------------------------------------------------- */
94 
95 char *Array1D (int, size_t);
96 char **Array2D (int, int, size_t);
97 char ***Array3D (int, int, int, size_t);
98 char ****Array4D (int, int, int, int, size_t);
99 
100 double ***ArrayBox(long int, long int, long int, long int, long int, long int);
101 
102 double ***ArrayBoxMap (int, int, int, int, int, int, double *);
103 double ***ArrayMap (int, int, int, double *);
104 
105 unsigned char ***ArrayCharMap (int, int, int, unsigned char *);
106 
107 void FreeArray1D (void *);
108 void FreeArray2D (void **);
109 void FreeArray3D (void ***);
110 void FreeArray4D (void ****);
111 
112 void FreeArrayBox(double ***, long, long, long);
113 
114 void FreeArrayBoxMap (double ***, int, int, int, int, int, int);
115 void FreeArrayMap (double ***);
116 
117 void FreeArrayCharMap(unsigned char ***);
118 
119 #define ARRAY_1D(nx,type) (type *)Array1D(nx,sizeof(type))
120 #define ARRAY_2D(nx,ny,type) (type **)Array2D(nx,ny,sizeof(type))
121 #define ARRAY_3D(nx,ny,nz,type) (type ***)Array3D(nx,ny,nz,sizeof(type))
122 #define ARRAY_4D(nx,ny,nz,nv,type) (type ****)Array4D(nx,ny,nz,nv,sizeof(type))
123 
124 /* ---------------------------------------------------------------------
125  Prototyping for time-stepping functions
126  --------------------------------------------------------------------- */
127 
128 void CharTracingStep(const State_1D *, int, int, Grid *);
129 void HancockStep (const State_1D *, int, int, Grid *);
130 int Sweep (const Data *, Riemann_Solver *, Time_Step *, Grid *);
131 void STS (const Data *d, Time_Step *, Grid *);
132 int Unsplit (const Data *, Riemann_Solver *, Time_Step *, Grid *);
133 
134 /* ---------------------------------------------------------------------
135  Prototyping for standard output/debugging
136  --------------------------------------------------------------------- */
137 
138 void print (const char *fmt, ...);
139 void print1 (const char *fmt, ...);
140 void ShowMatrix(double **, double);
141 void Show (double **, int);
142 void ShowConfig();
143 void ShowDomainDecomposition (int, Grid *);
144 void ShowUnits ();
145 void Trace (double);
146 void Where (int, Grid *);
147 
148 /* ---------------------------------------------------------------------
149  Prototyping for Boundary condition functions
150  --------------------------------------------------------------------- */
151 
152 void Boundary (const Data *, int, Grid *);
153 void FlipSign (int, int, int *);
154 void OutflowBound (double ***, RBox *, int, Grid *);
155 void PeriodicBound (double ***, RBox *, int);
156 void ReflectiveBound(double ***, RBox *, int, int);
157 void UserDefBoundary (const Data *, RBox *, int, Grid *);
158 
159 /* ---------------------------------------------------------------------
160  Prototyping for I/O functions
161  --------------------------------------------------------------------- */
162 
163 #ifdef USE_ASYNC_IO
164 void Async_EndWriteData (Input *ini);
165 void Async_BegWriteData (const Data *d, Output *output, Grid *grid);
166 #endif
167 int CloseBinaryFile (FILE *, int);
168 FILE *OpenBinaryFile (char *, int, char *);
169 void ReadBinaryArray (void *, size_t, int, FILE *, int, int);
170 void ReadHDF5 (Output *output, Grid *grid);
171 
172 void Restart (Input *, int, int, Grid *);
173 void RestartDump (Input *);
174 void RestartGet (Input *, int, int, int);
175 
176 void SwapEndian (void *, const int);
177 
178 void WriteData (const Data *, Output *, Grid *);
179 void WriteBinaryArray (void *, size_t, int, FILE *, int);
180 void WriteHDF5 (Output *output, Grid *grid);
181 void WriteVTK_Header (FILE *, Grid *);
182 void WriteVTK_Vector (FILE *, Data_Arr, char *, Grid *);
183 void WriteVTK_Scalar (FILE *, double ***, char *, Grid *);
184 void WriteTabArray (Output *, char *, Grid *);
185 void WritePPM (double ***, char *, char *, Grid *);
186 void WritePNG (double ***, char *, char *, Grid *);
187 
188 /* ---------------------------------------------------------------------
189  Prototype for cooling functions
190  --------------------------------------------------------------------- */
191 
192 #if COOLING != NO
193  void Numerical_Jacobian (double *v, double **J);
194  void Jacobian (double *v, double *rhs, double **dfdy);
195  void CoolingSource (const Data *, double, Time_Step *, Grid *);
196  #if COOLING == POWER_LAW
197  void PowerLawCooling (Data_Arr, double, Time_Step *, Grid *);
198  #endif
199  /* move the following elsewhere ? */
200  double SolveODE_CK45 (double *, double *, double *, double, double);
201  double SolveODE_RKF23 (double *, double *, double *, double, double);
202  double SolveODE_RKF12 (double *, double *, double *, double, double);
203  double SolveODE_ROS34 (double *, double *, double *, double, double);
204  double SolveODE_RK4 (double *, double *, double *, double);
205  double SolveODE_RK2 (double *, double *, double *, double);
206  double SolveODE_Euler (double *, double *, double *, double);
207 #endif
208 
209 /* ----------------------------------------------
210  functions in tools.c
211  ---------------------------------------------- */
212 
213 void PlutoError (int, char *);
214 
215 int LUDecomp (double **a, int n, int *indx, double *d);
216 void LUBackSubst (double **a, int n, int *indx, double b[]);
217 
218 double Length_1 (int i, int j, int k, Grid *);
219 double Length_2 (int i, int j, int k, Grid *);
220 double Length_3 (int i, int j, int k, Grid *);
221 
222 #if UPDATE_VECTOR_POTENTIAL == YES
223  void VectorPotentialUpdate (const Data *d, const void *vp,
224  const State_1D *state, const Grid *grid);
225 #endif
226 
227 
228 void CYLSOLVE (const Data *d, double dt, Grid *grid);
229 void CONS_CYLSOLVE (Data_Arr, double dt, Grid *grid);
230 
231 /* ---------------------- NEW PROTOTYPES ------------------------------ */
232 
233 void TransformGrid (Grid *grid);
234 double GridMap(double, int);
235 
236 
237 /*
238 inline double Lmc_lim (const double, const double, const double);
239 inline double Lgminmod_lim (const double, const double, const double);
240 
241 inline double Lvanleer_lim (const double, const double);
242 
243 inline double Lvanalbada_lim (const double, const double);
244 
245 inline double Lminmod_lim (const double, const double);
246 inline double Lumist_lim (const double, const double);
247 inline double Lflat_lim (const double, const double);
248 
249 
250 #define SET_LIM(a, LIM(b,c)) \
251 {
252  double xx;
253  a = LIM(b,c);
254 }
255 */