Code_Saturne
CFD tool
fvm_nodal_from_desc.h
Go to the documentation of this file.
1 #ifndef __FVM_NODAL_FROM_DESC_H__
2 #define __FVM_NODAL_FROM_DESC_H__
3 
4 /*============================================================================
5  * Initialization of a nodal connectivity definition based upon
6  * a (possibly partial) descending connectivity
7  *============================================================================*/
8 
9 /*
10  This file is part of Code_Saturne, a general-purpose CFD tool.
11 
12  Copyright (C) 1998-2012 EDF S.A.
13 
14  This program is free software; you can redistribute it and/or modify it under
15  the terms of the GNU General Public License as published by the Free Software
16  Foundation; either version 2 of the License, or (at your option) any later
17  version.
18 
19  This program is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22  details.
23 
24  You should have received a copy of the GNU General Public License along with
25  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
26  Street, Fifth Floor, Boston, MA 02110-1301, USA.
27 */
28 
29 /*----------------------------------------------------------------------------*/
30 
31 /*----------------------------------------------------------------------------
32  * Local headers
33  *----------------------------------------------------------------------------*/
34 
35 #include "fvm_defs.h"
36 #include "fvm_nodal.h"
37 
38 /*----------------------------------------------------------------------------*/
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #if 0
43 } /* Fake brace to force back Emacs auto-indentation back to column 0 */
44 #endif
45 #endif /* __cplusplus */
46 
47 /*=============================================================================
48  * Public function prototypes
49  *============================================================================*/
50 
51 /*----------------------------------------------------------------------------
52  * Convert and add cells from an descending connectivity mesh to a nodal mesh.
53  *
54  * If the optional filter list extr_cells[] argument is non-NULL, cells
55  * {extr_cells[0], extr_cells[1], extr_cells[n_extr_cells - 1]} are converted
56  * and added to the nodal mesh. If this filter is set to NULL, cells
57  * {1, 2, ..., n_extr_cells} are considered.
58  *
59  * In addition, an optional parent_cell_num[] array may also be given, in
60  * case the descending connectivity mesh definition is based on a temporary
61  * subset of a parent mesh, (corresponding to the parent_cell_num[] list,
62  * using 1 to n numbering), and the final nodal mesh element parent numbering
63  * should correspond to that parent mesh and not the temporary subset.
64  *
65  * parameters:
66  * this_nodal <-> nodal mesh structure
67  * n_extr_cells <-- count of cells to add
68  * extr_cells <-- optional filter list of cells to extract (1 to n)
69  * n_face_lists <-- number of face lists
70  * face_list_shift <-- face list to common number index shifts;
71  * size: n_face_lists
72  * face_vertex_idx <-- face -> vertex indexes (per face list)
73  * face_vertex_num <-- face -> vertex numbers (per face list)
74  * cell_face_idx <-- cell -> face indexes (1 to n)
75  * cell_face_num <-- cell -> face numbers (1 to n)
76  * cell_gc_id <-- cell -> group class ids, or NULL
77  * parent_cell_num <-- cell -> parent cell number (1 to n) if non-trivial
78  * (i.e. if cell definitions correspond to a subset
79  * of the parent mesh), NULL otherwise.
80  * cell_face_list --> numbers of faces defining polyhedra
81  *----------------------------------------------------------------------------*/
82 
83 void
85  const cs_lnum_t n_extr_cells,
86  const cs_lnum_t extr_cells[],
87  const int n_face_lists,
88  const cs_lnum_t face_list_shift[],
89  const cs_lnum_t *face_vertex_idx[],
90  const cs_lnum_t *face_vertex_num[],
91  const cs_lnum_t cell_face_idx[],
92  const cs_lnum_t cell_face_num[],
93  const int cell_gc_id[],
94  const cs_lnum_t parent_cell_num[],
95  cs_lnum_t *cell_face_list[]);
96 
97 /*----------------------------------------------------------------------------
98  * Convert and add faces from an descending connectivity mesh to a nodal mesh.
99  *
100  * If the optional filter list extr_faces[] argument is non-NULL, faces
101  * {extr_faces[0], extr_faces[1], extr_faces[n_extr_faces - 1]} are converted
102  * and added to the nodal mesh. If this filter is set to NULL, faces
103  * {1, 2, ..., n_extr_faces} are considered.
104  *
105  * In addition, an optional parent_face_num[] array may also be given, in
106  * case the descending connectivity mesh definition is based on a temporary
107  * subset of a parent mesh, (corresponding to the parent_face_num[] list,
108  * using 1 to n numbering), and the final nodal mesh element parent numbering
109  * should correspond to that parent mesh and not the temporary subset.
110  *
111  * parameters:
112  * this_nodal <-> nodal mesh structure
113  * n_extr_faces <-- count of faces to add
114  * extr_faces <-- optional filter list of faces to extract (1 to n)
115  * n_face_lists <-- number of face lists
116  * face_list_shift <-- face list to common number index shifts;
117  * size: n_face_lists
118  * face_vertex_idx <-- face -> vertex indexes (per face list)
119  * face_vertex_num <-- face -> vertex numbers (per face list)
120  * face_gc_id <-- face -> group class ids, or NULL (per face list)
121  * parent_face_num <-- face -> parent face number (1 to n) if non-trivial
122  * (i.e. if face definitions correspond to a subset
123  * of the parent mesh), NULL otherwise.
124  *----------------------------------------------------------------------------*/
125 
126 void
128  const cs_lnum_t n_extr_faces,
129  const cs_lnum_t extr_faces[],
130  const int n_face_lists,
131  const cs_lnum_t face_list_shift[],
132  const cs_lnum_t *face_vertex_idx[],
133  const cs_lnum_t *face_vertex_num[],
134  const int *face_gc_id[],
135  const cs_lnum_t parent_face_num[]);
136 
137 /*----------------------------------------------------------------------------
138  * Determination of a given cell's type.
139  *
140  * If the optional cell_vtx[8] array is given, it is filled with the vertex
141  * indexes of cell's vertices, unless the cell is a general polyhedron.
142  *
143  * parameters:
144  * cell_id <-- cell id (0 to n-1)
145  * n_face_lists <-- number of face lists
146  * face_list_shift <-- face list to common number index shifts;
147  * size: n_face_lists
148  * face_vertex_idx <-- face -> vertex indexes (per face list)
149  * face_vertex_num <-- face -> vertex numbers (per face list)
150  * cell_face_idx <-- cell -> face indexes (1 to n)
151  * cell_face_num <-- cell -> face numbers (1 to n)
152  * vertex_num --> nodal connectivity of cell, if not a general
153  * polyhedron
154  *
155  * returns:
156  * type of cell defined by cell_id
157  *----------------------------------------------------------------------------*/
158 
160 fvm_nodal_from_desc_cell(const cs_lnum_t cell_id,
161  const int n_face_lists,
162  const cs_lnum_t face_list_shift[],
163  const cs_lnum_t *face_vertex_idx[],
164  const cs_lnum_t *face_vertex_num[],
165  const cs_lnum_t cell_face_idx[],
166  const cs_lnum_t cell_face_num[],
167  cs_lnum_t vertex_num[8]);
168 
169 /*----------------------------------------------------------------------------*/
170 
171 #ifdef __cplusplus
172 }
173 #endif /* __cplusplus */
174 
175 #endif /* __FVM_NODAL_FROM_DESC_H__ */
Definition: fvm_nodal_priv.h:152
fvm_element_t
Definition: fvm_defs.h:49
int cs_lnum_t
Definition: cs_defs.h:260
void fvm_nodal_from_desc_add_faces(fvm_nodal_t *this_nodal, const cs_lnum_t n_extr_faces, const cs_lnum_t extr_faces[], const int n_face_lists, const cs_lnum_t face_list_shift[], const cs_lnum_t *face_vertex_idx[], const cs_lnum_t *face_vertex_num[], const int *face_gc_id[], const cs_lnum_t parent_face_num[])
Definition: fvm_nodal_from_desc.c:1558
fvm_element_t fvm_nodal_from_desc_cell(const cs_lnum_t cell_id, const int n_face_lists, const cs_lnum_t face_list_shift[], const cs_lnum_t *face_vertex_idx[], const cs_lnum_t *face_vertex_num[], const cs_lnum_t cell_face_idx[], const cs_lnum_t cell_face_num[], cs_lnum_t vertex_num[8])
Definition: fvm_nodal_from_desc.c:1806
void fvm_nodal_from_desc_add_cells(fvm_nodal_t *this_nodal, const cs_lnum_t n_extr_cells, const cs_lnum_t extr_cells[], const int n_face_lists, const cs_lnum_t face_list_shift[], const cs_lnum_t *face_vertex_idx[], const cs_lnum_t *face_vertex_num[], const cs_lnum_t cell_face_idx[], const cs_lnum_t cell_face_num[], const int cell_gc_id[], const cs_lnum_t parent_cell_num[], cs_lnum_t *cell_face_list[])
Definition: fvm_nodal_from_desc.c:1286