7.0
general documentation
cs_restart.h File Reference
#include "cs_defs.h"
#include "cs_time_step.h"
+ Include dependency graph for cs_restart.h:

Go to the source code of this file.

Macros

#define CS_RESTART_INTERVAL_NONE   -2
 
#define CS_RESTART_INTERVAL_ONLY_AT_END   -1
 
#define CS_RESTART_INTERVAL_DEFAULT   0
 
#define CS_RESTART_SUCCESS   0
 
#define CS_RESTART_ERR_FILE_NUM   -1
 
#define CS_RESTART_ERR_LOCATION   -2
 
#define CS_RESTART_ERR_VAL_TYPE   -3
 
#define CS_RESTART_ERR_N_VALS   -4
 
#define CS_RESTART_ERR_MODE   -5
 
#define CS_RESTART_ERR_EXISTS   -6
 

Typedefs

typedef struct _cs_restart_t cs_restart_t
 
typedef int() cs_restart_check_section_t(cs_restart_t *restart, void *context, const char *sec_name, int location_id, int n_location_vals, cs_restart_val_type_t val_type)
 Function pointer for modifying behavior when checking a section's presence. More...
 
typedef int() cs_restart_read_section_t(cs_restart_t *restart, void *context, const char *sec_name, int location_id, int n_location_vals, cs_restart_val_type_t val_type, void *val)
 Function pointer for modifying behavior when reading a section. More...
 
typedef void() cs_restart_write_section_t(cs_restart_t *restart, void *context, const char *sec_name, int location_id, int n_location_vals, cs_restart_val_type_t val_type, const void *val)
 Function pointer for modifying behavior when writing a section. More...
 

Enumerations

enum  cs_restart_mode_t { CS_RESTART_MODE_READ, CS_RESTART_MODE_WRITE }
 
enum  cs_restart_val_type_t { CS_TYPE_char, CS_TYPE_int, CS_TYPE_cs_gnum_t, CS_TYPE_cs_real_t }
 

Functions

void dflsui (int *ntsuit, cs_real_t *ttsuit, cs_real_t *wtsuit)
 
void reqsui (int *iisuit)
 
void stusui (void)
 
void trbsui (void)
 
void indsui (int *isuite)
 
void cs_restart_checkpoint_set_defaults (int nt_interval, double t_interval, double wt_interval)
 Define default checkpoint interval. More...
 
void cs_restart_checkpoint_set_mesh_mode (int mode)
 Define checkpoint behavior for mesh. More...
 
void cs_restart_checkpoint_set_last_ts (int nt_last)
 Define last forced checkpoint time step. More...
 
void cs_restart_checkpoint_set_next_ts (int nt_next)
 Define next forced checkpoint time step. More...
 
void cs_restart_checkpoint_set_next_tv (double t_next)
 Define next forced checkpoint time value. More...
 
void cs_restart_checkpoint_set_next_wt (double wt_next)
 Define next forced checkpoint wall-clock time value. More...
 
bool cs_restart_checkpoint_required (const cs_time_step_t *ts)
 Check if checkpointing is recommended at a given time. More...
 
void cs_restart_checkpoint_done (const cs_time_step_t *ts)
 Indicate checkpointing has been done at a given time. More...
 
int cs_restart_present (void)
 Check if we have a restart directory. More...
 
cs_restart_tcs_restart_create (const char *name, const char *path, cs_restart_mode_t mode)
 Initialize a restart file. More...
 
void cs_restart_destroy (cs_restart_t **restart)
 Destroy structure associated with a restart file (and close the file). More...
 
void cs_restart_check_base_location (const cs_restart_t *restart, bool *match_cell, bool *match_i_face, bool *match_b_face, bool *match_vertex)
 Check the locations associated with a restart file. More...
 
int cs_restart_add_location (cs_restart_t *restart, const char *location_name, cs_gnum_t n_glob_ents, cs_lnum_t n_ents, const cs_gnum_t *ent_global_num)
 Add a location definition. More...
 
