/usr/include/code_saturne/cs_calcium.h is in code-saturne-include 3.2.1-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | #ifndef __CS_CALCIUM_H__
#define __CS_CALCIUM_H__
/*============================================================================
* Basic CALCIUM-mappable functions for code coupling using SALOME's YACS
*============================================================================*/
/*
This file is part of Code_Saturne, a general-purpose CFD tool.
Copyright (C) 1998-2013 EDF S.A.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------
* Local headers
*----------------------------------------------------------------------------*/
#include "cs_base.h"
/*----------------------------------------------------------------------------*/
BEGIN_C_DECLS
/*=============================================================================
* Local Macro Definitions
*============================================================================*/
/* Instance continuation directive */
#define CS_CALCIUM_CONTINUE 20
#define CS_CALCIUM_STOP 22
/* Maximum string Lengths (based on CALCIUM's limits) */
#define CS_CALCIUM_INSTANCE_LEN 72
#define CS_CALCIUM_VARIABLE_LEN 144
/*=============================================================================
* Type Definitions
*============================================================================*/
/* CALCIUM Variable type dependency */
typedef enum {
CALCIUM_time, /* Physical time */
CALCIUM_iteration /* Iteration number */
} cs_calcium_timedep_t;
/* CALCIUM Variable type dependency */
typedef enum {
CALCIUM_continue, /* Use last values after disconnect */
CALCIUM_stop /* Stop after disconnect */
} cs_calcium_continuation_t;
/*=============================================================================
* Public function prototypes
*============================================================================*/
/*----------------------------------------------------------------------------
* Connection
*
* parameters:
* comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
* s --> name of calling instance
* (CS_CALCIUM_INSTANCE_LEN chars max)
*
* returns:
* 0 in case of success, error code otherwise
*----------------------------------------------------------------------------*/
int
cs_calcium_connect(int comp_id,
char *s);
/*----------------------------------------------------------------------------
* Disconnection
*
* parameters:
* comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
* cont --> continuation directive (continue with last values or stop)
*
* returns:
* 0 in case of success, error code otherwise
*----------------------------------------------------------------------------*/
int
cs_calcium_disconnect(int comp_id,
cs_calcium_continuation_t cont);
/*----------------------------------------------------------------------------
* Read values, blocking until they are available.
*
* parameters:
* comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
* time_dep <-- type of time dependency (time or iteration)
* min_time <-> lower bound of read interval
* max_time <-- upper bound of read interval
* iteration <-> iteration number of read
* var_name <-- name of the variable to read
* n_val_max <-- maximum number of values to read
* n_val_read <-- maximum number of values to read
* val --> values read
*
* returns:
* 0 in case of success, error code otherwise
*----------------------------------------------------------------------------*/
int
cs_calcium_read_int(int comp_id,
cs_calcium_timedep_t time_dep,
double *min_time,
double *max_time,
int *iteration,
const char *var_name,
int n_val_max,
int *n_val_read,
int val[]);
int
cs_calcium_read_float(int comp_id,
cs_calcium_timedep_t time_dep,
double *min_time,
double *max_time,
int *iteration,
const char *var_name,
int n_val_max,
int *n_val_read,
float val[]);
int
cs_calcium_read_double(int comp_id,
cs_calcium_timedep_t time_dep,
double *min_time,
double *max_time,
int *iteration,
const char *var_name,
int n_val_max,
int *n_val_read,
double val[]);
/*----------------------------------------------------------------------------
* Write values.
*
* parameters:
* comp_id <-- id of component to connect (0 to n-1, Code_Saturne local)
* time_dep <-- type of time dependency (time or iteration)
* cur_time <-- current time
* iteration <-- iteration number
* var_name <-- name of the variable to read
* n_val <-- number of values to read
* val <-- values written
*
* returns:
* 0 in case of success, error code otherwise
*----------------------------------------------------------------------------*/
int
cs_calcium_write_int(int comp_id,
cs_calcium_timedep_t time_dep,
double cur_time,
int iteration,
const char *var_name,
int n_val,
const int val[]);
int
cs_calcium_write_float(int comp_id,
cs_calcium_timedep_t time_dep,
double cur_time,
int iteration,
const char *var_name,
int n_val,
const float val[]);
int
cs_calcium_write_double(int comp_id,
cs_calcium_timedep_t time_dep,
double cur_time,
int iteration,
const char *var_name,
int n_val,
const double val[]);
/*----------------------------------------------------------------------------
* Assign a component and its id
*
* parameters:
* comp_id <-- id of component (0 to n-1, Code_Saturne local)
* comp <-- pointer to component
*----------------------------------------------------------------------------*/
void
cs_calcium_set_component(int comp_id,
void *comp);
/*----------------------------------------------------------------------------
* Set the CALCIUM-mappable function's verbosity
*
* parameters:
* n_echo <-- verbosity (none if -1, headers if 0,
* headers + n first and last elements if > 0.
*----------------------------------------------------------------------------*/
void
cs_calcium_set_verbosity(int n_echo);
/*----------------------------------------------------------------------------
* Load YACS and corresponding Calcium functions.
*
* parameters:
* lib_path <-- path to shared library containing the yacsinit() function.
*----------------------------------------------------------------------------*/
void
cs_calcium_load_yacs(const char *lib_path);
/*----------------------------------------------------------------------------
* Unload YACS and corresponding Calcium functions
*----------------------------------------------------------------------------*/
void
cs_calcium_unload_yacs(void);
/*----------------------------------------------------------------------------
* Initialize YACS component and enter event loop.
*
* This must be called after cs_calcium_load_yacs().
*
* Note that the YACS event loop does not return, sot the YACS component
* description should ensure that the code's main run() method (or similar)
* is called in the component body.
*----------------------------------------------------------------------------*/
void
cs_calcium_start_yacs(void);
/*----------------------------------------------------------------------------*/
END_C_DECLS
#endif /* __CS_CALCIUM_H__ */
|