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