8.0
general documentation
cs_medcoupling_intersector.h
Go to the documentation of this file.
1 #ifndef __CS_MEDCOUPLING_INTERSECTOR_HXX__
2 #define __CS_MEDCOUPLING_INTERSECTOR_HXX__
3 
4 /*============================================================================
5  * Interpolation using MEDCoupling Intersector.
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 "cs_defs.h"
35 #include "fvm_writer.h"
36 
37 /*----------------------------------------------------------------------------*/
38 
40 
41 /*============================================================================
42  * Type definitions
43  *============================================================================*/
44 
45 typedef enum {
46 
53 
54 typedef enum {
55 
60 
62 
63 /*============================================================================
64  * Structure definitions
65  *============================================================================*/
66 
67 typedef struct _cs_medcoupling_intersector_t cs_medcoupling_intersector_t;
68 
69 /*============================================================================
70  * Structure definitions
71  *============================================================================*/
72 
73 /*----------------------------------------------------------------------------*/
83 /*----------------------------------------------------------------------------*/
84 
85 void
86 cs_medcoupling_intersector_add_vol(const char *name,
87  const char *medfile_path,
88  const char *interp_method,
89  const char *select_criteria);
90 
91 /*----------------------------------------------------------------------------*/
101 /*----------------------------------------------------------------------------*/
102 
103 void
104 cs_medcoupling_intersector_add_surf(const char *name,
105  const char *medfile_path,
106  const char *interp_method,
107  const char *select_criteria);
108 
109 /*----------------------------------------------------------------------------*/
119 /*----------------------------------------------------------------------------*/
120 
121 void
123  const char *medfile_path,
124  const char *interp_method,
125  const char *select_criteria);
126 
127 /*----------------------------------------------------------------------------*/
133 /*----------------------------------------------------------------------------*/
134 
135 void
136 cs_medcoupling_intersector_destroy(cs_medcoupling_intersector_t *mi);
137 
138 /*----------------------------------------------------------------------------*/
142 /*----------------------------------------------------------------------------*/
143 
144 void
146 
147 /*----------------------------------------------------------------------------*/
155 /*----------------------------------------------------------------------------*/
156 
157 cs_medcoupling_intersector_t *
159 
160 /*----------------------------------------------------------------------------*/
168 /*----------------------------------------------------------------------------*/
169 
170 cs_medcoupling_intersector_t *
171 cs_medcoupling_intersector_by_name(const char *name);
172 
173 /*----------------------------------------------------------------------------*/
182 /*----------------------------------------------------------------------------*/
183 
184 cs_real_t *
185 cs_medcoupling_intersect_volumes(cs_medcoupling_intersector_t *mi);
186 
187 /*----------------------------------------------------------------------------*/
196 /*----------------------------------------------------------------------------*/
197 
198 cs_real_t *
199 cs_medcoupling_intersect_surfaces(cs_medcoupling_intersector_t *mi);
200 
201 /*----------------------------------------------------------------------------*/
210 /*----------------------------------------------------------------------------*/
211 
212 cs_real_t *
213 cs_medcoupling_intersect_volume_and_surfaces(cs_medcoupling_intersector_t *mi);
214 
215 /*----------------------------------------------------------------------------*/
222 /*----------------------------------------------------------------------------*/
223 
224 void
225 cs_medcoupling_intersector_translate(cs_medcoupling_intersector_t *mi,
226  cs_real_t translation[3]);
227 
228 /*----------------------------------------------------------------------------*/
238 /*----------------------------------------------------------------------------*/
239 
240 void
241 cs_medcoupling_intersector_rotate(cs_medcoupling_intersector_t *mi,
242  cs_real_t invariant[3],
243  cs_real_t axis[3],
244  cs_real_t angle);
245 
246 /*----------------------------------------------------------------------------*/
254 /*----------------------------------------------------------------------------*/
255 
256 void
257 cs_medcoupling_intersector_scale_auto(cs_medcoupling_intersector_t *mi,
258  cs_real_t factor);
259 
260 /*----------------------------------------------------------------------------*/
268 /*----------------------------------------------------------------------------*/
269 
270 void
271 cs_medcoupling_intersector_transform_from_init(cs_medcoupling_intersector_t *mi,
272  cs_real_t matrix[3][4]);
273 
274 /*----------------------------------------------------------------------------*/
281 /*----------------------------------------------------------------------------*/
282 
283 void
284 cs_medcoupling_intersector_dump_mesh(cs_medcoupling_intersector_t *mi,
285  const char *prefix);
286 
287 /*----------------------------------------------------------------------------*/
291 /*----------------------------------------------------------------------------*/
292 
293 int
295 
296 /*----------------------------------------------------------------------------*/
303 /*----------------------------------------------------------------------------*/
304 
305 void
306 cs_mi_post_init_writer(const char *case_name,
307  const char *dir_name,
308  const char *fmt_name,
309  const char *fmt_opts,
310  fvm_writer_time_dep_t time_dep,
311  bool output_at_start,
312  bool output_at_end,
313  int frequency_n,
314  double frequency_t);
315 
316 /*----------------------------------------------------------------------------*/
322 /*----------------------------------------------------------------------------*/
323 
324 void
325 cs_mi_post_add_mesh(cs_medcoupling_intersector_t *mi);
326 
327 /*----------------------------------------------------------------------------*/
328 
330 
331 #endif /* __CS_MEDCOUPLING_INTERSECTOR_HXX__ */
#define BEGIN_C_DECLS
Definition: cs_defs.h:509
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define END_C_DECLS
Definition: cs_defs.h:510
void matrix(const int *iconvp, const int *idiffp, const int *ndircp, const int *isym, const cs_real_t *thetap, const int *imucpp, const cs_real_t coefbp[], const cs_real_t cofbfp[], const cs_real_t rovsdt[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t xcpp[], cs_real_t da[], cs_real_t xa[])
Definition: cs_matrix_building.c:111
void cs_medcoupling_intersector_rotate(cs_medcoupling_intersector_t *mi, cs_real_t invariant[3], cs_real_t axis[3], cs_real_t angle)
rotate the mesh
Definition: cs_medcoupling_intersector.cxx:1211
cs_real_t * cs_medcoupling_intersect_surfaces(cs_medcoupling_intersector_t *mi)
Compute the intersection surfaces between the source mesh and code mesh.
Definition: cs_medcoupling_intersector.cxx:1067
void cs_medcoupling_intersector_translate(cs_medcoupling_intersector_t *mi, cs_real_t translation[3])
translate the mesh using a given vector
Definition: cs_medcoupling_intersector.cxx:1151
void cs_medcoupling_intersector_add_vol(const char *name, const char *medfile_path, const char *interp_method, const char *select_criteria)
Add a volume MEDCoupling intersector.
Definition: cs_medcoupling_intersector.cxx:831
void cs_medcoupling_intersector_add_surf(const char *name, const char *medfile_path, const char *interp_method, const char *select_criteria)
Add a surface MEDCoupling intersector.
Definition: cs_medcoupling_intersector.cxx:867
void cs_medcoupling_intersector_dump_mesh(cs_medcoupling_intersector_t *mi, const char *prefix)
translate the mesh using a given vector
Definition: cs_medcoupling_intersector.cxx:1397
void cs_medcoupling_intersector_destroy(cs_medcoupling_intersector_t *mi)
Destroy a given MEDCoupling intersector.
Definition: cs_medcoupling_intersector.cxx:935
void cs_mi_post_init_writer(const char *case_name, const char *dir_name, const char *fmt_name, const char *fmt_opts, fvm_writer_time_dep_t time_dep, bool output_at_start, bool output_at_end, int frequency_n, double frequency_t)
Create a new writer that will contains the boundary MED mesh added.
Definition: cs_medcoupling_intersector.cxx:1433
cs_real_t * cs_medcoupling_intersect_volumes(cs_medcoupling_intersector_t *mi)
Compute the intersection volumes between the source mesh and code mesh.
Definition: cs_medcoupling_intersector.cxx:1026
cs_medcoupling_intersector_t * cs_medcoupling_intersector_by_id(int id)
Get a MEDCoupling intersector using its id.
Definition: cs_medcoupling_intersector.cxx:977
void cs_medcoupling_intersector_scale_auto(cs_medcoupling_intersector_t *mi, cs_real_t factor)
Scale a mesh using a factor based on the current mesh center position.
Definition: cs_medcoupling_intersector.cxx:1260
cs_medcoupling_intersector_t * cs_medcoupling_intersector_by_name(const char *name)
Get a MEDCoupling intersector by name.
Definition: cs_medcoupling_intersector.cxx:998
void cs_medcoupling_intersector_destroy_all(void)
Free all allocated intersectors.
Definition: cs_medcoupling_intersector.cxx:956
void cs_medcoupling_intersector_transform_from_init(cs_medcoupling_intersector_t *mi, cs_real_t matrix[3][4])
Transform a mesh, but takes as input the initial position of the mesh.
Definition: cs_medcoupling_intersector.cxx:1348
int cs_mi_post_get_writer_id(void)
Return writer id used for medcoupling meshes, 0 means unused.
Definition: cs_medcoupling_intersector.cxx:1418
cs_medcpl_mesh_type_t
Definition: cs_medcoupling_intersector.h:54
@ CS_MEDCPL_MESH_FROM_FILE
Definition: cs_medcoupling_intersector.h:56
@ CS_MEDCPL_MESH_FROM_PRIMITIVE
Definition: cs_medcoupling_intersector.h:57
@ CS_MEDCPL_MESH_UKNOWN
Definition: cs_medcoupling_intersector.h:59
@ CS_MEDCPL_N_MESH_TYPES
Definition: cs_medcoupling_intersector.h:58
cs_real_t * cs_medcoupling_intersect_volume_and_surfaces(cs_medcoupling_intersector_t *mi)
Compute the intersection surfaces between the source mesh and code mesh.
Definition: cs_medcoupling_intersector.cxx:1110
void cs_medcoupling_intersector_add_vol_surf(const char *name, const char *medfile_path, const char *interp_method, const char *select_criteria)
Add a surface in volume MEDCoupling intersector.
Definition: cs_medcoupling_intersector.cxx:903
cs_medcpl_intersect_type_t
Definition: cs_medcoupling_intersector.h:45
@ CS_MEDCPL_INTERSECT_VOL_SURF
Definition: cs_medcoupling_intersector.h:49
@ CS_MEDCPL_INTERSECT_VOL
Definition: cs_medcoupling_intersector.h:48
@ CS_MEDCPL_INTERSECT_UKNOWN
Definition: cs_medcoupling_intersector.h:51
@ CS_MEDCPL_INTERSECT_SURF
Definition: cs_medcoupling_intersector.h:47
@ CS_MEDCPL_N_INTERSECT_TYPES
Definition: cs_medcoupling_intersector.h:50
void cs_mi_post_add_mesh(cs_medcoupling_intersector_t *mi)
Associate a Medcoupling mesh to the default writer.
Definition: cs_medcoupling_intersector.cxx:1476
fvm_writer_time_dep_t
Definition: fvm_writer.h:57