My Project
programmer's documentation
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-2019 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  * Local headers
38  *---------------------------------------------------------------------------*/
39 
40 #include "cs_base.h"
41 #include "cs_join_intersect.h"
42 #include "cs_join_mesh.h"
43 #include "cs_join_set.h"
44 #include "cs_join_util.h"
45 
46 /*---------------------------------------------------------------------------*/
47 
49 
50 /*============================================================================
51  * Macro and type definitions
52  *===========================================================================*/
53 
54 /*============================================================================
55  * Public function prototypes
56  *===========================================================================*/
57 
58 /*----------------------------------------------------------------------------
59  * Creation of new vertices.
60  *
61  * Update list of equivalent vertices, and assign a vertex (existing or
62  * newly created) to each intersection.
63  *
64  * parameters:
65  * verbosity <-- verbosity level
66  * edges <-- list of edges
67  * work <-> joining mesh maintaining initial vertex data
68  * inter_set <-> cs_join_inter_set_t structure including
69  * data on edge-edge intersections
70  * init_max_vtx_gnum <-- initial max. global number for vertices
71  * p_n_g_new_vertices <-> pointer to the global number of new vertices
72  * p_vtx_eset <-> pointer to a structure dealing with vertex
73  * equivalences
74  *---------------------------------------------------------------------------*/
75 
76 void
77 cs_join_create_new_vertices(int verbosity,
78  const cs_join_edges_t *edges,
79  cs_join_mesh_t *work,
80  cs_join_inter_set_t *inter_set,
81  cs_gnum_t init_max_vtx_gnum,
82  cs_gnum_t *p_n_g_new_vertices,
83  cs_join_eset_t **p_vtx_eset);
84 
85 /*----------------------------------------------------------------------------
86  * Merge of equivalent vertices (and tolerance reduction if necessary)
87  *
88  * Define a new cs_join_vertex_t structure (stored in "work" structure).
89  * Returns an updated cs_join_mesh_t and cs_join_edges_t structures.
90  *
91  * parameters:
92  * param <-- set of user-defined parameters for the joining
93  * n_g_vertices_tot <-- global number of vertices (initial parent mesh)
94  * work <-> pointer to a cs_join_mesh_t structure
95  * vtx_eset <-- structure storing equivalences between vertices
96  * (two vertices are equivalent if they are within
97  * each other's tolerance)
98  *---------------------------------------------------------------------------*/
99 
100 void
102  cs_gnum_t n_g_vertices_tot,
103  cs_join_mesh_t *work,
104  const cs_join_eset_t *vtx_eset);
105 
106 /*----------------------------------------------------------------------------
107  * Merge of equivalent vertices (and reduction of tolerance if necessary)
108  *
109  * Define a new cs_join_vertex_t structure (stored in "work" structure)
110  * Returns an updated cs_join_mesh_t and cs_join_edges_t structures.
111  *
112  * parameters:
113  * param <-- set of user-defined parameters for the joining
114  * n_iwm_vertices <-- initial number of vertices (work mesh struct.)
115  * iwm_vtx_gnum <-- initial global vertex num. (work mesh struct)
116  * init_max_vtx_gnum <-- initial max. global number for vertices
117  * rank_face_gnum_index <-- index on face global numbering to determine
118  * the related rank
119  * p_mesh <-> pointer to cs_join_mesh_t structure
120  * p_edges <-> pointer to cs_join_edges_t structure
121  * p_inter_edges <-> pointer to a cs_join_inter_edges_t struct.
122  * p_local_mesh <-> pointer to a cs_join_mesh_t structure
123  * p_o2n_vtx_gnum --> array on blocks on the new global vertex
124  * numbering for the init. vertices (before inter.)
125  *---------------------------------------------------------------------------*/
126 
127 void
129  cs_lnum_t n_iwm_vertices,
130  const cs_gnum_t iwm_vtx_gnum[],
131  cs_gnum_t init_max_vtx_gnum,
132  const cs_gnum_t rank_face_gnum_index[],
133  cs_join_mesh_t **p_mesh,
134  cs_join_edges_t **p_edges,
135  cs_join_inter_edges_t **p_inter_edges,
136  cs_join_mesh_t **p_local_mesh,
137  cs_gnum_t *p_o2n_vtx_gnum[]);
138 
139 /*---------------------------------------------------------------------------*/
140 
142 
143 #endif /* __CS_JOIN_MERGE_H__ */
cs_join_intersect.h
cs_join_merge_vertices
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:3233
END_C_DECLS
#define END_C_DECLS
Definition: cs_defs.h:468
cs_join_create_new_vertices
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:3033
BEGIN_C_DECLS
#define BEGIN_C_DECLS
Definition: cs_defs.h:467
cs_join_util.h
cs_gnum_t
unsigned long cs_gnum_t
global mesh entity number
Definition: cs_defs.h:286
cs_lnum_t
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:298
cs_join_mesh.h
cs_join_param_t
Definition: cs_join_util.h:115
cs_join_merge_update_struct
void cs_join_merge_update_struct(cs_join_param_t param, cs_lnum_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:3363
cs_join_set.h
cs_base.h