~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to src/fvm/fvm_box_priv.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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-2011 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
  fvm_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
  fvm_lnum_t  *index;   /* Index on ranks (size = n_ranks + 1) */
 
74
  fvm_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
 
 
81
struct _fvm_box_set_t {
 
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
  fvm_lnum_t     n_boxes;        /* Number of bounding boxes */
 
87
  fvm_gnum_t     n_g_boxes;      /* Global number of bounding boxes */
 
88
 
 
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) */
 
94
 
 
95
  fvm_coord_t    gmin[3];        /* Global minima of the coordinates */
 
96
  fvm_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__ */