My Project
programmer's documentation
Data Structures | Macros | Enumerations | Functions | Variables
cs_lagr_particle.h File Reference
#include "cs_defs.h"
#include "assert.h"
Include dependency graph for cs_lagr_particle.h:

Go to the source code of this file.

Data Structures

struct  cs_lagr_attribute_map_t
 
struct  cs_lagr_particle_set_t
 

Macros

#define CS_LAGR_PART_TO_DELETE   (1 << 0)
 
#define CS_LAGR_PART_FIXED   (1 << 1)
 
#define CS_LAGR_PART_DEPOSITED   (1 << 2)
 
#define CS_LAGR_PART_ROLLING   (1 << 3)
 
#define CS_LAGR_PART_IMPOSED_MOTION   (1 << 4)
 
#define CS_LAGR_PART_DEPOSITION_FLAGS
 

Enumerations

enum  cs_lagr_attribute_t {
  CS_LAGR_P_FLAG, CS_LAGR_CELL_ID, CS_LAGR_RANK_ID, CS_LAGR_REBOUND_ID,
  CS_LAGR_RANDOM_VALUE, CS_LAGR_STAT_WEIGHT, CS_LAGR_RESIDENCE_TIME, CS_LAGR_MASS,
  CS_LAGR_DIAMETER, CS_LAGR_TAUP_AUX, CS_LAGR_COORDS, CS_LAGR_VELOCITY,
  CS_LAGR_VELOCITY_SEEN, CS_LAGR_TR_TRUNCATE, CS_LAGR_TR_REPOSITION, CS_LAGR_TURB_STATE_1,
  CS_LAGR_PRED_VELOCITY, CS_LAGR_PRED_VELOCITY_SEEN, CS_LAGR_V_GAUSS, CS_LAGR_BR_GAUSS,
  CS_LAGR_YPLUS, CS_LAGR_INTERF, CS_LAGR_NEIGHBOR_FACE_ID, CS_LAGR_MARKO_VALUE,
  CS_LAGR_FOULING_INDEX, CS_LAGR_N_LARGE_ASPERITIES, CS_LAGR_N_SMALL_ASPERITIES, CS_LAGR_ADHESION_FORCE,
  CS_LAGR_ADHESION_TORQUE, CS_LAGR_DISPLACEMENT_NORM, CS_LAGR_HEIGHT, CS_LAGR_CLUSTER_NB_PART,
  CS_LAGR_DEPO_TIME, CS_LAGR_CONSOL_HEIGHT, CS_LAGR_TEMPERATURE, CS_LAGR_FLUID_TEMPERATURE,
  CS_LAGR_CP, CS_LAGR_WATER_MASS, CS_LAGR_COAL_MASS, CS_LAGR_COKE_MASS,
  CS_LAGR_SHRINKING_DIAMETER, CS_LAGR_INITIAL_DIAMETER, CS_LAGR_COAL_ID, CS_LAGR_COAL_DENSITY,
  CS_LAGR_EMISSIVITY, CS_LAGR_STAT_CLASS, CS_LAGR_PARTICLE_AGGREGATE, CS_LAGR_USER,
  CS_LAGR_N_ATTRIBUTES
}
 

Functions

void cs_lagr_particle_attr_initialize (void)
 Define particle map based on defined options. More...
 
const cs_lagr_attribute_map_tcs_lagr_particle_get_attr_map (void)
 Return const pointer to the main particle attribute map structure. More...
 
void cs_lagr_particle_set_create (void)
 
void cs_lagr_particle_finalize (void)
 Destroy main particle set and map if they exist. More...
 
void cs_lagr_part_copy (cs_lnum_t dest, cs_lnum_t src)
 Copy attributes from one particle to another. More...
 
void cs_lagr_get_attr_info (const cs_lagr_particle_set_t *particles, int time_id, cs_lagr_attribute_t attr, size_t *extents, size_t *size, ptrdiff_t *displ, cs_datatype_t *datatype, int *count)
 Get data extents for a given particle attribute. More...
 
int cs_lagr_check_attr_query (const cs_lagr_particle_set_t *particles, cs_lagr_attribute_t attr, cs_datatype_t datatype, int stride, int component_id)
 Check that query for a given particle attribute is valid. More...
 
void cs_lagr_particle_attr_in_range (int attr)
 Check if a particle attribute is in a valid range. More...
 
