 |
6.3
general documentation
|
|
Postprocessing of results obtained with CDO schemes for a scalar transport equation.
This is an example of cs_user_extra_operations allowing to add operations on results produced by CDO schemes. It allows to define advanced postprocessing.
if (eq == NULL)
" Invalid equation name. Stop extra operations.");
char *filename = NULL;
int len = strlen("Resume-.log")+strlen(eqname)+1;
return;
if (time_step->
nt_cur % domain->output_nt > 0)
return;
len += 9;
sprintf(filename,
"Resume-%s-t%.f.log", eqname, time_step->
t_cur);
}
else {
return;
sprintf(filename, "Resume-%s.log", eqname);
}
resume = fopen(filename, "w");
switch (space_scheme) {
_cdovb_post(connect, cdoq, time_step, eq, true);
break;
default:
_(
"Invalid space scheme. Stop post-processing.\n"));
}
printf("\n >> Extra operation for equation: %s\n", eqname);
fclose(resume);
Main structure to handle the discretization and the resolution of an equation.
const char * cs_equation_get_name(const cs_equation_t *eq)
Return the name related to the given cs_equation_t structure.
Definition: cs_equation.c:538
const char cs_sepline[80]
Definition: cs_param_types.c:69
cs_flag_t flag
Definition: cs_equation_param.h:228
#define _(String)
Definition: cs_defs.h:63
int nt_cur
Definition: cs_time_step.h:74
void bft_error(const char *const file_name, const int line_num, const int sys_error_code, const char *const format,...)
Calls the error handler (set by bft_error_handler_set() or default).
Definition: bft_error.c:193
#define CS_EQUATION_UNSTEADY
Unsteady term is needed.
Definition: cs_equation_param.h:92
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:201
#define BFT_MALLOC(_ptr, _ni, _type)
Allocate memory for _ni elements of type _type.
Definition: bft_mem.h:62
time step descriptor
Definition: cs_time_step.h:64
#define BFT_FREE(_ptr)
Free allocated memory.
Definition: bft_mem.h:101
cs_param_space_scheme_t cs_equation_get_space_scheme(const cs_equation_t *eq)
Return the type of numerical scheme used for the discretization in space.
Definition: cs_equation.c:1003
Definition: cs_cdo_quantities.h:124
double t_cur
Definition: cs_time_step.h:80
Definition: cs_cdo_connect.h:76
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param_types.h:172
cs_equation_t * cs_equation_by_name(const char *eqname)
Find the cs_equation_t structure with name eqname Return NULL if not find.
Definition: cs_equation.c:353
@ CS_SPACE_SCHEME_CDOVB
Definition: cs_param_types.h:175
cs_equation_param_t * cs_equation_get_param(const cs_equation_t *eq)
Return the cs_equation_param_t structure associated to a cs_equation_t structure.
Definition: cs_equation.c:498
int bft_printf(const char *const format,...)
Replacement for printf() with modifiable behavior.
Definition: bft_printf.c:140