void cs_restart_add_location_ref (const char *location_name, cs_gnum_t n_glob_ents, cs_lnum_t n_ents, const cs_gnum_t *ent_global_num)
 Add a reference location definition with a private copy. More...
 
void cs_restart_clear_locations_ref (void)
 Clear reference location definitions with a private copy. More...
 
void cs_restart_set_context (void *context)
 Associate a context to restart section check operations. More...
 
cs_restart_check_section_tcs_restart_set_check_section_func (cs_restart_check_section_t *func)
 Associate a function to restart section check operations. More...
 
cs_restart_read_section_tcs_restart_set_read_section_func (cs_restart_read_section_t *func)
 Associate a function and its input to all restart section read operations. More...
 
cs_restart_write_section_tcs_restart_set_write_section_func (cs_restart_write_section_t *func)
 Associate a function and its input to all restart section write operations. More...
 
const char * cs_restart_get_name (const cs_restart_t *restart)
 Return name of restart file. More...
 
cs_lnum_t cs_restart_get_n_location_elts (const cs_restart_t *restart, int location_id)
 Return local number of elements associated with a given restart location. More...
 
void cs_restart_dump_index (const cs_restart_t *restart)
 Print the index associated with a restart file in read mode. More...
 
int cs_restart_check_section (cs_restart_t *restart, const char *sec_name, int location_id, int n_location_vals, cs_restart_val_type_t val_type)
 Check the presence of a given section in a restart file. More...
 
int cs_restart_read_section (cs_restart_t *restart, const char *sec_name, int location_id, int n_location_vals, cs_restart_val_type_t val_type, void *val)
 Read a section from a restart file. More...
 
void cs_restart_write_section (cs_restart_t *restart, const char *sec_name, int location_id, int n_location_vals, cs_restart_val_type_t val_type, const void *val)
 Write a section to a restart file. More...
 
int cs_restart_read_particles_info (cs_restart_t *restart, const char *name, cs_lnum_t *n_particles)
 Read basic particles information from a restart file. More...
 
int cs_restart_read_particles (cs_restart_t *restart, int particles_location_id, cs_lnum_t *particle_cell_id, cs_real_t *particle_coords)
 Read basic particles information from a restart file. More...
 
int cs_restart_write_particles (cs_restart_t *restart, const char *name, bool number_by_coords, cs_lnum_t n_particles, const cs_lnum_t *particle_cell_id, const cs_real_t *particle_coords)
 Write basic particles information to a restart file. More...
 
int cs_restart_read_ids (cs_restart_t *restart, const char *sec_name, int location_id, int ref_location_id, cs_lnum_t ref_id_base, cs_lnum_t *ref_id)
 Read a referenced location id section from a restart file. More...
 
void cs_restart_write_ids (cs_restart_t *restart, const char *sec_name, int location_id, int ref_location_id, cs_lnum_t ref_id_base, const cs_lnum_t *ref_id)
 Write a referenced location id section to a restart file. More...
 
int cs_restart_read_section_compat (cs_restart_t *restart, const char *sec_name, const char *old_name, int location_id, int n_location_vals, cs_restart_val_type_t val_type, void *val)
 Read a section from a restart file, when that section may have used a different name in a previous version. More...
 
int cs_restart_read_real_3_t_compat (cs_restart_t *restart, const char *sec_name, const char *old_name_x, const char *old_name_y, const char *old_name_z, int location_id, cs_real_3_t *val)
 Read a cs_real_3_t vector section from a restart file, when that section may have used a different name and been non-interleaved in a previous version. More...
 
int cs_restart_read_real_6_t_compat (cs_restart_t *restart, const char *sec_name, const char *old_name_xx, const char *old_name_yy, const char *old_name_zz, const char *old_name_xy, const char *old_name_yz, const char *old_name_xz, int location_id, cs_real_6_t *val)
 Read a cs_real_6_t tensor section from a restart file, when that section may have used a different name and been non-interleaved in a previous version. More...
 