cs_lagr_particle_set_tcs_lagr_get_particle_set (void)
 Return pointer to the main cs_lagr_particle_set_t structure. More...
 
static void * cs_lagr_particles_attr (cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, cs_lagr_attribute_t attr)
 Get pointer to a current attribute of a given particle in a set. More...
 
static const void * cs_lagr_particles_attr_const (const cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, cs_lagr_attribute_t attr)
 Get const pointer to current attribute data of a given particle in a set. More...
 
static void * cs_lagr_particles_attr_n (cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, int time_id, cs_lagr_attribute_t attr)
 Get pointer to attribute data of a given particle in a set at a given time. More...
 
static const void * cs_lagr_particles_attr_n_const (const cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, int time_id, cs_lagr_attribute_t attr)
 Get const pointer to attribute data of a given particle in a set at a given time. More...
 
static int cs_lagr_particles_get_flag (const cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, int mask)
 Get flag value with a selected mask for a given particle in a set. More...
 
static void cs_lagr_particles_set_flag (const cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, int mask)
 Set flag value with a selected mask for a given particle in a set. More...
 
static void cs_lagr_particles_unset_flag (const cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, int mask)
 Unset flag value with a selected mask for a given particle in a set. More...
 
static cs_lnum_t cs_lagr_particles_get_lnum (const cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, cs_lagr_attribute_t attr)
 Get attribute value of type cs_lnum_t of a given particle in a set. More...
 
static cs_lnum_t cs_lagr_particles_get_lnum_n (const cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, int time_id, cs_lagr_attribute_t attr)
 Get attribute value of type cs_lnum_t of a given particle in a set at a given time. More...
 
static void cs_lagr_particles_set_lnum (cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, cs_lagr_attribute_t attr, cs_lnum_t value)
 Set attribute value of type cs_lnum_t of a given particle in a set. More...
 
static void cs_lagr_particles_set_lnum_n (cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, int time_id, cs_lagr_attribute_t attr, cs_lnum_t value)
 Set attribute value of type cs_lnum_t of a given particle in a set at a given time. More...
 
static cs_gnum_t cs_lagr_particles_get_gnum (const cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, cs_lagr_attribute_t attr)
 Get attribute value of type cs_gnum_t of a given particle in a set. More...
 
static cs_gnum_t cs_lagr_particles_get_gnum_n (const cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, int time_id, cs_lagr_attribute_t attr)
 Get attribute value of type cs_gnum_t of a given particle in a set at a given time. More...
 
static void cs_lagr_particles_set_gnum (cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, cs_lagr_attribute_t attr, cs_gnum_t value)
 Set attribute value of type cs_gnum_t of a given particle in a set. More...
 
static void cs_lagr_particles_set_gnum_n (cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, int time_id, cs_lagr_attribute_t attr, cs_gnum_t value)
 Set attribute value of type cs_gnum_t of a given particle in a set at a given time. More...
 
static cs_real_t cs_lagr_particles_get_real (const cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, cs_lagr_attribute_t attr)
 Get attribute value of type cs_real_t of a given particle in a set. More...
 
static cs_real_t cs_lagr_particles_get_real_n (const cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, int time_id, cs_lagr_attribute_t attr)
 Get attribute value of type cs_real_t of a given particle in a set at a given time. More...
 
static void cs_lagr_particles_set_real (cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, cs_lagr_attribute_t attr, cs_real_t value)
 Set attribute value of type cs_real_t of a given particle in a set. More...
 
static void cs_lagr_particles_set_real_n (cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, int time_id, cs_lagr_attribute_t attr, cs_real_t value)
 Set attribute value of type cs_real_t of a given particle in a set at a given time. More...
 
static cs_real_tcs_lagr_particles_source_terms (cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, cs_lagr_attribute_t attr)
 Get pointer to 2nd order scheme source terms for an attribute of a given particle in a set. More...
 
static const cs_real_tcs_lagr_particles_source_terms_const (cs_lagr_particle_set_t *particle_set, cs_lnum_t particle_id, cs_lagr_attribute_t attr)
 Get const pointer to 2nd order scheme source terms an attribute of a given particle in a set. More...
 
static void * cs_lagr_particle_attr (void *particle, const cs_lagr_attribute_map_t *attr_map, cs_lagr_attribute_t attr)
 Get pointer to current attribute data of a particle. More...
 
