1
#ifndef __FVM_BOX_PRIV_H__
2
#define __FVM_BOX_PRIV_H__
4
/*============================================================================
5
* Handle bounding boxes.
6
*============================================================================*/
9
This file is part of Code_Saturne, a general-purpose CFD tool.
11
Copyright (C) 1998-2011 EDF S.A.
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
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
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.
28
/*----------------------------------------------------------------------------*/
30
/*----------------------------------------------------------------------------
32
*----------------------------------------------------------------------------*/
35
#include "fvm_morton.h"
39
/*----------------------------------------------------------------------------*/
46
#endif /* __cplusplus */
48
/*============================================================================
49
* Macro and type definitions
50
*============================================================================*/
52
/* Structure use to manage box distribution on a tree structure */
56
struct _fvm_box_distrib_t {
58
int n_ranks; /* Number of associated ranks */
60
fvm_lnum_t n_boxes; /* Number of bounding boxes */
62
int max_level; /* Global max level used to compute the
64
double fit; /* Evaluation of the distribution
67
/* Morton code array defining an index on ranks = resulting distribution */
69
fvm_morton_code_t *morton_index; /* size = n_ranks + 1 */
71
/* Indexed list on ranks to list related bounding boxes */
73
fvm_lnum_t *index; /* Index on ranks (size = n_ranks + 1) */
74
fvm_lnum_t *list; /* List of bounding boxes associated to each rank */
77
#endif /* defined(HAVE_MPI) */
79
/* Set of bounding boxes */
81
struct _fvm_box_set_t {
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 */
86
fvm_lnum_t n_boxes; /* Number of bounding boxes */
87
fvm_gnum_t n_g_boxes; /* Global number of bounding boxes */
89
fvm_gnum_t *g_num; /* Array of associated global numbers */
90
fvm_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) */
95
fvm_coord_t gmin[3]; /* Global minima of the coordinates */
96
fvm_coord_t gmax[3]; /* Global maxima of the coordinates */
99
MPI_Comm comm; /* Associated MPI communicator */
104
/*----------------------------------------------------------------------------*/
108
#endif /* __cplusplus */
110
#endif /* __FVM_BOX_PRIV_H__ */