My Project
programmer's documentation
Functions
cs_lagr_extract.h File Reference
#include "fvm_nodal.h"
#include "fvm_writer.h"
#include "cs_base.h"
#include "cs_lagr_particle.h"
#include "cs_time_step.h"
Include dependency graph for cs_lagr_extract.h:

Go to the source code of this file.

Functions

cs_lnum_t cs_lagr_get_n_particles (void)
 Get the local number of particles. More...
 
void cs_lagr_get_particle_list (cs_lnum_t n_cells, const cs_lnum_t cell_list[], double density, cs_lnum_t *n_particles, cs_lnum_t *particle_list)
 Extract a list of particles using an optional cell filter and statistical density filter. More...
 
int cs_lagr_get_particle_values (const cs_lagr_particle_set_t *particles, cs_lagr_attribute_t attr, cs_datatype_t datatype, int stride, int component_id, cs_lnum_t n_particles, const cs_lnum_t particle_list[], void *values)
 Extract values for a set of particles. More...
 
int cs_lagr_get_trajectory_values (const cs_lagr_particle_set_t *particles, cs_lagr_attribute_t attr, cs_datatype_t datatype, int stride, int component_id, cs_lnum_t n_particles, const cs_lnum_t particle_list[], void *segment_values)
 Extract trajectory values for a set of particles. More...
 

Function Documentation

◆ cs_lagr_get_n_particles()

cs_lnum_t cs_lagr_get_n_particles ( void  )

Get the local number of particles.

Returns
current number of particles.

◆ cs_lagr_get_particle_list()

void cs_lagr_get_particle_list ( cs_lnum_t  n_cells,
const cs_lnum_t  cell_list[],
double  density,
cs_lnum_t n_particles,
cs_lnum_t particle_list 
)

Extract a list of particles using an optional cell filter and statistical density filter.

The output array must have been allocated by the caller and be of sufficient size.

Parameters
[in]n_cellsnumber of cells in filter
[in]cell_listoptional list of containing cells filter (1 to n numbering)
[in]densityif < 1, fraction of particles to select
[out]n_particlesnumber of selected particles, or NULL
[out]particle_listparticle_list (1 to n numbering), or NULL

◆ cs_lagr_get_particle_values()

int cs_lagr_get_particle_values ( const cs_lagr_particle_set_t particles,
cs_lagr_attribute_t  attr,
cs_datatype_t  datatype,
int  stride,
int  component_id,
cs_lnum_t  n_particles,
const cs_lnum_t  particle_list[],
void *  values 
)

Extract values for a set of particles.

The output array must have been allocated by the caller and be of sufficient size.

Parameters
[in]particlesassociated particle set
[in]attrattribute whose values are required
[in]datatypeassociated value type
[in]stridenumber of values per particle
[in]component_idif -1 : extract the whole attribute if >0 : id of the component to extract
[in]n_particlesnumber of particles in filter
[in]particle_listparticle_list (1 to n numbering), or NULL
[out]valuesparticle values for given attribute
Returns
0 in case of success, 1 if attribute is not present

◆ cs_lagr_get_trajectory_values()

int cs_lagr_get_trajectory_values ( const cs_lagr_particle_set_t particles,
cs_lagr_attribute_t  attr,
cs_datatype_t  datatype,
int  stride,
int  component_id,
cs_lnum_t  n_particles,
const cs_lnum_t  particle_list[],
void *  segment_values 
)

Extract trajectory values for a set of particles.

Trajectories are defined as a mesh of segments, whose start and end points are copied in an interleaved manner in the segment_values array (p1_old, p1_new, p2_old, p2_new, ... pn_old, pn_new).

The output array must have been allocated by the caller and be of sufficient size.

Parameters
[in]particlesassociated particle set
[in]attrattribute whose values are required
[in]datatypeassociated value type
[in]stridenumber of values per particle
[in]component_idif -1 : extract the whole attribute if >0 : id of the component to extract
[in]n_particlesnumber of particles in filter
[in]particle_listparticle_list (1 to n numbering), or NULL
[out]segment_valuesparticle segment values
Returns
0 in case of success, 1 if attribute is not present