int cs_restart_read_real_66_t_compat (cs_restart_t *restart, const char *sec_name, const char *old_name_xx, const char *old_name_yy, const char *old_name_zz, const char *old_name_xy, const char *old_name_yz, const char *old_name_xz, int location_id, cs_real_66_t *val)
 Read a cs_real_66_t tensor section from a restart file, when that section may have used a different name and been non-interleaved in a previous version. More...
 
void cs_restart_print_stats (void)
 Print statistics associated with restart files. More...
 
int cs_restart_check_if_restart_from_ncfd (cs_restart_t *r)
 Checks if restart is done from a NCFD checkpoint file. More...
 
int cs_restart_is_from_ncfd (void)
 Returns if restart is done from a NCFD checkpoint file. More...
 
void cs_restart_set_n_max_checkpoints (int n_checkpoints)
 Set the number of checkpoint files to keep. More...
 
void cs_restart_clean_multiwriters_history (void)
 Remove all previous checkpoints which are not to be retained. More...
 
void cs_restart_multiwriters_destroy_all (void)
 Destroy the multiwriter structure at the end of the computation. More...
 

Macro Definition Documentation

◆ CS_RESTART_ERR_EXISTS

#define CS_RESTART_ERR_EXISTS   -6

Section not available

◆ CS_RESTART_ERR_FILE_NUM

#define CS_RESTART_ERR_FILE_NUM   -1

No restart file for the given number

◆ CS_RESTART_ERR_LOCATION

#define CS_RESTART_ERR_LOCATION   -2

Undefined location / incorrect size

◆ CS_RESTART_ERR_MODE

#define CS_RESTART_ERR_MODE   -5

Incompatible access mode

◆ CS_RESTART_ERR_N_VALS

#define CS_RESTART_ERR_N_VALS   -4

Number of values does not match

◆ CS_RESTART_ERR_VAL_TYPE

#define CS_RESTART_ERR_VAL_TYPE   -3

Unknown or unexpected value type

◆ CS_RESTART_INTERVAL_DEFAULT

#define CS_RESTART_INTERVAL_DEFAULT   0

◆ CS_RESTART_INTERVAL_NONE

#define CS_RESTART_INTERVAL_NONE   -2

◆ CS_RESTART_INTERVAL_ONLY_AT_END

#define CS_RESTART_INTERVAL_ONLY_AT_END   -1

◆ CS_RESTART_SUCCESS

#define CS_RESTART_SUCCESS   0

Success

Typedef Documentation

◆ cs_restart_check_section_t

typedef int() cs_restart_check_section_t(cs_restart_t *restart, void *context, const char *sec_name, int location_id, int n_location_vals, cs_restart_val_type_t val_type)

Function pointer for modifying behavior when checking a section's presence.

Note: if the context pointer is non-NULL, it must point to valid data when the selection function is called, so that value or structure should in general not be temporary.

Parameters
[in]restartassociated restart file pointer
[in,out]contextpointer to optional (untyped) value or structure.
[in]sec_namesection name
[in]location_idid of corresponding location
[in]n_location_valsnumber of values per location (interlaced)
[in]val_typevalue type
Returns
0 (CS_RESTART_SUCCESS) in case of success, or error code (CS_RESTART_ERR_xxx) in case of error

◆ cs_restart_read_section_t

typedef int() cs_restart_read_section_t(cs_restart_t *restart, void *context, const char *sec_name, int location_id, int n_location_vals, cs_restart_val_type_t val_type, void *val)

Function pointer for modifying behavior when reading a section.

Note: if the context pointer is non-NULL, it must point to valid data when the selection function is called, so that value or structure should in general not be temporary.

Parameters
[in]restartassociated restart file pointer
[in,out]contextpointer to optional (untyped) value or structure.
[in]sec_namesection name
[in]location_idid of corresponding location
[in]n_location_valsnumber of values per location (interlaced)
[in]val_typevalue type
[out]valarray of values
Returns
0 (CS_RESTART_SUCCESS) in case of success, or error code (CS_RESTART_ERR_xxx) in case of error