static const void * cs_lagr_particle_attr_const (const void *particle, const cs_lagr_attribute_map_t *attr_map, cs_lagr_attribute_t attr)
 Get const pointer to current attribute data of a particle. More...
 
static void * cs_lagr_particle_attr_n (void *particle, const cs_lagr_attribute_map_t *attr_map, int time_id, cs_lagr_attribute_t attr)
 Get pointer to attribute data of a particle at a given time. More...
 
static const void * cs_lagr_particle_attr_n_const (const void *particle, const cs_lagr_attribute_map_t *attr_map, int time_id, cs_lagr_attribute_t attr)
 Get const pointer to attribute data of a particle at a given time. More...
 
static cs_lnum_t cs_lagr_particle_get_lnum (const void *particle, const cs_lagr_attribute_map_t *attr_map, cs_lagr_attribute_t attr)
 Get attribute value of type cs_lnum_t of a given particle in a set. More...
 
static cs_lnum_t cs_lagr_particle_get_lnum_n (const void *particle, const cs_lagr_attribute_map_t *attr_map, int time_id, cs_lagr_attribute_t attr)
 Get attribute value of type cs_lnum_t of a given particle at a given time. More...
 
static void cs_lagr_particle_set_lnum (void *particle, const cs_lagr_attribute_map_t *attr_map, cs_lagr_attribute_t attr, cs_lnum_t value)
 Set attribute value of type cs_lnum_t of a given particle. More...
 
static void cs_lagr_particle_set_lnum_n (void *particle, const cs_lagr_attribute_map_t *attr_map, int time_id, cs_lagr_attribute_t attr, cs_lnum_t value)
 Set attribute value of type cs_lnum_t of a given particle at a given time. More...
 
static cs_gnum_t cs_lagr_particle_get_gnum (const void *particle, const cs_lagr_attribute_map_t *attr_map, cs_lagr_attribute_t attr)
 Get attribute value of type cs_gnum_t of a given particle in a set. More...
 
static cs_gnum_t cs_lagr_particle_get_gnum_n (const void *particle, const cs_lagr_attribute_map_t *attr_map, int time_id, cs_lagr_attribute_t attr)
 Get attribute value of type cs_gnum_t of a given particle at a given time. More...
 
static void cs_lagr_particle_set_gnum (void *particle, const cs_lagr_attribute_map_t *attr_map, cs_lagr_attribute_t attr, cs_gnum_t value)
 Set attribute value of type cs_gnum_t of a given particle. More...
 
static void cs_lagr_particle_set_gnum_n (void *particle, const cs_lagr_attribute_map_t *attr_map, int time_id, cs_lagr_attribute_t attr, cs_gnum_t value)
 Set attribute value of type cs_gnum_t of a given particle at a given time. More...
 
static cs_real_t cs_lagr_particle_get_real (const void *particle, const cs_lagr_attribute_map_t *attr_map, cs_lagr_attribute_t attr)
 Get attribute value of type cs_real_t of a given particle in a set. More...
 
static cs_real_t cs_lagr_particle_get_real_n (const void *particle, const cs_lagr_attribute_map_t *attr_map, int time_id, cs_lagr_attribute_t attr)
 Get attribute value of type cs_real_t of a given particle at a given time. More...
 
static void cs_lagr_particle_set_real (void *particle, const cs_lagr_attribute_map_t *attr_map, cs_lagr_attribute_t attr, cs_real_t value)
 Set attribute value of type cs_real_t of a given particle. More...
 
static void cs_lagr_particle_set_real_n (void *particle, const cs_lagr_attribute_map_t *attr_map, int time_id, cs_lagr_attribute_t attr, cs_real_t value)
 Set attribute value of type cs_real_t of a given particle at a given time. More...
 
static cs_real_tcs_lagr_particle_source_term (void *particle, const cs_lagr_attribute_map_t *attr_map, cs_lagr_attribute_t attr)
 Get pointer to 2nd order scheme attribute source terms of a particle. More...
 
static const cs_real_tcs_lagr_particle_source_term_const (void *particle, const cs_lagr_attribute_map_t *attr_map, cs_lagr_attribute_t attr)
 Get pointer to 2nd order scheme attribute source terms of a particle. More...
 
