8.3
general 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-2024 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
57typedef struct {
58
59 cs_lnum_t n_elts[3];
63 cs_gnum_t l_range[2];
65 const cs_gnum_t *g_id;
71 const cs_halo_t *halo;
74
75/*============================================================================
76 * Type definitions
77 *============================================================================*/
78
79/*============================================================================
80 * Static global variables
81 *============================================================================*/
82
83/*=============================================================================
84 * Public function prototypes
85 *============================================================================*/
86
87/*----------------------------------------------------------------------------*/
128/*----------------------------------------------------------------------------*/
129
130void
132 const cs_halo_t *halo,
133 cs_lnum_t n_elts,
134 bool balance,
135 int tr_ignore,
136 cs_gnum_t g_id_base,
137 cs_gnum_t l_range[2],
138 cs_gnum_t *g_id);
139
140/*----------------------------------------------------------------------------*/
172/*----------------------------------------------------------------------------*/
173
176 const cs_halo_t *halo,
177 cs_lnum_t n_elts,
178 bool balance,
179 int tr_ignore,
180 cs_gnum_t g_id_base);
181
182/*----------------------------------------------------------------------------*/
201/*----------------------------------------------------------------------------*/
202
205 const cs_halo_t *halo,
206 cs_lnum_t n_elts,
207 cs_gnum_t l_range[2],
208 cs_gnum_t *g_id);
209
210/*----------------------------------------------------------------------------*/
216/*----------------------------------------------------------------------------*/
217
218void
220
221/*----------------------------------------------------------------------------*/
235/*----------------------------------------------------------------------------*/
236
237void
239 cs_datatype_t datatype,
240 cs_lnum_t stride,
241 void *val);
242
243/*----------------------------------------------------------------------------*/
253/*----------------------------------------------------------------------------*/
254
255void
257 cs_datatype_t datatype,
258 cs_lnum_t stride,
259 void *val);
260
261/*----------------------------------------------------------------------------*/
272/*----------------------------------------------------------------------------*/
273
274void
276 cs_datatype_t datatype,
277 cs_lnum_t stride,
278 const void *src_val,
279 void *dest_val);
280
281/*----------------------------------------------------------------------------*/
295/*----------------------------------------------------------------------------*/
296
297void
299 cs_datatype_t datatype,
300 cs_lnum_t stride,
301 const void *src_val,
302 void *dest_val);
303
304/*----------------------------------------------------------------------------*/
305
307
308#endif /* __CS_RANGE_SET_H__ */
cs_datatype_t
Definition: cs_defs.h:300
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
uint64_t cs_gnum_t
global mesh entity number
Definition: cs_defs.h:325
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
struct _cs_interface_set_t cs_interface_set_t
Definition: cs_interface.h:61
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.cpp:736
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.cpp:1060
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, int tr_ignore, 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.cpp:682
void cs_range_set_destroy(cs_range_set_t **rs)
Destroy a range set structure.
Definition: cs_range_set.cpp:782
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.cpp:930
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.cpp:987
void cs_range_set_define(const cs_interface_set_t *ifs, const cs_halo_t *halo, cs_lnum_t n_elts, bool balance, int tr_ignore, 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.cpp:578
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.cpp:810
Definition: cs_halo.h:77
Definition: cs_range_set.h:57
const cs_interface_set_t * ifs
Definition: cs_range_set.h:70
const cs_halo_t * halo
Definition: cs_range_set.h:71
const cs_gnum_t * g_id
Definition: cs_range_set.h:65
cs_gnum_t * _g_id
Definition: cs_range_set.h:67