◆ cs_restart_t

typedef struct _cs_restart_t cs_restart_t

◆ cs_restart_write_section_t

typedef void() cs_restart_write_section_t(cs_restart_t *restart, void *context, const char *sec_name, int location_id, int n_location_vals, cs_restart_val_type_t val_type, const void *val)

Function pointer for modifying behavior when writing a section.

Note: if the context pointer is non-NULL, it must point to valid data when the selection function is called, so that value or structure should in general not be temporary.

Parameters
[in]restartassociated restart file pointer
[in,out]contextpointer to optional (untyped) value or structure.
[in]sec_namesection name
[in]location_idid of corresponding location
[in]n_location_valsnumber of values per location (interlaced)
[in]val_typevalue type
[in]valarray of values

Enumeration Type Documentation

◆ cs_restart_mode_t

Read or write mode

Enumerator
CS_RESTART_MODE_READ 

Read mode

CS_RESTART_MODE_WRITE 

Write mode

◆ cs_restart_val_type_t

Enumerator
CS_TYPE_char 
CS_TYPE_int 
CS_TYPE_cs_gnum_t 
CS_TYPE_cs_real_t 

Function Documentation

◆ cs_restart_add_location()

int cs_restart_add_location ( cs_restart_t restart,
const char *  location_name,
cs_gnum_t  n_glob_ents,
cs_lnum_t  n_ents,
const cs_gnum_t ent_global_num 
)

Add a location definition.

Parameters
[in]restartassociated restart file pointer
[in]location_namename associated with the location
[in]n_glob_entsglobal number of entities
[in]n_entslocal number of entities
[in]ent_global_numglobal entity numbers, or NULL
Returns
the location id assigned, or -1 in case of error

◆ cs_restart_add_location_ref()

void cs_restart_add_location_ref ( const char *  location_name,
cs_gnum_t  n_glob_ents,
cs_lnum_t  n_ents,
const cs_gnum_t ent_global_num 
)

Add a reference location definition with a private copy.

Parameters
[in]location_namename associated with the location
[in]n_glob_entsglobal number of entities
[in]n_entslocal number of entities
[in]ent_global_numglobal entity numbers, or NULL
Returns
the location id assigned, or -1 in case of error

◆ cs_restart_check_base_location()

void cs_restart_check_base_location ( const cs_restart_t restart,
bool *  match_cell,
bool *  match_i_face,
bool *  match_b_face,
bool *  match_vertex 
)

Check the locations associated with a restart file.

For each type of entity, the corresponding flag is set to true if the associated number of entities matches the current value (and so that we consider the mesh locations are the same), false otherwise.

Parameters
[out]restartassociated restart file pointer
[out]match_cellmatching cells flag
[out]match_i_facematching interior faces flag
[out]match_b_facematching boundary faces flag
[out]match_vertexmatching vertices flag

◆ cs_restart_check_if_restart_from_ncfd()

int cs_restart_check_if_restart_from_ncfd ( cs_restart_t r)

Checks if restart is done from a NCFD checkpoint file.

Returns
0 if no, 1 if yes

◆ cs_restart_check_section()

int cs_restart_check_section ( cs_restart_t restart,
const char *  sec_name,
int  location_id,
int  n_location_vals,
cs_restart_val_type_t  val_type 
)

Check the presence of a given section in a restart file.

Parameters
[in]restartassociated restart file pointer
[in]sec_namesection name
[in]location_idid of corresponding location
[in]n_location_valsnumber of values per location (interlaced)
[in]val_typevalue type
Returns
0 (CS_RESTART_SUCCESS) in case of success, or error code (CS_RESTART_ERR_xxx) in case of error

◆ cs_restart_checkpoint_done()

void cs_restart_checkpoint_done ( const cs_time_step_t ts)

Indicate checkpointing has been done at a given time.

This updates the status for future checks to determine if checkpointing is recommended at a given time.

