My Project
programmer's 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-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_defs.h"
31 
32 /*----------------------------------------------------------------------------
33  * Local headers
34  *----------------------------------------------------------------------------*/
35 
36 #include "fvm_defs.h"
37 #include "fvm_morton.h"
38 
39 #include "fvm_box.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*============================================================================
46  * Macro and type definitions
47  *============================================================================*/
48 
49 /* Structure use to manage box distribution on a tree structure */
50 
51 #if defined(HAVE_MPI)
52 
53 struct _fvm_box_distrib_t {
54 
55  int n_ranks; /* Number of associated ranks */
56 
57  cs_lnum_t n_boxes; /* Number of bounding boxes */
58 
59  int max_level; /* Global max level used to compute the
60  distribution */
61  double fit; /* Evaluation of the distribution
62  (lower is better) */
63 
64  /* Morton code array defining an index on ranks = resulting distribution */
65 
66  fvm_morton_code_t *morton_index; /* size = n_ranks + 1 */
67 
68  /* Indexed list on ranks to list related bounding boxes */
69 
70  cs_lnum_t *index; /* Index on ranks (size = n_ranks + 1) */
71  cs_lnum_t *list; /* List of bounding boxes associated to each rank */
72 };
73 
74 #endif /* defined(HAVE_MPI) */
75 
76 /* Set of bounding boxes */
77 
79 
80  int dim; /* Spatial dimension (1, 2 or 3) */
81  int dimensions[3]; /* Only used in 1 or 2D: X = 0, Y = 1, Z = 2 */
82 
83  cs_lnum_t n_boxes; /* Number of bounding boxes */
84  cs_gnum_t n_g_boxes; /* Global number of bounding boxes */
85 
86  cs_gnum_t *g_num; /* Array of associated global numbers */
87  cs_coord_t *extents; /* Extents associated with each box:
88  * x_min_0, y_min_0, ..., x_max_0, y_max_0, ...
89  * x_min_n, y_min_n, ..., x_max_n, y_max_n,
90  * (size: n_boxes * dim * 2) */
91 
92  cs_coord_t gmin[3]; /* Global minima of the coordinates */
93  cs_coord_t gmax[3]; /* Global maxima of the coordinates */
94 
95 #if defined(HAVE_MPI)
96  MPI_Comm comm; /* Associated MPI communicator */
97 #endif
98 
99 };
100 
101 /*----------------------------------------------------------------------------*/
102 
104 
105 #endif /* __FVM_BOX_PRIV_H__ */
_fvm_box_set_t::g_num
cs_gnum_t * g_num
Definition: fvm_box_priv.h:86
cs_defs.h
_fvm_box_set_t::n_boxes
cs_lnum_t n_boxes
Definition: fvm_box_priv.h:83
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
_fvm_box_set_t::dim
int dim
Definition: fvm_box_priv.h:80
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
_fvm_box_set_t::dimensions
int dimensions[3]
Definition: fvm_box_priv.h:81
cs_gnum_t
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:286
fvm_box.h
fvm_morton.h
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
_fvm_box_set_t
Definition: fvm_box_priv.h:78
_fvm_box_set_t::gmin
cs_coord_t gmin[3]
Definition: fvm_box_priv.h:92
_fvm_box_set_t::n_g_boxes
cs_gnum_t n_g_boxes
Definition: fvm_box_priv.h:84
_fvm_box_set_t::gmax
cs_coord_t gmax[3]
Definition: fvm_box_priv.h:93
fvm_morton_code_t
Definition: fvm_morton.h:62
cs_coord_t
double cs_coord_t
Definition: cs_defs.h:299
fvm_defs.h
_fvm_box_set_t::extents
cs_coord_t * extents
Definition: fvm_box_priv.h:87