programmer's documentation
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cs_prototypes.h
Go to the documentation of this file.
1 #ifndef __CS_PROTOTYPES_H__
2 #define __CS_PROTOTYPES_H__
3 
4 /*============================================================================
5  * Prototypes for Fortran functions and subroutines callable from C
6  *============================================================================*/
7 
8 /*
9  This file is part of Code_Saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2014 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_base.h"
35 #include "cs_mesh.h"
36 #include "cs_mesh_quantities.h"
37 #include "cs_mesh_bad_cells.h"
38 
39 /*----------------------------------------------------------------------------*/
40 
42 
43 /*============================================================================
44  * Macro definitions
45  *============================================================================*/
46 
47 /*=============================================================================
48  * Fortran function/subroutine prototypes
49  *============================================================================*/
50 
51 /*----------------------------------------------------------------------------
52  * Main Fortran subroutine
53  *----------------------------------------------------------------------------*/
54 
55 extern void CS_PROCF (caltri, CALTRI)
56 (
57  void
58 );
59 
60 /*----------------------------------------------------------------------------
61  * Initialize Fortran base common block values
62  *----------------------------------------------------------------------------*/
63 
64 extern void CS_PROCF (csinit, CSINIT)
65 (
66  const cs_int_t *irgpar, /* <-- MPI Rank in parallel, -1 otherwise */
67  const cs_int_t *nrgpar /* <-- Number of MPI processes, or 1 */
68 );
69 
70 /*----------------------------------------------------------------------------
71  * Developer function for output of variables on a post-processing mesh
72  *----------------------------------------------------------------------------*/
73 
74 extern void CS_PROCF (dvvpst, DVVPST)
75 (
76  const cs_int_t *nummai, /* <-- number or post-processing mesh */
77  const cs_int_t *numtyp, /* <-- number or post-processing type
78  * (-1 as volume, -2 as boundary, or nummai) */
79  const cs_int_t *nvar, /* <-- number of variables */
80  const cs_int_t *nscal, /* <-- number of scalars */
81  const cs_int_t *nvlsta, /* <-- number of statistical variables (lagr) */
82  const cs_int_t *nvisbr, /* <-- number of boundary stat. variables (lagr) */
83  const cs_int_t *ncelps, /* <-- number of post-processed cells */
84  const cs_int_t *nfbrps, /* <-- number of post processed boundary faces */
85  const cs_int_t lstcel[], /* <-- list of post-processed cells */
86  const cs_int_t lstfbr[], /* <-- list of post-processed boundary faces */
87  const cs_real_t rtp[], /* <-- cell variables */
88  const cs_real_t propce[], /* <-- cell physical properties */
89  cs_real_t tracel[], /* --- work array for output cells */
90  cs_real_t trafbr[] /* --- work array for output boundary faces */
91 );
92 
93 /*----------------------------------------------------------------------------
94  * Find the nearest cell's center from a node
95  *----------------------------------------------------------------------------*/
96 
97 extern void CS_PROCF (findpt, FINDPT)
98 (
99  const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
100  const cs_int_t *ncel, /* <-- number of cells */
101  const cs_real_t *xyzcen, /* <-- cell centers */
102  const cs_real_t *xx, /* <-- node coordinate X */
103  const cs_real_t *yy, /* <-- node coordinate Y */
104  const cs_real_t *zz, /* <-- node coordinate Z */
105  cs_int_t *node, /* --> node we are looking for, zero if error */
106  cs_int_t *ndrang /* --> rank of associated process */
107 );
108 
109 /*----------------------------------------------------------------------------
110  * Generator for distribution function of p's
111  *----------------------------------------------------------------------------*/
112 
113 extern void CS_PROCF (fische, FISCHE)
114 (
115  const cs_int_t *n,
116  const cs_real_t *mu,
117  cs_int_t p[]);
118 
119 /*----------------------------------------------------------------------------
120  * Check necessity of extended mesh from FORTRAN options.
121  *
122  * Interface Fortran :
123  *
124  * SUBROUTINE HALTYP (IVOSET)
125  * *****************
126  *
127  * INTEGER IVOSET : <-- : Indicator of necessity of extended mesh
128  *----------------------------------------------------------------------------*/
129 
130 extern void
131 CS_PROCF (haltyp, HALTYP)(const cs_int_t *ivoset);
132 
133 /*----------------------------------------------------------------------------
134  * Main Fortran options initialization
135  *----------------------------------------------------------------------------*/
136 
137 extern void CS_PROCF (initi1, INITI1)
138 (
139  void
140 );
141 
142 /*----------------------------------------------------------------------------
143  * Free Fortran allocated memory
144  *----------------------------------------------------------------------------*/
145 
146 extern void CS_PROCF (memfin, MEMFIN) (void);
147 
148 /*----------------------------------------------------------------------------
149  * Mesh renumbering for vector processors
150  *----------------------------------------------------------------------------*/
151 
152 extern void CS_PROCF (numvec, NUMVEC)
153 (
154  const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
155  const cs_int_t *ncel, /* <-- number of local cells */
156  const cs_int_t *nfac, /* <-- number of interior faces */
157  const cs_int_t *nfabor, /* <-- number of boundary faces */
158  const cs_int_t *lregis, /* <-- vector registor length */
159  cs_int_t *irveci, /* <-> interior face vectorization indic. */
160  cs_int_t *irvecb, /* <-> boundary face vectorization indic. */
161  cs_int_t ifacel[], /* <-- interior face->cell connectivity */
162  cs_int_t ifabor[], /* <-- boundary face->cell connectivity */
163  cs_int_t inumfi[], /* <-> interior faces renumbering (size: nfac) */
164  cs_int_t inumfb[], /* <-> boundary faces renumbering (size: nfabor) */
165  cs_int_t iworkf[], /* --- work array, size: max(nfac, nfabor) */
166  cs_int_t ismbs[] /* --- work array, size: ncelet */
167 );
168 
169 /*----------------------------------------------------------------------------
170  * Test renumbering for vector processors
171  *----------------------------------------------------------------------------*/
172 
173 extern void CS_PROCF (tstvec, TSTVEC)
174 (
175  const cs_int_t *ncelet, /* <-- number of extended (real + ghost) cells */
176  const cs_int_t *ncel, /* <-- number of local cells */
177  const cs_int_t *nfac, /* <-- number of interior faces */
178  const cs_int_t *nfabor, /* <-- number of boundary faces */
179  const cs_int_t ifacel[], /* <-- interior face->cell connectivity */
180  const cs_int_t ifabor[], /* <-- boundary face->cell connectivity */
181  cs_int_t iworkf[], /* --- work array, size: max(nfac, nfabor) */
182  cs_int_t ismbs[], /* --- work array, size: ncelet */
183  cs_int_t ismbv[], /* --- work array, size: ncelet */
184  cs_real_t rworkf[], /* --- work array, size: max(nfac, nfabor) */
185  cs_real_t rsmbs[], /* --- work array, size: ncelet */
186  cs_real_t rsmbv[] /* --- work array, size: ncelet */
187 );
188 
189 /*----------------------------------------------------------------------------
190  * User function for output of variables on a post-processing mesh
191  *----------------------------------------------------------------------------*/
192 
193 void CS_PROCF (usvpst, USVPST)
194 (
195  const cs_int_t *nummai, /* <-- number or post-processing mesh */
196  const cs_int_t *nvar, /* <-- number of variables */
197  const cs_int_t *nscal, /* <-- number of scalars */
198  const cs_int_t *nvlsta, /* <-- number of statistical variables (lagr) */
199  const cs_int_t *ncelps, /* <-- number of post-processed cells */
200  const cs_int_t *nfacps, /* <-- number of post processed interior faces */
201  const cs_int_t *nfbrps, /* <-- number of post processed boundary faces */
202  const cs_int_t itypps[3], /* <-- flag (0 or 1) for presence of cells, */
203  /* interior faces, and boundary faces */
204  const cs_int_t lstcel[], /* <-- list of post-processed cells */
205  const cs_int_t lstfac[], /* <-- list of post-processed interior faces */
206  const cs_int_t lstfbr[], /* <-- list of post-processed boundary faces */
207  const cs_real_t dt[] /* <-- local time step */
208 );
209 
210 /*----------------------------------------------------------------------------
211  * Uniform random number generator
212  *----------------------------------------------------------------------------*/
213 
214 void CS_PROCF (zufall, zufall)
215 (
216  const cs_int_t *n, /* --> size of the vector */
217  const cs_real_t *a /* <-- generated random number vector */
218 );
219 
220 /*----------------------------------------------------------------------------
221  * Gaussian random number generator
222  *----------------------------------------------------------------------------*/
223 
224 void CS_PROCF (normalen, normalen)
225 (
226  const cs_int_t *n, /* --> size of the vector */
227  const cs_real_t *x /* <-- generated random number vector */
228 );
229 
230 /*----------------------------------------------------------------------------
231  * Initialize Lagrangian module parameters for a given zone and class
232  *
233  * parameters:
234  * i_cz_params <-- integer parameters for this class and zone
235  * r_cz_params <-- real parameters for this class and zone
236  *----------------------------------------------------------------------------*/
237 
238 void
239 cs_lagr_init_zone_class_param(const cs_int_t i_cs_params[],
240  const cs_real_t r_cs_params[]);
241 
242 /*----------------------------------------------------------------------------
243  * Define Lagrangian module parameters for a given zone and class
244  *
245  * parameters:
246  * class_id <-- id of given particle class
247  * zone_id <-- id of given boundary zone
248  * i_cz_params <-- integer parameters for this class and zone
249  * r_cz_params <-- real parameters for this class and zone
250  *----------------------------------------------------------------------------*/
251 
252 void
254  cs_int_t zone_id,
255  const cs_int_t i_cs_params[],
256  const cs_real_t r_cs_params[]);
257 
258 /*----------------------------------------------------------------------------
259  * Return Lagrangian model status.
260  *
261  * parameters:
262  * model_flag --> 0 without Lagrangian, 1 or 2 with Lagrangian
263  * restart_flag --> 1 for Lagrangian restart, 0 otherwise
264  * frozen_flag --> 1 for frozen Eulerian flow, 0 otherwise
265  *----------------------------------------------------------------------------*/
266 
267 void
268 cs_lagr_status(int *model_flag,
269  int *restart_flag,
270  int *frozen_flag);
271 
272 /*============================================================================
273  * User function prototypes
274  *============================================================================*/
275 
276 /*----------------------------------------------------------------------------
277  * Define global options for couplings.
278  *
279  * These options allow defining the time step synchronization policy,
280  * as well as a time step multiplier.
281  *----------------------------------------------------------------------------*/
282 
283 void
284 cs_user_coupling(void);
285 
286 /*----------------------------------------------------------------------------
287  * This function is called at the end of each time step.
288  *
289  * It and has a very general purpose, although it is recommended to handle
290  * mainly postprocessing or data-extraction type operations.
291  *----------------------------------------------------------------------------*/
292 
293 void
295 
296 /*----------------------------------------------------------------------------
297  * Define mesh joinings.
298  *----------------------------------------------------------------------------*/
299 
300 void
301 cs_user_join(void);
302 
303 /*----------------------------------------------------------------------------
304  * Tag bad cells within the mesh based on geometric criteria.
305  *----------------------------------------------------------------------------*/
306 
307 void
309  cs_mesh_quantities_t *mesh_quantities);
310 
311 /*----------------------------------------------------------------------------
312  * Define mesh files to read and optional associated transformations.
313  *----------------------------------------------------------------------------*/
314 
315 void
316 cs_user_mesh_input(void);
317 
318 /*----------------------------------------------------------------------------
319  * Modifiy geometry and mesh.
320  *----------------------------------------------------------------------------*/
321 
322 void
324 
325 /*----------------------------------------------------------------------------
326  * Insert thin wall into a mesh.
327  *----------------------------------------------------------------------------*/
328 
329 void
331 
332 /*----------------------------------------------------------------------------
333  * Mesh smoothing.
334  *
335  * parameters:
336  * mesh <-> pointer to mesh structure to smoothe
337  *----------------------------------------------------------------------------*/
338 
339 void
341 
342 /*----------------------------------------------------------------------------
343  * Enable or disable mesh saving.
344  *
345  * By default, mesh is saved when modified.
346  *
347  * parameters:
348  * mesh <-> pointer to mesh structure
349  *----------------------------------------------------------------------------*/
350 
351 void
353 
354 /*----------------------------------------------------------------------------
355  * Set options for cutting of warped faces
356  *
357  * parameters:
358  * mesh <-> pointer to mesh structure to smoothe
359  *----------------------------------------------------------------------------*/
360 
361 void
363 
364 /*----------------------------------------------------------------------------
365  * Define advanced mesh numbering options.
366  *----------------------------------------------------------------------------*/
367 
368 void
369 cs_user_numbering(void);
370 
371 /*----------------------------------------------------------------------------
372  * Define parallel IO settings.
373  *----------------------------------------------------------------------------*/
374 
375 void
376 cs_user_parallel_io(void);
377 
378 /*----------------------------------------------------------------------------
379  * Define advanced partitioning options.
380  *----------------------------------------------------------------------------*/
381 
382 void
383 cs_user_partition(void);
384 
385 /*----------------------------------------------------------------------------
386  * Define sparse matrix tuning options.
387  *----------------------------------------------------------------------------*/
388 
389 void
391 
392 /*----------------------------------------------------------------------------
393  * Define periodic faces.
394  *----------------------------------------------------------------------------*/
395 
396 void
397 cs_user_periodicity(void);
398 
399 /*----------------------------------------------------------------------------
400  * Define post-processing writers.
401  *
402  * The default output format and frequency may be configured, and additional
403  * post-processing writers allowing outputs in different formats or with
404  * different format options and output frequency than the main writer may
405  * be defined.
406  *----------------------------------------------------------------------------*/
407 
408 void
410 
411 /*----------------------------------------------------------------------------
412  * Define post-processing meshes.
413  *
414  * The main post-processing meshes may be configured, and additional
415  * post-processing meshes may be defined as a subset of the main mesh's
416  * cells or faces (both interior and boundary).
417  *----------------------------------------------------------------------------*/
418 
419 void
421 
422 /*----------------------------------------------------------------------------
423  * Override default frequency or calculation end based output.
424  *
425  * This allows fine-grained control of activation or deactivation,
426  *
427  * parameters:
428  * nt_max_abs <-- maximum time step number
429  * nt_cur_abs <-- current time step number
430  * t_cur_abs <-- absolute time at the current time step
431  *----------------------------------------------------------------------------*/
432 
433 void
434 cs_user_postprocess_activate(int nt_max_abs,
435  int nt_cur_abs,
436  double t_cur_abs);
437 
438 /*----------------------------------------------------------------------------
439  * Define couplings with other instances of Code_Saturne.
440  *----------------------------------------------------------------------------*/
441 
442 void
444 
445 /*----------------------------------------------------------------------------
446  * Set user solver.
447  *----------------------------------------------------------------------------*/
448 
449 int
450 cs_user_solver_set(void);
451 
452 /*----------------------------------------------------------------------------
453  * Main call to user solver.
454  *----------------------------------------------------------------------------*/
455 
456 void
458  const cs_mesh_quantities_t *mesh_quantities);
459 
460 /*----------------------------------------------------------------------------
461  * Define couplings with SYRTHES code.
462  *----------------------------------------------------------------------------*/
463 
464 void
466 
467 /*----------------------------------------------------------------------------
468  * Define rotor/stator model.
469  *----------------------------------------------------------------------------*/
470 
471 void
473 
474 /*----------------------------------------------------------------------------
475  * Define rotor axes, associated cells, and rotor/stator faces.
476  *----------------------------------------------------------------------------*/
477 
478 void
480 
481 /*----------------------------------------------------------------------------*/
482 
484 
485 #endif /* __CS_PROTOTYPES_H__ */
void dvvpst(const cs_int_t *nummai, const cs_int_t *numtyp, const cs_int_t *nvar, const cs_int_t *nscal, const cs_int_t *nvlsta, const cs_int_t *nvisbr, const cs_int_t *ncelps, const cs_int_t *nfbrps, const cs_int_t lstcel[], const cs_int_t lstfbr[], const cs_real_t rtp[], const cs_real_t propce[], cs_real_t tracel[], cs_real_t trafbr[])
void cs_user_partition(void)
Definition: cs_user_performance_tuning.c:108
void tstvec(const cs_int_t *ncelet, const cs_int_t *ncel, const cs_int_t *nfac, const cs_int_t *nfabor, const cs_int_t ifacel[], const cs_int_t ifabor[], cs_int_t iworkf[], cs_int_t ismbs[], cs_int_t ismbv[], cs_real_t rworkf[], cs_real_t rsmbs[], cs_real_t rsmbv[])
void csinit(const cs_int_t *irgpar, const cs_int_t *nrgpar)
void initi1(void)
Definition: initi1.f90:28
void cs_user_periodicity(void)
Definition: cs_user_mesh.c:285
void cs_user_turbomachinery(void)
Definition: cs_user_turbomachinery.c:77
void zufall(const cs_int_t *n, const cs_real_t *a)
void cs_user_mesh_thinwall(cs_mesh_t *mesh)
Definition: cs_user_mesh.c:492
void caltri(void)
Definition: caltri.f90:23
#define BEGIN_C_DECLS
Definition: cs_defs.h:405
int cs_int_t
Fortran-compatible integer.
Definition: cs_defs.h:295
void cs_user_postprocess_activate(int nt_max_abs, int nt_cur_abs, double t_cur_abs)
Definition: cs_user_postprocess.c:630
void cs_user_postprocess_meshes(void)
Definition: cs_user_postprocess.c:390
void cs_user_coupling(void)
Definition: cs_user_coupling.c:75
void cs_user_mesh_modify(cs_mesh_t *mesh)
Definition: cs_user_mesh.c:546
void cs_user_join(void)
Definition: cs_user_mesh.c:145
void cs_user_numbering(void)
Definition: cs_user_performance_tuning.c:78
void cs_user_mesh_save(cs_mesh_t *mesh)
Definition: cs_user_mesh.c:623
void numvec(const cs_int_t *ncelet, const cs_int_t *ncel, const cs_int_t *nfac, const cs_int_t *nfabor, const cs_int_t *lregis, cs_int_t *irveci, cs_int_t *irvecb, cs_int_t ifacel[], cs_int_t ifabor[], cs_int_t inumfi[], cs_int_t inumfb[], cs_int_t iworkf[], cs_int_t ismbs[])
Definition: cs_mesh.h:62
Definition: mesh.f90:26
void cs_user_matrix_tuning(void)
Definition: cs_user_performance_tuning.c:249
void cs_user_mesh_warping(void)
Definition: cs_user_mesh.c:471
void cs_user_solver(const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities)
Definition: cs_user_solver.c:86
void cs_lagr_status(int *model_flag, int *restart_flag, int *frozen_flag)
int cs_user_solver_set(void)
Definition: cs_user_solver.c:75
void memfin(void)
Definition: memfin.f90:23
Definition: cs_mesh_quantities.h:51
void fische(const cs_int_t *n, const cs_real_t *mu, cs_int_t p[])
void normalen(const cs_int_t *n, const cs_real_t *x)
void cs_user_extra_operations(void)
This function is called at the end of each time step.
Definition: cs_user_extra_operations.c:101
void cs_user_mesh_input(void)
Definition: cs_user_mesh.c:94
void cs_user_mesh_bad_cells_tag(cs_mesh_t *mesh, cs_mesh_quantities_t *mesh_quantities)
Definition: cs_user_mesh.c:644
void cs_user_postprocess_writers(void)
Definition: cs_user_postprocess.c:264
void findpt(const cs_int_t *ncelet, const cs_int_t *ncel, const cs_real_t *xyzcen, const cs_real_t *xx, const cs_real_t *yy, const cs_real_t *zz, cs_int_t *node, cs_int_t *ndrang)
void haltyp(const cs_int_t *ivoset)
#define END_C_DECLS
Definition: cs_defs.h:406
double cs_real_t
Definition: cs_defs.h:296
void usvpst(const cs_int_t *nummai, const cs_int_t *nvar, const cs_int_t *nscal, const cs_int_t *nvlsta, const cs_int_t *ncelps, const cs_int_t *nfacps, const cs_int_t *nfbrps, const cs_int_t itypps[3], const cs_int_t lstcel[], const cs_int_t lstfac[], const cs_int_t lstfbr[], const cs_real_t dt[])
#define CS_PROCF(x, y)
Definition: cs_defs.h:419
void cs_user_syrthes_coupling(void)
Definition: cs_user_coupling.c:126
void cs_user_turbomachinery_rotor(void)
Definition: cs_user_turbomachinery.c:96
void cs_lagr_define_zone_class_param(cs_int_t class_id, cs_int_t zone_id, const cs_int_t i_cs_params[], const cs_real_t r_cs_params[])
void cs_user_parallel_io(void)
Definition: cs_user_performance_tuning.c:175
void cs_user_saturne_coupling(void)
Definition: cs_user_coupling.c:222
void cs_lagr_init_zone_class_param(const cs_int_t i_cs_params[], const cs_real_t r_cs_params[])
void cs_user_mesh_smoothe(cs_mesh_t *mesh)
Definition: cs_user_mesh.c:587