int cs_lagr_particle_set_resize (cs_lnum_t n_min_particles)
 Resize particle set buffers if needed. More...
 
void cs_lagr_set_reallocation_factor (double f)
 Set reallocation factor for particle sets. More...
 
unsigned long long cs_lagr_get_n_g_particles_max (void)
 Get global maximum number of particles. More...
 
void cs_lagr_set_n_g_particles_max (unsigned long long n_g_particles_max)
 Set global maximum number of particles. More...
 
void cs_lagr_particles_current_to_previous (cs_lagr_particle_set_t *particles, cs_lnum_t particle_id)
 Copy current attributes to previous attributes. More...
 
void cs_lagr_particle_set_dump (const cs_lagr_particle_set_t *particles)
 Dump a cs_lagr_particle_set_t structure. More...
 
void cs_lagr_set_n_user_variables (int n_user_variables)
 Set number of user particle variables. More...
 

Variables

const char * cs_lagr_attribute_name []
 
cs_lagr_particle_set_tcs_glob_lagr_particle_set
 

Macro Definition Documentation

◆ CS_LAGR_PART_DEPOSITED

#define CS_LAGR_PART_DEPOSITED   (1 << 2)

particle is deposited

◆ CS_LAGR_PART_DEPOSITION_FLAGS

#define CS_LAGR_PART_DEPOSITION_FLAGS
Value:

Flag sets (useful for cancelling nay flag of a set)

particle is in flow

◆ CS_LAGR_PART_FIXED

#define CS_LAGR_PART_FIXED   (1 << 1)

particle is fixed, no resuspension possible

◆ CS_LAGR_PART_IMPOSED_MOTION

#define CS_LAGR_PART_IMPOSED_MOTION   (1 << 4)

particle motion is prescribed

◆ CS_LAGR_PART_ROLLING

#define CS_LAGR_PART_ROLLING   (1 << 3)

particle is rolling

◆ CS_LAGR_PART_TO_DELETE

#define CS_LAGR_PART_TO_DELETE   (1 << 0)

Flags specifying general event attributes

particle will be deleted

Enumeration Type Documentation

◆ cs_lagr_attribute_t

Prefedined particle attributes

Enumerator
CS_LAGR_P_FLAG 

local metadata flag

CS_LAGR_CELL_ID 

local cell id (0 to n-1)

CS_LAGR_RANK_ID 

local parallel rank id

CS_LAGR_REBOUND_ID 

number of time steps since rebound, or -1

CS_LAGR_RANDOM_VALUE 

associated random value (for sampling)

CS_LAGR_STAT_WEIGHT 

statistical weight

CS_LAGR_RESIDENCE_TIME 

time since particle injection

CS_LAGR_MASS 
CS_LAGR_DIAMETER 
CS_LAGR_TAUP_AUX 
CS_LAGR_COORDS 
CS_LAGR_VELOCITY 
CS_LAGR_VELOCITY_SEEN 
CS_LAGR_TR_TRUNCATE 

portion of trajectory truncated

CS_LAGR_TR_REPOSITION 

number of times the particle is repositioned at the cell center, or -1 when lost (to be discarded at the next displacement step)

CS_LAGR_TURB_STATE_1 
CS_LAGR_PRED_VELOCITY 
CS_LAGR_PRED_VELOCITY_SEEN 
CS_LAGR_V_GAUSS 
CS_LAGR_BR_GAUSS 
CS_LAGR_YPLUS 
CS_LAGR_INTERF 
CS_LAGR_NEIGHBOR_FACE_ID 
CS_LAGR_MARKO_VALUE 
CS_LAGR_FOULING_INDEX 
CS_LAGR_N_LARGE_ASPERITIES 
CS_LAGR_N_SMALL_ASPERITIES 
CS_LAGR_ADHESION_FORCE 
CS_LAGR_ADHESION_TORQUE 
CS_LAGR_DISPLACEMENT_NORM 
CS_LAGR_HEIGHT 
CS_LAGR_CLUSTER_NB_PART 
CS_LAGR_DEPO_TIME 
CS_LAGR_CONSOL_HEIGHT 
CS_LAGR_TEMPERATURE 
CS_LAGR_FLUID_TEMPERATURE 
CS_LAGR_CP 
CS_LAGR_WATER_MASS 
CS_LAGR_COAL_MASS 
CS_LAGR_COKE_MASS 
CS_LAGR_SHRINKING_DIAMETER 
CS_LAGR_INITIAL_DIAMETER 
CS_LAGR_COAL_ID 
CS_LAGR_COAL_DENSITY 
CS_LAGR_EMISSIVITY 
CS_LAGR_STAT_CLASS 
CS_LAGR_PARTICLE_AGGREGATE 
CS_LAGR_USER 
CS_LAGR_N_ATTRIBUTES 