Parameters
[in]tstime step status structure

◆ cs_restart_checkpoint_required()

bool cs_restart_checkpoint_required ( const cs_time_step_t ts)

Check if checkpointing is recommended at a given time.

Parameters
[in]tstime step status structure
Returns
true if checkpointing is recommended, false otherwise

◆ cs_restart_checkpoint_set_defaults()

void cs_restart_checkpoint_set_defaults ( int  nt_interval,
double  t_interval,
double  wt_interval 
)

Define default checkpoint interval.

Parameters
[in]nt_intervalif > 0 time step interval for checkpoint if 0, default of 4 checkpoints per run if -1, checkpoint at end if -2, no checkpointing
[in]t_intervalif > 0, time value interval for checkpoint
[in]wt_intervalif > 0, wall-clock interval for checkpoints

◆ cs_restart_checkpoint_set_last_ts()

void cs_restart_checkpoint_set_last_ts ( int  nt_last)

Define last forced checkpoint time step.

Parameters
[in]nt_lastlast time step for forced checkpoint

◆ cs_restart_checkpoint_set_mesh_mode()

void cs_restart_checkpoint_set_mesh_mode ( int  mode)

Define checkpoint behavior for mesh.

If mesh checkpointing is active (default), upon writing the first checkpoint file of a computation, a mesh_output file is moved to checkpoint/mesh_input if present. If not present but a mesh_input file (or link to file) is present, a hard link to that file is added as checkpoint/mesh_input.

A mesh_input directory is ignored, as it is normally only created when multiple input files are appended, which leads to the output and thus presence of a mesh_output file, unless explicitely deactivated by the user.

Parameters
[in]modeif 0, do not checkpoint mesh if 1, checkpoint mesh_output or mesh_input file

◆ cs_restart_checkpoint_set_next_ts()

void cs_restart_checkpoint_set_next_ts ( int  nt_next)

Define next forced checkpoint time step.

Parameters
[in]nt_nextnext time step for forced checkpoint

◆ cs_restart_checkpoint_set_next_tv()

void cs_restart_checkpoint_set_next_tv ( double  t_next)

Define next forced checkpoint time value.

Parameters
[in]t_nextnext time value for forced checkpoint

◆ cs_restart_checkpoint_set_next_wt()

void cs_restart_checkpoint_set_next_wt ( double  wt_next)

Define next forced checkpoint wall-clock time value.

Parameters
[in]wt_nextnext wall-clock time value for forced checkpoint

◆ cs_restart_clean_multiwriters_history()

void cs_restart_clean_multiwriters_history ( void  )

Remove all previous checkpoints which are not to be retained.

◆ cs_restart_clear_locations_ref()

void cs_restart_clear_locations_ref ( void  )

Clear reference location definitions with a private copy.

◆ cs_restart_create()

cs_restart_t* cs_restart_create ( const char *  name,
const char *  path,
cs_restart_mode_t  mode 
)

Initialize a restart file.

Parameters
[in]namefile name
[in]pathoptional directory name for output, or NULL for default (directory automatically created if necessary)
[in]moderead or write
Returns
pointer to initialized restart file structure
Parameters
[in]namefile name
[in]pathoptional directory name for output, or NULL for default (directory automatically created if necessary)
[in]moderead or write
Returns
pointer to initialized restart file structure

◆ cs_restart_destroy()

void cs_restart_destroy ( cs_restart_t **  restart)

Destroy structure associated with a restart file (and close the file).

Parameters
[in,out]restartpointer to restart file structure pointer

◆ cs_restart_dump_index()

void cs_restart_dump_index ( const cs_restart_t restart)

Print the index associated with a restart file in read mode.

Parameters
[in]restartassociated restart file pointer

◆ cs_restart_get_n_location_elts()

cs_lnum_t cs_restart_get_n_location_elts ( const cs_restart_t restart,
int  location_id 
)

Return local number of elements associated with a given restart location.

