/usr/include/code_saturne/mei_node.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 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | #ifndef __MEI_NODE_H__
#define __MEI_NODE_H__
/*!
* \file mei_node.h
*
* \brief Nodal structure of the interpreter
*/
/*
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.
*/
/*----------------------------------------------------------------------------*/
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*----------------------------------------------------------------------------
* Local headers
*----------------------------------------------------------------------------*/
#include "mei_hash_table.h"
/*============================================================================
* Type definitions
*============================================================================*/
/*!
* \brief Constants node
*/
typedef struct
{
double value; /*!< value of constant */
} const_node_t;
/*!
* \brief Identifiers node
*/
typedef struct
{
char *i; /*!< label of the identifier */
int l; /*!< line number */
int c; /*!< column number */
} id_node_t;
/*!
* \brief Function with single argument node
*/
typedef struct
{
char *name; /*!< label of the function */
int l; /*!< line number */
int c; /*!< column number */
struct _mei_node_t *op; /*!< variable of the function */
} func_node_t;
/*!
* \brief Function with two arguments node
*/
typedef struct
{
char *name; /*!< label of the operand */
int l; /*!< line number */
int c; /*!< column number */
int nops; /*!< number of operands */
struct _mei_node_t *op[]; /*!< list of variable of the function */
} func2_node_t;
/*!
* \brief Function of interpolation 1D
*/
typedef struct
{
char *name; /*!< label of the interpolation function */
char *data; /*!< name of the file of the data */
int l; /*!< line number */
int c; /*!< column number */
int col1; /*!< column number in the file for interpolation */
int col2; /*!< column number in the file for interpolation */
struct _mei_node_t *op; /*!< variable to be interpolate */
} interp1d_node_t;
/*!
* \brief Operators node
*/
typedef struct
{
int oper; /*!< operator */
int nops; /*!< number of operands */
struct _mei_node_t *op[]; /*!< list of operands (expandable) */
} opr_node_t;
/*!
* \brief Type of a node
*/
typedef union
{
const_node_t con; /* constants */
id_node_t id; /* identifiers */
func_node_t func; /* function with one argument */
func2_node_t funcx; /* function with two, three, or four arguments */
interp1d_node_t interp1d; /* function of 1D interpolation */
opr_node_t opr; /* operators */
} node_type_t;
/*!
* \brief General node definition
*/
/* union must be last entry in _mei_node_t */
/* because operNodeType may dynamically increase */
struct _mei_node_t
{
mei_flag_t flag; /*!< type of node */
hash_table_t *ht; /*!< pointer of the hash table of the expression */
node_type_t *type; /*!< type of node */
};
/*!
* \brief General node definition
*/
typedef struct _mei_node_t mei_node_t;
/*============================================================================
* Public function prototypes
*============================================================================*/
/*----------------------------------------------------------------------------*/
/* Build a node for a constant.
*
* param [in] value real value of the constant
*
* return built node
*/
/*----------------------------------------------------------------------------*/
mei_node_t *
mei_const_node(const double value);
/*----------------------------------------------------------------------------*/
/* Build a node for a variable.
*
* param [in] variable label of the variable
*
* return built node
*/
/*----------------------------------------------------------------------------*/
mei_node_t *
mei_id_node(const char *variable);
/*----------------------------------------------------------------------------*/
/* Build a node for a function of a single variable.
*
* param [in] function label of the function
* param [in] expr node that represents the variable of the function
*
* return built node
*/
/*----------------------------------------------------------------------------*/
mei_node_t *
mei_func_node(const char *const,
mei_node_t *const expr);
/*----------------------------------------------------------------------------*/
/* Build a node for a function of a several variables.
*
* param [in] function label of the function
* param [in] nops number of variables
* param [in] ... list of nodes which represent variables of the function
*
* return built node
*/
/*----------------------------------------------------------------------------*/
mei_node_t *
mei_funcx_node(const char *function,
const int nops,
...);
/*----------------------------------------------------------------------------*/
/* Build a node for an 1D interpolation.
*
* param [in] function interp1d
* param [in] data name of the file which contains data
* param [in] col1 abscissa for interpolation
* param [in] col2 ordinate for interpolation
* param [in] expr node that represents the variable to be interpolate
*
* return built node
*/
/*----------------------------------------------------------------------------*/
mei_node_t *
mei_interp1d_node(const char *function,
const mei_node_t *data,
const mei_node_t *col1,
const mei_node_t *col2,
const mei_node_t *expr);
/*----------------------------------------------------------------------------*/
/*
* Build a node for an operators and its operands.
*
* param [in] oper operator
* param [in] nops number of operand
* param [in] ... list of nodes which represent operands
*
* return built node
*/
/*----------------------------------------------------------------------------*/
mei_node_t *
mei_opr_node(const int oper,
const int nops,
...);
/*----------------------------------------------------------------------------*/
/*
* Return label of a node.
*
* param [in] n node
*
* return label of a node
*/
/*----------------------------------------------------------------------------*/
char *
mei_label_node(mei_node_t *p);
/*----------------------------------------------------------------------------*/
/*
* Free memory.
*
* param [in] n node
*/
/*----------------------------------------------------------------------------*/
void
mei_free_node(mei_node_t *p);
/*----------------------------------------------------------------------------*/
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __NODE_H__ */
|