Functions

restart.c File Reference

Functions for writing and reading restart files. More...

Go to the source code of this file.

Functions

void restart_grids (char *res_file, MeshS *pM)
 Reads nstep, time, dt, and arrays of ConsS and interface B for each of the Grid structures in the restart file.
void dump_restart (MeshS *pM, OutputS *pout)
 Writes a restart file, including problem-specific data from a user defined function.

Detailed Description

Functions for writing and reading restart files.

PURPOSE: Functions for writing and reading restart files. Restart files begin with the input parameter file (athinput.XX) used to start the run in text format, followed by binary format data for selected quantities (time, dt, etc) for each of the Grid structures being updated by this processor. Lastly, any problem-specific data in binary format is included, which must be written by a user function in the problem generator. Since all of the mesh data (NLevels, number of Domains, size of Grids, etc.) can be recalculated from the athinput file, only the dependent variables (time, dt, nstep, U, B, etc.) are dumped in restart files.

The athinput file included at the start of the restart file is parsed by main() in Step 2, using the standard par_* functions, with the parameters used by init_mesh() and init_grid() to re-initialize the grid. Parameter values read from the athinput file contained in the resfile can be superceded by input from the command line, or another input file.

MPI parallel jobs must be restarted on the same number of processors as they were run originally.

With SMR, restart files contain ALL levels and domains being updated by each processor in one file, written in the default directory for the process.

CONTAINS PUBLIC FUNCTIONS:

Definition in file restart.c.


Function Documentation

void dump_restart ( MeshS pM,
OutputS pout 
)
void restart_grids ( char *  res_file,
MeshS pM 
)

Reads nstep, time, dt, and arrays of ConsS and interface B for each of the Grid structures in the restart file.

By the time this function is called (in Step 6 of main()), the Mesh hierarchy has already been re-initialized by init_mesh() and init_grid() in Step 4 of main() using parameters in the athinput file at the start of this restart file, the command line, or from a new input file.

Definition at line 56 of file restart.c.

References alamcoeff, ath_error(), ConsS::B1c, GridS::B1i, ConsS::B2c, GridS::B2i, ConsS::B3c, GridS::B3i, ConsS::d, MeshS::Domain, MeshS::DomainsPerLevel, GridS::dt, MeshS::dt, ConsS::E, DomainS::Grid, GridS::grproperty, grrhoa, GridS::ie, Grain_Property::integrator, GridS::is, GridS::je, GridS::js, kb, GridS::ke, GridS::ks, Grain_Property::m, ConsS::M1, ConsS::M2, ConsS::M3, n, MeshS::NLevels, GridS::nparticle, MeshS::nstep, Grain_Property::num, GridS::particle, GridS::partypes, problem_read_restart(), Grain_Property::rad, Grain_Property::rho, ConsS::s, GridS::time, MeshS::time, tstop0, and GridS::U.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function: