1
#ifndef __FVM_NODAL_EXTRACT_H__
2
#define __FVM_NODAL_EXTRACT_H__
4
/*============================================================================
5
* Main structure for a nodal representation associated with a mesh
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_nodal.h"
37
/*----------------------------------------------------------------------------*/
42
} /* Fake brace to force back Emacs auto-indentation back to column 0 */
44
#endif /* __cplusplus */
46
/*=============================================================================
48
*============================================================================*/
50
/*============================================================================
52
*============================================================================*/
54
/*----------------------------------------------------------------------------
55
* Structure defining a mesh in nodal definition
56
*----------------------------------------------------------------------------*/
59
/*=============================================================================
60
* Static global variables
61
*============================================================================*/
64
/*=============================================================================
65
* Public function prototypes
66
*============================================================================*/
68
/*----------------------------------------------------------------------------
69
* Copy global vertex numbers to an array.
72
* this_nodal <-- pointer to nodal mesh structure
73
* g_vtx_num --> global vertex numbers (pre-allocated)
74
*----------------------------------------------------------------------------*/
77
fvm_nodal_get_global_vertex_num(const fvm_nodal_t *this_nodal,
78
fvm_gnum_t *g_vtx_num);
80
/*----------------------------------------------------------------------------
81
* Copy global element numbers of a given element type to an array.
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.
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)
93
*----------------------------------------------------------------------------*/
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);
100
/*----------------------------------------------------------------------------
101
* Copy vertex coordinates to an array.
104
* this_nodal <-- pointer to nodal mesh structure
105
* interlace <-- indicates if destination array is interlaced
106
* vertex_coords --> vertices coordinates (pre-allocated)
107
*----------------------------------------------------------------------------*/
110
fvm_nodal_get_vertex_coords(const fvm_nodal_t *this_nodal,
111
fvm_interlace_t interlace,
112
fvm_coord_t *vertex_coords);
114
/*----------------------------------------------------------------------------
115
* Copy element centers to an array.
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.
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
*----------------------------------------------------------------------------*/
129
fvm_nodal_get_element_centers(const fvm_nodal_t *this_nodal,
130
fvm_interlace_t interlace,
132
fvm_coord_t *cell_centers);
134
/*----------------------------------------------------------------------------
135
* Copy element -> vertex connectivity of a given element type to an array.
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.
141
* Return local connectivity for sections of a given element_type.
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
*----------------------------------------------------------------------------*/
150
fvm_nodal_get_strided_connect(const fvm_nodal_t *this_nodal,
151
fvm_element_t element_type,
152
fvm_lnum_t *connectivity);
154
/*----------------------------------------------------------------------------
155
* Build inverse vertex -> element connectivity.
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].
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.
166
* Note also that both the vertex -> element index and connectivity arrays
167
* returned use 0 to n numbering.
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
*----------------------------------------------------------------------------*/
177
fvm_nodal_get_vertex_elements(const fvm_nodal_t *this_nodal,
179
fvm_lnum_t **element_index,
180
fvm_lnum_t **element_id);
182
/*----------------------------------------------------------------------------
183
* Compute extents of a nodal mesh representation
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
*----------------------------------------------------------------------------*/
194
fvm_nodal_extents(const fvm_nodal_t *this_nodal,
198
/*----------------------------------------------------------------------------*/
202
#endif /* __cplusplus */
204
#endif /* __FVM_NODAL_EXTRACT_H__ */