8.3
general documentation
cs_calcium.h
Go to the documentation of this file.
1#ifndef __CS_CALCIUM_H__
2#define __CS_CALCIUM_H__
3
4/*============================================================================
5 * Basic CALCIUM-mappable functions for code coupling
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2024 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
36/*----------------------------------------------------------------------------*/
37
39
40/*=============================================================================
41 * Local Macro Definitions
42 *============================================================================*/
43
44/*=============================================================================
45 * Type Definitions
46 *============================================================================*/
47
48/*=============================================================================
49 * Public function prototypes
50 *============================================================================*/
51
52/*----------------------------------------------------------------------------
53 * Read values, blocking until they are available.
54 *
55 * parameters:
56 * rank_id <-- communicating MPI rank id
57 * iteration <-> iteration number of read
58 * var_name <-- name of the variable to read
59 * n_val_max <-- maximum number of values to read
60 * n_val_read <-- maximum number of values to read
61 * val --> values read
62 *
63 * returns:
64 * 0 in case of success, error code otherwise
65 *----------------------------------------------------------------------------*/
66
67int
68cs_calcium_read_int(int rank_id,
69 int *iteration,
70 const char *var_name,
71 int n_val_max,
72 int *n_val_read,
73 int val[]);
74
75int
76cs_calcium_read_double(int rank_id,
77 int *iteration,
78 const char *var_name,
79 int n_val_max,
80 int *n_val_read,
81 double val[]);
82
83/*----------------------------------------------------------------------------
84 * Write values.
85 *
86 * parameters:
87 * rank_id <-- communicating MPI rank id
88 * iteration <-- iteration number
89 * var_name <-- name of the variable to read
90 * n_val <-- number of values to read
91 * val <-- values written
92 *
93 * returns:
94 * 0 in case of success, error code otherwise
95 *----------------------------------------------------------------------------*/
96
97int
98cs_calcium_write_int(int rank_id,
99 int iteration,
100 const char *var_name,
101 int n_val,
102 const int val[]);
103
104int
105cs_calcium_write_double(int rank_id,
106 int iteration,
107 const char *var_name,
108 int n_val,
109 const double val[]);
110
111/*----------------------------------------------------------------------------
112 * Set the CALCIUM-mappable function's verbosity
113 *
114 * parameters:
115 * n_echo <-- verbosity (none if -1, headers if 0,
116 * headers + n first and last elements if > 0.
117 *----------------------------------------------------------------------------*/
118
119void
120cs_calcium_set_verbosity(int n_echo);
121
122/*----------------------------------------------------------------------------*/
123
125
126#endif /* __CS_CALCIUM_H__ */
127
int cs_calcium_read_int(int rank_id, int *iteration, const char *var_name, int n_val_max, int *n_val_read, int val[])
Definition: cs_calcium.cpp:308
void cs_calcium_set_verbosity(int n_echo)
Definition: cs_calcium.cpp:570
int cs_calcium_write_int(int rank_id, int iteration, const char *var_name, int n_val, const int val[])
Definition: cs_calcium.cpp:465
int cs_calcium_write_double(int rank_id, int iteration, const char *var_name, int n_val, const double val[])
Definition: cs_calcium.cpp:521
int cs_calcium_read_double(int rank_id, int *iteration, const char *var_name, int n_val_max, int *n_val_read, double val[])
Definition: cs_calcium.cpp:388
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
#define END_C_DECLS
Definition: cs_defs.h:543