My Project
programmer's documentation
cs_lagr_particle.h
Go to the documentation of this file.
1 #ifndef __CS_LAGR_PARTICLE_H__
2 #define __CS_LAGR_PARTICLE_H__
3 
4 /*============================================================================
5  * Lagrangian module particle model
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2019 EDF S.A.
12 
13  This program is free software; you can redistribute it and/or modify it under
14  the terms of the GNU General Public License as published by the Free Software
15  Foundation; either version 2 of the License, or (at your option) any later
16  version.
17 
18  This program is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21  details.
22 
23  You should have received a copy of the GNU General Public License along with
24  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25  Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 */
27 
28 /*----------------------------------------------------------------------------*/
29 
30 #include "cs_defs.h"
31 
32 #include "assert.h"
33 
34 /*----------------------------------------------------------------------------*/
35 
37 
38 /*=============================================================================
39  * Macro definitions
40  *============================================================================*/
41 
42 /*=============================================================================
43  * Macro definitions
44  *============================================================================*/
45 
51 #define CS_LAGR_PART_TO_DELETE (1 << 0)
52 
54 #define CS_LAGR_PART_FIXED (1 << 1)
55 
57 #define CS_LAGR_PART_DEPOSITED (1 << 2)
58 
60 #define CS_LAGR_PART_ROLLING (1 << 3)
61 
63 #define CS_LAGR_PART_IMPOSED_MOTION (1 << 4)
64 
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)
71 
72 /*============================================================================
73  * Type definitions
74  *============================================================================*/
75 
77 /* ------------------------------- */
78 
79 typedef enum {
80 
98 
104  /* Arrays for 2nd order scheme */
105 
106  CS_LAGR_TURB_STATE_1, /* turbulence characteristics of first pass */
107  CS_LAGR_PRED_VELOCITY, /* 1st step prediction for particle velocity */
108  CS_LAGR_PRED_VELOCITY_SEEN, /* 1st step prediction for relative velocity */
109  CS_LAGR_V_GAUSS, /* 1st step Gaussian variable */
110  CS_LAGR_BR_GAUSS, /* 1st step Brownian motion Gaussian variable */
111 
112  /* Deposition submodel additional parameters */
113 
119 
120  /* Resuspension model additional parameters */
121 
127 
128  /* Clogging model additional parameters */
129 
134 
135  /* Thermal model additional parameters */
136 
140 
141  /* Coal combustion additional parameters */
142 
146 
149 
152 
153  /* Radiative model additional parameters */
154 
156 
157  /* Statistical class */
158 
160 
162 
163  /* User attributes */
164 
166 
167  /* End of attributes */
168 
170 
172 
174 /* ------------------------------------- */
175 
176 typedef struct {
177 
178  size_t extents; /* size (in bytes) of particle
179  structure */
180  size_t lb; /* size (in bytes) of lower
181  bounds of particle data
182  (work area before) */
183 
184  int n_time_vals; /* number of time values
185  handled */
186 
187  size_t size[CS_LAGR_N_ATTRIBUTES]; /* size (in bytes) of
188  attributes in particle
189  structure for a given
190  time value */
191  cs_datatype_t datatype[CS_LAGR_N_ATTRIBUTES]; /* datatype of associated
192  attributes */
193  int (*count)[CS_LAGR_N_ATTRIBUTES]; /* number of values for each
194  attribute, per associated
195  time_id */
196  ptrdiff_t (*displ)[CS_LAGR_N_ATTRIBUTES]; /* displacement (in bytes) of
197  attributes in particle data,
198  per associated time_id*/
199 
200  ptrdiff_t *source_term_displ; /* displacement (in bytes) of
201  source term values
202  for second-order scheme,
203  or NULL */
204 
206 
207 /* Particle set */
208 /* ------------ */
209 
210 typedef struct {
211 
212  cs_lnum_t n_particles; /* number of particle in domain */
215  cs_lnum_t n_part_merged; /* number of merged particles */
220 
229 
231 
234  unsigned char *p_buffer;
237 
238 /*=============================================================================
239  * Global variables
240  *============================================================================*/
241 
244 extern const char *cs_lagr_attribute_name[];
245 
249 
250 /*============================================================================
251  * Public function prototypes for Fortran API
252  *============================================================================*/
253 
254 /*============================================================================
255  * Public function prototypes
256  *============================================================================*/
257 
258 /*----------------------------------------------------------------------------*/
262 /*----------------------------------------------------------------------------*/
263 
264 void
266 
267 /*----------------------------------------------------------------------------*/
273 /*----------------------------------------------------------------------------*/
274 
277 
278 /*----------------------------------------------------------------------------*/
282 /*----------------------------------------------------------------------------*/
283 
284 void
286 
287 /*----------------------------------------------------------------------------*/
291 /*----------------------------------------------------------------------------*/
292 
293 void
295 
296 /*----------------------------------------------------------------------------*/
305 /*----------------------------------------------------------------------------*/
306 
307 void
309  cs_lnum_t src);
310 
311 /*----------------------------------------------------------------------------*/
330 /*----------------------------------------------------------------------------*/
331 
332 void
334  int time_id,
335  cs_lagr_attribute_t attr,
336  size_t *extents,
337  size_t *size,
338  ptrdiff_t *displ,
339  cs_datatype_t *datatype,
340  int *count);
341 
342 /*----------------------------------------------------------------------------*/
355 /*----------------------------------------------------------------------------*/
356 
357 int
359  cs_lagr_attribute_t attr,
360  cs_datatype_t datatype,
361  int stride,
362  int component_id);
363 
364 /*----------------------------------------------------------------------------*/
372 /*----------------------------------------------------------------------------*/
373 
374 void
376 
377 /*----------------------------------------------------------------------------
378  * Return pointer to the main cs_lagr_particle_set_t structure.
379  *
380  * returns:
381  * pointer to current particle set, or NULL
382  *----------------------------------------------------------------------------*/
383 
386 
387 /*----------------------------------------------------------------------------*/
397 /*----------------------------------------------------------------------------*/
398 
399 inline static void *
401  cs_lnum_t particle_id,
402  cs_lagr_attribute_t attr)
403 {
404  assert(particle_set->p_am->count[0][attr] > 0);
405 
406  return (unsigned char *)particle_set->p_buffer
407  + particle_set->p_am->extents*particle_id
408  + particle_set->p_am->displ[0][attr];
409 }
410 
411 /*----------------------------------------------------------------------------*/
422 /*----------------------------------------------------------------------------*/
423 
424 inline static const void *
426  cs_lnum_t particle_id,
427  cs_lagr_attribute_t attr)
428 {
429  assert(particle_set->p_am->count[0][attr] > 0);
430 
431  return particle_set->p_buffer
432  + particle_set->p_am->extents*particle_id
433  + particle_set->p_am->displ[0][attr];
434 }
435 
436 /*----------------------------------------------------------------------------*/
448 /*----------------------------------------------------------------------------*/
449 
450 inline static void *
452  cs_lnum_t particle_id,
453  int time_id,
454  cs_lagr_attribute_t attr)
455 {
456  assert(particle_set->p_am->count[time_id][attr] > 0);
457 
458  return particle_set->p_buffer
459  + particle_set->p_am->extents*particle_id
460  + particle_set->p_am->displ[time_id][attr];
461 }
462 
463 /*----------------------------------------------------------------------------*/
475 /*----------------------------------------------------------------------------*/
476 
477 inline static const void *
479  cs_lnum_t particle_id,
480  int time_id,
481  cs_lagr_attribute_t attr)
482 {
483  assert(particle_set->p_am->count[time_id][attr] > 0);
484 
485  return particle_set->p_buffer
486  + particle_set->p_am->extents*particle_id
487  + particle_set->p_am->displ[time_id][attr];
488 }
489 
490 /*----------------------------------------------------------------------------*/
500 /*----------------------------------------------------------------------------*/
501 
502 inline static int
504  cs_lnum_t particle_id,
505  int mask)
506 {
507  int flag
508  = *((const cs_lnum_t *)( particle_set->p_buffer
509  + particle_set->p_am->extents*particle_id
510  + particle_set->p_am->displ[0][CS_LAGR_P_FLAG]));
511 
512  return (flag & mask);
513 }
514 
515 /*----------------------------------------------------------------------------*/
523 /*----------------------------------------------------------------------------*/
524 
525 inline static void
527  cs_lnum_t particle_id,
528  int mask)
529 {
530  int flag
531  = *((const cs_lnum_t *)( particle_set->p_buffer
532  + particle_set->p_am->extents*particle_id
533  + particle_set->p_am->displ[0][CS_LAGR_P_FLAG]));
534 
535  flag = flag | mask;
536 
537  *((cs_lnum_t *)( particle_set->p_buffer
538  + particle_set->p_am->extents*particle_id
539  + particle_set->p_am->displ[0][CS_LAGR_P_FLAG])) = flag;
540 }
541 
542 /*----------------------------------------------------------------------------*/
550 /*----------------------------------------------------------------------------*/
551 
552 inline static void
554  cs_lnum_t particle_id,
555  int mask)
556 {
557  int flag
558  = *((const cs_lnum_t *)( particle_set->p_buffer
559  + particle_set->p_am->extents*particle_id
560  + particle_set->p_am->displ[0][CS_LAGR_P_FLAG]));
561 
562  flag = (flag | mask) - mask;
563 
564  *((cs_lnum_t *)( particle_set->p_buffer
565  + particle_set->p_am->extents*particle_id
566  + particle_set->p_am->displ[0][CS_LAGR_P_FLAG])) = flag;
567 }
568 
569 /*----------------------------------------------------------------------------*/
579 /*----------------------------------------------------------------------------*/
580 
581 inline static cs_lnum_t
583  cs_lnum_t particle_id,
584  cs_lagr_attribute_t attr)
585 {
586  assert(particle_set->p_am->count[0][attr] > 0);
587 
588  return *((const cs_lnum_t *)( particle_set->p_buffer
589  + particle_set->p_am->extents*particle_id
590  + particle_set->p_am->displ[0][attr]));
591 }
592 
593 /*----------------------------------------------------------------------------*/
605 /*----------------------------------------------------------------------------*/
606 
607 inline static cs_lnum_t
609  cs_lnum_t particle_id,
610  int time_id,
611  cs_lagr_attribute_t attr)
612 {
613  assert(particle_set->p_am->count[time_id][attr] > 0);
614 
615  return *((const cs_lnum_t *)( particle_set->p_buffer
616  + particle_set->p_am->extents*particle_id
617  + particle_set->p_am->displ[time_id][attr]));
618 }
619 
620 /*----------------------------------------------------------------------------*/
629 /*----------------------------------------------------------------------------*/
630 
631 inline static void
633  cs_lnum_t particle_id,
634  cs_lagr_attribute_t attr,
635  cs_lnum_t value)
636 {
637  assert(particle_set->p_am->count[0][attr] > 0);
638 
639  *((cs_lnum_t *)( particle_set->p_buffer
640  + particle_set->p_am->extents*particle_id
641  + particle_set->p_am->displ[0][attr])) = value;
642 }
643 
644 /*----------------------------------------------------------------------------*/
655 /*----------------------------------------------------------------------------*/
656 
657 inline static void
659  cs_lnum_t particle_id,
660  int time_id,
661  cs_lagr_attribute_t attr,
662  cs_lnum_t value)
663 {
664  assert(particle_set->p_am->count[time_id][attr] > 0);
665 
666  *((cs_lnum_t *)( particle_set->p_buffer
667  + particle_set->p_am->extents*particle_id
668  + particle_set->p_am->displ[time_id][attr])) = value;
669 }
670 
671 /*----------------------------------------------------------------------------*/
681 /*----------------------------------------------------------------------------*/
682 
683 inline static cs_gnum_t
685  cs_lnum_t particle_id,
686  cs_lagr_attribute_t attr)
687 {
688  assert(particle_set->p_am->count[0][attr] > 0);
689 
690  return *((const cs_gnum_t *)( particle_set->p_buffer
691  + particle_set->p_am->extents*particle_id
692  + particle_set->p_am->displ[0][attr]));
693 }
694 
695 /*----------------------------------------------------------------------------*/
707 /*----------------------------------------------------------------------------*/
708 
709 inline static cs_gnum_t
711  cs_lnum_t particle_id,
712  int time_id,
713  cs_lagr_attribute_t attr)
714 {
715  assert(particle_set->p_am->count[time_id][attr] > 0);
716 
717  return *((const cs_gnum_t *)( particle_set->p_buffer
718  + particle_set->p_am->extents*particle_id
719  + particle_set->p_am->displ[time_id][attr]));
720 }
721 
722 /*----------------------------------------------------------------------------*/
731 /*----------------------------------------------------------------------------*/
732 
733 inline static void
735  cs_lnum_t particle_id,
736  cs_lagr_attribute_t attr,
737  cs_gnum_t value)
738 {
739  assert(particle_set->p_am->count[0][attr] > 0);
740 
741  *((cs_gnum_t *)( particle_set->p_buffer
742  + particle_set->p_am->extents*particle_id
743  + particle_set->p_am->displ[0][attr])) = value;
744 }
745 
746 /*----------------------------------------------------------------------------*/
757 /*----------------------------------------------------------------------------*/
758 
759 inline static void
761  cs_lnum_t particle_id,
762  int time_id,
763  cs_lagr_attribute_t attr,
764  cs_gnum_t value)
765 {
766  assert(particle_set->p_am->count[time_id][attr] > 0);
767 
768  *((cs_gnum_t *)( particle_set->p_buffer
769  + particle_set->p_am->extents*particle_id
770  + particle_set->p_am->displ[time_id][attr])) = value;
771 }
772 
773 /*----------------------------------------------------------------------------*/
783 /*----------------------------------------------------------------------------*/
784 
785 inline static cs_real_t
787  cs_lnum_t particle_id,
788  cs_lagr_attribute_t attr)
789 {
790  assert(particle_set->p_am->count[0][attr] > 0);
791 
792  return *((const cs_real_t *)( particle_set->p_buffer
793  + particle_set->p_am->extents*particle_id
794  + particle_set->p_am->displ[0][attr]));
795 }
796 
797 /*----------------------------------------------------------------------------*/
809 /*----------------------------------------------------------------------------*/
810 
811 inline static cs_real_t
813  cs_lnum_t particle_id,
814  int time_id,
815  cs_lagr_attribute_t attr)
816 {
817  assert(particle_set->p_am->count[time_id][attr] > 0);
818 
819  return *((const cs_real_t *)( particle_set->p_buffer
820  + particle_set->p_am->extents*particle_id
821  + particle_set->p_am->displ[time_id][attr]));
822 }
823 
824 /*----------------------------------------------------------------------------*/
833 /*----------------------------------------------------------------------------*/
834 
835 inline static void
837  cs_lnum_t particle_id,
838  cs_lagr_attribute_t attr,
839  cs_real_t value)
840 {
841  assert(particle_set->p_am->count[0][attr] > 0);
842 
843  *((cs_real_t *)( particle_set->p_buffer
844  + particle_set->p_am->extents*particle_id
845  + particle_set->p_am->displ[0][attr])) = value;
846 }
847 
848 /*----------------------------------------------------------------------------*/
859 /*----------------------------------------------------------------------------*/
860 
861 inline static void
863  cs_lnum_t particle_id,
864  int time_id,
865  cs_lagr_attribute_t attr,
866  cs_real_t value)
867 {
868  assert(particle_set->p_am->count[time_id][attr] > 0);
869 
870  *((cs_real_t *)( particle_set->p_buffer
871  + particle_set->p_am->extents*particle_id
872  + particle_set->p_am->displ[time_id][attr])) = value;
873 }
874 
875 /*----------------------------------------------------------------------------*/
886 /*----------------------------------------------------------------------------*/
887 
888 inline static cs_real_t *
890  cs_lnum_t particle_id,
891  cs_lagr_attribute_t attr)
892 {
893  assert(particle_set->p_am->source_term_displ != NULL);
894  assert(particle_set->p_am->source_term_displ[attr] >= 0);
895 
896  return (cs_real_t *)( (unsigned char *)particle_set->p_buffer
897  + particle_set->p_am->extents*particle_id
898  + particle_set->p_am->source_term_displ[attr]);
899 }
900 
901 /*----------------------------------------------------------------------------*/
912 /*----------------------------------------------------------------------------*/
913 
914 inline static const cs_real_t *
916  cs_lnum_t particle_id,
917  cs_lagr_attribute_t attr)
918 {
919  assert(particle_set->p_am->source_term_displ != NULL);
920  assert(particle_set->p_am->source_term_displ[attr] >= 0);
921 
922  return (const cs_real_t *)( (unsigned char *)particle_set->p_buffer
923  + particle_set->p_am->extents*particle_id
924  + particle_set->p_am->source_term_displ[attr]);
925 }
926 
927 /*----------------------------------------------------------------------------*/
937 /*----------------------------------------------------------------------------*/
938 
939 inline static void *
940 cs_lagr_particle_attr(void *particle,
941  const cs_lagr_attribute_map_t *attr_map,
942  cs_lagr_attribute_t attr)
943 {
944  assert(attr_map->count[0][attr] > 0);
945 
946  return (unsigned char *)particle + attr_map->displ[0][attr];
947 }
948 
949 /*----------------------------------------------------------------------------*/
959 /*----------------------------------------------------------------------------*/
960 
961 inline static const void *
962 cs_lagr_particle_attr_const(const void *particle,
963  const cs_lagr_attribute_map_t *attr_map,
964  cs_lagr_attribute_t attr)
965 {
966  assert(attr_map->count[0][attr] > 0);
967 
968  return (const unsigned char *)particle + attr_map->displ[0][attr];
969 }
970 
971 /*----------------------------------------------------------------------------*/
982 /*----------------------------------------------------------------------------*/
983 
984 inline static void *
985 cs_lagr_particle_attr_n(void *particle,
986  const cs_lagr_attribute_map_t *attr_map,
987  int time_id,
988  cs_lagr_attribute_t attr)
989 {
990  assert(attr_map->count[time_id][attr] > 0);
991 
992  return (unsigned char *)particle + attr_map->displ[time_id][attr];
993 }
994 
995 /*----------------------------------------------------------------------------*/
1006 /*----------------------------------------------------------------------------*/
1007 
1008 inline static const void *
1009 cs_lagr_particle_attr_n_const(const void *particle,
1010  const cs_lagr_attribute_map_t *attr_map,
1011  int time_id,
1012  cs_lagr_attribute_t attr)
1013 {
1014  assert(attr_map->count[time_id][attr] > 0);
1015 
1016  return (const unsigned char *)particle
1017  + attr_map->displ[time_id][attr];
1018 }
1019 
1020 /*----------------------------------------------------------------------------*/
1030 /*----------------------------------------------------------------------------*/
1031 
1032 inline static cs_lnum_t
1033 cs_lagr_particle_get_lnum(const void *particle,
1034  const cs_lagr_attribute_map_t *attr_map,
1035  cs_lagr_attribute_t attr)
1036 {
1037  assert(attr_map->count[0][attr] > 0);
1038 
1039  return *((const cs_lnum_t *)( (const unsigned char *)particle
1040  + attr_map->displ[0][attr]));
1041 }
1042 
1043 /*----------------------------------------------------------------------------*/
1055 /*----------------------------------------------------------------------------*/
1056 
1057 inline static cs_lnum_t
1058 cs_lagr_particle_get_lnum_n(const void *particle,
1059  const cs_lagr_attribute_map_t *attr_map,
1060  int time_id,
1061  cs_lagr_attribute_t attr)
1062 {
1063  assert(attr_map->count[time_id][attr] > 0);
1064 
1065  return *((const cs_lnum_t *)( (const unsigned char *)particle
1066  + attr_map->displ[time_id][attr]));
1067 }
1068 
1069 /*----------------------------------------------------------------------------*/
1078  /*----------------------------------------------------------------------------*/
1079 
1080 inline static void
1082  const cs_lagr_attribute_map_t *attr_map,
1083  cs_lagr_attribute_t attr,
1084  cs_lnum_t value)
1085 {
1086  assert(attr_map->count[0][attr] > 0);
1087 
1088  *((cs_lnum_t *)((unsigned char *)particle + attr_map->displ[0][attr]))
1089  = value;
1090 }
1091 
1092 /*----------------------------------------------------------------------------*/
1103  /*----------------------------------------------------------------------------*/
1104 
1105 inline static void
1107  const cs_lagr_attribute_map_t *attr_map,
1108  int time_id,
1109  cs_lagr_attribute_t attr,
1110  cs_lnum_t value)
1111 {
1112  assert(attr_map->count[time_id][attr] > 0);
1113 
1114  *((cs_lnum_t *)( (unsigned char *)particle
1115  + attr_map->displ[time_id][attr])) = value;
1116 }
1117 
1118 /*----------------------------------------------------------------------------*/
1128 /*----------------------------------------------------------------------------*/
1129 
1130 inline static cs_gnum_t
1131 cs_lagr_particle_get_gnum(const void *particle,
1132  const cs_lagr_attribute_map_t *attr_map,
1133  cs_lagr_attribute_t attr)
1134 {
1135  assert(attr_map->count[0][attr] > 0);
1136 
1137  return *((const cs_gnum_t *)( (const unsigned char *)particle
1138  + attr_map->displ[0][attr]));
1139 }
1140 
1141 /*----------------------------------------------------------------------------*/
1153 /*----------------------------------------------------------------------------*/
1154 
1155 inline static cs_gnum_t
1156 cs_lagr_particle_get_gnum_n(const void *particle,
1157  const cs_lagr_attribute_map_t *attr_map,
1158  int time_id,
1159  cs_lagr_attribute_t attr)
1160 {
1161  assert(attr_map->count[time_id][attr] > 0);
1162 
1163  return *((const cs_gnum_t *)( (const unsigned char *)particle
1164  + attr_map->displ[time_id][attr]));
1165 }
1166 
1167 /*----------------------------------------------------------------------------*/
1176  /*----------------------------------------------------------------------------*/
1177 
1178 inline static void
1180  const cs_lagr_attribute_map_t *attr_map,
1181  cs_lagr_attribute_t attr,
1182  cs_gnum_t value)
1183 {
1184  assert(attr_map->count[0][attr] > 0);
1185 
1186  *((cs_gnum_t *)((unsigned char *)particle + attr_map->displ[0][attr]))
1187  = value;
1188 }
1189 
1190 /*----------------------------------------------------------------------------*/
1201  /*----------------------------------------------------------------------------*/
1202 
1203 inline static void
1205  const cs_lagr_attribute_map_t *attr_map,
1206  int time_id,
1207  cs_lagr_attribute_t attr,
1208  cs_gnum_t value)
1209 {
1210  assert(attr_map->count[time_id][attr] > 0);
1211 
1212  *((cs_gnum_t *)( (unsigned char *)particle
1213  + attr_map->displ[time_id][attr])) = value;
1214 }
1215 
1216 /*----------------------------------------------------------------------------*/
1226 /*----------------------------------------------------------------------------*/
1227 
1228 inline static cs_real_t
1229 cs_lagr_particle_get_real(const void *particle,
1230  const cs_lagr_attribute_map_t *attr_map,
1231  cs_lagr_attribute_t attr)
1232 {
1233  assert(attr_map->count[0][attr] > 0);
1234 
1235  return *((const cs_real_t *)( (const unsigned char *)particle
1236  + attr_map->displ[0][attr]));
1237 }
1238 
1239 /*----------------------------------------------------------------------------*/
1251 /*----------------------------------------------------------------------------*/
1252 
1253 inline static cs_real_t
1254 cs_lagr_particle_get_real_n(const void *particle,
1255  const cs_lagr_attribute_map_t *attr_map,
1256  int time_id,
1257  cs_lagr_attribute_t attr)
1258 {
1259  assert(attr_map->count[time_id][attr] > 0);
1260 
1261  return *((const cs_real_t *)( (const unsigned char *)particle
1262  + attr_map->displ[time_id][attr]));
1263 }
1264 
1265 /*----------------------------------------------------------------------------*/
1274  /*----------------------------------------------------------------------------*/
1275 
1276 inline static void
1278  const cs_lagr_attribute_map_t *attr_map,
1279  cs_lagr_attribute_t attr,
1280  cs_real_t value)
1281 {
1282  assert(attr_map->count[0][attr] > 0);
1283 
1284  *((cs_real_t *)((unsigned char *)particle + attr_map->displ[0][attr]))
1285  = value;
1286 }
1287 
1288 /*----------------------------------------------------------------------------*/
1299  /*----------------------------------------------------------------------------*/
1300 
1301 inline static void
1303  const cs_lagr_attribute_map_t *attr_map,
1304  int time_id,
1305  cs_lagr_attribute_t attr,
1306  cs_real_t value)
1307 {
1308  assert(attr_map->count[time_id][attr] > 0);
1309 
1310  *((cs_real_t *)( (unsigned char *)particle
1311  + attr_map->displ[time_id][attr])) = value;
1312 }
1313 
1314 /*----------------------------------------------------------------------------*/
1324 /*----------------------------------------------------------------------------*/
1325 
1326 inline static cs_real_t *
1328  const cs_lagr_attribute_map_t *attr_map,
1329  cs_lagr_attribute_t attr)
1330 {
1331  assert(attr_map->source_term_displ != NULL);
1332  assert(attr_map->source_term_displ[attr] >= 0);
1333 
1334  return (cs_real_t *)( (unsigned char *)particle
1335  + attr_map->source_term_displ[attr]);
1336 }
1337 
1338 /*----------------------------------------------------------------------------*/
1348 /*----------------------------------------------------------------------------*/
1349 
1350 inline static const cs_real_t *
1352  const cs_lagr_attribute_map_t *attr_map,
1353  cs_lagr_attribute_t attr)
1354 {
1355  assert(attr_map->source_term_displ != NULL);
1356  assert(attr_map->source_term_displ[attr] >= 0);
1357 
1358  return (const cs_real_t *)( (unsigned char *)particle
1359  + attr_map->source_term_displ[attr]);
1360 }
1361 
1362 /*----------------------------------------------------------------------------
1363  * Resize particle set buffers if needed.
1364  *
1365  * parameters:
1366  * n_particles <-- minumum number of particles required
1367  *
1368  *
1369  * returns:
1370  * 1 if resizing was required, 0 otherwise
1371  *----------------------------------------------------------------------------*/
1372 
1373 int
1374 cs_lagr_particle_set_resize(cs_lnum_t n_min_particles);
1375 
1376 /*----------------------------------------------------------------------------
1377  * Set reallocation factor for particle sets.
1378  *
1379  * This factor determines the multiplier used for reallocations when
1380  * the particle set's buffers are too small to handle the new number of
1381  * particles.
1382  *
1383  * parameters:
1384  * f <-- reallocation size multiplier
1385  *----------------------------------------------------------------------------*/
1386 
1387 void
1389 
1390 /*----------------------------------------------------------------------------*/
1399 /*----------------------------------------------------------------------------*/
1400 
1401 unsigned long long
1403 
1404 /*----------------------------------------------------------------------------*/
1413 /*----------------------------------------------------------------------------*/
1414 
1415 void
1416 cs_lagr_set_n_g_particles_max(unsigned long long n_g_particles_max);
1417 
1418 /*----------------------------------------------------------------------------*/
1425 /*----------------------------------------------------------------------------*/
1426 
1427 void
1429  cs_lnum_t particle_id);
1430 
1431 /*----------------------------------------------------------------------------*/
1437 /*----------------------------------------------------------------------------*/
1438 
1439 void
1441 
1442 /*----------------------------------------------------------------------------*/
1448 /*----------------------------------------------------------------------------*/
1449 
1450 void
1451 cs_lagr_set_n_user_variables(int n_user_variables);
1452 
1453 /*----------------------------------------------------------------------------*/
1454 
1456 
1457 #endif /* __CS_LAGR_PARTICLE_H__ */
CS_LAGR_WATER_MASS
Definition: cs_lagr_particle.h:143
cs_lagr_particle_set_t::p_am
const cs_lagr_attribute_map_t * p_am
Definition: cs_lagr_particle.h:232
cs_lagr_attribute_map_t
Definition: cs_lagr_particle.h:176
cs_lagr_attribute_map_t::lb
size_t lb
Definition: cs_lagr_particle.h:180
CS_LAGR_VELOCITY
Definition: cs_lagr_particle.h:96
CS_LAGR_SHRINKING_DIAMETER
Definition: cs_lagr_particle.h:147
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)
Get const pointer to 2nd order scheme source terms an attribute of a given particle in a set.
Definition: cs_lagr_particle.h:915
cs_defs.h
CS_LAGR_TR_TRUNCATE
Definition: cs_lagr_particle.h:99
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)
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
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)
Get const pointer to attribute data of a particle at a given time.
Definition: cs_lagr_particle.h:1009
CS_LAGR_INTERF
Definition: cs_lagr_particle.h:115
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.
Definition: cs_lagr_particle.c:897
cs_lagr_attribute_name
const char * cs_lagr_attribute_name[]
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)
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
CS_LAGR_EMISSIVITY
Definition: cs_lagr_particle.h:155
CS_LAGR_ADHESION_TORQUE
Definition: cs_lagr_particle.h:125
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)
Get pointer to current attribute data of a particle.
Definition: cs_lagr_particle.h:940
cs_lagr_particle_set_t::weight
cs_real_t weight
Definition: cs_lagr_particle.h:221
CS_LAGR_FLUID_TEMPERATURE
Definition: cs_lagr_particle.h:138
cs_lagr_particle_set_t::n_part_dep
cs_lnum_t n_part_dep
Definition: cs_lagr_particle.h:216
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.
Definition: cs_lagr_particle.c:981
CS_LAGR_N_LARGE_ASPERITIES
Definition: cs_lagr_particle.h:122
CS_LAGR_BR_GAUSS
Definition: cs_lagr_particle.h:110
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)
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_lagr_particle_set_t::weight_failed
cs_real_t weight_failed
Definition: cs_lagr_particle.h:228
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
CS_LAGR_DEPO_TIME
Definition: cs_lagr_particle.h:132
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.
Definition: cs_lagr_particle.c:1228
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)
Get attribute value of type cs_gnum_t of a given particle in a set.
Definition: cs_lagr_particle.h:1131
cs_lagr_particle_finalize
void cs_lagr_particle_finalize(void)
Destroy main particle set and map if they exist.
Definition: cs_lagr_particle.c:927
cs_lagr_particle_set_t
Definition: cs_lagr_particle.h:210
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)
Unset flag value with a selected mask for a given particle in a set.
Definition: cs_lagr_particle.h:553
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)
Set attribute value of type cs_lnum_t of a given particle in a set.
Definition: cs_lagr_particle.h:632
cs_lagr_attribute_map_t::displ
ptrdiff_t(* displ)[CS_LAGR_N_ATTRIBUTES]
Definition: cs_lagr_particle.h:196
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)
Set attribute value of type cs_gnum_t of a given particle in a set.
Definition: cs_lagr_particle.h:734
cs_real_t
double cs_real_t
Floating-point value.
Definition: cs_defs.h:302
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)
Set attribute value of type cs_real_t of a given particle.
Definition: cs_lagr_particle.h:1277
cs_lagr_particle_set_t::n_part_resusp
cs_lnum_t n_part_resusp
Definition: cs_lagr_particle.h:218
cs_lagr_particle_set_t::n_particles
cs_lnum_t n_particles
Definition: cs_lagr_particle.h:212
CS_LAGR_REBOUND_ID
Definition: cs_lagr_particle.h:86
CS_LAGR_COAL_DENSITY
Definition: cs_lagr_particle.h:151
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)
Set flag value with a selected mask for a given particle in a set.
Definition: cs_lagr_particle.h:526
CS_LAGR_MARKO_VALUE
Definition: cs_lagr_particle.h:117
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
CS_LAGR_CELL_ID
Definition: cs_lagr_particle.h:83
cs_lagr_particle_set_t::n_part_merged
cs_lnum_t n_part_merged
Definition: cs_lagr_particle.h:215
CS_LAGR_USER
Definition: cs_lagr_particle.h:165
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)
Get pointer to attribute data of a particle at a given time.
Definition: cs_lagr_particle.h:985
CS_LAGR_STAT_CLASS
Definition: cs_lagr_particle.h:159
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)
Get pointer to attribute data of a given particle in a set at a given time.
Definition: cs_lagr_particle.h:451
cs_lagr_particle_set_create
void cs_lagr_particle_set_create(void)
Definition: cs_lagr_particle.c:910
cs_glob_lagr_particle_set
cs_lagr_particle_set_t * cs_glob_lagr_particle_set
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)
Get pointer to a current attribute of a given particle in a set.
Definition: cs_lagr_particle.h:400
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)
Get pointer to 2nd order scheme attribute source terms of a particle.
Definition: cs_lagr_particle.h:1351
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)
Get attribute value of type cs_real_t of a given particle in a set.
Definition: cs_lagr_particle.h:1229
cs_datatype_t
cs_datatype_t
Definition: cs_defs.h:260
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.
Definition: cs_lagr_particle.c:1186
stride
void const cs_int_t const cs_int_t const cs_int_t const cs_int_t * stride
Definition: cs_sat_coupling.h:325
CS_LAGR_DISPLACEMENT_NORM
Definition: cs_lagr_particle.h:126
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)
Get attribute value of type cs_real_t of a given particle in a set.
Definition: cs_lagr_particle.h:786
cs_lagr_attribute_map_t::n_time_vals
int n_time_vals
Definition: cs_lagr_particle.h:184
cs_lagr_particle_attr_initialize
void cs_lagr_particle_attr_initialize(void)
Define particle map based on defined options.
Definition: cs_lagr_particle.c:639
CS_LAGR_ADHESION_FORCE
Definition: cs_lagr_particle.h:124
CS_LAGR_TAUP_AUX
Definition: cs_lagr_particle.h:94
CS_LAGR_TURB_STATE_1
Definition: cs_lagr_particle.h:106
cs_lagr_attribute_map_t::source_term_displ
ptrdiff_t * source_term_displ
Definition: cs_lagr_particle.h:200
cs_lagr_particle_set_t::n_part_new
cs_lnum_t n_part_new
Definition: cs_lagr_particle.h:213
CS_LAGR_NEIGHBOR_FACE_ID
Definition: cs_lagr_particle.h:116
cs_lagr_attribute_t
cs_lagr_attribute_t
Definition: cs_lagr_particle.h:79
cs_lagr_particle_set_t::n_failed_part
cs_lnum_t n_failed_part
Definition: cs_lagr_particle.h:219
CS_LAGR_N_SMALL_ASPERITIES
Definition: cs_lagr_particle.h:123
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.
Definition: cs_lagr_particle.c:1201
CS_LAGR_INITIAL_DIAMETER
Definition: cs_lagr_particle.h:148
CS_LAGR_N_ATTRIBUTES
Definition: cs_lagr_particle.h:169
cs_gnum_t
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:286
cs_lagr_part_copy
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
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)
Get const pointer to current attribute data of a particle.
Definition: cs_lagr_particle.h:962
CS_LAGR_VELOCITY_SEEN
Definition: cs_lagr_particle.h:97
cs_lagr_particle_set_t::weight_out
cs_real_t weight_out
Definition: cs_lagr_particle.h:223
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.
Definition: cs_lagr_particle.c:1100
CS_LAGR_COKE_MASS
Definition: cs_lagr_particle.h:145
CS_LAGR_MASS
Definition: cs_lagr_particle.h:92
CS_LAGR_PARTICLE_AGGREGATE
Definition: cs_lagr_particle.h:161
cs_lagr_particle_set_t::weight_fou
cs_real_t weight_fou
Definition: cs_lagr_particle.h:226
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)
Get attribute value of type cs_lnum_t of a given particle in a set.
Definition: cs_lagr_particle.h:582
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)
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_lagr_particle_set_t::n_particles_max
cs_lnum_t n_particles_max
Definition: cs_lagr_particle.h:230
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)
Set attribute value of type cs_gnum_t of a given particle.
Definition: cs_lagr_particle.h:1179
CS_LAGR_RANDOM_VALUE
Definition: cs_lagr_particle.h:88
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
CS_LAGR_PRED_VELOCITY
Definition: cs_lagr_particle.h:107
CS_LAGR_CONSOL_HEIGHT
Definition: cs_lagr_particle.h:133
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)
Get pointer to 2nd order scheme attribute source terms of a particle.
Definition: cs_lagr_particle.h:1327
CS_LAGR_CLUSTER_NB_PART
Definition: cs_lagr_particle.h:131
cs_lagr_set_reallocation_factor
void cs_lagr_set_reallocation_factor(double f)
Set reallocation factor for particle sets.
Definition: cs_lagr_particle.c:1151
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)
Get attribute value of type cs_lnum_t of a given particle at a given time.
Definition: cs_lagr_particle.h:1058
cs_lagr_attribute_map_t::extents
size_t extents
Definition: cs_lagr_particle.h:178
cs_lagr_particle_set_t::weight_dep
cs_real_t weight_dep
Definition: cs_lagr_particle.h:225
cs_lagr_particle_set_t::p_buffer
unsigned char * p_buffer
Definition: cs_lagr_particle.h:234
cs_lagr_particle_set_t::n_part_out
cs_lnum_t n_part_out
Definition: cs_lagr_particle.h:214
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)
Set attribute value of type cs_lnum_t of a given particle.
Definition: cs_lagr_particle.h:1081
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)
Set attribute value of type cs_gnum_t of a given particle at a given time.
Definition: cs_lagr_particle.h:1204
CS_LAGR_TR_REPOSITION
Definition: cs_lagr_particle.h:100
CS_LAGR_V_GAUSS
Definition: cs_lagr_particle.h:109
CS_LAGR_RANK_ID
Definition: cs_lagr_particle.h:84
CS_LAGR_TEMPERATURE
Definition: cs_lagr_particle.h:137
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.
Definition: cs_lagr_particle.c:1083
CS_LAGR_RESIDENCE_TIME
Definition: cs_lagr_particle.h:91
cs_lagr_particle_set_t::weight_merged
cs_real_t weight_merged
Definition: cs_lagr_particle.h:224
CS_LAGR_COAL_MASS
Definition: cs_lagr_particle.h:144
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)
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
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)
Get flag value with a selected mask for a given particle in a set.
Definition: cs_lagr_particle.h:503
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)
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
CS_LAGR_COAL_ID
Definition: cs_lagr_particle.h:150
CS_LAGR_COORDS
Definition: cs_lagr_particle.h:95
cs_lagr_set_n_user_variables
void cs_lagr_set_n_user_variables(int n_user_variables)
Set number of user particle variables.
Definition: cs_lagr_particle.c:1256
CS_LAGR_STAT_WEIGHT
Definition: cs_lagr_particle.h:90
CS_LAGR_HEIGHT
Definition: cs_lagr_particle.h:130
CS_LAGR_FOULING_INDEX
Definition: cs_lagr_particle.h:118
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)
Set attribute value of type cs_real_t of a given particle at a given time.
Definition: cs_lagr_particle.h:1302
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)
Get attribute value of type cs_gnum_t of a given particle at a given time.
Definition: cs_lagr_particle.h:1156
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)
Set attribute value of type cs_lnum_t of a given particle at a given time.
Definition: cs_lagr_particle.h:1106
cs_lagr_attribute_map_t::count
int(* count)[CS_LAGR_N_ATTRIBUTES]
Definition: cs_lagr_particle.h:193
CS_LAGR_P_FLAG
Definition: cs_lagr_particle.h:81
CS_LAGR_CP
Definition: cs_lagr_particle.h:139
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)
Get attribute value of type cs_lnum_t of a given particle in a set.
Definition: cs_lagr_particle.h:1033
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)
Set attribute value of type cs_real_t of a given particle in a set.
Definition: cs_lagr_particle.h:836
cs_lagr_particle_set_t::weight_new
cs_real_t weight_new
Definition: cs_lagr_particle.h:222
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)
Get const pointer to current attribute data of a given particle in a set.
Definition: cs_lagr_particle.h:425
CS_LAGR_YPLUS
Definition: cs_lagr_particle.h:114
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)
Get const pointer to attribute data of a given particle in a set at a given time.
Definition: cs_lagr_particle.h:478
CS_LAGR_PRED_VELOCITY_SEEN
Definition: cs_lagr_particle.h:108
CS_LAGR_DIAMETER
Definition: cs_lagr_particle.h:93
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.
Definition: cs_lagr_particle.c:1018
cs_lagr_particle_set_t::n_part_fou
cs_lnum_t n_part_fou
Definition: cs_lagr_particle.h:217
cs_lagr_particle_set_t::weight_resusp
cs_real_t weight_resusp
Definition: cs_lagr_particle.h:227
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)
Get attribute value of type cs_real_t of a given particle at a given time.
Definition: cs_lagr_particle.h:1254
cs_lagr_particle_set_resize
int cs_lagr_particle_set_resize(cs_lnum_t n_min_particles)
Resize particle set buffers if needed.
Definition: cs_lagr_particle.c:1120
cs_lagr_get_n_g_particles_max
unsigned long long cs_lagr_get_n_g_particles_max(void)
Get global maximum number of particles.
Definition: cs_lagr_particle.c:1169
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)
Get pointer to 2nd order scheme source terms for an attribute of a given particle in a set.
Definition: cs_lagr_particle.h:889
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)
Get attribute value of type cs_gnum_t of a given particle in a set.
Definition: cs_lagr_particle.h:684