Function Documentation

◆ cs_lagr_check_attr_query()

int cs_lagr_check_attr_query ( const cs_lagr_particle_set_t particles,
cs_lagr_attribute_t  attr,
cs_datatype_t  datatype,
int  stride,
int  component_id 
)

Check that query for a given particle attribute is valid.

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
Returns
0 in case of success, 1 in case of error

◆ cs_lagr_get_attr_info()

void cs_lagr_get_attr_info ( const cs_lagr_particle_set_t particles,
int  time_id,
cs_lagr_attribute_t  attr,
size_t *  extents,
size_t *  size,
ptrdiff_t *  displ,
cs_datatype_t datatype,
int *  count 
)

Get data extents for a given particle attribute.

For attributes not currently present, the displacement and data size should be -1 and 0 respectively.

Parameters
[in]particlesassociated particle set
[in]time_idassociated time id (0: current, 1: previous)
[in]attrparticle attribute
[out]extentssize (in bytes) of particle structure, or NULL
[out]sizesize (in bytes) of attribute in particle structure, or NULL
[out]displdisplacement (in bytes) in particle structure, or NULL
[out]datatypedatatype of associated attribute, or NULL
[out]countnumber of type values associated with attribute, or NULL

◆ cs_lagr_get_n_g_particles_max()

unsigned long long cs_lagr_get_n_g_particles_max ( void  )

Get global maximum number of particles.

By default, the number is limited only by local cs_lnum_t and global cs_gnum_t data representation limits.

Returns
global maximum number of particles

◆ cs_lagr_get_particle_set()

cs_lagr_particle_set_t* cs_lagr_get_particle_set ( void  )

Return pointer to the main cs_lagr_particle_set_t structure.

Returns
pointer to current particle set, or NULL

◆ cs_lagr_part_copy()

void cs_lagr_part_copy ( cs_lnum_t  dest,
cs_lnum_t  src 
)

Copy attributes from one particle to another.

The random value associated with the particle is modified.

Parameters
destid (0-based) of destination particle
srcid (0-based) of source particle

◆ cs_lagr_particle_attr()

static void* cs_lagr_particle_attr ( void *  particle,
const cs_lagr_attribute_map_t attr_map,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get pointer to current attribute data of a particle.

Parameters
[in]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]attrrequested attribute id
Returns
pointer to attribute data

◆ cs_lagr_particle_attr_const()

static const void* cs_lagr_particle_attr_const ( const void *  particle,
const cs_lagr_attribute_map_t attr_map,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get const pointer to current attribute data of a particle.

Parameters
[in]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]attrrequested attribute id
Returns
const pointer to attribute

◆ cs_lagr_particle_attr_in_range()

void cs_lagr_particle_attr_in_range ( int  attr)

Check if a particle attribute is in a valid range.

If this is not the case, a fatal error is provoked.

Parameters
[in]attrparticle attribute

◆ cs_lagr_particle_attr_initialize()

void cs_lagr_particle_attr_initialize ( void  )

Define particle map based on defined options.

◆ cs_lagr_particle_attr_n()

