8.3
general documentation
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-2024 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#include "cs_defs.h"
32
33/*----------------------------------------------------------------------------
34 * Local headers
35 *----------------------------------------------------------------------------*/
36
37#include "fvm_defs.h"
38#include "fvm_nodal.h"
39
40/*----------------------------------------------------------------------------*/
41
43
44/*=============================================================================
45 * Public function prototypes
46 *============================================================================*/
47
48/*----------------------------------------------------------------------------
49 * Convert and add cells from an descending connectivity mesh to a nodal mesh.
50 *
51 * An optional parent_cell_num[] array may also be given, in
52 * case the descending connectivity mesh definition is based on a temporary
53 * subset of a parent mesh, (corresponding to the parent_cell_num[] list,
54 * using 1 to n numbering), and the final nodal mesh element parent numbering
55 * should correspond to that parent mesh and not the temporary subset.
56 *
57 * parameters:
58 * this_nodal <-> nodal mesh structure
59 * n_extr_cells <-- count of cells to add
60 * n_face_lists <-- number of face lists
61 * face_list_shift <-- face list to common number index shifts;
62 * size: n_face_lists + 1
63 * face_vertex_idx <-- face -> vertex indexes (per face list)
64 * face_vertex <-- face -> vertex ids (per face list)
65 * cell_face_idx <-- cell -> face indexes (1 to n)
66 * cell_face_num <-- cell -> face numbers (1 to n)
67 * cell_gc_id <-- cell -> group class ids, or NULL
68 * parent_cell_id <-- cell -> parent cell id (0 to n-1) if non-trivial
69 * (i.e. if cell definitions correspond to a subset
70 * of the parent mesh), NULL otherwise.
71 * cell_face_list --> numbers of faces defining polyhedra
72 *----------------------------------------------------------------------------*/
73
74void
75fvm_nodal_from_desc_add_cells(fvm_nodal_t *this_nodal,
76 const cs_lnum_t n_extr_cells,
77 const int n_face_lists,
78 const cs_lnum_t face_list_shift[],
79 const cs_lnum_t *face_vertex_idx[],
80 const cs_lnum_t *face_vertex[],
81 const cs_lnum_t cell_face_idx[],
82 const cs_lnum_t cell_face_num[],
83 const int cell_gc_id[],
84 const cs_lnum_t parent_cell_id[],
85 cs_lnum_t *cell_face_list[]);
86
87/*----------------------------------------------------------------------------
88 * Convert and add faces from an descending connectivity mesh to a nodal mesh.
89 *
90 * If the optional filter list extr_faces[] argument is non-null, faces
91 * {extr_faces[0], extr_faces[1], extr_faces[n_extr_faces - 1]} are converted
92 * and added to the nodal mesh. If this filter is set to NULL, faces
93 * {1, 2, ..., n_extr_faces} are considered.
94 *
95 * In addition, an optional parent_face_num[] array may also be given, in
96 * case the descending connectivity mesh definition is based on a temporary
97 * subset of a parent mesh, (corresponding to the parent_face_num[] list,
98 * using 1 to n numbering), and the final nodal mesh element parent numbering
99 * should correspond to that parent mesh and not the temporary subset.
100 *
101 * parameters:
102 * this_nodal <-> nodal mesh structure
103 * boundary_flag <-- -1 if unspecified, 0 if faces are not on boundary,
104 * 1 if faces are on boundary
105 * n_extr_faces <-- count of faces to add
106 * extr_faces <-- optional filter list of faces to extract (0 to n-1)
107 * n_face_lists <-- number of face lists
108 * face_list_shift <-- face list to common number index shifts;
109 * size: n_face_lists
110 * face_vertex_idx <-- face -> vertex indexes (per face list)
111 * face_vertex <-- face -> vertex ids (per face list)
112 * face_gc_id <-- face -> group class ids, or NULL (per face list)
113 * parent_face_id <-- face -> parent face id (0 to n-1) if non-trivial
114 * (i.e. if face definitions correspond to a subset
115 * of the parent mesh), NULL otherwise.
116 *----------------------------------------------------------------------------*/
117
118void
119fvm_nodal_from_desc_add_faces(fvm_nodal_t *this_nodal,
120 int boundary_flag,
121 const cs_lnum_t n_extr_faces,
122 const cs_lnum_t extr_faces[],
123 const int n_face_lists,
124 const cs_lnum_t face_list_shift[],
125 const cs_lnum_t *face_vertex_idx[],
126 const cs_lnum_t *face_vertex_num[],
127 const int *face_gc_id[],
128 const cs_lnum_t parent_face_id[]);
129
130/*----------------------------------------------------------------------------
131 * Determination of a given cell's type.
132 *
133 * If the optional cell_vtx[8] array is given, it is filled with the vertex
134 * indexes of cell's vertices, unless the cell is a general polyhedron.
135 *
136 * parameters:
137 * cell_id <-- cell id (0 to n-1)
138 * n_face_lists <-- number of face lists
139 * face_list_shift <-- face list to common number index shifts;
140 * size: n_face_lists
141 * face_vertex_idx <-- face -> vertex indexes (per face list)
142 * face_vertex <-- face -> vertex ids (per face list)
143 * cell_face_idx <-- cell -> face indexes (1 to n)
144 * cell_face_num <-- cell -> face numbers (1 to n)
145 * vertex_num --> nodal connectivity of cell, if not a general
146 * polyhedron
147 *
148 * returns:
149 * type of cell defined by cell_id
150 *----------------------------------------------------------------------------*/
151
154 const int n_face_lists,
155 const cs_lnum_t face_list_shift[],
156 const cs_lnum_t *face_vertex_idx[],
157 const cs_lnum_t *face_vertex_num[],
158 const cs_lnum_t cell_face_idx[],
159 const cs_lnum_t cell_face_num[],
160 cs_lnum_t vertex_num[8]);
161
162/*----------------------------------------------------------------------------*/
163
165
166#endif /* __FVM_NODAL_FROM_DESC_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
#define END_C_DECLS
Definition: cs_defs.h:543
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:335
fvm_element_t
Definition: fvm_defs.h:48
void fvm_nodal_from_desc_add_faces(fvm_nodal_t *this_nodal, int boundary_flag, 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_id[])
Definition: fvm_nodal_from_desc.cpp:1528
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.cpp:1777
void fvm_nodal_from_desc_add_cells(fvm_nodal_t *this_nodal, const cs_lnum_t n_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[], 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_id[], cs_lnum_t *cell_face_list[])
Definition: fvm_nodal_from_desc.cpp:1266