Parameters
[in]restartassociated restart file pointer
[in]location_idid of corresponding location
Returns
number of elements associated with location.

◆ cs_restart_get_name()

const char* cs_restart_get_name ( const cs_restart_t restart)

Return name of restart file.

Parameters
[in]restartassociated restart file pointer
Returns
base name of restart file

◆ cs_restart_is_from_ncfd()

int cs_restart_is_from_ncfd ( void  )

Returns if restart is done from a NCFD checkpoint file.

Returns
0 if no, 1 if yes

◆ cs_restart_multiwriters_destroy_all()

void cs_restart_multiwriters_destroy_all ( void  )

Destroy the multiwriter structure at the end of the computation.

◆ cs_restart_present()

int cs_restart_present ( void  )

Check if we have a restart directory.

Returns
1 if a restart directory is present, 0 otherwise

◆ cs_restart_print_stats()

void cs_restart_print_stats ( void  )

Print statistics associated with restart files.

◆ cs_restart_read_ids()

int cs_restart_read_ids ( cs_restart_t restart,
const char *  sec_name,
int  location_id,
int  ref_location_id,
cs_lnum_t  ref_id_base,
cs_lnum_t ref_id 
)

Read a referenced location id section from a restart file.

The section read from file contains the global ids matching the local element ids of a given location. Global id's are transformed to local ids by this function.

In case global referenced ids read do not match those of local elements, id_base - 1 is assigned to the corresponding local ids.

Parameters
[in]restartassociated restart file pointer
[in]sec_namesection name
[in]location_idid of location on which id_ref is defined
[in]ref_location_idid of referenced location
[in]ref_id_basebase of location entity id numbers (usually 0 or 1)
[out]ref_idarray of location entity ids
Returns
0 (CS_RESTART_SUCCESS) in case of success, or error code (CS_RESTART_ERR_xxx) in case of error

◆ cs_restart_read_particles()

int cs_restart_read_particles ( cs_restart_t restart,
int  particles_location_id,
cs_lnum_t particle_cell_id,
cs_real_t particle_coords 
)

Read basic particles information from a restart file.

Parameters
[in]restartassociated restart file pointer
[in]particles_location_idlocation id of particles set
[out]particle_cell_idlocal cell id to which particles belong
[out]particle_coordslocal particle coordinates (interleaved)
Returns
0 (CS_RESTART_SUCCESS) in case of success, or error code (CS_RESTART_ERR_xxx) in case of error

◆ cs_restart_read_particles_info()

int cs_restart_read_particles_info ( cs_restart_t restart,
const char *  name,
cs_lnum_t n_particles 
)

Read basic particles information from a restart file.

This includes building a matching location and associated global numbering.

Parameters
[in]restartassociated restart file pointer
[in]namename of particles set
[out]n_particlesnumber of particles, or NULL
Returns
the location id assigned to the particles, or -1 in case of error

◆ cs_restart_read_real_3_t_compat()

int cs_restart_read_real_3_t_compat ( cs_restart_t restart,
const char *  sec_name,
const char *  old_name_x,
const char *  old_name_y,
const char *  old_name_z,
int  location_id,
cs_real_3_t val 
)

Read a cs_real_3_t vector section from a restart file, when that section may have used a different name and been non-interleaved in a previous version.

This function assumes a mesh-base location (i.e. location_id > 0)

Parameters
[in]restartassociated restart file pointer
[in]sec_namesection name
[in]old_name_xold name, x component
[in]old_name_yold name, y component
[in]old_name_zold name, z component
[in]location_idid of corresponding location
[out]valarray of values
Returns
0 (CS_RESTART_SUCCESS) in case of success, or error code (CS_RESTART_ERR_xxx) in case of error

◆ cs_restart_read_real_66_t_compat()

int cs_restart_read_real_66_t_compat ( cs_restart_t restart,
const char *  sec_name,
const char *  old_name_xx,
const char *  old_name_yy,
const char *  old_name_zz,
const char *  old_name_xy,
const char *  old_name_yz,
const char *  old_name_xz,
int  location_id,
cs_real_66_t val 
)

