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
bool dense_output,
void *input,
{
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;
}
}
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
cs_real_t cs_notebook_parameter_value_by_name(const char *name)
Return a parameter value (real).
Definition: cs_notebook.c:383
Note that accessing the notebook value in the function above 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",
_notebook_t_inlet,
NULL);
cs_equation_param_t * cs_equation_param_by_name(const char *eqname)
Return the cs_equation_param_t structure associated to a cs_equation_t structure based on the equatio...
Definition: cs_equation.c:570
cs_xdef_t * cs_equation_add_bc_by_dof_func(cs_equation_param_t *eqp, const cs_param_bc_type_t bc_type, const char *z_name, cs_flag_t loc_flag, cs_dof_func_t *func, void *input)
Define and initialize a new structure to set a boundary condition related to the given cs_equation_pa...
Definition: cs_equation_param.c:2856
const cs_flag_t cs_flag_boundary_face
Definition: cs_flag.c:77
@ CS_PARAM_BC_DIRICHLET
Definition: cs_param_types.h:478
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:192