My Project
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,
227  void *val);
228 
229 /*----------------------------------------------------------------------------*/
239 /*----------------------------------------------------------------------------*/
240 
241 void
243  cs_datatype_t datatype,
245  void *val);
246 
247 /*----------------------------------------------------------------------------*/
258 /*----------------------------------------------------------------------------*/
259 
260 void
262  cs_datatype_t datatype,
264  const void *src_val,
265  void *dest_val);
266 
267 /*----------------------------------------------------------------------------*/
281 /*----------------------------------------------------------------------------*/
282 
283 void
285  cs_datatype_t datatype,
287  const void *src_val,
288  void *dest_val);
289 
290 /*----------------------------------------------------------------------------*/
291 
293 
294 #endif /* __CS_RANGE_SET_H__ */
cs_defs.h
cs_interface_set_t
struct _cs_interface_set_t cs_interface_set_t
Definition: cs_interface.h:61
cs_numbering.h
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
fvm_group.h
cs_range_set_define
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
cs_range_set_zero_out_of_range
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
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_datatype_t
cs_datatype_t
Definition: cs_defs.h:260
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_range_set_t::g_id
const cs_gnum_t * g_id
Definition: cs_range_set.h:64
cs_halo.h
cs_gnum_t
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:286
fvm_selector.h
cs_range_set_t::_g_id
cs_gnum_t * _g_id
Definition: cs_range_set.h:66
cs_mesh_builder.h
cs_range_set_t::ifs
const cs_interface_set_t * ifs
Definition: cs_range_set.h:69
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
cs_range_set_scatter
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
cs_range_set_t
Definition: cs_range_set.h:57
cs_interface.h
cs_halo_t
Definition: cs_halo.h:71
cs_range_set_destroy
void cs_range_set_destroy(cs_range_set_t **rs)
Destroy a range set structure.
Definition: cs_range_set.c:609
cs_range_set_t::halo
const cs_halo_t * halo
Definition: cs_range_set.h:70
fvm_periodicity.h
cs_range_set_create_from_shared
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
cs_range_set_create
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
cs_range_set_sync
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
cs_base.h
cs_range_set_gather
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