Read a cs_real_66_t tensor section from a restart file, when that section may have used a different name and been non-interleaved in a previous version.

This function assumes a mesh-base location (i.e. location_id > 0)

Parameters
[in]restartassociated restart file pointer
[in]sec_namesection name
[in]old_name_xxold name, xx component
[in]old_name_yyold name, yy component
[in]old_name_zzold name, zz component
[in]old_name_xyold name, xy component
[in]old_name_yzold name, yz component
[in]old_name_xzold name, xz component
[in]location_idid of corresponding location
[out]valarray of values
Returns
0 (CS_RESTART_SUCCESS) in case of success, or error code (CS_RESTART_ERR_xxx) in case of error

◆ cs_restart_read_real_6_t_compat()

int cs_restart_read_real_6_t_compat ( cs_restart_t restart,
const char *  sec_name,
const char *  old_name_xx,
const char *  old_name_yy,
const char *  old_name_zz,
const char *  old_name_xy,
const char *  old_name_yz,
const char *  old_name_xz,
int  location_id,
cs_real_6_t val 
)

Read a cs_real_6_t tensor section from a restart file, when that section may have used a different name and been non-interleaved in a previous version.

This function assumes a mesh-base location (i.e. location_id > 0)

Parameters
[in]restartassociated restart file pointer
[in]sec_namesection name
[in]old_name_xxold name, xx component
[in]old_name_yyold name, yy component
[in]old_name_zzold name, zz component
[in]old_name_xyold name, xy component
[in]old_name_yzold name, yz component
[in]old_name_xzold name, xz component
[in]location_idid of corresponding location
[out]valarray of values
Returns
0 (CS_RESTART_SUCCESS) in case of success, or error code (CS_RESTART_ERR_xxx) in case of error

◆ cs_restart_read_section()

int cs_restart_read_section ( cs_restart_t restart,
const char *  sec_name,
int  location_id,
int  n_location_vals,
cs_restart_val_type_t  val_type,
void *  val 
)

Read a section from a restart file.

Parameters
[in]restartassociated restart file pointer
[in]sec_namesection name
[in]location_idid of corresponding location
[in]n_location_valsnumber of values per location (interlaced)
[in]val_typevalue type
[out]valarray of values
Returns
0 (CS_RESTART_SUCCESS) in case of success, or error code (CS_RESTART_ERR_xxx) in case of error

◆ cs_restart_read_section_compat()

int cs_restart_read_section_compat ( cs_restart_t restart,
const char *  sec_name,
const char *  old_name,
int  location_id,
int  n_location_vals,
cs_restart_val_type_t  val_type,
void *  val 
)

Read a section from a restart file, when that section may have used a different name in a previous version.

Parameters
[in]restartassociated restart file pointer
[in]sec_namesection name
[in]old_nameold name
[in]location_idid of corresponding location
[in]n_location_valsnumber of values per location (interlaced)
[in]val_typevalue type
[out]valarray of values
Returns
0 (CS_RESTART_SUCCESS) in case of success, or error code (CS_RESTART_ERR_xxx) in case of error

◆ cs_restart_set_check_section_func()

cs_restart_check_section_t* cs_restart_set_check_section_func ( cs_restart_check_section_t func)

Associate a function to restart section check operations.

This allows defining alternate operations when checking restart sections.

Parameters
[in]funcassociated function
Returns
pointer to previous function

◆ cs_restart_set_context()

void cs_restart_set_context ( void *  context)

Associate a context to restart section check operations.

This context may be used by the cs_restart_check_section_t, cs_restart_read_section_t, and cs_restart_write_section_t type functions.

