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

« back to all changes in this revision

Viewing changes to src/fvm/fvm_nodal_extract.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_NODAL_EXTRACT_H__
 
2
#define __FVM_NODAL_EXTRACT_H__
 
3
 
 
4
/*============================================================================
 
5
 * Main structure for a nodal representation associated with a mesh
 
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_nodal.h"
 
36
 
 
37
/*----------------------------------------------------------------------------*/
 
38
 
 
39
#ifdef __cplusplus
 
40
extern "C" {
 
41
#if 0
 
42
} /* Fake brace to force back Emacs auto-indentation back to column 0 */
 
43
#endif
 
44
#endif /* __cplusplus */
 
45
 
 
46
/*=============================================================================
 
47
 * Macro definitions
 
48
 *============================================================================*/
 
49
 
 
50
/*============================================================================
 
51
 * Type definitions
 
52
 *============================================================================*/
 
53
 
 
54
/*----------------------------------------------------------------------------
 
55
 * Structure defining a mesh in nodal definition
 
56
 *----------------------------------------------------------------------------*/
 
57
 
 
58
 
 
59
/*=============================================================================
 
60
 * Static global variables
 
61
 *============================================================================*/
 
62
 
 
63
 
 
64
/*=============================================================================
 
65
 * Public function prototypes
 
66
 *============================================================================*/
 
67
 
 
68
/*----------------------------------------------------------------------------
 
69
 * Copy global vertex numbers to an array.
 
70
 *
 
71
 * parameters:
 
72
 *   this_nodal <-- pointer to nodal mesh structure
 
73
 *   g_vtx_num  --> global vertex numbers (pre-allocated)
 
74
 *----------------------------------------------------------------------------*/
 
75
 
 
76
void
 
77
fvm_nodal_get_global_vertex_num(const fvm_nodal_t  *this_nodal,
 
78
                                fvm_gnum_t         *g_vtx_num);
 
79
 
 
80
/*----------------------------------------------------------------------------
 
81
 * Copy global element numbers of a given element type to an array.
 
82
 *
 
83
 * Note that if the mesh contains multiple sections of the same element type,
 
84
 * the global element numbers are continued from one section to the next,
 
85
 * so to the user, all is as if the sections were concatenated.
 
86
 *
 
87
 * parameters:
 
88
 *   this_nodal    <-- pointer to nodal mesh structure
 
89
 *   element_type  <-- type of elements to deal with
 
90
 *   g_elt_num     <-> pointer to global_element_num array (pre-allocated)
 
91
 *
 
92
 * returns:
 
93
 *----------------------------------------------------------------------------*/
 
94
 
 
95
void
 
96
fvm_nodal_get_global_element_num(const fvm_nodal_t  *this_nodal,
 
97
                                 fvm_element_t       element_type,
 
98
                                 fvm_gnum_t         *g_elt_num);
 
99
 
 
100
/*----------------------------------------------------------------------------
 
101
 * Copy vertex coordinates to an array.
 
102
 *
 
103
 * parameters:
 
104
 *   this_nodal     <-- pointer to nodal mesh structure
 
105
 *   interlace      <-- indicates if destination array is interlaced
 
106
 *   vertex_coords  --> vertices coordinates (pre-allocated)
 
107
 *----------------------------------------------------------------------------*/
 
108
 
 
109
void
 
110
fvm_nodal_get_vertex_coords(const fvm_nodal_t  *this_nodal,
 
111
                            fvm_interlace_t     interlace,
 
112
                            fvm_coord_t        *vertex_coords);
 
113
 
 
114
/*----------------------------------------------------------------------------
 
115
 * Copy element centers to an array.
 
116
 *
 
117
 * Note that if the mesh contains multiple cell element sections of, the
 
118
 * cell_centers array spans all sections, so to the user, all is as if the
 
119
 * sections were concatenated.
 
120
 *
 
121
 * parameters:
 
122
 *   this_nodal     <-- pointer to nodal mesh structure
 
123
 *   interlace      <-- indicates if destination array is interlaced
 
124
 *   entity_dim     <-- dimension of entities we want to count (0 to 3)
 
125
 *   cell_centers   --> cell centers coordinates (pre-allocated)
 
126
 *----------------------------------------------------------------------------*/
 
