9.2
general documentation
fvm_box_priv.h
Go to the documentation of this file.
1#ifndef FVM_BOX_PRIV_H
2#define FVM_BOX_PRIV_H
3
4/*============================================================================
5 * Handle bounding boxes.
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 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 "base/cs_defs.h"
31
32/*----------------------------------------------------------------------------
33 * Local headers
34 *----------------------------------------------------------------------------*/
35
36#include "fvm/fvm_defs.h"
37#include "fvm/fvm_morton.h"
38
39#include "fvm/fvm_box.h"
40
41/*============================================================================
42 * Macro and type definitions
43 *============================================================================*/
44
45/* Structure use to manage box distribution on a tree structure */
46
47#if defined(HAVE_MPI)
48
50
51 int n_ranks; /* Number of associated ranks */
52
53 cs_lnum_t n_boxes; /* Number of bounding boxes */
54
55 int max_level; /* Global max level used to compute the
56 distribution */
57 double fit; /* Evaluation of the distribution
58 (lower is better) */
59
60 /* Morton code array defining an index on ranks = resulting distribution */
61
62 fvm_morton_code_t *morton_index; /* size = n_ranks + 1 */
63
64 /* Indexed list on ranks to list related bounding boxes */
65
66 cs_lnum_t *index; /* Index on ranks (size = n_ranks + 1) */
67 cs_lnum_t *list; /* List of bounding boxes associated to each rank */
68};
69
70#endif /* defined(HAVE_MPI) */
71
72/* Set of bounding boxes */
73
75
76 int dim; /* Spatial dimension (1, 2 or 3) */
77 int dimensions[3]; /* Only used in 1 or 2D: X = 0, Y = 1, Z = 2 */
78
79 cs_lnum_t n_boxes; /* Number of bounding boxes */
80 cs_gnum_t n_g_boxes; /* Global number of bounding boxes */
81
82 cs_gnum_t *g_num; /* Array of associated global numbers */
83 cs_coord_t *extents; /* Extents associated with each box:
84 * x_min_0, y_min_0, ..., x_max_0, y_max_0, ...
85 * x_min_n, y_min_n, ..., x_max_n, y_max_n,
86 * (size: n_boxes * dim * 2) */
87
88 cs_coord_t gmin[3]; /* Global minima of the coordinates */
89 cs_coord_t gmax[3]; /* Global maxima of the coordinates */
90
91#if defined(HAVE_MPI)
92 MPI_Comm comm; /* Associated MPI communicator */
93#endif
94
95};
96
97/*----------------------------------------------------------------------------*/
98
99#endif /* FVM_BOX_PRIV_H */
double cs_coord_t
Definition: cs_defs.h:330
unsigned cs_gnum_t
global mesh entity number
Definition: cs_defs.h:317
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
Definition: fvm_box_priv.h:49
int max_level
Definition: fvm_box_priv.h:55
int n_ranks
Definition: fvm_box_priv.h:51
cs_lnum_t * index
Definition: fvm_box_priv.h:66
cs_lnum_t n_boxes
Definition: fvm_box_priv.h:53
fvm_morton_code_t * morton_index
Definition: fvm_box_priv.h:62
double fit
Definition: fvm_box_priv.h:57
cs_lnum_t * list
Definition: fvm_box_priv.h:67
Definition: fvm_box_priv.h:74
cs_coord_t gmin[3]
Definition: fvm_box_priv.h:88
cs_gnum_t n_g_boxes
Definition: fvm_box_priv.h:80
cs_gnum_t * g_num
Definition: fvm_box_priv.h:82
cs_coord_t gmax[3]
Definition: fvm_box_priv.h:89
cs_lnum_t n_boxes
Definition: fvm_box_priv.h:79
int dimensions[3]
Definition: fvm_box_priv.h:77
int dim
Definition: fvm_box_priv.h:76
MPI_Comm comm
Definition: fvm_box_priv.h:92
cs_coord_t * extents
Definition: fvm_box_priv.h:83
Definition: fvm_morton.h:58