My Project
programmer's documentation
|
Sets of probes may also be defined through the cs_user_postprocess_probes function, to allow for extraction and output of values at specific mesh locations, often with a higher time frequency than for volume or surface meshes.
Probe sets, and profiles (which can be viewed as a series of probes lying on a user-defined curve) are handled as a point mesh, which can be associated with plot and time_plot 2D-plot writers, as well as any of the general (3D-output) writer types (the priviledged writer types being plot for a profile, and time_plot for other probes).
Probe sets may be defined using the cs_probe_set_create_from_array function. In some cases, it might be useful to define those in multiple stages, using first cs_probe_set_create then a series of calls to cs_probe_set_add_probe.
The following example shows how probes may be added using that function.
Probe set creation functions return a pointer to a cs_probe_set_t structure which can be used to specify additional options using the cs_probe_set_option function.
A writer (id = CS_POST_WRITER_PROBES) using the format "time_plot" is associated by default to a set of monitoring probes. This is not the case for profiles.
As with regular meshes, profiles may be defined using user functions.
In this example, we define a series of profiles. To avoid redundant code, an array defining both the name of each profile and the matching x coordinate (as a text string) is defined. The code then loops along these array values to define the series:
As we observe here, the cs_probe_set_create_from_local requires a process-local definition, calling a user-defined function. This requires that the line_defs array be defined as static, so as to be available when this function is called. For this example, the function is defined as follows (before the calling function, preferably in the file's local function definitions section).
Probes and profiles may also be associated to the mesh boundary.
In the following example, a profile is defined based on a mesh boundary selection criterion, using the predefined cs_b_face_criterion_probes_define (which assumes curvilinear coordinates based on the "x" direction):
and in the below example using an array of 2 selection criteria: