PLUTO  4.4-patch2
Functions
main.c File Reference

PLUTO main function. More...

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

Functions

static double NextTimeStep (timeStep *, Runtime *, Grid *)
 
static char * TotalExecutionTime (double)
 
static int Integrate (Data *, timeStep *, Grid *)
 
static void CheckForOutput (Data *, Runtime *, time_t, 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, NextTimeStep() responsible for computing the next time step based on the information available at the last time level.

The standard integration loop consists of the following steps:

Author
A. Mignone (migno.nosp@m.ne@t.nosp@m.o.inf.nosp@m.n.it)
Date
Nov 12, 2020

Function Documentation

◆ CheckForOutput()

void CheckForOutput ( Data d,
Runtime runtime,
time_t  t0,
Grid grid 
)
static

Check if file output has to be performed.

◆ Integrate()

int Integrate ( Data d,
timeStep Dts,
Grid grid 
)
static

Advance equations by a single time-step.

Parameters
dpointer to PLUTO Data structure;
Dtspointer to time Step structure;
gridpointer to grid structure.
Returns
An integer giving success / failure (development).

◆ main()

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.

◆ NextTimeStep()

double NextTimeStep ( timeStep Dts,
Runtime runtime,
Grid grid 
)
static

Compute and return the time step for the next time level using the information from the previous integration (Dts->invDt_hyp and Dts->invDt_par).

Parameters
[in]Dtspointer to the timeStep structure
[in]runtimepointer to the Runtime structure
[in]gridpointer to array of Grid structures
Returns
The time step for next time level

◆ TotalExecutionTime()

char * TotalExecutionTime ( double  dt)
static

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