7.1
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-2021 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  * Structure definitions
43  *============================================================================*/
44 
45 typedef struct _cs_medcoupling_intersector_t cs_medcoupling_intersector_t;
46 
47 /*============================================================================
48  * Structure definitions
49  *============================================================================*/
50 
51 /*----------------------------------------------------------------------------*/
61 /*----------------------------------------------------------------------------*/
62 
63 void
64 cs_medcoupling_intersector_add(const char *name,
65  const char *medfile_path,
66  const char *interp_method,
67  const char *select_criteria);
68 
69 /*----------------------------------------------------------------------------*/
75 /*----------------------------------------------------------------------------*/
76 
77 void
78 cs_medcoupling_intersector_destroy(cs_medcoupling_intersector_t *mi);
79 
80 /*----------------------------------------------------------------------------*/
84 /*----------------------------------------------------------------------------*/
85 
86 void
88 
89 /*----------------------------------------------------------------------------*/
97 /*----------------------------------------------------------------------------*/
98 
99 cs_medcoupling_intersector_t *
101 
102 /*----------------------------------------------------------------------------*/
110 /*----------------------------------------------------------------------------*/
111 
112 cs_medcoupling_intersector_t *
113 cs_medcoupling_intersector_by_name(const char *name);
114 
115 /*----------------------------------------------------------------------------*/
124 /*----------------------------------------------------------------------------*/
125 
126 cs_real_t *
127 cs_medcoupling_intersect_volumes(cs_medcoupling_intersector_t *mi);
128 
129 /*----------------------------------------------------------------------------*/
136 /*----------------------------------------------------------------------------*/
137 
138 void
139 cs_medcoupling_intersector_translate(cs_medcoupling_intersector_t *mi,
140  cs_real_t translation[3]);
141 
142 /*----------------------------------------------------------------------------*/
152 /*----------------------------------------------------------------------------*/
153 
154 void
155 cs_medcoupling_intersector_rotate(cs_medcoupling_intersector_t *mi,
156  cs_real_t invariant[3],
157  cs_real_t axis[3],
158  cs_real_t angle);
159 
160 /*----------------------------------------------------------------------------*/
168 /*----------------------------------------------------------------------------*/
169 
170 void
171 cs_medcoupling_intersector_scale_auto(cs_medcoupling_intersector_t *mi,
172  cs_real_t factor);
173 
174 /*----------------------------------------------------------------------------*/
182 /*----------------------------------------------------------------------------*/
183 
184 void
185 cs_medcoupling_intersector_transform_from_init(cs_medcoupling_intersector_t *mi,
186  cs_real_t matrix[3][4]);
187 
188 /*----------------------------------------------------------------------------*/
195 /*----------------------------------------------------------------------------*/
196 
197 void
198 cs_medcoupling_intersector_dump_mesh(cs_medcoupling_intersector_t *mi,
199  const char *prefix);
200 
201 /*----------------------------------------------------------------------------*/
205 /*----------------------------------------------------------------------------*/
206 
207 int
209 
210 /*----------------------------------------------------------------------------*/
217 /*----------------------------------------------------------------------------*/
218 
219 void
220 cs_mi_post_init_writer(const char *case_name,
221  const char *dir_name,
222  const char *fmt_name,
223  const char *fmt_opts,
224  fvm_writer_time_dep_t time_dep,
225  bool output_at_start,
226  bool output_at_end,
227  int frequency_n,
228  double frequency_t);
229 
230 /*----------------------------------------------------------------------------*/
236 /*----------------------------------------------------------------------------*/
237 
238 void
239 cs_mi_post_add_mesh(cs_medcoupling_intersector_t *mi);
240 
241 /*----------------------------------------------------------------------------*/
242 
244 
245 #endif /* __CS_MEDCOUPLING_INTERSECTOR_HXX__ */
cs_medcoupling_intersector_t * cs_medcoupling_intersector_by_id(int id)
Get a MEDCoupling intersector using its id.
Definition: cs_medcoupling_intersector.cxx:667
void cs_medcoupling_intersector_destroy_all(void)
Free all allocated intersectors.
Definition: cs_medcoupling_intersector.cxx:646
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:749
#define BEGIN_C_DECLS
Definition: cs_defs.h:510
void cs_medcoupling_intersector_add(const char *name, const char *medfile_path, const char *interp_method, const char *select_criteria)
Add a MEDCoupling intersector.
Definition: cs_medcoupling_intersector.cxx:583
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:806
fvm_writer_time_dep_t
Definition: fvm_writer.h:57
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:852
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:983
int cs_mi_post_get_writer_id(void)
Return writer id used for medcoupling meshes, 0 means unused.
Definition: cs_medcoupling_intersector.cxx:1004
double cs_real_t
Floating-point value.
Definition: cs_defs.h:322
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_destroy(cs_medcoupling_intersector_t *mi)
Destroy a given MEDCoupling intersector.
Definition: cs_medcoupling_intersector.cxx:625
cs_medcoupling_intersector_t * cs_medcoupling_intersector_by_name(const char *name)
Get a MEDCoupling intersector by name.
Definition: cs_medcoupling_intersector.cxx:688
void cs_mi_post_add_mesh(cs_medcoupling_intersector_t *mi)
Associate a Medcoupling mesh to the default writer.
Definition: cs_medcoupling_intersector.cxx:1062
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:1019
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:937
#define END_C_DECLS
Definition: cs_defs.h:511
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:716