PLUTO  4.2
 All Data Structures Files Functions Variables Enumerations Macros Pages
Functions
main.c File Reference

PLUTO main function. More...

#include "pluto.h"
#include "globals.h"

Functions

static double NextTimeStep (Time_Step *, Runtime *, Grid *)
 
static char * TotalExecutionTime (double)
 
static int Integrate (Data *, Riemann_Solver *, Time_Step *, Grid *)
 
static void CheckForOutput (Data *, Runtime *, Grid *)
 
int main (int argc, char *argv[])
 

Detailed Description

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:

Author
A. Mignone (migno.nosp@m.ne@p.nosp@m.h.uni.nosp@m.to.i.nosp@m.t)
Date
Aug 16, 2012

Function Documentation

void CheckForOutput ( Data d,
Runtime ini,
Grid grid 
)
static

Check if file output has to be performed.

int Integrate ( Data d,
Riemann_Solver *  Solver,
Time_Step Dts,
Grid grid 
)
static

Advance equations by a single time-step.

Parameters
dpointer to PLUTO Data structure;
Solverpointer to a Riemann solver function;
Dtspointer to time Step structure;
gridpointer to grid structure.
Returns
An integer giving success / failure (development).
int main ( int  argc,
char *  argv[] 
)

Start PLUTO, initialize functions, define data structures and handle the main integration loop.

Parameters
[in]argcArgument counts.
[in]argvArray of pointers to the strings.
Returns
This function return 0 on normal exit.
double NextTimeStep ( Time_Step Dts,
Runtime ini,
Grid grid 
)
static

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).

Parameters
[in]Dtspointer to the Time_Step structure
[in]inipointer to the Runtime structure
[in]gridpointer to array of Grid structures
Returns
The time step for next time level
char * TotalExecutionTime ( double  dt)
static

convert a floating-point variable (dt, in seconds) to a string displaying days:hours:minutes:seconds