#include "cs_defs.h"
#include <assert.h>
#include <ctype.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bft_mem.h"
#include "bft_error.h"
#include "bft_printf.h"
#include "cs_array.h"
#include "cs_base.h"
#include "cs_field.h"
#include "cs_field_pointer.h"
#include "cs_field_operator.h"
#include "cs_gradient.h"
#include "cs_halo.h"
#include "cs_halo_perio.h"
#include "cs_les_inflow.h"
#include "cs_log.h"
#include "cs_map.h"
#include "cs_math.h"
#include "cs_mesh.h"
#include "cs_notebook.h"
#include "cs_parall.h"
#include "cs_mesh_location.h"
#include "cs_random.h"
#include "cs_physical_model.h"
#include "cs_time_step.h"
#include "cs_turbulence_model.h"
#include "cs_physical_constants.h"
#include "cs_velocity_pressure.h"
#include "cs_vof.h"
#include "cs_volume_zone.h"
#include "cs_restart_default.h"
Functions | |
void | cs_restart_read_field_info (cs_restart_t *r, cs_map_name_to_id_t **old_field_map) |
Read field metadata from checkpoint. More... | |
void | cs_restart_write_field_info (cs_restart_t *r) |
Write field metadata to main checkpoint. More... | |
void | cs_restart_read_variables (cs_restart_t *r, const cs_map_name_to_id_t *old_field_map, int t_id_flag, int read_flag[]) |
Read variables from checkpoint. More... | |
void | cs_restart_write_variables (cs_restart_t *r, int t_id_flag, int write_flag[]) |
Write variables to checkpoint. More... | |
void | cs_restart_read_notebook_variables (cs_restart_t *r) |
Read notebook parameters from main checkpoint. More... | |
void | cs_restart_write_notebook_variables (cs_restart_t *r) |
Write notebook parameters to main checkpoint. More... | |
void | cs_restart_read_linked_fields (cs_restart_t *r, const cs_map_name_to_id_t *old_field_map, const char *key, int read_flag[]) |
Read fields depending on others from checkpoint. More... | |
int | cs_restart_write_linked_fields (cs_restart_t *r, const char *key, int write_flag[]) |
Write fields depending on others to checkpoint. More... | |
void | cs_restart_read_bc_coeffs (cs_restart_t *r) |
Read boundary condition coefficients for all fields from checkpoint. More... | |
void | cs_restart_write_bc_coeffs (cs_restart_t *r) |
Write boundary condition coefficients for all fields to checkpoint. More... | |
int | cs_restart_read_field_vals (cs_restart_t *r, int f_id, int t_id) |
Read field values from checkpoint. More... | |
void | cs_restart_write_field_vals (cs_restart_t *r, int f_id, int t_id) |
Write field values to checkpoint. More... | |
void | cs_restart_read_time_step_info (cs_restart_t *r) |
Read restart time step info. More... | |
void | cs_restart_write_fields (cs_restart_t *r, cs_restart_file_t r_id) |
Loop over all fields and save them in the restart file which id is passed in argument if it matches their "restart_file" key value. More... | |
void | cs_restart_read_fields (cs_restart_t *r, cs_restart_file_t r_id) |
Loop over all fields and read them in the restart file which id is passed in argument if it matches their "restart_file" key value. More... | |
void | cs_restart_set_auxiliary_field_options (void) |
Set restart file values for fields when those values cannot be determined at field definition time. More... | |
void | cs_restart_initialize_fields_read_status (void) |
Initialize fields read status array. More... | |
void | cs_restart_finalize_fields_read_status (void) |
Finalize fields read status array. More... | |
int | cs_restart_get_field_read_status (const int f_id) |
Get checkpoint read status for a field based on its id. More... | |
Checkpoint/restart handling for default application.
void cs_restart_finalize_fields_read_status | ( | void | ) |
Finalize fields read status array.
int cs_restart_get_field_read_status | ( | const int | f_id | ) |
Get checkpoint read status for a field based on its id.
[in] | f_id | field id |
void cs_restart_initialize_fields_read_status | ( | void | ) |
Initialize fields read status array.
void cs_restart_read_bc_coeffs | ( | cs_restart_t * | r | ) |
Read boundary condition coefficients for all fields from checkpoint.
[in,out] | r | associated restart file pointer |
void cs_restart_read_field_info | ( | cs_restart_t * | r, |
cs_map_name_to_id_t ** | old_field_map | ||
) |
Read field metadata from checkpoint.
Old ids associated to each field are determined for future use. Note that when reading legacy files (code_saturne version 3.3 and below), the old id will actually be the old scalar id (-1 for others).
[in,out] | r | associated restart file pointer |
[out] | old_field_map | name to id map of fields in restart file |
int cs_restart_read_field_vals | ( | cs_restart_t * | r, |
int | f_id, | ||
int | t_id | ||
) |
Read field values from checkpoint.
If the values are not found using the default rules based on the field's name, its name itself, or a "restart_rename" keyed string value, an old name may be used for compatibility with older files. For cell-based fields, the old name base is appended automatically with "_ce_phase01", except for scalars, where the name uses a different scheme, based on "scalaire_ce_%04" % s_num;
[in,out] | r | associated restart file pointer |
[in] | f_id | field id |
[in] | t_id | time id (0 for current, 1 for previous, ...) |
void cs_restart_read_fields | ( | cs_restart_t * | r, |
cs_restart_file_t | r_id | ||
) |
Loop over all fields and read them in the restart file which id is passed in argument if it matches their "restart_file" key value.
[in,out] | r | associated restart file pointer |
[in] | r_id | value of the key "restart_file" |
void cs_restart_read_linked_fields | ( | cs_restart_t * | r, |
const cs_map_name_to_id_t * | old_field_map, | ||
const char * | key, | ||
int | read_flag[] | ||
) |
Read fields depending on others from checkpoint.
Old ids associate to each field are determined for future use. Note that when reading legacy files (code_saturne version 3.3 and below), the old id will actually be the old scalar id (-1 for others).
[in,out] | r | associated restart file pointer |
[in] | old_field_map | name to id map of fields in restart file |
[in] | key | key for field association |
[in,out] | read_flag | optional flag to track fields read, or nullptr; set to sum of 2^time_id for fields read, -1 for fields failed to read (size: n_fields) |
void cs_restart_read_notebook_variables | ( | cs_restart_t * | r | ) |
Read notebook parameters from main checkpoint.
[in,out] | r | associated restart file pointer |
void cs_restart_read_time_step_info | ( | cs_restart_t * | r | ) |
Read restart time step info.
[in,out] | r | associated restart file pointer |
void cs_restart_read_variables | ( | cs_restart_t * | r, |
const cs_map_name_to_id_t * | old_field_map, | ||
int | t_id_flag, | ||
int | read_flag[] | ||
) |
Read variables from checkpoint.
[in,out] | r | associated restart file pointer |
[in] | old_field_map | name to id map of fields in restart file |
[in] | t_id_flag | -1: all time values; 0: current values; > 0: previous values |
[in,out] | read_flag | optional flag to track fields read, or nullptr; set to sum of 2^time_id for fields read (size: n_fields) |
void cs_restart_set_auxiliary_field_options | ( | void | ) |
Set restart file values for fields when those values cannot be determined at field definition time.
This is needed when the need for restart data depends on various combinations of settings.
void cs_restart_write_bc_coeffs | ( | cs_restart_t * | r | ) |
Write boundary condition coefficients for all fields to checkpoint.
[in,out] | r | associated restart file pointer |
void cs_restart_write_field_info | ( | cs_restart_t * | r | ) |
Write field metadata to main checkpoint.
[in,out] | r | associated restart file pointer |
void cs_restart_write_field_vals | ( | cs_restart_t * | r, |
int | f_id, | ||
int | t_id | ||
) |
Write field values to checkpoint.
[in,out] | r | associated restart file pointer |
[in] | f_id | field id |
[in] | t_id | time id (0 for current, 1 for previous, ...) |
void cs_restart_write_fields | ( | cs_restart_t * | r, |
cs_restart_file_t | r_id | ||
) |
Loop over all fields and save them in the restart file which id is passed in argument if it matches their "restart_file" key value.
[in,out] | r | associated restart file pointer |
[in] | r_id | value of the key "restart_file" |
int cs_restart_write_linked_fields | ( | cs_restart_t * | r, |
const char * | key, | ||
int | write_flag[] | ||
) |
Write fields depending on others to checkpoint.
[in,out] | r | associated restart file pointer |
[in] | key | key for field association |
[in,out] | write_flag | optional flag to track fields written, or nullptr; set to sum of 2^time_id for fields written (size: n_fields) |
void cs_restart_write_notebook_variables | ( | cs_restart_t * | r | ) |
Write notebook parameters to main checkpoint.
[in,out] | r | associated restart file pointer |
void cs_restart_write_variables | ( | cs_restart_t * | r, |
int | t_id_flag, | ||
int | write_flag[] | ||
) |
Write variables to checkpoint.
[in,out] | r | associated restart file pointer |
[in] | t_id_flag | -1: all time values; 0: current values; > 0: previous values |
[in,out] | write_flag | optional flag to track fields written, or nullptr; set to sum of 2^time_id for fields written (size: n_fields) |