My Project
programmer's documentation
cs_selector.h
Go to the documentation of this file.
1 #ifndef __CS_SELECTOR_H__
2 #define __CS_SELECTOR_H__
3 
4 /*============================================================================
5  * Build selection lists for faces or cells
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_base.h"
31 
32 /*----------------------------------------------------------------------------*/
33 
35 
36 /*============================================================================
37  * Public function prototypes for Fortran API
38  *============================================================================*/
39 
40 /*=============================================================================
41  * Public function prototypes
42  *============================================================================*/
43 
44 /*----------------------------------------------------------------------------
45  * Fill a list of boundary face numbers verifying a given selection criteria.
46  *
47  * parameters:
48  * criteria <-- selection criteria string
49  * n_b_faces --> number of selected interior faces
50  * b_face_num_list --> list of selected boundary face numbers
51  * (1 to n, preallocated to cs_glob_mesh->n_b_faces)
52  *----------------------------------------------------------------------------*/
53 
54 void
55 cs_selector_get_b_face_num_list(const char *criteria,
56  cs_lnum_t *n_b_faces,
57  cs_lnum_t b_face_num_list[]);
58 
59 /*----------------------------------------------------------------------------
60  * Fill a list of interior faces verifying a given selection criteria.
61  *
62  * parameters:
63  * criteria <-- selection criteria string
64  * n_i_faces --> number of selected interior faces
65  * i_face_num_list --> list of selected interior face numbers
66  * (1 to n, preallocated to cs_glob_mesh->n_i_faces)
67  *----------------------------------------------------------------------------*/
68 
69 void
70 cs_selector_get_i_face_num_list(const char *criteria,
71  cs_lnum_t *n_i_faces,
72  cs_lnum_t i_face_num_list[]);
73 
74 /*----------------------------------------------------------------------------
75  * Fill a list of cells verifying a given selection criteria.
76  *
77  * parameters:
78  * criteria <-- selection criteria string
79  * n_cells --> number of selected cells
80  * cell_num_list --> list of selected cell numbers
81  * (1 to n, preallocated to cs_glob_mesh->n_cells)
82  *----------------------------------------------------------------------------*/
83 
84 void
85 cs_selector_get_cell_num_list(const char *criteria,
86  cs_lnum_t *n_cells,
87  cs_lnum_t cell_num_list[]);
88 
89 /*----------------------------------------------------------------------------
90  * Fill a list of boundary faces verifying a given selection criteria.
91  *
92  * parameters:
93  * criteria <-- selection criteria string
94  * n_b_faces --> number of selected interior faces
95  * b_face_list --> list of selected boundary faces
96  * (0 to n-1, preallocated to cs_glob_mesh->n_b_faces)
97  *----------------------------------------------------------------------------*/
98 
99 void
100 cs_selector_get_b_face_list(const char *criteria,
101  cs_lnum_t *n_b_faces,
102  cs_lnum_t b_face_list[]);
103 
104 /*----------------------------------------------------------------------------
105  * Fill a list of interior faces verifying a given selection criteria.
106  *
107  * parameters:
108  * criteria <-- selection criteria string
109  * n_i_faces --> number of selected interior faces
110  * i_face_list --> list of selected interior faces
111  * (0 to n-1, preallocated to cs_glob_mesh->n_i_faces)
112  *----------------------------------------------------------------------------*/
113 
114 void
115 cs_selector_get_i_face_list(const char *criteria,
116  cs_lnum_t *n_i_faces,
117  cs_lnum_t i_face_list[]);
118 
119 /*----------------------------------------------------------------------------
120  * Fill a list of cells verifying a given selection criteria.
121  *
122  * parameters:
123  * criteria <-- selection criteria string
124  * n_cells --> number of selected cells
125  * cell_list --> list of selected cells
126  * (0 to n-1, preallocated to cs_glob_mesh->n_cells)
127  *----------------------------------------------------------------------------*/
128 
129 void
130 cs_selector_get_cell_list(const char *criteria,
131  cs_lnum_t *n_cells,
132  cs_lnum_t cell_list[]);
133 
134 /*----------------------------------------------------------------------------*/
143 /*----------------------------------------------------------------------------*/
144 
145 void
146 cs_selector_get_cell_vertices_list(const char *criteria,
147  cs_lnum_t *n_vertices,
148  cs_lnum_t vtx_ids[]);
149 
150 /*----------------------------------------------------------------------------*/
159 /*----------------------------------------------------------------------------*/
160 
161 void
163  const cs_lnum_t cell_ids[],
164  cs_lnum_t *n_vertices,
165  cs_lnum_t vtx_ids[]);
166 
167 /*----------------------------------------------------------------------------
168  * Fill lists of faces at the boundary of a set of cells verifying a given
169  * selection criteria.
170  *
171  * parameters:
172  * criteria <-- selection criteria string
173  * n_i_faces --> number of selected interior faces
174  * n_b_faces --> number of selected interior faces
175  * i_face_id --> list of selected interior faces
176  * (0 to n-1, preallocated to cs_glob_mesh->n_i_faces)
177  * b_face_id --> list of selected boundary faces
178  * (0 to n-1, preallocated to cs_glob_mesh->n_b_faces)
179  *----------------------------------------------------------------------------*/
180 
181 void
182 cs_selector_get_cells_boundary(const char *criteria,
183  cs_lnum_t *n_i_faces,
184  cs_lnum_t *n_b_faces,
185  cs_lnum_t i_face_id[],
186  cs_lnum_t b_face_id[]);
187 
188 /*----------------------------------------------------------------------------
189  * Fill a list of interior faces belonging to a given periodicity.
190  *
191  * parameters:
192  * perio_num <-- periodicity number
193  * n_i_faces --> number of selected interior faces
194  * i_face_id --> list of selected interior faces
195  * (0 to n-1, preallocated to cs_glob_mesh->n_i_faces)
196  *----------------------------------------------------------------------------*/
197 
198 void
199 cs_selector_get_perio_face_list(int perio_num,
200  cs_lnum_t *n_i_faces,
201  cs_lnum_t i_face_id[]);
202 
203 /*----------------------------------------------------------------------------
204  * Fill a list of families verifying a given selection criteria.
205  *
206  * parameters:
207  * criteria <-- selection criteria string
208  * n_families --> number of selected families
209  * family_list --> list of selected families faces
210  * (0 to n-1, preallocated to cs_glob_mesh->n_families + 1)
211  *----------------------------------------------------------------------------*/
212 
213 void
214 cs_selector_get_family_list(const char *criteria,
215  cs_lnum_t *n_families,
216  cs_int_t family_list[]);
217 
218 /*----------------------------------------------------------------------------*/
219 
221 
222 #endif /* __CS_SELECTOR_H__ */
cs_selector_get_b_face_list
void cs_selector_get_b_face_list(const char *criteria, cs_lnum_t *n_b_faces, cs_lnum_t b_face_list[])
Fill a list of boundary faces verifying a given selection criteria.
Definition: cs_selector.c:213
cs_selector_get_cells_boundary
void cs_selector_get_cells_boundary(const char *criteria, cs_lnum_t *n_i_faces, cs_lnum_t *n_b_faces, cs_lnum_t i_face_id[], cs_lnum_t b_face_id[])
Fill lists of faces at the boundary of a set of cells verifying a given selection criteria.
Definition: cs_selector.c:576
cs_selector_get_i_face_list
void cs_selector_get_i_face_list(const char *criteria, cs_lnum_t *n_i_faces, cs_lnum_t i_face_list[])
Fill a list of interior faces verifying a given selection criteria.
Definition: cs_selector.c:291
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_selector_get_cell_num_list
void cs_selector_get_cell_num_list(const char *criteria, cs_lnum_t *n_cells, cs_lnum_t cell_num_list[])
Definition: cs_selector.c:171
cs_selector_get_perio_face_list
void cs_selector_get_perio_face_list(int perio_num, cs_lnum_t *n_i_faces, cs_lnum_t i_face_id[])
Fill a list of interior faces belonging to a given periodicity.
Definition: cs_selector.c:641
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_selector_get_cell_list
void cs_selector_get_cell_list(const char *criteria, cs_lnum_t *n_cells, cs_lnum_t cell_list[])
Fill a list of cells verifying a given selection criteria.
Definition: cs_selector.c:369
cs_selector_get_cell_vertices_list
void cs_selector_get_cell_vertices_list(const char *criteria, cs_lnum_t *n_vertices, cs_lnum_t vtx_ids[])
Fill a list of cells verifying a given selection criteria.
Definition: cs_selector.c:462
cs_selector_get_b_face_num_list
void cs_selector_get_b_face_num_list(const char *criteria, cs_lnum_t *n_b_faces, cs_lnum_t b_face_num_list[])
Definition: cs_selector.c:89
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
cs_selector_get_i_face_num_list
void cs_selector_get_i_face_num_list(const char *criteria, cs_lnum_t *n_i_faces, cs_lnum_t i_face_num_list[])
Definition: cs_selector.c:130
cs_int_t
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:301
cs_selector_get_family_list
void cs_selector_get_family_list(const char *criteria, cs_lnum_t *n_families, cs_int_t family_list[])
Fill a list of families verifying a given selection criteria.
Definition: cs_selector.c:675
cs_selector_get_cell_vertices_list_by_ids
void cs_selector_get_cell_vertices_list_by_ids(cs_lnum_t n_cells, const cs_lnum_t cell_ids[], cs_lnum_t *n_vertices, cs_lnum_t vtx_ids[])
Fill a list of vertices belonging to a given list of cells.
Definition: cs_selector.c:492
cs_base.h