Code_Saturne
CFD tool
cs_join_merge.h
Go to the documentation of this file.
1 #ifndef __CS_JOIN_MERGE_H__
2 #define __CS_JOIN_MERGE_H__
3 
4 /*============================================================================
5  * Set of subroutines for:
6  * - fusing equivalent vertices,
7  * - managing tolerance reduction,
8  *===========================================================================*/
9 
10 /*
11  This file is part of Code_Saturne, a general-purpose CFD tool.
12 
13  Copyright (C) 1998-2012 EDF S.A.
14 
15  This program is free software; you can redistribute it and/or modify it under
16  the terms of the GNU General Public License as published by the Free Software
17  Foundation; either version 2 of the License, or (at your option) any later
18  version.
19 
20  This program is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
23  details.
24 
25  You should have received a copy of the GNU General Public License along with
26  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
27  Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29 
30 /*----------------------------------------------------------------------------*/
31 
32 /*----------------------------------------------------------------------------
33  * Standard C library headers
34  *---------------------------------------------------------------------------*/
35 
36 /*----------------------------------------------------------------------------
37  * BFT library headers
38  *---------------------------------------------------------------------------*/
39 
40 /*----------------------------------------------------------------------------
41  * Local headers
42  *---------------------------------------------------------------------------*/
43 
44 #include "cs_base.h"
45 #include "cs_join_intersect.h"
46 #include "cs_join_mesh.h"
47 #include "cs_join_set.h"
48 #include "cs_join_util.h"
49 
50 /*---------------------------------------------------------------------------*/
51 
53 
54 /*============================================================================
55  * Macro and type definitions
56  *===========================================================================*/
57 
58 /*============================================================================
59  * Public function prototypes
60  *===========================================================================*/
61 
62 /*----------------------------------------------------------------------------
63  * Creation of new vertices.
64  *
65  * Update list of equivalent vertices, and assign a vertex (existing or
66  * newly created) to each intersection.
67  *
68  * parameters:
69  * verbosity <-- verbosity level
70  * edges <-- list of edges
71  * work <-> joining mesh maintaining initial vertex data
72  * inter_set <-> cs_join_inter_set_t structure including
73  * data on edge-edge intersections
74  * init_max_vtx_gnum <-- initial max. global number for vertices
75  * p_n_g_new_vertices <-> pointer to the global number of new vertices
76  * p_vtx_eset <-> pointer to a structure dealing with vertex
77  * equivalences
78  *---------------------------------------------------------------------------*/
79 
80 void
81 cs_join_create_new_vertices(int verbosity,
82  const cs_join_edges_t *edges,
83  cs_join_mesh_t *work,
84  cs_join_inter_set_t *inter_set,
85  cs_gnum_t init_max_vtx_gnum,
86  cs_gnum_t *p_n_g_new_vertices,
87  cs_join_eset_t **p_vtx_eset);
88 
89 /*----------------------------------------------------------------------------
90  * Merge of equivalent vertices (and tolerance reduction if necessary)
91  *
92  * Define a new cs_join_vertex_t structure (stored in "work" structure).
93  * Returns an updated cs_join_mesh_t and cs_join_edges_t structures.
94  *
95  * parameters:
96  * param <-- set of user-defined parameters for the joining
97  * n_g_vertices_tot <-- global number of vertices (initial parent mesh)
98  * work <-> pointer to a cs_join_mesh_t structure
99  * vtx_eset <-- structure storing equivalences between vertices
100  * (two vertices are equivalent if they are within
101  * each other's tolerance)
102  *---------------------------------------------------------------------------*/
103 
104 void
106  cs_gnum_t n_g_vertices_tot,
107  cs_join_mesh_t *work,
108  const cs_join_eset_t *vtx_eset);
109 
110 /*----------------------------------------------------------------------------
111  * Merge of equivalent vertices (and reduction of tolerance if necessary)
112  *
113  * Define a new cs_join_vertex_t structure (stored in "work" structure)
114  * Returns an updated cs_join_mesh_t and cs_join_edges_t structures.
115  *
116  * parameters:
117  * param <-- set of user-defined parameters for the joining
118  * n_iwm_vertices <-- initial number of vertices (work mesh struct.)
119  * iwm_vtx_gnum <-- initial global vertex num. (work mesh struct)
120  * init_max_vtx_gnum <-- initial max. global number for vertices
121  * rank_face_gnum_index <-- index on face global numbering to determine
122  * the related rank
123  * p_mesh <-> pointer to cs_join_mesh_t structure
124  * p_edges <-> pointer to cs_join_edges_t structure
125  * p_inter_edges <-> pointer to a cs_join_inter_edges_t struct.
126  * p_local_mesh <-> pointer to a cs_join_mesh_t structure
127  * p_o2n_vtx_gnum --> array on blocks on the new global vertex
128  * numbering for the init. vertices (before inter.)
129  *---------------------------------------------------------------------------*/
130 
131 void
133  cs_int_t n_iwm_vertices,
134  const cs_gnum_t iwm_vtx_gnum[],
135  cs_gnum_t init_max_vtx_gnum,
136  const cs_gnum_t rank_face_gnum_index[],
137  cs_join_mesh_t **p_mesh,
138  cs_join_edges_t **p_edges,
139  cs_join_inter_edges_t **p_inter_edges,
140  cs_join_mesh_t **p_local_mesh,
141  cs_gnum_t *p_o2n_vtx_gnum[]);
142 
143 /*---------------------------------------------------------------------------*/
144 
146 
147 #endif /* __CS_JOIN_MERGE_H__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:365
BEGIN_C_DECLS void cs_join_create_new_vertices(int verbosity, const cs_join_edges_t *edges, cs_join_mesh_t *work, cs_join_inter_set_t *inter_set, cs_gnum_t init_max_vtx_gnum, cs_gnum_t *p_n_g_new_vertices, cs_join_eset_t **p_vtx_eset)
Definition: cs_join_merge.c:3031
Definition: cs_join_mesh.h:80
int cs_int_t
Definition: cs_defs.h:263
Definition: cs_join_intersect.h:73
Definition: cs_join_mesh.h:111
Definition: cs_join_set.h:75
unsigned cs_gnum_t
Definition: cs_defs.h:255
void cs_join_merge_update_struct(cs_join_param_t param, cs_int_t n_iwm_vertices, const cs_gnum_t iwm_vtx_gnum[], cs_gnum_t init_max_vtx_gnum, const cs_gnum_t rank_face_gnum_index[], cs_join_mesh_t **p_mesh, cs_join_edges_t **p_edges, cs_join_inter_edges_t **p_inter_edges, cs_join_mesh_t **p_local_mesh, cs_gnum_t *p_o2n_vtx_gnum[])
Definition: cs_join_merge.c:3360
#define END_C_DECLS
Definition: cs_defs.h:366
Definition: cs_join_intersect.h:87
Definition: cs_join_util.h:86
void cs_join_merge_vertices(cs_join_param_t param, cs_gnum_t n_g_vertices_tot, cs_join_mesh_t *work, const cs_join_eset_t *vtx_eset)
Definition: cs_join_merge.c:3230