|
My Project
programmer's documentation
|
Go to the documentation of this file. 1 #ifndef __CS_LAGR_PARTICLE_H__
2 #define __CS_LAGR_PARTICLE_H__
51 #define CS_LAGR_PART_TO_DELETE (1 << 0)
54 #define CS_LAGR_PART_FIXED (1 << 1)
57 #define CS_LAGR_PART_DEPOSITED (1 << 2)
60 #define CS_LAGR_PART_ROLLING (1 << 3)
63 #define CS_LAGR_PART_IMPOSED_MOTION (1 << 4)
68 #define CS_LAGR_PART_DEPOSITION_FLAGS \
69 ( CS_LAGR_PART_TO_DELETE | CS_LAGR_PART_FIXED | CS_LAGR_PART_DEPOSITED \
70 | CS_LAGR_PART_ROLLING | CS_LAGR_PART_IMPOSED_MOTION)
404 assert(particle_set->
p_am->
count[0][attr] > 0);
406 return (
unsigned char *)particle_set->
p_buffer
424 inline static const void *
429 assert(particle_set->
p_am->
count[0][attr] > 0);
456 assert(particle_set->
p_am->
count[time_id][attr] > 0);
460 + particle_set->
p_am->
displ[time_id][attr];
477 inline static const void *
483 assert(particle_set->
p_am->
count[time_id][attr] > 0);
487 + particle_set->
p_am->
displ[time_id][attr];
512 return (flag & mask);
562 flag = (flag | mask) - mask;
586 assert(particle_set->
p_am->
count[0][attr] > 0);
613 assert(particle_set->
p_am->
count[time_id][attr] > 0);
617 + particle_set->
p_am->
displ[time_id][attr]));
637 assert(particle_set->
p_am->
count[0][attr] > 0);
641 + particle_set->
p_am->
displ[0][attr])) = value;
664 assert(particle_set->
p_am->
count[time_id][attr] > 0);
668 + particle_set->
p_am->
displ[time_id][attr])) = value;
688 assert(particle_set->
p_am->
count[0][attr] > 0);
715 assert(particle_set->
p_am->
count[time_id][attr] > 0);
719 + particle_set->
p_am->
displ[time_id][attr]));
739 assert(particle_set->
p_am->
count[0][attr] > 0);
743 + particle_set->
p_am->
displ[0][attr])) = value;
766 assert(particle_set->
p_am->
count[time_id][attr] > 0);
770 + particle_set->
p_am->
displ[time_id][attr])) = value;
790 assert(particle_set->
p_am->
count[0][attr] > 0);
817 assert(particle_set->
p_am->
count[time_id][attr] > 0);
821 + particle_set->
p_am->
displ[time_id][attr]));
841 assert(particle_set->
p_am->
count[0][attr] > 0);
845 + particle_set->
p_am->
displ[0][attr])) = value;
868 assert(particle_set->
p_am->
count[time_id][attr] > 0);
872 + particle_set->
p_am->
displ[time_id][attr])) = value;
944 assert(attr_map->
count[0][attr] > 0);
946 return (
unsigned char *)particle + attr_map->
displ[0][attr];
961 inline static const void *
966 assert(attr_map->
count[0][attr] > 0);
968 return (
const unsigned char *)particle + attr_map->
displ[0][attr];
990 assert(attr_map->
count[time_id][attr] > 0);
992 return (
unsigned char *)particle + attr_map->
displ[time_id][attr];
1008 inline static const void *
1014 assert(attr_map->
count[time_id][attr] > 0);
1016 return (
const unsigned char *)particle
1017 + attr_map->
displ[time_id][attr];
1037 assert(attr_map->
count[0][attr] > 0);
1039 return *((
const cs_lnum_t *)( (
const unsigned char *)particle
1040 + attr_map->
displ[0][attr]));
1063 assert(attr_map->
count[time_id][attr] > 0);
1065 return *((
const cs_lnum_t *)( (
const unsigned char *)particle
1066 + attr_map->
displ[time_id][attr]));
1086 assert(attr_map->
count[0][attr] > 0);
1088 *((
cs_lnum_t *)((
unsigned char *)particle + attr_map->
displ[0][attr]))
1112 assert(attr_map->
count[time_id][attr] > 0);
1114 *((
cs_lnum_t *)( (
unsigned char *)particle
1115 + attr_map->
displ[time_id][attr])) = value;
1135 assert(attr_map->
count[0][attr] > 0);
1137 return *((
const cs_gnum_t *)( (
const unsigned char *)particle
1138 + attr_map->
displ[0][attr]));
1161 assert(attr_map->
count[time_id][attr] > 0);
1163 return *((
const cs_gnum_t *)( (
const unsigned char *)particle
1164 + attr_map->
displ[time_id][attr]));
1184 assert(attr_map->
count[0][attr] > 0);
1186 *((
cs_gnum_t *)((
unsigned char *)particle + attr_map->
displ[0][attr]))
1210 assert(attr_map->
count[time_id][attr] > 0);
1212 *((
cs_gnum_t *)( (
unsigned char *)particle
1213 + attr_map->
displ[time_id][attr])) = value;
1233 assert(attr_map->
count[0][attr] > 0);
1235 return *((
const cs_real_t *)( (
const unsigned char *)particle
1236 + attr_map->
displ[0][attr]));
1259 assert(attr_map->
count[time_id][attr] > 0);
1261 return *((
const cs_real_t *)( (
const unsigned char *)particle
1262 + attr_map->
displ[time_id][attr]));
1282 assert(attr_map->
count[0][attr] > 0);
1284 *((
cs_real_t *)((
unsigned char *)particle + attr_map->
displ[0][attr]))
1308 assert(attr_map->
count[time_id][attr] > 0);
1310 *((
cs_real_t *)( (
unsigned char *)particle
1311 + attr_map->
displ[time_id][attr])) = value;
1334 return (
cs_real_t *)( (
unsigned char *)particle
1358 return (
const cs_real_t *)( (
unsigned char *)particle
Definition: cs_lagr_particle.h:143
const cs_lagr_attribute_map_t * p_am
Definition: cs_lagr_particle.h:232
Definition: cs_lagr_particle.h:176
size_t lb
Definition: cs_lagr_particle.h:180
Definition: cs_lagr_particle.h:96
Definition: cs_lagr_particle.h:147
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)
Get const pointer to 2nd order scheme source terms an attribute of a given particle in a set.
Definition: cs_lagr_particle.h:915
Definition: cs_lagr_particle.h:99
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.
Definition: cs_lagr_particle.h:710
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.
Definition: cs_lagr_particle.h:1009
Definition: cs_lagr_particle.h:115
const cs_lagr_attribute_map_t * cs_lagr_particle_get_attr_map(void)
Return const pointer to the main particle attribute map structure.
Definition: cs_lagr_particle.c:897
const char * cs_lagr_attribute_name[]
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.
Definition: cs_lagr_particle.h:658
Definition: cs_lagr_particle.h:155
Definition: cs_lagr_particle.h:125
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.
Definition: cs_lagr_particle.h:940
cs_real_t weight
Definition: cs_lagr_particle.h:221
Definition: cs_lagr_particle.h:138
cs_lnum_t n_part_dep
Definition: cs_lagr_particle.h:216
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.
Definition: cs_lagr_particle.c:981
Definition: cs_lagr_particle.h:122
Definition: cs_lagr_particle.h:110
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.
Definition: cs_lagr_particle.h:862
cs_real_t weight_failed
Definition: cs_lagr_particle.h:228
#define END_C_DECLS
Definition: cs_defs.h:468
Definition: cs_lagr_particle.h:132
void cs_lagr_particle_set_dump(const cs_lagr_particle_set_t *particles)
Dump a cs_lagr_particle_set_t structure.
Definition: cs_lagr_particle.c:1228
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.
Definition: cs_lagr_particle.h:1131
void cs_lagr_particle_finalize(void)
Destroy main particle set and map if they exist.
Definition: cs_lagr_particle.c:927
Definition: cs_lagr_particle.h:210
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.
Definition: cs_lagr_particle.h:553
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.
Definition: cs_lagr_particle.h:632
ptrdiff_t(* displ)[CS_LAGR_N_ATTRIBUTES]
Definition: cs_lagr_particle.h:196
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.
Definition: cs_lagr_particle.h:734
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
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.
Definition: cs_lagr_particle.h:1277
cs_lnum_t n_part_resusp
Definition: cs_lagr_particle.h:218
cs_lnum_t n_particles
Definition: cs_lagr_particle.h:212
Definition: cs_lagr_particle.h:86
Definition: cs_lagr_particle.h:151
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.
Definition: cs_lagr_particle.h:526
Definition: cs_lagr_particle.h:117
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
Definition: cs_lagr_particle.h:83
cs_lnum_t n_part_merged
Definition: cs_lagr_particle.h:215
Definition: cs_lagr_particle.h:165
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.
Definition: cs_lagr_particle.h:985
Definition: cs_lagr_particle.h:159
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.
Definition: cs_lagr_particle.h:451
void cs_lagr_particle_set_create(void)
Definition: cs_lagr_particle.c:910
cs_lagr_particle_set_t * cs_glob_lagr_particle_set
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.
Definition: cs_lagr_particle.h:400
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)
Get pointer to 2nd order scheme attribute source terms of a particle.
Definition: cs_lagr_particle.h:1351
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.
Definition: cs_lagr_particle.h:1229
cs_datatype_t
Definition: cs_defs.h:260
void cs_lagr_set_n_g_particles_max(unsigned long long n_g_particles_max)
Set global maximum number of particles.
Definition: cs_lagr_particle.c:1186
void const cs_int_t const cs_int_t const cs_int_t const cs_int_t * stride
Definition: cs_sat_coupling.h:325
Definition: cs_lagr_particle.h:126
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.
Definition: cs_lagr_particle.h:786
int n_time_vals
Definition: cs_lagr_particle.h:184
void cs_lagr_particle_attr_initialize(void)
Define particle map based on defined options.
Definition: cs_lagr_particle.c:639
Definition: cs_lagr_particle.h:124
Definition: cs_lagr_particle.h:94
Definition: cs_lagr_particle.h:106
ptrdiff_t * source_term_displ
Definition: cs_lagr_particle.h:200
cs_lnum_t n_part_new
Definition: cs_lagr_particle.h:213
Definition: cs_lagr_particle.h:116
cs_lagr_attribute_t
Definition: cs_lagr_particle.h:79
cs_lnum_t n_failed_part
Definition: cs_lagr_particle.h:219
Definition: cs_lagr_particle.h:123
void cs_lagr_particles_current_to_previous(cs_lagr_particle_set_t *particles, cs_lnum_t particle_id)
Copy current attributes to previous attributes.
Definition: cs_lagr_particle.c:1201
Definition: cs_lagr_particle.h:148
Definition: cs_lagr_particle.h:169
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:286
void cs_lagr_part_copy(cs_lnum_t dest, cs_lnum_t src)
Copy attributes from one particle to another.
Definition: cs_lagr_particle.c:946
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.
Definition: cs_lagr_particle.h:962
Definition: cs_lagr_particle.h:97
cs_real_t weight_out
Definition: cs_lagr_particle.h:223
cs_lagr_particle_set_t * cs_lagr_get_particle_set(void)
Return pointer to the main cs_lagr_particle_set_t structure.
Definition: cs_lagr_particle.c:1100
Definition: cs_lagr_particle.h:145
Definition: cs_lagr_particle.h:92
Definition: cs_lagr_particle.h:161
cs_real_t weight_fou
Definition: cs_lagr_particle.h:226
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.
Definition: cs_lagr_particle.h:582
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.
Definition: cs_lagr_particle.h:760
cs_lnum_t n_particles_max
Definition: cs_lagr_particle.h:230
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.
Definition: cs_lagr_particle.h:1179
Definition: cs_lagr_particle.h:88
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
Definition: cs_lagr_particle.h:107
Definition: cs_lagr_particle.h:133
static cs_real_t * cs_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.
Definition: cs_lagr_particle.h:1327
Definition: cs_lagr_particle.h:131
void cs_lagr_set_reallocation_factor(double f)
Set reallocation factor for particle sets.
Definition: cs_lagr_particle.c:1151
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.
Definition: cs_lagr_particle.h:1058
size_t extents
Definition: cs_lagr_particle.h:178
cs_real_t weight_dep
Definition: cs_lagr_particle.h:225
unsigned char * p_buffer
Definition: cs_lagr_particle.h:234
cs_lnum_t n_part_out
Definition: cs_lagr_particle.h:214
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.
Definition: cs_lagr_particle.h:1081
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.
Definition: cs_lagr_particle.h:1204
Definition: cs_lagr_particle.h:100
Definition: cs_lagr_particle.h:109
Definition: cs_lagr_particle.h:84
Definition: cs_lagr_particle.h:137
void cs_lagr_particle_attr_in_range(int attr)
Check if a particle attribute is in a valid range.
Definition: cs_lagr_particle.c:1083
Definition: cs_lagr_particle.h:91
cs_real_t weight_merged
Definition: cs_lagr_particle.h:224
Definition: cs_lagr_particle.h:144
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.
Definition: cs_lagr_particle.h:812
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.
Definition: cs_lagr_particle.h:503
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.
Definition: cs_lagr_particle.h:608
Definition: cs_lagr_particle.h:150
Definition: cs_lagr_particle.h:95
void cs_lagr_set_n_user_variables(int n_user_variables)
Set number of user particle variables.
Definition: cs_lagr_particle.c:1256
Definition: cs_lagr_particle.h:90
Definition: cs_lagr_particle.h:130
Definition: cs_lagr_particle.h:118
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.
Definition: cs_lagr_particle.h:1302
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.
Definition: cs_lagr_particle.h:1156
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.
Definition: cs_lagr_particle.h:1106
int(* count)[CS_LAGR_N_ATTRIBUTES]
Definition: cs_lagr_particle.h:193
Definition: cs_lagr_particle.h:81
Definition: cs_lagr_particle.h:139
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.
Definition: cs_lagr_particle.h:1033
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.
Definition: cs_lagr_particle.h:836
cs_real_t weight_new
Definition: cs_lagr_particle.h:222
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.
Definition: cs_lagr_particle.h:425
Definition: cs_lagr_particle.h:114
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.
Definition: cs_lagr_particle.h:478
Definition: cs_lagr_particle.h:108
Definition: cs_lagr_particle.h:93
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.
Definition: cs_lagr_particle.c:1018
cs_lnum_t n_part_fou
Definition: cs_lagr_particle.h:217
cs_real_t weight_resusp
Definition: cs_lagr_particle.h:227
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.
Definition: cs_lagr_particle.h:1254
int cs_lagr_particle_set_resize(cs_lnum_t n_min_particles)
Resize particle set buffers if needed.
Definition: cs_lagr_particle.c:1120
unsigned long long cs_lagr_get_n_g_particles_max(void)
Get global maximum number of particles.
Definition: cs_lagr_particle.c:1169
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)
Get pointer to 2nd order scheme source terms for an attribute of a given particle in a set.
Definition: cs_lagr_particle.h:889
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.
Definition: cs_lagr_particle.h:684