8.1
general documentation
cs_mesh_connect.h
Go to the documentation of this file.
1 #ifndef __CS_MESH_CONNECT_H__
2 #define __CS_MESH_CONNECT_H__
3 
4 /*============================================================================
5  * Extract nodal connectivity mesh representations from a native mesh.
6  *============================================================================*/
7 
8 /*
9  This file is part of code_saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2023 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_nodal.h"
35 
36 #include "cs_base.h"
37 #include "cs_mesh.h"
38 
39 /*----------------------------------------------------------------------------*/
40 
42 
43 /*=============================================================================
44  * Macro definitions
45  *============================================================================*/
46 
47 /*============================================================================
48  * Type definitions
49  *============================================================================*/
50 
51 /*============================================================================
52  * Static global variables
53  *============================================================================*/
54 
55 /*=============================================================================
56  * Public function prototypes
57  *============================================================================*/
58 
59 /*----------------------------------------------------------------------------
60  * Extract a mesh's "cells -> faces" connectivity.
61  *
62  * We consider a common numbering for internal and boundary faces, in which
63  * boundary faces are defined first. The common id for the i-th boundary
64  * face is thus i, and that of the j-th interior face is n_b_faces + j.
65  *
66  * If ind_cel_extr != NULL, then:
67  * --- ind_cel_extr[cell_id] = id in the list to extract (0 to n-1)
68  * if cell cell_id should be extracted
69  * --- ind_cel_extr[cell_id] = -1 if cells cell_id should be ignored
70  *
71  * parameters:
72  * mesh <-- pointer to mesh structure
73  * extr_cell_size <-- size of extr_cell_id[] array
74  * extr_cell_id <-- extr_cell_id = ids of extracted cells, or -1
75  * p_cell_faces_idx --> cells -> faces index
76  * p_cell_faces_val --> cells -> faces connectivity
77  *----------------------------------------------------------------------------*/
78 
79 void
81  cs_lnum_t extr_cell_size,
82  const cs_lnum_t extr_cell_id[],
83  cs_lnum_t **const p_cell_faces_idx,
84  cs_lnum_t **const p_cell_faces_val);
85 
86 /*----------------------------------------------------------------------------
87  * Build a nodal connectivity structure from a subset of a mesh's cells.
88  *
89  * The list of cells to extract is optional (if none is given, all cells
90  * faces are extracted by default).
91  *
92  * parameters:
93  * mesh <-- base mesh
94  * name <-- extracted mesh name
95  * include_families <-- include family info if true
96  * cell_list_size <-- size of cell_list[] array
97  * cell_list <-- list of cells (0 to n-1), or NULL
98  *
99  * returns:
100  * pointer to extracted nodal mesh
101  *----------------------------------------------------------------------------*/
102 
103 fvm_nodal_t *
105  const char *name,
106  bool include_families,
107  cs_lnum_t cell_list_size,
108  const cs_lnum_t cell_list[]);
109 
110 /*----------------------------------------------------------------------------
111  * Build a nodal connectivity structure from a subset of a mesh's faces.
112  *
113  * The lists of faces to extract are optional (if none is given, boundary
114  * faces are extracted by default).
115  *
116  * parameters:
117  * mesh <-- base mesh
118  * name <-- extracted mesh name
119  * include_families <-- include family info if true
120  * i_face_list_size <-- size of i_face_list[] array
121  * b_face_list_size <-- size of b_face_list[] array
122  * i_face_list <-- list of interior faces (0 to n-1), or NULL
123  * b_face_list <-- list of boundary faces (0 to n-1), or NULL
124  *
125  * returns:
126  * pointer to extracted nodal mesh
127  *----------------------------------------------------------------------------*/
128 
129 fvm_nodal_t *
131  const char *name,
132  bool include_families,
133  cs_lnum_t i_face_list_size,
134  cs_lnum_t b_face_list_size,
135  const cs_lnum_t i_face_list[],
136  const cs_lnum_t b_face_list[]);
137 
138 /*----------------------------------------------------------------------------*/
150 /*----------------------------------------------------------------------------*/
151 
152 void
154  const char v_flag[],
155  cs_lnum_t **v2c_idx,
156  cs_lnum_t **v2c);
157 
158 /*----------------------------------------------------------------------------*/
159 
161 
162 #endif /* __CS_MESH_CONNECT_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
#define END_C_DECLS
Definition: cs_defs.h:515
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
fvm_nodal_t * cs_mesh_connect_cells_to_nodal(const cs_mesh_t *mesh, const char *name, bool include_families, cs_lnum_t cell_list_size, const cs_lnum_t cell_list[])
Definition: cs_mesh_connect.c:441
void cs_mesh_connect_get_cell_faces(const cs_mesh_t *mesh, cs_lnum_t extr_cell_size, const cs_lnum_t extr_cell_id[], cs_lnum_t **const p_cell_faces_idx, cs_lnum_t **const p_cell_faces_val)
Definition: cs_mesh_connect.c:286
fvm_nodal_t * cs_mesh_connect_faces_to_nodal(const cs_mesh_t *mesh, const char *name, bool include_families, cs_lnum_t i_face_list_size, cs_lnum_t b_face_list_size, const cs_lnum_t i_face_list[], const cs_lnum_t b_face_list[])
Definition: cs_mesh_connect.c:689
void cs_mesh_connect_vertices_to_cells(cs_mesh_t *mesh, const char v_flag[], cs_lnum_t **v2c_idx, cs_lnum_t **v2c)
Build a vertex to cell connectivity for marked vertices only.
Definition: cs_mesh_connect.c:755
Definition: mesh.f90:26
Definition: cs_mesh.h:85