~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to include/base/cs_mesh_connect.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*============================================================================
2
 
 *
3
 
 *     This file is part of the Code_Saturne Kernel, element of the
4
 
 *     Code_Saturne CFD tool.
5
 
 *
6
 
 *     Copyright (C) 1998-2009 EDF S.A., France
7
 
 *
8
 
 *     contact: saturne-support@edf.fr
9
 
 *
10
 
 *     The Code_Saturne Kernel is free software; you can redistribute it
11
 
 *     and/or modify it under the terms of the GNU General Public License
12
 
 *     as published by the Free Software Foundation; either version 2 of
13
 
 *     the License, or (at your option) any later version.
14
 
 *
15
 
 *     The Code_Saturne Kernel is distributed in the hope that it will be
16
 
 *     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
 
 *     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
 *     GNU General Public License for more details.
19
 
 *
20
 
 *     You should have received a copy of the GNU General Public License
21
 
 *     along with the Code_Saturne Kernel; if not, write to the
22
 
 *     Free Software Foundation, Inc.,
23
 
 *     51 Franklin St, Fifth Floor,
24
 
 *     Boston, MA  02110-1301  USA
25
 
 *
26
 
 *============================================================================*/
27
 
 
28
 
#ifndef __CS_MESH_CONNECT_H__
29
 
#define __CS_MESH_CONNECT_H__
30
 
 
31
 
/*============================================================================
32
 
 * Extract nodal connectivity mesh representations from a native mesh.
33
 
 *============================================================================*/
34
 
 
35
 
/*----------------------------------------------------------------------------
36
 
 * FVM library headers
37
 
 *----------------------------------------------------------------------------*/
38
 
 
39
 
#include "fvm_nodal.h"
40
 
 
41
 
/*----------------------------------------------------------------------------
42
 
 *  Local headers
43
 
 *----------------------------------------------------------------------------*/
44
 
 
45
 
#include "cs_base.h"
46
 
#include "cs_mesh.h"
47
 
 
48
 
/*----------------------------------------------------------------------------*/
49
 
 
50
 
BEGIN_C_DECLS
51
 
 
52
 
/*=============================================================================
53
 
 * Macro definitions
54
 
 *============================================================================*/
55
 
 
56
 
/*============================================================================
57
 
 * Type definitions
58
 
 *============================================================================*/
59
 
 
60
 
/*============================================================================
61
 
 * Static global variables
62
 
 *============================================================================*/
63
 
 
64
 
/*=============================================================================
65
 
 * Public function prototypes
66
 
 *============================================================================*/
67
 
 
68
 
/*----------------------------------------------------------------------------
69
 
 * Extract a mesh's "cells -> faces" connectivity.
70
 
 *
71
 
 * We consider a common numbering for internal and boundary faces, in which
72
 
 * boundary faces are defined first. The common id for the i-th boundary
73
 
 * face is thus i, and that of the j-th interior face is n_b_faces + j.
74
 
 *
75
 
 * If ind_cel_extr != NULL, then:
76
 
 * --- ind_cel_extr[cell_id] = id in the list to extract (0 to n-1)
77
 
 *     if cell cell_id should be extracted
78
 
 * --- ind_cel_extr[cell_id] = -1 if cells cell_id should be ignored
79
 
 *
80
 
 * parameters:
81
 
 *   mesh             <-- pointer to mesh structure
82
 
 *   extr_cell_size   <-- size of extr_cell_id[] array
83
 
 *   extr_cell_id     <-- extr_cell_id = ids of extracted cells, or -1
84
 
 *   p_cell_faces_idx --> cells -> faces index
85
 
 *   p_cell_faces_val --> cells -> faces connectivity
86
 
 *----------------------------------------------------------------------------*/
87
 
 
88
 
void
89
 
cs_mesh_connect_get_cell_faces(const cs_mesh_t             *mesh,
90
 
                               fvm_lnum_t                   extr_cell_size,
91
 
                               const fvm_lnum_t             extr_cell_id[],
92
 
                               fvm_lnum_t          * *const p_cell_faces_idx,
93
 
                               fvm_lnum_t          * *const p_cell_faces_val);
94
 
 
95
 
/*----------------------------------------------------------------------------
96
 
 * Build a nodal connectivity structure from a subset of a mesh's cells.
97
 
 *
98
 
 * The list of cells to extract is optional (if none is given, all cells
99
 
 * faces are extracted by default); it does not need to be ordered on input,
100
 
 * but is always ordered on exit (as cells are extracted by increasing number
101
 
 * traversal, the list is reordered to ensure the coherency of the extracted
102
 
 * mesh's link to its parent cells, built using this list).
103
 
 *
104
 
 * parameters:
105
 
 *   mesh           <-- base mesh
106
 
 *   name           <-- extracted mesh name
107
 
 *   cell_list_size <-- size of cell_list[] array
108
 
 *   cell_list      <-> list of cells (1 to n), or NULL
109
 
 *
110
 
 * returns:
111
 
 *   pointer to extracted nodal mesh
112
 
 *----------------------------------------------------------------------------*/
113
 
 
114
 
fvm_nodal_t *
115
 
cs_mesh_connect_cells_to_nodal(const cs_mesh_t  *mesh,
116
 
                               const char       *name,
117
 
                               fvm_lnum_t        cell_list_size,
118
 
                               fvm_lnum_t        cell_list[]);
119
 
 
120
 
/*----------------------------------------------------------------------------
121
 
 * Build a nodal connectivity structure from a subset of a mesh's faces.
122
 
 *
123
 
 * The lists of faces to extract are optional (if none is given, boundary
124
 
 * faces are extracted by default); they do not need to be ordered on input,
125
 
 * but they are always ordered on exit (as faces are extracted by increasing
126
 
 * number traversal, the lists are reordered to ensure the coherency of
127
 
 * the extracted mesh's link to its parent faces, built using these lists).
128
 
 *
129
 
 * parameters:
130
 
 *   mesh             <-- base mesh
131
 
 *   name             <-- extracted mesh name
132
 
 *   i_face_list_size <-- size of i_face_list[] array
133
 
 *   b_face_list_size <-- size of b_face_list[] array
134
 
 *   i_face_list      <-> list of interior faces (1 to n), or NULL
135
 
 *   b_face_list      <-> list of boundary faces (1 to n), or NULL
136
 
 *
137
 
 * returns:
138
 
 *   pointer to extracted nodal mesh
139
 
 *----------------------------------------------------------------------------*/
140
 
 
141
 
fvm_nodal_t *
142
 
cs_mesh_connect_faces_to_nodal(const cs_mesh_t  *mesh,
143
 
                               const char       *name,
144
 
                               fvm_lnum_t        i_face_list_size,
145
 
                               fvm_lnum_t        b_face_list_size,
146
 
                               fvm_lnum_t        i_face_list[],
147
 
                               fvm_lnum_t        b_face_list[]);
148
 
 
149
 
/*----------------------------------------------------------------------------*/
150
 
 
151
 
END_C_DECLS
152
 
 
153
 
#endif /* __CS_MESH_CONNECT_H__ */