programmer's documentation
Functions
cs_probe.c File Reference

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_math.h"
#include "cs_mesh.h"
#include "cs_mesh_connect.h"
#include "cs_mesh_quantities.h"
#include "cs_selector.h"
#include "cs_timer.h"
#include "cs_probe.h"
Include dependency graph for cs_probe.c:

Functions

int cs_probe_get_n_sets (void)
 Retrieve the number of probe sets defined. More...
 
cs_probe_set_tcs_probe_set_get (const char *name)
 Retrieve a cs_probe_set_t structure. More...
 
cs_probe_set_tcs_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 *is_profile, bool *on_boundary, bool *is_automatic, int *n_writers, int *writer_ids[])
 Retrieve information useful for the postprocessing step. More...
 
bool cs_probe_set_have_monitoring (void)
 Check if a set of monitoring probes has been defined among all the probe sets. More...
 
cs_probe_set_tcs_probe_set_create (const char *name)
 Create a new set of probes. More...
 
void cs_probe_set_add_probe (cs_probe_set_t *pset, const cs_real_t *xyz, const char *label)
 Add a new probe to an existing set of probes. More...
 
cs_probe_set_tcs_probe_set_create_from_array (const char *name, int n_probes, const cs_real_t *coords, const char **labels)
 Define a new set of probes from an array of coordinates. More...
 
cs_probe_set_tcs_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...
 
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_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)
 Try to locate each probe and define the coordinate really use 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...
 
void cs_probe_finalize (void)
 Free all structures related to a set of 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, int *mode, int *n_probes, cs_real_t *coords[], cs_lnum_t *ent_num[], float *distances[])
 Retrieve the main members of a cs_probe_set_t structure. More...
 

Detailed Description

Probes and profiles management.

Function Documentation

◆ cs_probe_finalize()

void cs_probe_finalize ( void  )

Free all structures related to a set of probes.

◆ cs_probe_get_n_sets()

int cs_probe_get_n_sets ( void  )

Retrieve the number of probe sets defined.

Returns
the number of probe sets defined

◆ cs_probe_set_add_probe()

void cs_probe_set_add_probe ( cs_probe_set_t pset,
const cs_real_t xyz,
const char *  label 
)

Add a new probe to an existing set of probes.

Parameters
[in,out]psetset of probes
[in]xyzcoordinates of the point to add
[in]labelNULL or the name of the point (optional)

◆ cs_probe_set_associate_writers()

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.

Parameters
[in,out]psetpointer to a cs_probe_set_t structure to set
[in]n_writersnumber of writers assocuated to this probe set
[in]writer_idslist of writer ids

◆ cs_probe_set_create()

cs_probe_set_t* cs_probe_set_create ( const char *  name)

Create a new set of probes.

Parameters
[in]namename of the set of probes
Returns
a pointer to a new allocated cs_probe_set_t structure

◆ cs_probe_set_create_from_array()

cs_probe_set_t* cs_probe_set_create_from_array ( const char *  name,
int  n_probes,
const cs_real_t coords,
const char **  labels 
)

Define a new set of probes from an array of coordinates.

Parameters
[in]namename of the set of probes
[in]n_probesnumber of probes in coords and labels
[in]coordslist of coordinates related to each probe
[in]labelslist of label related to each probe (optional)
Returns
a pointer to a new allocated cs_probe_set_t structure

◆ cs_probe_set_create_from_segment()

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.

Parameters
[in]namename of the set of probes
[in]n_probesnumber of probes
[in]start_coordscoordinates of the starting point
[in]end_coordscoordinates of the ending point
Returns
a pointer to a new allocated cs_probe_set_t structure

◆ cs_probe_set_dump()

void cs_probe_set_dump ( const cs_probe_set_t pset)

Dump a cs_probe_set_t structure.

Parameters
[in]psetpointer to a cs_probe_set_t structure

◆ cs_probe_set_export_mesh()

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.

Parameters
[in,out]psetpointer to a cs_probe_set_t structure
[in]mesh_namename of the mesh to export
Returns
a pointer to a fvm_nodal_t structure

◆ cs_probe_set_get()

cs_probe_set_t* cs_probe_set_get ( const char *  name)

Retrieve a cs_probe_set_t structure.

Parameters
[in]namename of the set of probes to find
Returns
a pointer to a cs_probes_t structure or NULL if not found

◆ cs_probe_set_get_by_id()

cs_probe_set_t* cs_probe_set_get_by_id ( int  pset_id)

Retrieve a cs_probe_set_t structure from its id.

Parameters
[in]pset_idid related to the set of probes to find
Returns
a pointer to a cs_probes_t structure or NULL if not found

◆ cs_probe_set_get_members()

void cs_probe_set_get_members ( const cs_probe_set_t pset,
int *  mode,
int *  n_probes,
cs_real_t coords[],
cs_lnum_t ent_num[],
float *  distances[] 
)

Retrieve the main members of a cs_probe_set_t structure.

Parameters
[in]psetpointer to a cs_probe_set_t structure
[in,out]modemode of location
[in,out]n_probesnumber of probes
[in,out]coordsprobe coordinates
[in,out]ent_numentity numbers (-1 if not located on this rank)
[in,out]distancesdistance of each probe from its related cell center

◆ cs_probe_set_get_name()

const char* cs_probe_set_get_name ( cs_probe_set_t pset)

Retrieve the name related to a cs_probe_set_t structure.

Parameters
[in]psetpointer to a cs_probe_set_t structure
Returns
the name of the cs_probes_t structure or NULL if not found

◆ cs_probe_set_get_post_info()

void cs_probe_set_get_post_info ( const cs_probe_set_t pset,
bool *  time_varying,
bool *  is_profile,
bool *  on_boundary,
bool *  is_automatic,
int *  n_writers,
int *  writer_ids[] 
)

Retrieve information useful for the postprocessing step.

Parameters
[in]psetpointer to a cs_probe_set_t structure
[out]time_varyingtrue if probe coords may change during computation
[out]is_profiletrue if probe set is related to a profile
[out]on_boundarytrue if probes are located on boundary
[out]is_automatictrue if set of variables to output is predefined
[out]n_writersnumber of associated user-defined writers
[out]writer_idspointer to a list of writer ids

◆ cs_probe_set_have_monitoring()

bool cs_probe_set_have_monitoring ( void  )

Check if a set of monitoring probes has been defined among all the probe sets.

Returns
true or false

◆ cs_probe_set_locate()

void cs_probe_set_locate ( cs_probe_set_t pset)

Try to locate each probe and define the coordinate really use for the postprocessing step.

Parameters
[in,out]psetpointer to a cs_probe_set_t structure

◆ cs_probe_set_option()

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 are the following:

  • activated where keyval is either true or false (default)
  • boundary where keyval is either true or false (default)
  • mode where keyval is exact, nearest_vertex or nearest_center (default)
  • profile where keyval is either true or false
  • selection_criteria where keyval is selection criteria string
  • tolerance where keyval is for instance "0.05" (default "0.10")
  • moving_probes where keyval is either true or false (default)
Parameters
[in,out]psetpointer to a cs_probe_set_t structure to set
[in]keynamename of the keyword related to the parameter to set
[in]keyvalvalue of the keyword to set