#include "cs_defs.h"#include <limits.h>#include <stdio.h>#include <stddef.h>#include <stdlib.h>#include <string.h>#include <math.h>#include <ctype.h>#include <float.h>#include <assert.h>#include "bft_printf.h"#include "bft_error.h"#include "bft_mem.h"#include "fvm_periodicity.h"#include "cs_base.h"#include "cs_math.h"#include "cs_order.h"#include "cs_parall.h"#include "cs_random.h"#include "cs_timer_stats.h"#include "cs_lagr.h"#include "cs_lagr_post.h"#include "cs_lagr_clogging.h"#include "cs_lagr_roughness.h"#include "cs_lagr_dlvo.h"#include "cs_lagr_particle.h" Include dependency graph for cs_lagr_particle.c:
 Include dependency graph for cs_lagr_particle.c:| Functions | |
| void | cs_lagr_particle_attr_initialize (void) | 
| Define particle map based on defined options.  More... | |
| const cs_lagr_attribute_map_t * | cs_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_t * | cs_lagr_get_particle_set (void) | 
| Return pointer to the main cs_lagr_particle_set_t structure.  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... | |
Particle structure.
| 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.
| [in] | particles | associated particle set | 
| [in] | attr | attribute whose values are required | 
| [in] | datatype | associated value type | 
| [in] | stride | number of values per particle | 
| [in] | component_id | if -1 : extract the whole attribute if >0 : id of the component to extract | 
| 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.
| [in] | particles | associated particle set | 
| [in] | time_id | associated time id (0: current, 1: previous) | 
| [in] | attr | particle attribute | 
| [out] | extents | size (in bytes) of particle structure, or NULL | 
| [out] | size | size (in bytes) of attribute in particle structure, or NULL | 
| [out] | displ | displacement (in bytes) in particle structure, or NULL | 
| [out] | datatype | datatype of associated attribute, or NULL | 
| [out] | count | number of type values associated with attribute, or NULL | 
| unsigned long long cs_lagr_get_n_g_particles_max | ( | void | ) | 
| cs_lagr_particle_set_t* cs_lagr_get_particle_set | ( | void | ) | 
Return pointer to the main cs_lagr_particle_set_t structure.
Copy attributes from one particle to another.
The random value associated with the particle is modified.
| dest | id (0-based) of destination particle | 
| src | id (0-based) of source particle | 
| 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.
| [in] | attr | particle attribute | 
| void cs_lagr_particle_attr_initialize | ( | void | ) | 
Define particle map based on defined options.
| void cs_lagr_particle_finalize | ( | void | ) | 
Destroy main particle set and map if they exist.
| const cs_lagr_attribute_map_t* cs_lagr_particle_get_attr_map | ( | void | ) | 
Return const pointer to the main particle attribute map structure.
| void cs_lagr_particle_set_create | ( | void | ) | 
Allocate main cs_lagr_particle_set_t structure.
| void cs_lagr_particle_set_dump | ( | const cs_lagr_particle_set_t * | particles | ) | 
Dump a cs_lagr_particle_set_t structure.
| [in] | particles | cs_lagr_particle_t structure to dump | 
| 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.
| [in] | n_min_particles | minimum number of particles required | 
| void cs_lagr_particles_current_to_previous | ( | cs_lagr_particle_set_t * | particles, | 
| cs_lnum_t | particle_id | ||
| ) | 
Copy current attributes to previous attributes.
| [in,out] | particles | associated particle set | 
| [in] | particle_id | id of particle | 
| void cs_lagr_set_n_g_particles_max | ( | unsigned long long | n_g_particles_max | ) | 
| void cs_lagr_set_n_user_variables | ( | int | n_user_variables | ) | 
Set number of user particle variables.
| [in] | n_user_variables | number of user variables | 
| 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.
| [in] | f | reallocation size multiplier |