PLUTO main function. More...
Functions | |
static double | GetNextTimeStep (Time_Step *, struct INPUT *, Grid *) |
static int | Integrate (Data *, Riemann_Solver *, Time_Step *, Grid *) |
static void | CheckForOutput (Data *, Input *, Grid *) |
int | main (int argc, char *argv[]) |
The file main.c contains the PLUTO main function and several other top-level routines. main() provides basic code initialization, handles the the principal integration loop and calls the output driver write_data.c. Other useful functions contained in this file are Integrate() which does the actual integration, GetNextTimeStep() responsible for computing the next time step based on the information available at the last time level.
We use two slightly different integration loops depending on whether asnchrounous I/O has to be performed (macro USE_ASYNC_IO). If the macro USE_ASYNC_IO is not defined, the standard integration loop consists of the following steps:
Otherwise, using Asynchrounous I/O:
Check if file output has to be performed.
Compute and return the time step for the next time level using the information from the previous integration (Dts->inv_dta and Dts->inv_dp).
[in] | Dts | pointer to the Time_Step structure |
[in] | ini | pointer to the Input structure |
[in] | grid | pointer to array of Grid structures |
Advance equations by a single time-step.
d | pointer to PLUTO Data structure; |
Solver | pointer to a Riemann solver function; |
Dts | pointer to time Step structure; |
grid | pointer to grid structure. |
int main | ( | int | argc, |
char * | argv[] | ||
) |
Start PLUTO, initialize functions, define data structures and handle the main integration loop.
[in] | argc | Argument counts. |
[in] | argv | Array of pointers to the strings. |