Note that the lifecycle of the data pointed to must be handled separately (and the pointer must remain valid until the matching restart structure is destroyed.

Parameters
[in]contextpointer to associated data, or NULL

◆ cs_restart_set_n_max_checkpoints()

void cs_restart_set_n_max_checkpoints ( int  n_checkpoints)

Set the number of checkpoint files to keep.

This function sets the number of checkpoint files to keep. If value is set to -1, all checkpoints are kept. If more than one file is kept, last one is always named "<prefix>.csc", while others are names "<prefix_%04d.csc". %04 provides an id using 4 digits (0 padding), and value is the order of writing, starting with 0. Hence : prefix_0000.csc, prefix_0001.csc, ...

Parameters
[in]n_checkpointsnumber of checkpoint files to keps.

Set the number of checkpoint files to keep.

This function sets the maximum number of checkpoint files to keep. Beyond this maximum, the oldest checkpoints are deleted to limit the number of saved checkpoints. The default value is 1.

If more than one file is kept, last one is always named "<prefix>.csc", while others are names "<prefix_%04d.csc".

%04 provides an id using 4 digits (0 padding), and value is the order of writing, starting with 0. Hence: prefix_0000.csc, prefix_0001.csc, ...

Parameters
[in]n_checkpointsnumber of checkpoints to save.

◆ cs_restart_set_read_section_func()

cs_restart_read_section_t* cs_restart_set_read_section_func ( cs_restart_read_section_t func)

Associate a function and its input to all restart section read operations.

This allows defining alternate operations when reading restart sections.

Parameters
[in]funcassociated function
Returns
pointer to previous function

◆ cs_restart_set_write_section_func()

cs_restart_write_section_t* cs_restart_set_write_section_func ( cs_restart_write_section_t func)

Associate a function and its input to all restart section write operations.

This allows defining alternate operations when writing restart sections.

Parameters
[in]funcassociated hook function
Returns
pointer to previous function

◆ cs_restart_write_ids()

void cs_restart_write_ids ( cs_restart_t restart,
const char *  sec_name,
int  location_id,
int  ref_location_id,
cs_lnum_t  ref_id_base,
const cs_lnum_t ref_id 
)

Write a referenced location id section to a restart file.

The section written to file contains the global ids matching the local element ids of a given location.

Parameters
[in]restartassociated restart file pointer
[in]sec_namesection name
[in]location_idid of location on which id_ref is defined
[in]ref_location_idid of referenced location
[in]ref_id_basebase of location entity id numbers (usually 0 or 1)
[in]ref_idarray of location entity ids

◆ cs_restart_write_particles()

int cs_restart_write_particles ( cs_restart_t restart,
const char *  name,
bool  number_by_coords,
cs_lnum_t  n_particles,
const cs_lnum_t particle_cell_id,
const cs_real_t particle_coords 
)

Write basic particles information to a restart file.

This includes defining a matching location and associated global numbering, then writing particle coordinates and cell ids.

Parameters
[in]restartassociated restart file pointer
[in]namename of particles set
[in]number_by_coordsif true, numbering is based on current coordinates; otherwise, it is simply based on local numbers, plus the sum of particles on lower MPI ranks
[in]n_particleslocal number of particles
[in]particle_cell_idlocal cell id (0 to n-1) to which particles belong
[in]particle_coordslocal particle coordinates (interleaved)
Returns
the location id assigned to the particles

◆ cs_restart_write_section()

void cs_restart_write_section ( cs_restart_t restart,
const char *  sec_name,
int  location_id,
int  n_location_vals,
cs_restart_val_type_t  val_type,
const void *  val 
)

Write a section to a restart file.

Parameters
[in]restartassociated restart file pointer
[in]sec_namesection name
[in]location_idid of corresponding location
[in]n_location_valsnumber of values per location (interlaced)
[in]val_typevalue type
[in]valarray of values

◆ dflsui()

void dflsui ( int *  ntsuit,
cs_real_t ttsuit,
cs_real_t wtsuit 
)

◆ indsui()

void indsui ( int *  isuite)

◆ reqsui()

void reqsui ( int *  iisuit)

◆ stusui()

void stusui ( void  )

◆ trbsui()

void trbsui ( void  )