7.2
general documentation
Boundary conditions using notebook

Get a user parameter defined in the GUI notebook.

To access a notebook-defined variable when defining boundary conditions, a callback function of the type of type cs_dof_func_t can be defined, such as the following (for a notebook variable named "t_inlet"):

static void
_notebook_t_inlet(cs_lnum_t n_elts,
const cs_lnum_t *elt_ids,
bool dense_output,
void *input,
cs_real_t *retval)
{
/* Get a user parameter defined in the GUI notebook */
/* Apply values at selected locations */
for (cs_lnum_t i = 0; i < n_elts; i++) {
const cs_lnum_t face_id = (elt_ids == NULL) ? i : elt_ids[i];
const cs_lnum_t j = dense_output ? i : face_id;
retval[j] = t_bnd;
}
}

Note that accessing the notebook value in the function aboe is done through the call to cs_notebook_parameter_value_by_name.

The callback function can then be assigned to the zone named "inlet" for variable "scalar1" in the usual way (in cs_user_boundary_conditions_setup):

"inlet", // zone name
cs_flag_boundary_face, // location flag
_notebook_t_inlet, // callback function
NULL); // input structure