|  | My Project
    programmer's documentation | 
Probes and profiles management. More...
#include "cs_defs.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <assert.h>#include "bft_mem.h"#include "bft_error.h"#include "bft_printf.h"#include "fvm_nodal.h"#include "fvm_point_location.h"#include "cs_base.h"#include "cs_map.h"#include "cs_math.h"#include "cs_mesh.h"#include "cs_mesh_connect.h"#include "cs_mesh_location.h"#include "cs_mesh_quantities.h"#include "cs_selector.h"#include "cs_timer.h"#include "cs_probe.h"
| Functions | |
| void | cs_probe_finalize (void) | 
| Free all structures related to a set of probes.  More... | |
| int | cs_probe_get_n_sets (void) | 
| Retrieve the number of probe sets defined.  More... | |
| cs_probe_set_t * | cs_probe_set_get (const char *name) | 
| Retrieve a cs_probe_set_t structure.  More... | |
| cs_probe_set_t * | cs_probe_set_get_by_id (int pset_id) | 
| Retrieve a cs_probe_set_t structure from its id.  More... | |
| const char * | cs_probe_set_get_name (cs_probe_set_t *pset) | 
| Retrieve the name related to a cs_probe_set_t structure.  More... | |
| void | cs_probe_set_get_post_info (const cs_probe_set_t *pset, bool *time_varying, bool *on_boundary, bool *on_curve, bool *auto_variables, int *n_writers, int *writer_ids[]) | 
| Retrieve information useful for the postprocessing step.  More... | |
| const char * | cs_probe_set_get_location_criteria (cs_probe_set_t *pset) | 
| Return the location filter selection criteria string for a given probe set.  More... | |
| cs_probe_set_t * | cs_probe_set_create (const char *name) | 
| Create a new set of probes.  More... | |
| void | cs_probe_set_add_probe (cs_probe_set_t *pset, cs_real_t x, cs_real_t y, cs_real_t z, const char *label) | 
| Add a new probe to an existing set of probes.  More... | |
| cs_probe_set_t * | cs_probe_set_create_from_array (const char *name, int n_probes, const cs_real_3_t *coords, const char **labels) | 
| Define a new set of probes from an array of coordinates.  More... | |
| cs_probe_set_t * | cs_probe_set_create_from_segment (const char *name, int n_probes, const cs_real_t start_coords[3], const cs_real_t end_coords[3]) | 
| Define a new set of probes from the segment spanned by two points.  More... | |
| cs_probe_set_t * | cs_probe_set_create_from_local (const char *name, cs_probe_set_define_local_t *p_define_func, void *p_define_input) | 
| Define a new set of probes from rank-local definition function.  More... | |
| void | cs_probe_set_allow_overwrite (const char *name) | 
| allow overwriting the definition of a given probe set.  More... | |
| void | cs_probe_set_associate_writers (cs_probe_set_t *pset, int n_writers, const int *writer_ids) | 
| Associate a list of writers to a probe set.  More... | |
| void | cs_probe_set_auto_var (cs_probe_set_t *pset, bool mode) | 
| Set to true or false the automatic post-processing of variables.  More... | |
| void | cs_probe_set_snap_mode (cs_probe_set_t *pset, cs_probe_snap_t snap_mode) | 
| Set snap mode related to the management of a set of probes.  More... | |
| void | cs_probe_set_option (cs_probe_set_t *pset, const char *keyname, const char *keyval) | 
| Set optional parameters related to the management of a set of probes.  More... | |
| void | cs_probe_set_locate (cs_probe_set_t *pset, const fvm_nodal_t *location_mesh) | 
| Try to locate each probe and define the coordinate really used for the postprocessing step.  More... | |
| fvm_nodal_t * | cs_probe_set_export_mesh (cs_probe_set_t *pset, const char *mesh_name) | 
| Define a fvm_nodal_t structure from the set of probes.  More... | |
| fvm_nodal_t * | cs_probe_set_unlocated_export_mesh (cs_probe_set_t *pset, const char *mesh_name) | 
| Define a fvm_nodal_t structure from the set of unlocated probes.  More... | |
| void | cs_probe_set_dump (const cs_probe_set_t *pset) | 
| Dump a cs_probe_set_t structure.  More... | |
| void | cs_probe_set_get_members (const cs_probe_set_t *pset, cs_probe_snap_t *snap_mode, int *n_probes, cs_real_3_t *coords[]) | 
| Retrieve the main members of a cs_probe_set_t structure.  More... | |
| int | cs_probe_set_get_n_local (const cs_probe_set_t *pset) | 
| Return the number probes in the local domain.  More... | |
| const cs_real_t * | cs_probe_set_get_curvilinear_abscissa (const cs_probe_set_t *pset) | 
| Return the list of curvilinear abscissa for the given probe set.  More... | |
| const cs_lnum_t * | cs_probe_set_get_elt_ids (const cs_probe_set_t *pset, int mesh_location_id) | 
| Return the ids of a probe set's local matching elements, relative to a given mesh location.  More... | |
Probes and profiles management.
| void cs_probe_finalize | ( | void | ) | 
Free all structures related to a set of probes.
| int cs_probe_get_n_sets | ( | void | ) | 
Retrieve the number of probe sets defined.
| void cs_probe_set_add_probe | ( | cs_probe_set_t * | pset, | 
| cs_real_t | x, | ||
| cs_real_t | y, | ||
| cs_real_t | z, | ||
| const char * | label | ||
| ) | 
Add a new probe to an existing set of probes.
| [in,out] | pset | set of probes | 
| [in] | x | x coordinate of the point to add | 
| [in] | y | y coordinate of the point to add | 
| [in] | z | z coordinate of the point to add | 
| [in] | label | NULL or the name of the point (optional) | 
| void cs_probe_set_allow_overwrite | ( | const char * | name | ) | 
allow overwriting the definition of a given probe set.
If no a probe set of the given name exists, the operation is ignored.
| [in] | name | name of the probe set | 
| void cs_probe_set_associate_writers | ( | cs_probe_set_t * | pset, | 
| int | n_writers, | ||
| const int * | writer_ids | ||
| ) | 
Associate a list of writers to a probe set.
| [in,out] | pset | pointer to a cs_probe_set_t structure to set | 
| [in] | n_writers | number of writers assocuated to this probe set | 
| [in] | writer_ids | list of writer ids | 
| void cs_probe_set_auto_var | ( | cs_probe_set_t * | pset, | 
| bool | mode | ||
| ) | 
Set to true or false the automatic post-processing of variables.
| [in,out] | pset | pointer to a cs_probe_set_t structure | 
| [in] | mode | true or false | 
| cs_probe_set_t* cs_probe_set_create | ( | const char * | name | ) | 
Create a new set of probes.
| [in] | name | name of the set of probes | 
| cs_probe_set_t* cs_probe_set_create_from_array | ( | const char * | name, | 
| int | n_probes, | ||
| const cs_real_3_t * | coords, | ||
| const char ** | labels | ||
| ) | 
Define a new set of probes from an array of coordinates.
| [in] | name | name of the set of probes | 
| [in] | n_probes | number of probes in coords and labels | 
| [in] | coords | list of coordinates related to each probe | 
| [in] | labels | list of label related to each probe (optional) | 
| cs_probe_set_t* cs_probe_set_create_from_local | ( | const char * | name, | 
| cs_probe_set_define_local_t * | p_define_func, | ||
| void * | p_define_input | ||
| ) | 
Define a new set of probes from rank-local definition function.
The local definition function given by the p_define_func pointer is called just before locating probes on the parent mesh, so this allows building probe sets based on subsets of the computational mesh.
Note: if the p_define_input pointer is non-NULL, it must point to valid data when the selection function is called, so that value or structure should not be temporary (i.e. local);
| [in] | name | name of the set of probes | 
| [in] | p_define_func | function used for local definition | 
| [in] | p_define_input | optional input for local definition function | 
| cs_probe_set_t* cs_probe_set_create_from_segment | ( | const char * | name, | 
| int | n_probes, | ||
| const cs_real_t | start_coords[3], | ||
| const cs_real_t | end_coords[3] | ||
| ) | 
Define a new set of probes from the segment spanned by two points.
| [in] | name | name of the set of probes | 
| [in] | n_probes | number of probes | 
| [in] | start_coords | coordinates of the starting point | 
| [in] | end_coords | coordinates of the ending point | 
| void cs_probe_set_dump | ( | const cs_probe_set_t * | pset | ) | 
Dump a cs_probe_set_t structure.
| [in] | pset | pointer to a cs_probe_set_t structure | 
| fvm_nodal_t* cs_probe_set_export_mesh | ( | cs_probe_set_t * | pset, | 
| const char * | mesh_name | ||
| ) | 
Define a fvm_nodal_t structure from the set of probes.
| [in,out] | pset | pointer to a cs_probe_set_t structure | 
| [in] | mesh_name | name of the mesh to export | 
| cs_probe_set_t* cs_probe_set_get | ( | const char * | name | ) | 
Retrieve a cs_probe_set_t structure.
| [in] | name | name of the set of probes to find | 
| cs_probe_set_t* cs_probe_set_get_by_id | ( | int | pset_id | ) | 
Retrieve a cs_probe_set_t structure from its id.
| [in] | pset_id | id related to the set of probes to find | 
| const cs_real_t* cs_probe_set_get_curvilinear_abscissa | ( | const cs_probe_set_t * | pset | ) | 
Return the list of curvilinear abscissa for the given probe set.
| [in] | pset | pointer to a cs_probe_set_t structure | 
| const cs_lnum_t* cs_probe_set_get_elt_ids | ( | const cs_probe_set_t * | pset, | 
| int | mesh_location_id | ||
| ) | 
Return the ids of a probe set's local matching elements, relative to a given mesh location.
The mesh_location id must match one of CS_MESH_LOCATION_CELLS, CS_MESH_LOCATION_BOUNDARY_FACES, or CS_MESH_LOCATION_VERTICES.
| [in] | pset | pointer to a cs_probe_set_t structure | 
| [in] | mesh_location_id | id of parent mesh location | 
| const char* cs_probe_set_get_location_criteria | ( | cs_probe_set_t * | pset | ) | 
Return the location filter selection criteria string for a given probe set.
| [in] | pset | pointer to a cs_probe_set_t structure | 
| void cs_probe_set_get_members | ( | const cs_probe_set_t * | pset, | 
| cs_probe_snap_t * | snap_mode, | ||
| int * | n_probes, | ||
| cs_real_3_t * | coords[] | ||
| ) | 
Retrieve the main members of a cs_probe_set_t structure.
| [in] | pset | pointer to a cs_probe_set_t structure | 
| [in,out] | snap_mode | mode of location | 
| [in,out] | n_probes | number of probes | 
| [in,out] | coords | probe coordinates | 
| int cs_probe_set_get_n_local | ( | const cs_probe_set_t * | pset | ) | 
Return the number probes in the local domain.
| [in] | pset | pointer to a cs_probe_set_t structure | 
| const char* cs_probe_set_get_name | ( | cs_probe_set_t * | pset | ) | 
Retrieve the name related to a cs_probe_set_t structure.
| [in] | pset | pointer to a cs_probe_set_t structure | 
| void cs_probe_set_get_post_info | ( | const cs_probe_set_t * | pset, | 
| bool * | time_varying, | ||
| bool * | on_boundary, | ||
| bool * | on_curve, | ||
| bool * | auto_variables, | ||
| int * | n_writers, | ||
| int * | writer_ids[] | ||
| ) | 
Retrieve information useful for the postprocessing step.
Output arguments may be set to NULL if we do not need to query them.
| [in] | pset | pointer to a cs_probe_set_t structure | 
| [out] | time_varying | true if probe locations may change with time | 
| [out] | on_boundary | true if probes are located on boundary | 
| [out] | on_curve | true if the probe set has cuvilinear coordinates | 
| [out] | auto_variables | true if set of variables to output is predefined | 
| [out] | n_writers | number of associated user-defined writers, or -1 if default unchanged | 
| [out] | writer_ids | pointer to a list of writer ids | 
| void cs_probe_set_locate | ( | cs_probe_set_t * | pset, | 
| const fvm_nodal_t * | location_mesh | ||
| ) | 
Try to locate each probe and define the coordinate really used for the postprocessing step.
For better performance when using multiple probe sets, a pointer to an existing location mesh may be passed to this function. The caller is responsible for ensuring this mesh matches selection criteria for the probe set.
| [in,out] | pset | pointer to a cs_probe_set_t structure | 
| [in] | location_mesh | optional pointer to mesh relative to which probe set should be located, or NULL | 
| void cs_probe_set_option | ( | cs_probe_set_t * | pset, | 
| const char * | keyname, | ||
| const char * | keyval | ||
| ) | 
Set optional parameters related to the management of a set of probes.
Available option key names accepting true or false: 
transient_location if true, relocate probes relative to deforming or moving mesh (default: false)boundary if \ c true, locate on boundary mesh; if false, locate on volume mesh (default)Other options:
selection_criteria where keyval is selection criteria stringtolerance where keyval is for instance "0.05" (default "0.10")| [in,out] | pset | pointer to a cs_probe_set_t structure to set | 
| [in] | keyname | name of the keyword related to the parameter to set | 
| [in] | keyval | value of the keyword to set | 
| void cs_probe_set_snap_mode | ( | cs_probe_set_t * | pset, | 
| cs_probe_snap_t | snap_mode | ||
| ) | 
Set snap mode related to the management of a set of probes.
| [in,out] | pset | pointer to a cs_probe_set_t structure | 
| [in] | snap_mode | snap mode to set | 
| fvm_nodal_t* cs_probe_set_unlocated_export_mesh | ( | cs_probe_set_t * | pset, | 
| const char * | mesh_name | ||
| ) | 
Define a fvm_nodal_t structure from the set of unlocated probes.
| [in,out] | pset | pointer to a cs_probe_set_t structure | 
| [in] | mesh_name | name of the mesh to export | 
 1.8.16
 1.8.16