9.0
general documentation
Loading...
Searching...
No Matches
cs_lagr_extract.cpp File Reference

Extract information from lagrangian particles. More...

#include "base/cs_defs.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bft/bft_mem.h"
#include "bft/bft_printf.h"
#include "base/cs_base.h"
#include "base/cs_field.h"
#include "base/cs_log.h"
#include "mesh/cs_mesh.h"
#include "base/cs_parall.h"
#include "lagr/cs_lagr_tracking.h"
#include "base/cs_selector.h"
#include "base/cs_timer.h"
#include "base/cs_time_step.h"
#include "lagr/cs_lagr_extract.h"
Include dependency graph for cs_lagr_extract.cpp:

Functions

cs_lnum_t cs_lagr_get_n_particles (void)
 Get the local number of particles.
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.
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.
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.

Detailed Description

Extract information from lagrangian particles.

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 nullptr
[out]particle_listparticle_list (1 to n numbering), or nullptr

◆ 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 nullptr
[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 nullptr
[out]segment_valuesparticle segment values
Returns
0 in case of success, 1 if attribute is not present