127
 
 
128
void
 
129
fvm_nodal_get_element_centers(const fvm_nodal_t  *this_nodal,
 
130
                              fvm_interlace_t     interlace,
 
131
                              int                 entity_dim,
 
132
                              fvm_coord_t        *cell_centers);
 
133
 
 
134
/*----------------------------------------------------------------------------
 
135
 * Copy element -> vertex connectivity of a given element type to an array.
 
136
 *
 
137
 * Note that if the mesh contains multiple sections of the same element type,
 
138
 * the connectivity spans all sections, so to the user, all is as if the
 
139
 * sections were concatenated.
 
140
 *
 
141
 * Return local connectivity for sections of a given element_type.
 
142
 *
 
143
 * parameters:
 
144
 *   this_nodal    <-- pointer to nodal mesh structure
 
145
 *   element_type  <-- type of elements of the section to deal with
 
146
 *   connectivity  <-> pointer to connectvity (pre-allocated)
 
147
 *----------------------------------------------------------------------------*/
 
148
 
 
149
void
 
150
fvm_nodal_get_strided_connect(const fvm_nodal_t  *this_nodal,
 
151
                              fvm_element_t       element_type,
 
152
                              fvm_lnum_t         *connectivity);
 
153
 
 
154
/*----------------------------------------------------------------------------
 
155
 * Build inverse vertex -> element connectivity.
 
156
 *
 
157
 * The user is responsible for freeing the returned arrays.
 
158
 * The size of element_index[] should be n_vertices + 1, where n_vertices
 
159
 * is the value returned by fvm_nodal_get_n_entities(this_nodal, entity_dim).
 
160
 * The size of element_id[] should be element_index[n_vertices].
 
161
 *
 
162
 * Note that if the mesh contains multiple cell element sections of, the
 
163
 * cell_centers array spans all sections, so to the user, all is as if the
 
164
 * sections were concatenated.
 
165
 *
 
166
 * Note also that both the vertex -> element index and connectivity arrays
 
167
 * returned use 0 to n numbering.
 
168
 *
 
169
 * parameters:
 
170
 *   this_nodal    <-- pointer to nodal mesh structure
 
171
 *   entity_dim    <-- dimension of entities we want to count (1 to 3)
 
172
 *   element_index --> vertex -> element connectivity index (O to n-1)
 
173
 *   element_id    --> vertex -> element connectivity (0 to n-1)
 
174
 *----------------------------------------------------------------------------*/
 
175
 
 
176
void
 
177
fvm_nodal_get_vertex_elements(const fvm_nodal_t   *this_nodal,
 
178
                              int                  entity_dim,
 
179
                              fvm_lnum_t         **element_index,
 
180
                              fvm_lnum_t         **element_id);
 
181
 
 
182
/*----------------------------------------------------------------------------
 
183
 * Compute extents of a nodal mesh representation
 
184
 *
 
185
 * parameters:
 
186
 *   this_nodal   <-- pointer to mesh representation structure
 
187
 *   tolerance    <-- addition to local extents of each element:
 
188
 *                    extent = base_extent * (1 + tolerance)
 
189
 *   extents      <-> extents associated with mesh:
 
190
 *                    x_min, y_min, ..., x_max, y_max, ... (size: 2*dim)
 
191
 *----------------------------------------------------------------------------*/
 
192
 
 
193
void
 
194
fvm_nodal_extents(const fvm_nodal_t  *this_nodal,
 
195
                  double              tolerance,
 
196
                  double              extents[]);
 
197
 
 
198
/*----------------------------------------------------------------------------*/
 
199
 
 
200
#ifdef __cplusplus
 
201
}
 
202
#endif /* __cplusplus */
 
203
 
 
204
#endif /* __FVM_NODAL_EXTRACT_H__ */