![]() |
programmer's documentation
|
#include "cs_defs.h"
#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <float.h>
#include <locale.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <bft_mem.h>
#include "cs_boundary_zone.h"
#include "cs_domain_post.h"
#include "cs_evaluate.h"
#include "cs_equation_common.h"
#include "cs_gwf.h"
#include "cs_hodge.h"
#include "cs_log.h"
#include "cs_log_iteration.h"
#include "cs_mesh_location.h"
#include "cs_parall.h"
#include "cs_prototypes.h"
#include "cs_restart.h"
#include "cs_restart_default.h"
#include "cs_source_term.h"
#include "cs_time_step.h"
#include "cs_walldistance.h"
#include "cs_domain.h"
Functions | |
static void | _wall_boundary_selection (void *input, const cs_mesh_t *m, int location_id, cs_lnum_t *n_elts, cs_lnum_t **elt_ids) |
Build the list of boundary faces attached to a wall boundary condition Function pointer to mesh location elements selection definition. More... | |
static void | _compute_steady_user_equations (cs_domain_t *domain) |
Compute equations which user-defined and steady-state. More... | |
static void | _compute_unsteady_user_equations (cs_domain_t *domain, int nt_cur) |
Compute user-defined equation which are time-dependent. More... | |
cs_domain_t * | cs_domain_create (void) |
Create and initialize by default a cs_domain_t structure. More... | |
cs_domain_t * | cs_domain_free (cs_domain_t *domain) |
Free a cs_domain_t structure. More... | |
void | cs_domain_set_default_boundary (cs_domain_t *domain, cs_param_boundary_type_t type) |
Set the default boundary related to this domain. More... | |
void | cs_domain_add_boundary (cs_domain_t *domain, cs_param_boundary_type_t type, const char *zone_name) |
Add a boundary type defined on a mesh location. More... | |
void | cs_domain_set_time_param (cs_domain_t *domain, int nt_max, double t_max) |
Set parameters for unsteady computations: the max number of time steps or the final physical time of the simulation. More... | |
void | cs_domain_set_output_param (cs_domain_t *domain, int nt_list, int verbosity) |
Set auxiliary parameters related to the way output is done. More... | |
void | cs_domain_update_advfield (cs_domain_t *domain) |
Set to true the automatic update of all advection fields. More... | |
void | cs_domain_set_advanced_param (cs_domain_t *domain, cs_domain_key_t key, const char *keyval) |
Set auxiliary parameters related to a cs_domain_t structure. More... | |
void | cs_domain_def_time_step_by_function (cs_domain_t *domain, cs_timestep_func_t *func, void *func_input) |
Define the value of the time step thanks to a predefined function. More... | |
void | cs_domain_def_time_step_by_value (cs_domain_t *domain, double dt) |
Define the value of the time step. More... | |
void | cs_domain_update_mesh_locations (cs_domain_t *domain) |
Add new mesh locations related to domain boundaries from existing mesh locations. More... | |
void | cs_domain_setup_predefined_equations (cs_domain_t *domain) |
Setup predefined equations which are activated. More... | |
void | cs_domain_set_scheme_flag (cs_domain_t *domain) |
Define the scheme flag for the current computational domain. More... | |
void | cs_domain_finalize_setup (cs_domain_t *domain, cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities) |
Build a cs_domain_t structure. More... | |
void | cs_domain_initialize_systems (cs_domain_t *domain) |
Initialize systems of equations and their related field values according to the user settings. More... | |
bool | cs_domain_needs_iteration (cs_domain_t *domain) |
Check if one needs to continue iterations in time. More... | |
bool | cs_domain_needs_log (const cs_domain_t *domain) |
Check if an ouput is requested according to the domain setting. More... | |
void | cs_domain_define_current_time_step (cs_domain_t *domain) |
Set the current time step for this new time iteration. More... | |
void | cs_domain_increment_time (cs_domain_t *domain) |
Update time step after one temporal iteration. More... | |
void | cs_domain_solve (cs_domain_t *domain) |
Solve all the equations of a computational domain for one time step. More... | |
void | cs_domain_process_after_solve (cs_domain_t *domain) |
Process the computational domain after the resolution. More... | |
void | cs_domain_read_restart (const cs_domain_t *domain) |
Read a restart file for the CDO module. More... | |
void | cs_domain_write_restart (const cs_domain_t *domain) |
Write a restart file for the CDO module. More... | |
void | cs_domain_summary (const cs_domain_t *domain) |
Summary of a cs_domain_t structure. More... | |
Variables | |
cs_domain_t * | cs_glob_domain = NULL |
static const char | _err_empty_domain [] |
static double | cs_domain_kahan_time_compensation = 0.0 |
|
static |
Compute equations which user-defined and steady-state.
[in,out] | domain | pointer to a cs_domain_t structure |
|
static |
Compute user-defined equation which are time-dependent.
[in,out] | domain | pointer to a cs_domain_t structure |
[in] | nt_cur | current number of iteration done |
|
static |
Build the list of boundary faces attached to a wall boundary condition Function pointer to mesh location elements selection definition.
If non-empty and not containing all elements, a list of elements of the parent mesh belonging to the location should be allocated (using BFT_MALLOC) and defined by this function when called. This list's lifecycle is then managed by the mesh location object.
[in] | m | pointer to associated mesh structure. |
[in] | location_id | id of associated location. |
[out] | n_elts | number of selected elements |
[out] | elt_list | list of selected elements. |
void cs_domain_add_boundary | ( | cs_domain_t * | domain, |
cs_param_boundary_type_t | type, | ||
const char * | zone_name | ||
) |
Add a boundary type defined on a mesh location.
[in,out] | domain | pointer to a cs_domain_t structure |
[in] | type | type of boundary to set |
[in] | zone_name | name of the zone related to this boundary |
cs_domain_t* cs_domain_create | ( | void | ) |
Create and initialize by default a cs_domain_t structure.
void cs_domain_def_time_step_by_function | ( | cs_domain_t * | domain, |
cs_timestep_func_t * | func, | ||
void * | func_input | ||
) |
Define the value of the time step thanks to a predefined function.
[in,out] | domain | pointer to a cs_domain_t structure |
[in] | func | pointer to a cs_timestep_func_t function |
[in] | func_input | pointer to a structure cast on-the-fly |
void cs_domain_def_time_step_by_value | ( | cs_domain_t * | domain, |
double | dt | ||
) |
Define the value of the time step.
[in,out] | domain | pointer to a cs_domain_t structure |
[in] | dt | value of the constant time step |
void cs_domain_define_current_time_step | ( | cs_domain_t * | domain | ) |
Set the current time step for this new time iteration.
[in,out] | domain | pointer to a cs_domain_t structure |
void cs_domain_finalize_setup | ( | cs_domain_t * | domain, |
cs_mesh_t * | mesh, | ||
const cs_mesh_quantities_t * | mesh_quantities | ||
) |
Build a cs_domain_t structure.
[in,out] | domain | pointer to a cs_domain_t struct. |
[in,out] | mesh | pointer to a cs_mesh_t struct. |
[in] | mesh_quantities | pointer to a cs_mesh_quantities_t struct. |
cs_domain_t* cs_domain_free | ( | cs_domain_t * | domain | ) |
Free a cs_domain_t structure.
[in,out] | domain | pointer to the cs_domain_t structure to free |
void cs_domain_increment_time | ( | cs_domain_t * | domain | ) |
Update time step after one temporal iteration.
[in,out] | domain | pointer to a cs_domain_t structure |
void cs_domain_initialize_systems | ( | cs_domain_t * | domain | ) |
Initialize systems of equations and their related field values according to the user settings.
[in,out] | domain | pointer to a cs_domain_t structure |
bool cs_domain_needs_iteration | ( | cs_domain_t * | domain | ) |
Check if one needs to continue iterations in time.
[in,out] | domain | pointer to a cs_domain_t structure |
bool cs_domain_needs_log | ( | const cs_domain_t * | domain | ) |
Check if an ouput is requested according to the domain setting.
[in] | domain | pointer to a cs_domain_t structure |
void cs_domain_process_after_solve | ( | cs_domain_t * | domain | ) |
Process the computational domain after the resolution.
[in] | domain | pointer to a cs_domain_t structure |
void cs_domain_read_restart | ( | const cs_domain_t * | domain | ) |
Read a restart file for the CDO module.
[in] | domain | pointer to a cs_domain_t structure |
void cs_domain_set_advanced_param | ( | cs_domain_t * | domain, |
cs_domain_key_t | key, | ||
const char * | keyval | ||
) |
Set auxiliary parameters related to a cs_domain_t structure.
[in,out] | domain | pointer to a cs_domain_t structure |
[in] | key | key related to the parameter to set |
[in] | keyval | value related to the parameter to set |
void cs_domain_set_default_boundary | ( | cs_domain_t * | domain, |
cs_param_boundary_type_t | type | ||
) |
Set the default boundary related to this domain.
[in,out] | domain | pointer to a cs_domain_t structure |
[in] | type | type of boundary to set |
void cs_domain_set_output_param | ( | cs_domain_t * | domain, |
int | nt_list, | ||
int | verbosity | ||
) |
Set auxiliary parameters related to the way output is done.
[in,out] | domain | pointer to a cs_domain_t structure |
[in] | nt_list | output frequency into the listing |
[in] | verbosity | level of information displayed |
void cs_domain_set_scheme_flag | ( | cs_domain_t * | domain | ) |
Define the scheme flag for the current computational domain.
[in,out] | domain | pointer to a cs_domain_t struct. |
void cs_domain_set_time_param | ( | cs_domain_t * | domain, |
int | nt_max, | ||
double | t_max | ||
) |
Set parameters for unsteady computations: the max number of time steps or the final physical time of the simulation.
[in,out] | domain | pointer to a cs_domain_t structure |
[in] | nt_max | max. number of time step iterations |
[in] | t_max | final physical time of the simulation |
void cs_domain_setup_predefined_equations | ( | cs_domain_t * | domain | ) |
Setup predefined equations which are activated.
[in,out] | domain | pointer to a cs_domain_t structure |
void cs_domain_solve | ( | cs_domain_t * | domain | ) |
Solve all the equations of a computational domain for one time step.
[in,out] | domain | pointer to a cs_domain_t structure |
void cs_domain_summary | ( | const cs_domain_t * | domain | ) |
Summary of a cs_domain_t structure.
[in] | domain | pointer to the cs_domain_t structure to summarize |
void cs_domain_update_advfield | ( | cs_domain_t * | domain | ) |
Set to true the automatic update of all advection fields.
[in,out] | domain | pointer to a cs_domain_t structure |
void cs_domain_update_mesh_locations | ( | cs_domain_t * | domain | ) |
Add new mesh locations related to domain boundaries from existing mesh locations.
[in] | domain | pointer to a cs_domain_t structure |
void cs_domain_write_restart | ( | const cs_domain_t * | domain | ) |
Write a restart file for the CDO module.
[in] | domain | pointer to a cs_domain_t structure |
|
static |
|
static |
cs_domain_t* cs_glob_domain = NULL |