My Project
programmer's documentation
Loading...
Searching...
No Matches
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-2019 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 * If the optional filter list extr_cells[] argument is non-NULL, cells
52 * {extr_cells[0], extr_cells[1], extr_cells[n_extr_cells - 1]} are converted
53 * and added to the nodal mesh. If this filter is set to NULL, cells
54 * {1, 2, ..., n_extr_cells} are considered.
55 *
56 * In addition, an optional parent_cell_num[] array may also be given, in
57 * case the descending connectivity mesh definition is based on a temporary
58 * subset of a parent mesh, (corresponding to the parent_cell_num[] list,
59 * using 1 to n numbering), and the final nodal mesh element parent numbering
60 * should correspond to that parent mesh and not the temporary subset.
61 *
62 * parameters:
63 * this_nodal <-> nodal mesh structure
64 * n_extr_cells <-- count of cells to add
65 * extr_cells <-- optional filter list of cells to extract (1 to n)
66 * n_face_lists <-- number of face lists
67 * face_list_shift <-- face list to common number index shifts;
68 * size: n_face_lists
69 * face_vertex_idx <-- face -> vertex indexes (per face list)
70 * face_vertex <-- face -> vertex ids (per face list)
71 * cell_face_idx <-- cell -> face indexes (1 to n)
72 * cell_face_num <-- cell -> face numbers (1 to n)
73 * cell_gc_id <-- cell -> group class ids, or NULL
74 * parent_cell_num <-- cell -> parent cell number (1 to n) if non-trivial
75 * (i.e. if cell definitions correspond to a subset
76 * of the parent mesh), NULL otherwise.
77 * cell_face_list --> numbers of faces defining polyhedra
78 *----------------------------------------------------------------------------*/
79
80void
81fvm_nodal_from_desc_add_cells(fvm_nodal_t *this_nodal,
82 const cs_lnum_t n_extr_cells,
83 const cs_lnum_t extr_cells[],
84 const int n_face_lists,
85 const cs_lnum_t face_list_shift[],
86 const cs_lnum_t *face_vertex_idx[],
87 const cs_lnum_t *face_vertex_num[],
88 const cs_lnum_t cell_face_idx[],
89 const cs_lnum_t cell_face_num[],
90 const int cell_gc_id[],
91 const cs_lnum_t parent_cell_num[],
92 cs_lnum_t *cell_face_list[]);
93
94/*----------------------------------------------------------------------------
95 * Convert and add faces from an descending connectivity mesh to a nodal mesh.
96 *
97 * If the optional filter list extr_faces[] argument is non-NULL, faces
98 * {extr_faces[0], extr_faces[1], extr_faces[n_extr_faces - 1]} are converted
99 * and added to the nodal mesh. If this filter is set to NULL, faces
100 * {1, 2, ..., n_extr_faces} are considered.
101 *
102 * In addition, an optional parent_face_num[] array may also be given, in
103 * case the descending connectivity mesh definition is based on a temporary
104 * subset of a parent mesh, (corresponding to the parent_face_num[] list,
105 * using 1 to n numbering), and the final nodal mesh element parent numbering
106 * should correspond to that parent mesh and not the temporary subset.
107 *
108 * parameters:
109 * this_nodal <-> nodal mesh structure
110 * n_extr_faces <-- count of faces to add
111 * extr_faces <-- optional filter list of faces to extract (1 to n)
112 * n_face_lists <-- number of face lists
113 * face_list_shift <-- face list to common number index shifts;
114 * size: n_face_lists
115 * face_vertex_idx <-- face -> vertex indexes (per face list)
116 * face_vertex <-- face -> vertex ids (per face list)
117 * face_gc_id <-- face -> group class ids, or NULL (per face list)
118 * parent_face_num <-- face -> parent face number (1 to n) if non-trivial
119 * (i.e. if face definitions correspond to a subset
120 * of the parent mesh), NULL otherwise.
121 *----------------------------------------------------------------------------*/
122
123void
124fvm_nodal_from_desc_add_faces(fvm_nodal_t *this_nodal,
125 const cs_lnum_t n_extr_faces,
126 const cs_lnum_t extr_faces[],
127 const int n_face_lists,
128 const cs_lnum_t face_list_shift[],
129 const cs_lnum_t *face_vertex_idx[],
130 const cs_lnum_t *face_vertex_num[],
131 const int *face_gc_id[],
132 const cs_lnum_t parent_face_num[]);
133
134/*----------------------------------------------------------------------------
135 * Determination of a given cell's type.
136 *
137 * If the optional cell_vtx[8] array is given, it is filled with the vertex
138 * indexes of cell's vertices, unless the cell is a general polyhedron.
139 *
140 * parameters:
141 * cell_id <-- cell id (0 to n-1)
142 * n_face_lists <-- number of face lists
143 * face_list_shift <-- face list to common number index shifts;
144 * size: n_face_lists
145 * face_vertex_idx <-- face -> vertex indexes (per face list)
146 * face_vertex <-- face -> vertex ids (per face list)
147 * cell_face_idx <-- cell -> face indexes (1 to n)
148 * cell_face_num <-- cell -> face numbers (1 to n)
149 * vertex_num --> nodal connectivity of cell, if not a general
150 * polyhedron
151 *
152 * returns:
153 * type of cell defined by cell_id
154 *----------------------------------------------------------------------------*/
155
158 const int n_face_lists,
159 const cs_lnum_t face_list_shift[],
160 const cs_lnum_t *face_vertex_idx[],
161 const cs_lnum_t *face_vertex_num[],
162 const cs_lnum_t cell_face_idx[],
163 const cs_lnum_t cell_face_num[],
164 cs_lnum_t vertex_num[8]);
165
166/*----------------------------------------------------------------------------*/
167
169
170#endif /* __FVM_NODAL_FROM_DESC_H__ */
#define BEGIN_C_DECLS
Definition cs_defs.h:467
#define END_C_DECLS
Definition cs_defs.h:468
int cs_lnum_t
local mesh entity id
Definition cs_defs.h:298
fvm_element_t
Definition fvm_defs.h:48
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:1553
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:1801
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:1281