static void* cs_lagr_particle_attr_n ( void *  particle,
const cs_lagr_attribute_map_t attr_map,
int  time_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get pointer to attribute data of a particle at a given time.

Parameters
[in]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
Returns
pointer to attribute data

◆ cs_lagr_particle_attr_n_const()

static const void* cs_lagr_particle_attr_n_const ( const void *  particle,
const cs_lagr_attribute_map_t attr_map,
int  time_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get const pointer to attribute data of a particle at a given time.

Parameters
[in]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
Returns
pointer to attribute data

◆ cs_lagr_particle_finalize()

void cs_lagr_particle_finalize ( void  )

Destroy main particle set and map if they exist.

◆ cs_lagr_particle_get_attr_map()

const cs_lagr_attribute_map_t* cs_lagr_particle_get_attr_map ( void  )

Return const pointer to the main particle attribute map structure.

Returns
pointer to current particle attribute map, or NULL
pointer to current particle attrbute map, or NULL

◆ cs_lagr_particle_get_gnum()

static cs_gnum_t cs_lagr_particle_get_gnum ( const void *  particle,
const cs_lagr_attribute_map_t attr_map,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_gnum_t of a given particle in a set.

Parameters
[in]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_particle_get_gnum_n()

static cs_gnum_t cs_lagr_particle_get_gnum_n ( const void *  particle,
const cs_lagr_attribute_map_t attr_map,
int  time_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_gnum_t of a given particle at a given time.

Parameters
[in]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_particle_get_lnum()

static cs_lnum_t cs_lagr_particle_get_lnum ( const void *  particle,
const cs_lagr_attribute_map_t attr_map,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_lnum_t of a given particle in a set.

Parameters
[in]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_particle_get_lnum_n()

static cs_lnum_t cs_lagr_particle_get_lnum_n ( const void *  particle,
const cs_lagr_attribute_map_t attr_map,
int  time_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_lnum_t of a given particle at a given time.

Parameters
[in]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_particle_get_real()

static cs_real_t cs_lagr_particle_get_real ( const void *  particle,
const cs_lagr_attribute_map_t attr_map,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_real_t of a given particle in a set.

Parameters
[in]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_particle_get_real_n()

static cs_real_t cs_lagr_particle_get_real_n ( const void *  particle,
const cs_lagr_attribute_map_t attr_map,
int  time_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_real_t of a given particle at a given time.

Parameters
[in]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_particle_set_create()

void cs_lagr_particle_set_create ( void  )

Allocate main cs_lagr_particle_set_t structure.

◆ cs_lagr_particle_set_dump()

void cs_lagr_particle_set_dump ( const cs_lagr_particle_set_t particles)

Dump a cs_lagr_particle_set_t structure.

Parameters
[in]particlescs_lagr_particle_t structure to dump

◆ cs_lagr_particle_set_gnum()

static void cs_lagr_particle_set_gnum ( void *  particle,
const cs_lagr_attribute_map_t attr_map,
cs_lagr_attribute_t  attr,
cs_gnum_t  value 
)
inlinestatic

Set attribute value of type cs_gnum_t of a given particle.

Parameters
[in,out]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_particle_set_gnum_n()

static void cs_lagr_particle_set_gnum_n ( void *  particle,
const cs_lagr_attribute_map_t attr_map,
int  time_id,
cs_lagr_attribute_t  attr,
cs_gnum_t  value 
)
inlinestatic

Set attribute value of type cs_gnum_t of a given particle at a given time.

Parameters
[in,out]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_particle_set_lnum()

static void cs_lagr_particle_set_lnum ( void *  particle,
const cs_lagr_attribute_map_t attr_map,
cs_lagr_attribute_t  attr,
cs_lnum_t  value 
)
inlinestatic

Set attribute value of type cs_lnum_t of a given particle.

Parameters
[in,out]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_particle_set_lnum_n()

static void cs_lagr_particle_set_lnum_n ( void *  particle,
const cs_lagr_attribute_map_t attr_map,
int  time_id,
cs_lagr_attribute_t  attr,
cs_lnum_t  value 
)
inlinestatic

Set attribute value of type cs_lnum_t of a given particle at a given time.

Parameters
[in,out]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_particle_set_real()

static void cs_lagr_particle_set_real ( void *  particle,
const cs_lagr_attribute_map_t attr_map,
cs_lagr_attribute_t  attr,
cs_real_t  value 
)
inlinestatic

Set attribute value of type cs_real_t of a given particle.

Parameters
[in,out]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_particle_set_real_n()

static void cs_lagr_particle_set_real_n ( void *  particle,
const cs_lagr_attribute_map_t attr_map,
int  time_id,
cs_lagr_attribute_t  attr,
cs_real_t  value 
)
inlinestatic

Set attribute value of type cs_real_t of a given particle at a given time.

Parameters
[in,out]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_particle_set_resize()

int cs_lagr_particle_set_resize ( cs_lnum_t  n_min_particles)

Resize particle set buffers if needed.

By default, the total number of particles is not limited. A global limit may be set using cs_lagr_set_n_g_particles_max.

Parameters
[in]n_min_particlesminimum number of particles required
Returns
1 if resizing was required, -1 if the global minimum number of particles would exceed the global limit, 0 otherwise.

◆ cs_lagr_particle_source_term()

static cs_real_t* cs_lagr_particle_source_term ( void *  particle,
const cs_lagr_attribute_map_t attr_map,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get pointer to 2nd order scheme attribute source terms of a particle.

Parameters
[in]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]attrrequested attribute id
Returns
pointer to attribute source terms

◆ cs_lagr_particle_source_term_const()

static const cs_real_t* cs_lagr_particle_source_term_const ( void *  particle,
const cs_lagr_attribute_map_t attr_map,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get pointer to 2nd order scheme attribute source terms of a particle.

Parameters
[in]particlepointer to particle data
[in]attr_mappointer to attribute map
[in]attrrequested attribute id
Returns
pointer to attribute source terms

◆ cs_lagr_particles_attr()

static void* cs_lagr_particles_attr ( cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get pointer to a current attribute of a given particle in a set.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]attrrequested attribute id
Returns
pointer to current attribute data

◆ cs_lagr_particles_attr_const()

static const void* cs_lagr_particles_attr_const ( const cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get const pointer to current attribute data of a given particle in a set.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]attrrequested attribute id
Returns
pointer to current attribute data

◆ cs_lagr_particles_attr_n()

static void* cs_lagr_particles_attr_n ( cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
int  time_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get pointer to attribute data of a given particle in a set at a given time.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
Returns
pointer to attribute data at given time

◆ cs_lagr_particles_attr_n_const()

static const void* cs_lagr_particles_attr_n_const ( const cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
int  time_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get const pointer to attribute data of a given particle in a set at a given time.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
Returns
pointer to attribute data at given time

◆ cs_lagr_particles_current_to_previous()

void cs_lagr_particles_current_to_previous ( cs_lagr_particle_set_t particles,
cs_lnum_t  particle_id 
)

Copy current attributes to previous attributes.

Parameters
[in,out]particlesassociated particle set
[in]particle_idid of particle

◆ cs_lagr_particles_get_flag()

static int cs_lagr_particles_get_flag ( const cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
int  mask 
)
inlinestatic

Get flag value with a selected mask for a given particle in a set.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]maskrequested attribute flag value
Returns
attribute value

◆ cs_lagr_particles_get_gnum()

static cs_gnum_t cs_lagr_particles_get_gnum ( const cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_gnum_t of a given particle in a set.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_particles_get_gnum_n()

static cs_gnum_t cs_lagr_particles_get_gnum_n ( const cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
int  time_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_gnum_t of a given particle in a set at a given time.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_particles_get_lnum()

static cs_lnum_t cs_lagr_particles_get_lnum ( const cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_lnum_t of a given particle in a set.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_particles_get_lnum_n()

static cs_lnum_t cs_lagr_particles_get_lnum_n ( const cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
int  time_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_lnum_t of a given particle in a set at a given time.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_particles_get_real()

static cs_real_t cs_lagr_particles_get_real ( const cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_real_t of a given particle in a set.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_particles_get_real_n()

static cs_real_t cs_lagr_particles_get_real_n ( const cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
int  time_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get attribute value of type cs_real_t of a given particle in a set at a given time.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
Returns
attribute value

◆ cs_lagr_particles_set_flag()

static void cs_lagr_particles_set_flag ( const cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
int  mask 
)
inlinestatic

Set flag value with a selected mask for a given particle in a set.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]maskattribute flag value to set

◆ cs_lagr_particles_set_gnum()

static void cs_lagr_particles_set_gnum ( cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
cs_lagr_attribute_t  attr,
cs_gnum_t  value 
)
inlinestatic

Set attribute value of type cs_gnum_t of a given particle in a set.

Parameters
[in,out]particle_setpointer to particle set
[in]particle_idparticle id
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_particles_set_gnum_n()

static void cs_lagr_particles_set_gnum_n ( cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
int  time_id,
cs_lagr_attribute_t  attr,
cs_gnum_t  value 
)
inlinestatic

Set attribute value of type cs_gnum_t of a given particle in a set at a given time.

Parameters
[in,out]particle_setpointer to particle set
[in]particle_idparticle id
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_particles_set_lnum()

static void cs_lagr_particles_set_lnum ( cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
cs_lagr_attribute_t  attr,
cs_lnum_t  value 
)
inlinestatic

Set attribute value of type cs_lnum_t of a given particle in a set.

Parameters
[in,out]particle_setpointer to particle set
[in]particle_idparticle id
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_particles_set_lnum_n()

static void cs_lagr_particles_set_lnum_n ( cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
int  time_id,
cs_lagr_attribute_t  attr,
cs_lnum_t  value 
)
inlinestatic

Set attribute value of type cs_lnum_t of a given particle in a set at a given time.

Parameters
[in,out]particle_setpointer to particle set
[in]particle_idparticle id
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_particles_set_real()

static void cs_lagr_particles_set_real ( cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
cs_lagr_attribute_t  attr,
cs_real_t  value 
)
inlinestatic

Set attribute value of type cs_real_t of a given particle in a set.

Parameters
[in,out]particle_setpointer to particle set
[in]particle_idparticle id
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_particles_set_real_n()

static void cs_lagr_particles_set_real_n ( cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
int  time_id,
cs_lagr_attribute_t  attr,
cs_real_t  value 
)
inlinestatic

Set attribute value of type cs_real_t of a given particle in a set at a given time.

Parameters
[in,out]particle_setpointer to particle set
[in]particle_idparticle id
[in]time_id0 for current, 1 for previous
[in]attrrequested attribute id
[in]valuevalue to assign

◆ cs_lagr_particles_source_terms()

static cs_real_t* cs_lagr_particles_source_terms ( cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get pointer to 2nd order scheme source terms for an attribute of a given particle in a set.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]attrrequested attribute id
Returns
pointer to current attribute data

◆ cs_lagr_particles_source_terms_const()

static const cs_real_t* cs_lagr_particles_source_terms_const ( cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
cs_lagr_attribute_t  attr 
)
inlinestatic

Get const pointer to 2nd order scheme source terms an attribute of a given particle in a set.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]attrrequested attribute id
Returns
pointer to current attribute data

◆ cs_lagr_particles_unset_flag()

static void cs_lagr_particles_unset_flag ( const cs_lagr_particle_set_t particle_set,
cs_lnum_t  particle_id,
int  mask 
)
inlinestatic

Unset flag value with a selected mask for a given particle in a set.

Parameters
[in]particle_setpointer to particle set
[in]particle_idparticle id
[in]maskattribute flag value to set

◆ cs_lagr_set_n_g_particles_max()

void cs_lagr_set_n_g_particles_max ( unsigned long long  n_g_particles_max)

Set global maximum number of particles.

By default, the number is limited only by local cs_lnum_t and global cs_gnum_t data representation limits.

Parameters
[in]n_g_particles_maxglobal maximum number of particles

◆ cs_lagr_set_n_user_variables()

void cs_lagr_set_n_user_variables ( int  n_user_variables)

Set number of user particle variables.

Parameters
[in]n_user_variablesnumber of user variables

◆ cs_lagr_set_reallocation_factor()

void cs_lagr_set_reallocation_factor ( double  f)

Set reallocation factor for particle sets.

This factor determines the multiplier used for reallocations when the particle set's buffers are too small to handle the new number of particles.

Parameters
[in]freallocation size multiplier

Variable Documentation

◆ cs_glob_lagr_particle_set

cs_lagr_particle_set_t* cs_glob_lagr_particle_set

Pointer to the main particle set

◆ cs_lagr_attribute_name

const char* cs_lagr_attribute_name[]

Names of particle attributes

CS_LAGR_PART_FIXED
#define CS_LAGR_PART_FIXED
Definition: cs_lagr_particle.h:54
CS_LAGR_PART_IMPOSED_MOTION
#define CS_LAGR_PART_IMPOSED_MOTION
Definition: cs_lagr_particle.h:63
CS_LAGR_PART_ROLLING
#define CS_LAGR_PART_ROLLING
Definition: cs_lagr_particle.h:60
CS_LAGR_PART_TO_DELETE
#define CS_LAGR_PART_TO_DELETE
Definition: cs_lagr_particle.h:51
CS_LAGR_PART_DEPOSITED
#define CS_LAGR_PART_DEPOSITED
Definition: cs_lagr_particle.h:57