src/lagr/cs_lagr_extract.h Source File

| programmer's documentation

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cs_lagr_extract.h
Go to the documentation of this file.
1 #ifndef __CS_LAGR_EXTRACT_H__
2 #define __CS_LAGR_EXTRACT_H__
3
4 /*============================================================================
5 * Extract information from lagrangian particles.
6 *============================================================================*/
7
8 /*
9 This file is part of Code_Saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2013 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 /*----------------------------------------------------------------------------
31 * Standard C library headers
32 *----------------------------------------------------------------------------*/
33
34 /*----------------------------------------------------------------------------
35 * Local headers
36 *----------------------------------------------------------------------------*/
37
38 #include "fvm_nodal.h"
39 #include "fvm_writer.h"
40
41 #include "cs_base.h"
42 #include "cs_lagr_tracking.h"
43 #include "cs_time_step.h"
44
45 /*----------------------------------------------------------------------------*/
46
47 BEGIN_C_DECLS
48
49 /*============================================================================
50 * Macro definitions
51 *============================================================================*/
52
53 /*============================================================================
54 * Local type definitions
55 *============================================================================*/
56
57 /*=============================================================================
58 * Global variables
59 *============================================================================*/
60
61 /*============================================================================
62 * Public function prototypes
63 *============================================================================*/
64
65 /*----------------------------------------------------------------------------
66 * Get the local number of particles.
67 *
68 * returns:
69 * current number of particles.
70 *----------------------------------------------------------------------------*/
71
72 cs_lnum_t
73 cs_lagr_get_n_particles(void);
74
75 /*----------------------------------------------------------------------------
76 * Extract a list of particles using an optional cell filter and
77 * statistical density filter.
78 *
79 * The output array must have been allocated by the caller and be of
80 * sufficient size.
81 *
82 * parameters:
83 * n_cells <-- number of cells in filter
84 * cell_list <-- optional list of containing cells filter
85 * (1 to n numbering)
86 * density <-- if < 1, fraction of particles to select
87 * n_particles --> number of selected particles, or NULL
88 * particle_list --> particle_list (1 to n numbering), or NULL
89 *----------------------------------------------------------------------------*/
90
91 void
92 cs_lagr_get_particle_list(cs_lnum_t n_cells,
93 const cs_lnum_t cell_list[],
94 double density,
95 cs_lnum_t *n_particles,
96 cs_lnum_t *particle_list);
97
98 /*----------------------------------------------------------------------------
99 * Extract values for a set of particles.
100 *
101 * The output array must have been allocated by the caller and be of
102 * sufficient size.
103 *
104 * parameters:
105 * particle_set <-- associated particle set
106 * attr <-- attribute whose values are required
107 * datatype <-- associated value type
108 * stride <-- number of values per particle
109 * component_id <-- if -1 : extract the whole attribute
110 * if >0 : id of the component to extract
111 * n_particles <-- number of particles in filter
112 * particle_list <-- particle_list (1 to n numbering), or NULL
113 * values --> particle values for given attribute
114 *
115 * returns:
116 * 0 in case of success, 1 if attribute is not present
117 *----------------------------------------------------------------------------*/
118
119 int
120 cs_lagr_get_particle_values(const cs_lagr_particle_set_t *particles,
121 cs_lagr_attribute_t attr,
122 cs_datatype_t datatype,
123 int stride,
124 int component_id,
125 cs_lnum_t n_particles,
126 const cs_lnum_t particle_list[],
127 void *values);
128
129 /*----------------------------------------------------------------------------
130 * Extract trajectory values joining 2 sets of particles.
131 *
132 * Trajectories are defined as a mesh of segments, whose start and end
133 * points are copied in an interleaved manner in the segment_values array
134 * (p1_old, p1_new, p2_old, p2_new, ... pn_old, pn_new).
135 *
136 * The output array must have been allocated by the caller and be of
137 * sufficient size.
138 *
139 * parameters:
140 * particles <-- associated particle set
141 * particles_prev <-- associated previous particle set
142 * attr <-- attribute whose values are required
143 * datatype <-- associated value type
144 * stride <-- number of values per particle
145 * component_id <-- if -1 : extract the whole attribute
146 * if >0 : id of the component to extract
147 * n_particles <-- number of particles in filter
148 * particle_list <-- particle_list (1 to n numbering), or NULL
149 * segment_values --> particle segment values
150 *
151 * returns:
152 * 0 in case of success, 1 if attribute is not present
153 *----------------------------------------------------------------------------*/
154
155 int
156 cs_lagr_get_trajectory_values(const cs_lagr_particle_set_t *particles,
157 const cs_lagr_particle_set_t *particles_prev,
158 cs_lagr_attribute_t attr,
159 cs_datatype_t datatype,
160 int stride,
161 int component_id,
162 cs_lnum_t n_particles,
163 const cs_lnum_t particle_list[],
164 void *segment_values);
165
166 END_C_DECLS
167
168 #endif /* __CS_LAGR_EXTRACT_H__ */