programmer's documentation
cs_range_set.h
Go to the documentation of this file.
1 #ifndef __CS_RANGE_SET_H__
2 #define __CS_RANGE_SET_H__
3 
4 /*============================================================================
5  * Operations related to handling of an owning rank for distributed entities.
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 /*----------------------------------------------------------------------------
31  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_defs.h"
35 
36 #include "fvm_group.h"
37 #include "fvm_selector.h"
38 #include "fvm_periodicity.h"
39 
40 #include "cs_base.h"
41 #include "cs_halo.h"
42 #include "cs_interface.h"
43 #include "cs_numbering.h"
44 
45 #include "cs_mesh_builder.h"
46 
47 /*----------------------------------------------------------------------------*/
48 
50 
51 /*=============================================================================
52  * Macro definitions
53  *============================================================================*/
54 
57 typedef struct {
58 
59  cs_lnum_t n_elts[2];
62  cs_gnum_t l_range[2];
64  const cs_gnum_t *g_id;
70  const cs_halo_t *halo;
73 
74 /*============================================================================
75  * Type definitions
76  *============================================================================*/
77 
78 /*============================================================================
79  * Static global variables
80  *============================================================================*/
81 
82 /*=============================================================================
83  * Public function prototypes
84  *============================================================================*/
85 
86 /*----------------------------------------------------------------------------*/
122 /*----------------------------------------------------------------------------*/
123 
124 void
126  const cs_halo_t *halo,
127  cs_lnum_t n_elts,
128  bool balance,
129  cs_gnum_t g_id_base,
130  cs_gnum_t l_range[2],
131  cs_gnum_t *g_id);
132 
133 /*----------------------------------------------------------------------------*/
159 /*----------------------------------------------------------------------------*/
160 
163  const cs_halo_t *halo,
164  cs_lnum_t n_elts,
165  bool balance,
166  cs_gnum_t g_id_base);
167 
168 /*----------------------------------------------------------------------------*/
187 /*----------------------------------------------------------------------------*/
188 
191  const cs_halo_t *halo,
192  cs_lnum_t n_elts,
193  cs_gnum_t l_range[2],
194  cs_gnum_t *g_id);
195 
196 /*----------------------------------------------------------------------------*/
202 /*----------------------------------------------------------------------------*/
203 
204 void
206 
207 /*----------------------------------------------------------------------------*/
221 /*----------------------------------------------------------------------------*/
222 
223 void
225  cs_datatype_t datatype,
226  cs_lnum_t stride,
227  void *val);
228 
229 /*----------------------------------------------------------------------------*/
239 /*----------------------------------------------------------------------------*/
240 
241 void
243  cs_datatype_t datatype,
244  cs_lnum_t stride,
245  void *val);
246 
247 /*----------------------------------------------------------------------------*/
258 /*----------------------------------------------------------------------------*/
259 
260 void
262  cs_datatype_t datatype,
263  cs_lnum_t stride,
264  const void *src_val,
265  void *dest_val);
266 
267 /*----------------------------------------------------------------------------*/
281 /*----------------------------------------------------------------------------*/
282 
283 void
285  cs_datatype_t datatype,
286  cs_lnum_t stride,
287  const void *src_val,
288  void *dest_val);
289 
290 /*----------------------------------------------------------------------------*/
291 
293 
294 #endif /* __CS_RANGE_SET_H__ */
cs_datatype_t
Definition: cs_defs.h:260
void cs_range_set_sync(const cs_range_set_t *rs, cs_datatype_t datatype, cs_lnum_t stride, void *val)
Synchronize values elements associated with a range set, using either a halo or an interface set...
Definition: cs_range_set.c:757
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:286
cs_range_set_t * cs_range_set_create(const cs_interface_set_t *ifs, const cs_halo_t *halo, cs_lnum_t n_elts, bool balance, cs_gnum_t g_id_base)
Create a range set (with associated range and global ids) for the partitioning of data based on local...
Definition: cs_range_set.c:521
void cs_range_set_define(const cs_interface_set_t *ifs, const cs_halo_t *halo, cs_lnum_t n_elts, bool balance, cs_gnum_t g_id_base, cs_gnum_t l_range[2], cs_gnum_t *g_id)
Define global ids and a partitioning of data based on local ranges for elements which may be shared a...
Definition: cs_range_set.c:446
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
const cs_gnum_t * g_id
Definition: cs_range_set.h:64
Definition: cs_halo.h:71
void cs_range_set_zero_out_of_range(const cs_range_set_t *rs, cs_datatype_t datatype, cs_lnum_t stride, void *val)
Set values of a given array to zero for indexes of elements outside the local range.
Definition: cs_range_set.c:637
cs_range_set_t * cs_range_set_create_from_shared(const cs_interface_set_t *ifs, const cs_halo_t *halo, cs_lnum_t n_elts, cs_gnum_t l_range[2], cs_gnum_t *g_id)
Create a range set (with associated range and global ids) from an existing partition of data based on...
Definition: cs_range_set.c:573
const cs_interface_set_t * ifs
Definition: cs_range_set.h:69
void cs_range_set_scatter(const cs_range_set_t *rs, cs_datatype_t datatype, cs_lnum_t stride, const void *src_val, void *dest_val)
Scatter element values associated with a range set to the full set.
Definition: cs_range_set.c:887
void cs_range_set_destroy(cs_range_set_t **rs)
Destroy a range set structure.
Definition: cs_range_set.c:609
Definition: cs_range_set.h:57
struct _cs_interface_set_t cs_interface_set_t
Definition: cs_interface.h:61
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
#define END_C_DECLS
Definition: cs_defs.h:468
cs_gnum_t * _g_id
Definition: cs_range_set.h:66
void cs_range_set_gather(const cs_range_set_t *rs, cs_datatype_t datatype, cs_lnum_t stride, const void *src_val, void *dest_val)
Gather element values associated with a range set to a compact set.
Definition: cs_range_set.c:804
const cs_halo_t * halo
Definition: cs_range_set.h:70